|
|
|
|
@ -61,6 +61,8 @@ public class ApiController extends BaseController {
|
|
|
|
|
private IRecordBasketCheckContentService recordBasketCheckContentService;//盘点内容
|
|
|
|
|
@Autowired
|
|
|
|
|
private IBaseAirCodeService baseAirCodeService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IRecordDeliveryTaskWaybillService recordDeliveryTaskWaybillService;//进港接货
|
|
|
|
|
|
|
|
|
|
@PostMapping("/findBindingList")
|
|
|
|
|
public AjaxResult findBindingList(String epc) {
|
|
|
|
|
@ -102,7 +104,6 @@ public class ApiController extends BaseController {
|
|
|
|
|
return AjaxResult.error("库位没有维护");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 接货查询
|
|
|
|
|
@PostMapping("/jion/select")
|
|
|
|
|
public AjaxResult jionSelect(String user) {
|
|
|
|
|
@ -136,7 +137,7 @@ public class ApiController extends BaseController {
|
|
|
|
|
for (MultipartFile file : files) {
|
|
|
|
|
try {
|
|
|
|
|
// 插入图片
|
|
|
|
|
recordDeliveryTaskImgService.insertRecordDeliveryTaskImg( new RecordDeliveryTaskImg(){{
|
|
|
|
|
recordDeliveryTaskImgService.insertRecordDeliveryTaskImg(new RecordDeliveryTaskImg() {{
|
|
|
|
|
setTaskCode(taskCode);
|
|
|
|
|
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);
|
|
|
|
|
@ -154,9 +155,9 @@ public class ApiController extends BaseController {
|
|
|
|
|
// 更新状态
|
|
|
|
|
List<Long> ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList());
|
|
|
|
|
ledgerInstantBindingService.updateTaskStatebyBasketID(ids);
|
|
|
|
|
}else if (type.equals("1")){
|
|
|
|
|
} else if (type.equals("1")) {
|
|
|
|
|
List<String> stringList = JSONArray.parseArray(json, String.class);
|
|
|
|
|
recordDeliveryTaskBaseketService.insertRecordDeliveryTaskWaybill(taskCode,stringList);
|
|
|
|
|
recordDeliveryTaskBaseketService.insertRecordDeliveryTaskWaybill(taskCode, stringList);
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
}
|
|
|
|
|
@ -176,7 +177,6 @@ public class ApiController extends BaseController {
|
|
|
|
|
@PostMapping("/join/shouSubmit")
|
|
|
|
|
public AjaxResult joinJieSubmit(@RequestBody ReceiptSubmitBeen been) {
|
|
|
|
|
int i = service.joinShouSubmit(been);
|
|
|
|
|
|
|
|
|
|
if (i >= been.getList().size()) {
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
}
|
|
|
|
|
@ -196,8 +196,7 @@ public class ApiController extends BaseController {
|
|
|
|
|
|
|
|
|
|
// 远程接货扫描epc
|
|
|
|
|
@PostMapping("/receipt/scanEpc")
|
|
|
|
|
public AjaxResult ReceiptScanEpc(@RequestParam(name = "epc", required = false, defaultValue = "") String epc,
|
|
|
|
|
@RequestParam(name = "waybillNumber", required = false, defaultValue = "") String waybillNumber) {
|
|
|
|
|
public AjaxResult ReceiptScanEpc(@RequestParam(name = "epc", required = false, defaultValue = "") String epc, @RequestParam(name = "waybillNumber", required = false, defaultValue = "") String waybillNumber) {
|
|
|
|
|
Long objId = null;
|
|
|
|
|
|
|
|
|
|
if (epc != null && !epc.equals("")) {
|
|
|
|
|
@ -227,8 +226,61 @@ public class ApiController extends BaseController {
|
|
|
|
|
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")
|
|
|
|
|
public AjaxResult receiptSubmit(@RequestBody ReceiptSubmitBeen been) {
|
|
|
|
|
int i = service.joinShouSubmit(been);
|
|
|
|
|
@ -348,8 +400,7 @@ public class ApiController extends BaseController {
|
|
|
|
|
* 提交绑定记录
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/submitBindingRecord")
|
|
|
|
|
public AjaxResult submitBindingRecord(Long baseBasketId, String basketEpc, String basketEpc2, String localWeight,
|
|
|
|
|
String createdBy, List<MultipartFile> files) {
|
|
|
|
|
public AjaxResult submitBindingRecord(Long baseBasketId, String basketEpc, String basketEpc2, String localWeight, String createdBy, List<MultipartFile> files) {
|
|
|
|
|
int tagCount = baseBasketInfoService.selectCountBasketByEpc(basketEpc);
|
|
|
|
|
if (tagCount > 0) {
|
|
|
|
|
return AjaxResult.error("RFID标签1已绑定");
|
|
|
|
|
|