feat:进出港交接接口

master
wanghao 4 weeks ago
parent dc1326a658
commit 44205ab6cc

@ -61,6 +61,8 @@ public class ApiController extends BaseController {
private IRecordBasketCheckContentService recordBasketCheckContentService;//盘点内容 private IRecordBasketCheckContentService recordBasketCheckContentService;//盘点内容
@Autowired @Autowired
private IBaseAirCodeService baseAirCodeService; private IBaseAirCodeService baseAirCodeService;
@Autowired
private IRecordDeliveryTaskWaybillService recordDeliveryTaskWaybillService;//进港接货
@PostMapping("/findBindingList") @PostMapping("/findBindingList")
public AjaxResult findBindingList(String epc) { public AjaxResult findBindingList(String epc) {
@ -102,7 +104,6 @@ public class ApiController extends BaseController {
return AjaxResult.error("库位没有维护"); return AjaxResult.error("库位没有维护");
} }
// 接货查询 // 接货查询
@PostMapping("/jion/select") @PostMapping("/jion/select")
public AjaxResult jionSelect(String user) { public AjaxResult jionSelect(String user) {
@ -136,7 +137,7 @@ public class ApiController extends BaseController {
for (MultipartFile file : files) { for (MultipartFile file : files) {
try { try {
// 插入图片 // 插入图片
recordDeliveryTaskImgService.insertRecordDeliveryTaskImg( new RecordDeliveryTaskImg(){{ recordDeliveryTaskImgService.insertRecordDeliveryTaskImg(new RecordDeliveryTaskImg() {{
setTaskCode(taskCode); setTaskCode(taskCode);
setImgPath(FileUploadUtils.upload(filePath, file)); setImgPath(FileUploadUtils.upload(filePath, file));
}}); }});
@ -145,7 +146,7 @@ public class ApiController extends BaseController {
} }
} }
} }
if (type.equals("0")){ if (type.equals("0")) {
// 出港 // 出港
// 插入资产到任务表 // 插入资产到任务表
List<LedgerInstantBinding> ledgerInstantBindings = JSONArray.parseArray(json, LedgerInstantBinding.class); List<LedgerInstantBinding> ledgerInstantBindings = JSONArray.parseArray(json, LedgerInstantBinding.class);
@ -154,9 +155,9 @@ public class ApiController extends BaseController {
// 更新状态 // 更新状态
List<Long> ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList()); List<Long> ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList());
ledgerInstantBindingService.updateTaskStatebyBasketID(ids); ledgerInstantBindingService.updateTaskStatebyBasketID(ids);
}else if (type.equals("1")){ } else if (type.equals("1")) {
List<String> stringList = JSONArray.parseArray(json, String.class); List<String> stringList = JSONArray.parseArray(json, String.class);
recordDeliveryTaskBaseketService.insertRecordDeliveryTaskWaybill(taskCode,stringList); recordDeliveryTaskBaseketService.insertRecordDeliveryTaskWaybill(taskCode, stringList);
} }
return AjaxResult.success(); return AjaxResult.success();
} }
@ -176,7 +177,6 @@ public class ApiController extends BaseController {
@PostMapping("/join/shouSubmit") @PostMapping("/join/shouSubmit")
public AjaxResult joinJieSubmit(@RequestBody ReceiptSubmitBeen been) { public AjaxResult joinJieSubmit(@RequestBody ReceiptSubmitBeen been) {
int i = service.joinShouSubmit(been); int i = service.joinShouSubmit(been);
if (i >= been.getList().size()) { if (i >= been.getList().size()) {
return AjaxResult.success(); return AjaxResult.success();
} }
@ -196,8 +196,7 @@ public class ApiController extends BaseController {
// 远程接货扫描epc // 远程接货扫描epc
@PostMapping("/receipt/scanEpc") @PostMapping("/receipt/scanEpc")
public AjaxResult ReceiptScanEpc(@RequestParam(name = "epc", required = false, defaultValue = "") String epc, public AjaxResult ReceiptScanEpc(@RequestParam(name = "epc", required = false, defaultValue = "") String epc, @RequestParam(name = "waybillNumber", required = false, defaultValue = "") String waybillNumber) {
@RequestParam(name = "waybillNumber", required = false, defaultValue = "") String waybillNumber) {
Long objId = null; Long objId = null;
if (epc != null && !epc.equals("")) { if (epc != null && !epc.equals("")) {
@ -227,8 +226,61 @@ public class ApiController extends BaseController {
return AjaxResult.success(map); return AjaxResult.success(map);
} }
// 进港接货扫描
@PostMapping("/receipt/selectTaskByWaybillCode")
public AjaxResult ReceiptScanEpc(String waybillNumber) {
List<RecordDeliveryTaskWaybill> list = recordDeliveryTaskWaybillService.selectTaskWaybillList(waybillNumber);
if (list == null || list.isEmpty()) return AjaxResult.error("集装器/散斗代码查询失败,暂无任务");
String taskCode = list.get(0).getTaskCode();
// 查询所有图片
RecordDeliveryTaskImg recordDeliveryTaskImg = new RecordDeliveryTaskImg();
recordDeliveryTaskImg.setTaskCode(taskCode);
List<RecordDeliveryTaskImg> imgList = recordDeliveryTaskImgService.selectRecordDeliveryTaskImgList(recordDeliveryTaskImg);
// 封装返回数据
Map<String, Object> map = new HashMap<>();
map.put("taskCode", taskCode);
// List<RecordDeliveryTaskBaseket> baseketList=new ArrayList<>(list.size());
// list.forEach(t->{
// baseketList.add(new RecordDeliveryTaskBaseket(){{
// setTaskCode(taskCode);
// setWaybillNumber(waybillNumber);
// }});
// });
map.put("baseketList", list);
map.put("imgList", imgList);
return AjaxResult.success(map);
}
// 远程接货确认 // 进港接货确认
@Transactional
@PostMapping("/receiveInTask/submit")
public AjaxResult receiveInTaskSubmit(String json, String gps, String taskCode, String user) {
List<LedgerInstantBinding> list = JSONArray.parseArray(json, LedgerInstantBinding.class);
list.forEach(item -> {
String cargoFrameEpc = item.getCargoFrameEpc();
String waybillNumber = item.getWaybillNumber();
Long basketId = item.getBasketId();
// 插入资产绑定关系
int i = service.insertLedgerBinding(cargoFrameEpc, waybillNumber, user, basketId);
// 插入资产绑定记录
recordCargoBindingService.insertRecordCargoBinding(new RecordCargoBinding() {{
setBasketId(basketId);
setCargoFrameEpc(cargoFrameEpc);
setWaybillNumber(waybillNumber);
setCreateBy(user);
setLocationInfo(gps);
}});
// 插入任务子表
recordDeliveryTaskWaybillService.updateRecord(taskCode,waybillNumber,cargoFrameEpc,basketId);
});
recordDeliveryTaskService.closeTaskByReceipt(taskCode, user, gps);//关闭任务
return AjaxResult.success();
}
// 出港接货
@PostMapping("/receipt/submit") @PostMapping("/receipt/submit")
public AjaxResult receiptSubmit(@RequestBody ReceiptSubmitBeen been) { public AjaxResult receiptSubmit(@RequestBody ReceiptSubmitBeen been) {
int i = service.joinShouSubmit(been); int i = service.joinShouSubmit(been);
@ -348,8 +400,7 @@ public class ApiController extends BaseController {
* *
*/ */
@PostMapping("/submitBindingRecord") @PostMapping("/submitBindingRecord")
public AjaxResult submitBindingRecord(Long baseBasketId, String basketEpc, String basketEpc2, String localWeight, public AjaxResult submitBindingRecord(Long baseBasketId, String basketEpc, String basketEpc2, String localWeight, String createdBy, List<MultipartFile> files) {
String createdBy, List<MultipartFile> files) {
int tagCount = baseBasketInfoService.selectCountBasketByEpc(basketEpc); int tagCount = baseBasketInfoService.selectCountBasketByEpc(basketEpc);
if (tagCount > 0) { if (tagCount > 0) {
return AjaxResult.error("RFID标签1已绑定"); return AjaxResult.error("RFID标签1已绑定");

@ -4,33 +4,50 @@
<select id="selectEpcByWaybill" resultType="string"> <select id="selectEpcByWaybill" resultType="string">
select cargo_frame_epc from ledger_instant_binding where waybill_number=#{code} and basket_id =#{basketId} limit 1 select cargo_frame_epc
from ledger_instant_binding
where waybill_number = #{code}
and basket_id = #{basketId} limit 1
</select> </select>
<insert id="insertLedgerBinding"> <insert id="insertLedgerBinding">
INSERT INTO ledger_instant_binding (cargo_frame_epc, waybill_number,create_by,basket_id) VALUES (#{param1}, #{param2},#{param3},#{param4}); INSERT INTO ledger_instant_binding (cargo_frame_epc, waybill_number, create_by, basket_id)
VALUES (#{param1}, #{param2}, #{param3}, #{param4});
</insert> </insert>
<select id="findBindingList" resultType="string"> <select id="findBindingList" resultType="string">
select waybill_number select waybill_number
from ledger_instant_binding lib from ledger_instant_binding lib
left join base_basket_info bbi on lib.basket_id=bbi.obj_id left join base_basket_info bbi on lib.basket_id = bbi.obj_id
WHERE basket_epc = #{epc} or basket_epc2 = #{epc} WHERE basket_epc = #{epc}
or basket_epc2 = #{epc}
</select> </select>
<delete id="deleteBindingList"> <delete id="deleteBindingList">
delete from ledger_instant_binding WHERE cargo_frame_epc = #{epc} delete
from ledger_instant_binding
WHERE cargo_frame_epc = #{epc}
</delete> </delete>
<delete id="deleteBindingItem"> <delete id="deleteBindingItem">
delete from ledger_instant_binding WHERE cargo_frame_epc = #{param1} and waybill_number = #{param2} delete
from ledger_instant_binding
WHERE cargo_frame_epc = #{param1}
and waybill_number = #{param2}
</delete> </delete>
<update id="blueToothSubmit"> <update id="blueToothSubmit">
UPDATE base_location_info SET remark = #{param2} WHERE location_code = #{param1} UPDATE base_location_info
SET remark = #{param2}
WHERE location_code = #{param1}
</update> </update>
<update id="delectLocationInfoRemarkByDbCode"> <update id="delectLocationInfoRemarkByDbCode">
UPDATE base_location_info SET remark = null WHERE location_code = #{locationCode}; UPDATE base_location_info
SET remark = null
WHERE location_code = #{locationCode};
</update> </update>
<select id="jionSelect" resultMap="com.ruoyi.manager.mapper.LedgerInstantBindingMapper.LedgerInstantBindingResult"> <select id="jionSelect" resultMap="com.ruoyi.manager.mapper.LedgerInstantBindingMapper.LedgerInstantBindingResult">
select cargo_frame_epc from ledger_instant_binding where create_by = #{user} group by cargo_frame_epc select cargo_frame_epc
from ledger_instant_binding
where create_by = #{user}
group by cargo_frame_epc
</select> </select>
<update id="joinShouSubmit" parameterType="com.ruoyi.webapi.doman.ReceiptSubmitBeen"> <update id="joinShouSubmit" parameterType="com.ruoyi.webapi.doman.ReceiptSubmitBeen">
@ -40,7 +57,8 @@
</foreach> </foreach>
</update> </update>
<select id="joinSelectByUser" parameterType="com.ruoyi.webapi.doman.ReceiptSubmitBeen" resultType="java.lang.Integer"> <select id="joinSelectByUser" parameterType="com.ruoyi.webapi.doman.ReceiptSubmitBeen"
resultType="java.lang.Integer">
select count(1) from ledger_instant_binding select count(1) from ledger_instant_binding
<where> <where>
basket_id in basket_id in
@ -52,17 +70,19 @@
</select> </select>
<resultMap type="com.ruoyi.webapi.doman.APKVersion" id="PdaApkVersionResult"> <resultMap type="com.ruoyi.webapi.doman.APKVersion" id="PdaApkVersionResult">
<result property="VersionCode" column="version_code" /> <result property="VersionCode" column="version_code"/>
<result property="VersionName" column="version_name" /> <result property="VersionName" column="version_name"/>
<result property="ModifyContent" column="modify_content" /> <result property="ModifyContent" column="modify_content"/>
<result property="DownloadUrl" column="download_url" /> <result property="DownloadUrl" column="download_url"/>
<result property="ApkSize" column="apk_size" /> <result property="ApkSize" column="apk_size"/>
<result property="ApkMd5" column="apk_md5" /> <result property="ApkMd5" column="apk_md5"/>
</resultMap> </resultMap>
<select id="getVersion" resultMap="PdaApkVersionResult"> <select id="getVersion" resultMap="PdaApkVersionResult">
select version_code, version_name, modify_content, download_url, apk_size, apk_md5 from pda_apk_version order by create_time desc limit 1 select version_code, version_name, modify_content, download_url, apk_size, apk_md5
from pda_apk_version
order by create_time desc limit 1
</select> </select>

Loading…
Cancel
Save