|
|
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
|
|
import com.ruoyi.manager.domain.*;
|
|
|
|
|
import com.ruoyi.manager.service.*;
|
|
|
|
|
@ -17,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@ -39,7 +39,8 @@ public class ApiController {
|
|
|
|
|
private IRecordtRfidBindingService recordtRfidBindingService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ILedgerInstantBindingService ledgerInstantBindingService;//货物实时绑定信息
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IRecordCargoBindingService recordCargoBindingService;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/findBindingList")
|
|
|
|
|
public AjaxResult findBindingList(String epc) {
|
|
|
|
|
@ -80,6 +81,7 @@ public class ApiController {
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.error("库位没有维护");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 接货查询
|
|
|
|
|
@PostMapping("/jion/select")
|
|
|
|
|
public AjaxResult jionSelect(String user) {
|
|
|
|
|
@ -90,13 +92,43 @@ public class ApiController {
|
|
|
|
|
if (list == null || list.isEmpty()) return AjaxResult.error("账号无绑定记录");
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
@Autowired
|
|
|
|
|
private IRecordDeliveryTaskService recordDeliveryTaskService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IRecordDeliveryTaskBaseketService recordDeliveryTaskBaseketService;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/delivery/createTask")
|
|
|
|
|
public AjaxResult createDeliveryTask(String json, List<MultipartFile> files) {
|
|
|
|
|
public AjaxResult createDeliveryTask(String json,String user, List<MultipartFile> files) {
|
|
|
|
|
List<Long> ids = JSONArray.parseArray(json, Long.class);
|
|
|
|
|
// 生成任务编码
|
|
|
|
|
int taskNumber = recordDeliveryTaskService.countNowDateTaskNumber();
|
|
|
|
|
String taskCode="Task"+DateUtils.dateTime()+String.format("%03d",taskNumber);
|
|
|
|
|
// 插入任务
|
|
|
|
|
RecordDeliveryTask recordDeliveryTask=new RecordDeliveryTask();
|
|
|
|
|
recordDeliveryTask.setTaskCode(taskCode);
|
|
|
|
|
recordDeliveryTask.setCreateBy(user);
|
|
|
|
|
recordDeliveryTaskService.insertRecordDeliveryTask(recordDeliveryTask);
|
|
|
|
|
// 插入资产到任务表
|
|
|
|
|
recordDeliveryTaskBaseketService.insertRecordDeliveryTaskBaseket(taskCode,ids);
|
|
|
|
|
// 插入图片
|
|
|
|
|
String filePath = RuoYiConfig.getUploadPath()+"/task";
|
|
|
|
|
for (int i = 0; i < files.size(); i++) {
|
|
|
|
|
try {
|
|
|
|
|
String fileName = FileUploadUtils.upload(filePath, files.get(i));
|
|
|
|
|
RecordDeliveryTaskImg recordDeliveryTaskImg=new RecordDeliveryTaskImg();
|
|
|
|
|
recordDeliveryTaskImg.setTaskCode(taskCode);
|
|
|
|
|
recordDeliveryTaskImg.setImgPath(fileName);
|
|
|
|
|
recordDeliveryTaskImgService.insertRecordDeliveryTaskImg(recordDeliveryTaskImg);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IRecordDeliveryTaskImgService recordDeliveryTaskImgService;
|
|
|
|
|
//交货提交
|
|
|
|
|
@PostMapping("/join/jiaoSubmit")
|
|
|
|
|
public AjaxResult joinJiaoSubmit(@RequestBody JoinSubmitBeen been) {
|
|
|
|
|
@ -268,8 +300,7 @@ return AjaxResult.success();
|
|
|
|
|
if (i > 0) return AjaxResult.success();
|
|
|
|
|
return AjaxResult.error();
|
|
|
|
|
}
|
|
|
|
|
@Autowired
|
|
|
|
|
private IRecordCargoBindingService recordCargoBindingService;
|
|
|
|
|
|
|
|
|
|
// 货物绑定货框
|
|
|
|
|
@PostMapping("/bindingSubmit")
|
|
|
|
|
public AjaxResult bindingSubmit(@RequestBody BindingSubmitBeen submitBeen) {
|
|
|
|
|
|