rev:储料仓重量上线修改

This commit is contained in:
zhangzhiqiang
2023-07-27 15:33:37 +08:00
parent e73877620a
commit bd5ae21530

View File

@@ -31,6 +31,8 @@ import org.nl.wms.scheduler_manage.service.extendtask.wash.WashSendMaterialQZTas
import org.nl.wms.scheduler_manage.service.extendtask.wash.WashSendMaterialTask;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.system_manage.service.param.ISysParamService;
import org.nl.wms.system_manage.service.param.dao.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -68,6 +70,8 @@ public class PdaWashController {
private WashSendMaterialTask washSendMaterialTask;
@Autowired
private WashSendMaterialQZTask washSendMaterialQZTask;
@Autowired
private ISysParamService paramService;
@PostMapping("/specList")
@SaIgnore
@@ -172,8 +176,12 @@ public class PdaWashController {
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())){
LIMIT_WEIGHT = Double.valueOf(one.getValue());
}
if (sum>LIMIT_WEIGHT){
throw new BadRequestException("选择的储料仓必物料总重量大于150公斤");
throw new BadRequestException("选择的储料仓必物料总重量大于"+LIMIT_WEIGHT+"公斤");
}
return list;
}