|
@@ -318,6 +318,44 @@ public class FbsWorkingStatisticsController {
|
|
|
res.setMsg("参数不能为空 ");
|
|
|
return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
}
|
|
|
+ if(StringUtils.isBlank(entity.getPersonnelCode())){
|
|
|
+ res.setCode("1");
|
|
|
+ res.setMsg("人员编码不能为空");
|
|
|
+ return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(entity.getPersonnelName())){
|
|
|
+ res.setCode("1");
|
|
|
+ res.setMsg("人员名称不能为空");
|
|
|
+ return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
+// if(StringUtils.isBlank(entity.getQualifiedNumber())){
|
|
|
+// res.setCode("1");
|
|
|
+// res.setMsg("合格数量不能为空");
|
|
|
+// return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
+// }
|
|
|
+ if(StringUtils.isBlank(entity.getBatchCode())){
|
|
|
+ res.setCode("1");
|
|
|
+ res.setMsg("批次号不能为空");
|
|
|
+ return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] batchCode = entity.getBatchCode().split(",");
|
|
|
+ if(batchCode.length > 0){
|
|
|
+ entity.setQualifiedNumber(String.valueOf(batchCode.length));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(entity.getState())){
|
|
|
+ res.setCode("1");
|
|
|
+ res.setMsg("状态不能为空0保存,1提交");
|
|
|
+ return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(entity.getOrderNumber())){
|
|
|
+ res.setCode("1");
|
|
|
+ res.setMsg("订单号不能为空");
|
|
|
+ return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
//完结状态(1-开工,2-下岗/暂停,3-实时报工)
|
|
|
QueryWrapper<FbsWorkingStatistics> workingStatisticsQueryWrapper = new QueryWrapper<>();
|
|
|
workingStatisticsQueryWrapper.eq("personnel_Code", entity.getPersonnelCode()).eq("del_flag", 0);
|
|
@@ -325,18 +363,16 @@ public class FbsWorkingStatisticsController {
|
|
|
workingStatisticsQueryWrapper.in("final_State", 1);
|
|
|
|
|
|
List<FbsWorkingStatistics> list2 = fbsWorkingStatisticsService.list(workingStatisticsQueryWrapper);
|
|
|
-
|
|
|
if(list2.size() < 1){
|
|
|
res.setCode("1");
|
|
|
- res.setMsg("报工单id不能为空");
|
|
|
+ res.setMsg("没有查到可以报工的数据");
|
|
|
return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
}
|
|
|
-// FbsWorkingStatistics par = fbsWorkingStatisticsService.getById(entity.getId());
|
|
|
FbsWorkingStatistics par = list2.get(0);
|
|
|
if(par != null){
|
|
|
if(par.getState().equals("1")){
|
|
|
res.setCode("1");
|
|
|
- res.setMsg("该次已完成报工,请勿再次操作");
|
|
|
+ res.setMsg("该次已完成报工入库,请勿再次操作");
|
|
|
return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
@@ -353,71 +389,30 @@ public class FbsWorkingStatisticsController {
|
|
|
|
|
|
}else{
|
|
|
res.setCode("1");
|
|
|
- res.setMsg("报工单id不正确,没有查询到数据");
|
|
|
+ res.setMsg("数据异常,没有查询到数据");
|
|
|
return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isBlank(entity.getPersonnelCode())){
|
|
|
- res.setCode("1");
|
|
|
- res.setMsg("人员编码不能为空");
|
|
|
- return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
- }
|
|
|
- if(StringUtils.isBlank(entity.getPersonnelName())){
|
|
|
- res.setCode("1");
|
|
|
- res.setMsg("人员名称不能为空");
|
|
|
- return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isBlank(entity.getQualifiedNumber())){
|
|
|
- res.setCode("1");
|
|
|
- res.setMsg("合格数量不能为空");
|
|
|
- return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
- }
|
|
|
- if(StringUtils.isBlank(entity.getBatchCode())){
|
|
|
- res.setCode("1");
|
|
|
- res.setMsg("批次号不能为空");
|
|
|
- return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
- }
|
|
|
- String[] batchCode = entity.getBatchCode().split(",");
|
|
|
- if(batchCode.length > 0){
|
|
|
- entity.setQualifiedNumber(String.valueOf(batchCode.length));
|
|
|
- }
|
|
|
-// if(StringUtils.isBlank(entity.getScrapNumber())){
|
|
|
+// QueryWrapper<FbsWorkshopDispatchList> ypffscSaleorderBQueryWrapper = new QueryWrapper<>();
|
|
|
+// //状态(0初始,1接单,2暂停,3完成)
|
|
|
+// ypffscSaleorderBQueryWrapper.eq("personnel_id_u8", entity.getPersonnelCode()).eq("del_flag", 0);
|
|
|
+// ypffscSaleorderBQueryWrapper.eq("production_order_number_id", entity.getOrderNumber());
|
|
|
+// ypffscSaleorderBQueryWrapper.eq("state", 1);
|
|
|
+//
|
|
|
+// List<FbsWorkshopDispatchList> list = fbsWorkshopDispatchListService.list(ypffscSaleorderBQueryWrapper);
|
|
|
+// if(list.size() < 1){
|
|
|
// res.setCode("1");
|
|
|
-// res.setMsg("报废数量不能为空");
|
|
|
+// res.setMsg("该订单还没有上岗"+entity.getOrderNumber());
|
|
|
// return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
// }
|
|
|
-// if(StringUtils.isBlank(entity.getRefuseNumber())){
|
|
|
-// res.setCode("1");
|
|
|
-// res.setMsg("拒绝数量不能为空");
|
|
|
-// return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
-// }
|
|
|
- if(StringUtils.isBlank(entity.getState())){
|
|
|
- res.setCode("1");
|
|
|
- res.setMsg("状态不能为空0保存,1提交");
|
|
|
- return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
- }
|
|
|
- if(StringUtils.isBlank(entity.getOrderNumber())){
|
|
|
- res.setCode("1");
|
|
|
- res.setMsg("订单号不能为空");
|
|
|
- return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
- }
|
|
|
-
|
|
|
- QueryWrapper<FbsWorkshopDispatchList> ypffscSaleorderBQueryWrapper = new QueryWrapper<>();
|
|
|
- //状态(0初始,1接单,2暂停,3完成)
|
|
|
- ypffscSaleorderBQueryWrapper.eq("personnel_id_u8", entity.getPersonnelCode()).eq("del_flag", 0);
|
|
|
- ypffscSaleorderBQueryWrapper.eq("production_order_number_id", entity.getOrderNumber());
|
|
|
- ypffscSaleorderBQueryWrapper.eq("state", 1);
|
|
|
-
|
|
|
- List<FbsWorkshopDispatchList> list = fbsWorkshopDispatchListService.list(ypffscSaleorderBQueryWrapper);
|
|
|
- if(list.size() < 1){
|
|
|
+// FbsWorkshopDispatchList workshopDispatchList = list.get(0);
|
|
|
+ FbsWorkshopDispatchList workshopDispatchList = fbsWorkshopDispatchListService.getById(par.getPkWorkshopDispatchList());
|
|
|
+ if(workshopDispatchList == null){
|
|
|
res.setCode("1");
|
|
|
res.setMsg("该订单还没有上岗"+entity.getOrderNumber());
|
|
|
return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
}
|
|
|
- FbsWorkshopDispatchList workshopDispatchList = list.get(0);
|
|
|
-
|
|
|
- //状态(0初始,1接单,2暂停,3完成)
|
|
|
+ //状态(0初始,1接单,2暂停,3完成)
|
|
|
if(workshopDispatchList.getState().equals("0") || workshopDispatchList.getState().equals("2")){
|
|
|
res.setCode("1");
|
|
|
res.setMsg("该订单目前正在进行中,无法报工"+entity.getOrderNumber());
|
|
@@ -428,7 +423,7 @@ public class FbsWorkingStatisticsController {
|
|
|
entity.setEndDate(workshopDispatchList.getPlannedStartTime());//计划时间
|
|
|
|
|
|
entity.setFinalInfo("实时报工");
|
|
|
- entity.setPkWorkshopDispatchList(list.get(0).getId());
|
|
|
+ entity.setPkWorkshopDispatchList(workshopDispatchList.getId());
|
|
|
entity.setFinalState("3");//完结状态(1-开工,2-下岗/暂停,3-实时报工)
|
|
|
fbsWorkingStatisticsService.updateById(entity);
|
|
|
fbsWorkshopDispatchListService.updateState("3",entity.getPkWorkshopDispatchList());
|