rev:清洗机上料任务
This commit is contained in:
@@ -164,10 +164,15 @@ public class PdaWashController {
|
||||
.eq("workprocedure_id", "1535144552481034240")
|
||||
.in("device_code", devices));
|
||||
Set<String> collect = list.stream().map(PdmBiDevice::getMaterial_id).collect(Collectors.toSet());
|
||||
|
||||
if (collect.size()>1){
|
||||
throw new BadRequestException("选择的储料仓必须是相同物料");
|
||||
}
|
||||
if (StringUtils.isEmpty(list.get(0).getMaterial_id())){
|
||||
throw new BadRequestException("储料仓物料编码不能为空");
|
||||
}
|
||||
if (list.get(0).getDeviceinstor_weight()==null||list.get(0).getDeviceinstor_weight().intValue()<=0){
|
||||
throw new BadRequestException("储料仓物料重量不能为空");
|
||||
}
|
||||
double sum = list.stream().mapToDouble(a->a.getDeviceinstor_weight().doubleValue()).sum();
|
||||
Param one = paramService.getOne(new QueryWrapper<Param>().eq("code", "LIMIT_WEIGHT"));
|
||||
if (one!=null && StringUtils.isNotEmpty(one.getValue())){
|
||||
@@ -244,7 +249,7 @@ public class PdaWashController {
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> washTasks(@RequestBody JSONObject query) {
|
||||
List<Map<String, Object>> taskMap = taskService.listMaps(new QueryWrapper<SchBaseTask>()
|
||||
.eq("task_status", StatusEnum.TASK_FINISH.getCode()).eq("task_step", 2).orderByDesc("update_time"));
|
||||
.eq("task_status", StatusEnum.TASK_FINISH.getCode()).eq("task_step", 2).orderByAsc("task_code"));
|
||||
if (!CollectionUtils.isEmpty(taskMap)){
|
||||
Set materials = taskMap.stream().map(a->a.get("material_id")).collect(Collectors.toSet());
|
||||
Map<String, MdMeMaterialbase> materialMap = materialbaseService.list(new QueryWrapper<MdMeMaterialbase>()
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.nl.common.anno.Log;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.enums.WorkerOrderEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext_manage.acs.service.WmsToAcsService;
|
||||
@@ -95,7 +96,7 @@ public class TmpPackageController {
|
||||
.set("task_id","")
|
||||
.set("point_status", StatusEnum.POINT_STATUS_EMPTY.getCode())
|
||||
.eq("point_code",param.getString("point_code")));
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
return new ResponseEntity<>(MapOf.of("message","操作成功","status", HttpStatus.OK.value()),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("cachepoint")
|
||||
@@ -148,6 +149,6 @@ public class TmpPackageController {
|
||||
.set("task_id","")
|
||||
.set("qty",0)
|
||||
.eq("point_code",points.get(0).getPoint_code()));
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
return new ResponseEntity<>(MapOf.of("message","操作成功","status", HttpStatus.OK.value()),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +75,12 @@ public class WashMachineryTask extends AbstractAcsTask {
|
||||
if (StringUtils.isNotEmpty(param.getString("task_code"))){
|
||||
query.eq("task_code",param.getString("task_code"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(param.getString("task_id"))){
|
||||
query.eq("task_id",param.getString("task_id"));
|
||||
}
|
||||
SchBaseTask taskDao = taskService.getOne(query);
|
||||
// 更新任务状态为完成
|
||||
if (taskDao.getTask_status().equals(TaskStatusEnum.FINISHED.getCode())||taskDao.getTask_status().equals(TaskStatusEnum.CANCEL.getCode())){
|
||||
if (taskDao.getTask_status().equals(TaskStatusEnum.CANCEL.getCode())){
|
||||
return;
|
||||
}
|
||||
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||
|
||||
Reference in New Issue
Block a user