|
|
@@ -9,15 +9,9 @@ import com.jeesite.common.web.BaseController;
|
|
|
import com.jeesite.modules.file.entity.FileUpload;
|
|
|
import com.jeesite.modules.file.service.FileUploadService;
|
|
|
import com.jeesite.modules.file.utils.FileUploadUtils;
|
|
|
-import com.jeesite.modules.mes.entity.MesProduct;
|
|
|
-import com.jeesite.modules.mes.entity.MesProductRecord;
|
|
|
-import com.jeesite.modules.mes.entity.MesRepair;
|
|
|
-import com.jeesite.modules.mes.entity.MesRepairQuality;
|
|
|
+import com.jeesite.modules.mes.entity.*;
|
|
|
import com.jeesite.modules.mes.resp.CommonResp;
|
|
|
-import com.jeesite.modules.mes.service.MesProductRecordService;
|
|
|
-import com.jeesite.modules.mes.service.MesProductService;
|
|
|
-import com.jeesite.modules.mes.service.MesRepairQualityService;
|
|
|
-import com.jeesite.modules.mes.service.MesRepairService;
|
|
|
+import com.jeesite.modules.mes.service.*;
|
|
|
import com.jeesite.modules.sys.entity.User;
|
|
|
import com.jeesite.modules.sys.utils.UserUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
@@ -52,6 +46,8 @@ public class MesRepairQualityController extends BaseController {
|
|
|
@Autowired
|
|
|
private MesRepairService mesRepairService;
|
|
|
@Autowired
|
|
|
+ private MesRepairItemsService mesRepairItemsService;
|
|
|
+ @Autowired
|
|
|
private FileUploadService fileUploadService;
|
|
|
@Autowired
|
|
|
private MesProductService mesProductService;
|
|
|
@@ -153,10 +149,15 @@ public class MesRepairQualityController extends BaseController {
|
|
|
String sn = req.getParameter("sn");
|
|
|
String remark = req.getParameter("remark");
|
|
|
String result = req.getParameter("result");
|
|
|
+ String returnOprno = req.getParameter("returnOprno");
|
|
|
if(StringUtils.isEmpty(sn)){
|
|
|
resp.setMessage("参数错误");
|
|
|
return resp;
|
|
|
}
|
|
|
+ if(StringUtils.isEmpty(returnOprno)){
|
|
|
+ resp.setMessage("参数错误");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
if(!result.equals("1") && !result.equals("2")){
|
|
|
resp.setMessage("参数错误");
|
|
|
return resp;
|
|
|
@@ -180,10 +181,18 @@ public class MesRepairQualityController extends BaseController {
|
|
|
resp.setMessage("返修记录不存在");
|
|
|
return resp;
|
|
|
}
|
|
|
- if(!mesRepair.getState().equals("2")){
|
|
|
+ if(mesRepair.getState().equals("1")){
|
|
|
+ resp.setMessage("当前工件未返修!");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+ if(mesRepair.getState().equals("3")){
|
|
|
resp.setMessage("当前工件已检查!");
|
|
|
return resp;
|
|
|
}
|
|
|
+ if(mesRepair.getState().equals("4")){
|
|
|
+ resp.setMessage("当前工件返修NG待处理!");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
|
|
|
MesRepairQuality mesRepairQuality = new MesRepairQuality();
|
|
|
mesRepairQuality.setRepairId(mesRepair.getId());
|
|
|
@@ -198,6 +207,7 @@ public class MesRepairQualityController extends BaseController {
|
|
|
mesRepair.setCheckDate(new Date());
|
|
|
mesRepair.setState("3");
|
|
|
mesRepair.setResult(result);
|
|
|
+ mesRepair.setReturnOprno(returnOprno);
|
|
|
mesRepairService.save(mesRepair);
|
|
|
|
|
|
MesProductRecord mesProductRecord = new MesProductRecord();
|
|
|
@@ -238,6 +248,31 @@ public class MesRepairQualityController extends BaseController {
|
|
|
pp2.setContent("UDF");
|
|
|
mesProductRecordService.save(pp2);
|
|
|
}
|
|
|
+
|
|
|
+ // 气密是否需要重新做
|
|
|
+ MesRepairItems mesRepairItems = mesRepairItemsService.get(mesRepair.getItemId());
|
|
|
+ if(!ObjectUtils.isEmpty(mesRepairItems)){
|
|
|
+ if("1".equals(mesRepairItems.getIsCp())){
|
|
|
+ String cpoprno = "OP450";
|
|
|
+ MesProductRecord mesProductRecord2 = new MesProductRecord();
|
|
|
+ mesProductRecord2.setSn(mesRepair.getSn());
|
|
|
+ mesProductRecord2.setOprno(cpoprno);
|
|
|
+ mesProductRecord2.setCraft("100000");
|
|
|
+ MesProductRecord pp2 = mesProductRecordService.findInfo(mesProductRecord2);
|
|
|
+ pp2.setContent("UDF");
|
|
|
+ mesProductRecordService.save(pp2);
|
|
|
+ }
|
|
|
+ if("1".equals(mesRepairItems.getIsYl())){
|
|
|
+ String yloprno = "OP460";
|
|
|
+ MesProductRecord mesProductRecord2 = new MesProductRecord();
|
|
|
+ mesProductRecord2.setSn(mesRepair.getSn());
|
|
|
+ mesProductRecord2.setOprno(yloprno);
|
|
|
+ mesProductRecord2.setCraft("100000");
|
|
|
+ MesProductRecord pp2 = mesProductRecordService.findInfo(mesProductRecord2);
|
|
|
+ pp2.setContent("UDF");
|
|
|
+ mesProductRecordService.save(pp2);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(result.equals("1")){ // 返修OK
|