|
@@ -8,13 +8,12 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import com.jeesite.common.collect.ListUtils;
|
|
import com.jeesite.common.collect.ListUtils;
|
|
|
import com.jeesite.common.collect.MapUtils;
|
|
import com.jeesite.common.collect.MapUtils;
|
|
|
|
|
+import com.jeesite.common.mybatis.mapper.query.QueryType;
|
|
|
import com.jeesite.modules.file.entity.FileUpload;
|
|
import com.jeesite.modules.file.entity.FileUpload;
|
|
|
import com.jeesite.modules.file.service.FileUploadService;
|
|
import com.jeesite.modules.file.service.FileUploadService;
|
|
|
import com.jeesite.modules.mes.entity.*;
|
|
import com.jeesite.modules.mes.entity.*;
|
|
|
import com.jeesite.modules.mes.resp.CommonResp;
|
|
import com.jeesite.modules.mes.resp.CommonResp;
|
|
|
import com.jeesite.modules.mes.service.*;
|
|
import com.jeesite.modules.mes.service.*;
|
|
|
-import com.jeesite.modules.sys.entity.User;
|
|
|
|
|
-import com.jeesite.modules.sys.utils.UserUtils;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -120,10 +119,9 @@ public class MesProductRepairQualityController extends BaseController {
|
|
|
@RequestMapping(value = "jcList")
|
|
@RequestMapping(value = "jcList")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public CommonResp jcList(HttpServletRequest req, HttpServletResponse response) {
|
|
public CommonResp jcList(HttpServletRequest req, HttpServletResponse response) {
|
|
|
- User user = UserUtils.getUser();
|
|
|
|
|
CommonResp<Page> resp = new CommonResp<>();
|
|
CommonResp<Page> resp = new CommonResp<>();
|
|
|
MesProductRepairQuality mesProductRepair = new MesProductRepairQuality();
|
|
MesProductRepairQuality mesProductRepair = new MesProductRepairQuality();
|
|
|
- mesProductRepair.setCreateBy(user.getUserCode());
|
|
|
|
|
|
|
+ mesProductRepair.getSqlMap().getWhere().and("b.state", QueryType.EQ, "1");
|
|
|
mesProductRepair.setPage(new Page<>(req, response));
|
|
mesProductRepair.setPage(new Page<>(req, response));
|
|
|
Page<MesProductRepairQuality> page = mesProductRepairQualityService.findPage(mesProductRepair);
|
|
Page<MesProductRepairQuality> page = mesProductRepairQualityService.findPage(mesProductRepair);
|
|
|
resp.setData(page);
|
|
resp.setData(page);
|
|
@@ -221,7 +219,8 @@ public class MesProductRepairQualityController extends BaseController {
|
|
|
String result = req.getParameter("result");
|
|
String result = req.getParameter("result");
|
|
|
String backOprno = req.getParameter("backOprno");
|
|
String backOprno = req.getParameter("backOprno");
|
|
|
|
|
|
|
|
- if(StringUtils.isEmpty(sn) || StringUtils.isEmpty(result)){
|
|
|
|
|
|
|
+ if(StringUtils.isEmpty(sn) || StringUtils.isEmpty(result)
|
|
|
|
|
+ || (!result.equals("1") && !result.equals("2"))){
|
|
|
resp.setResult(Global.FALSE);
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("参数错误");
|
|
resp.setMessage("参数错误");
|
|
|
return resp;
|
|
return resp;
|
|
@@ -239,18 +238,26 @@ public class MesProductRepairQualityController extends BaseController {
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(mesProductRepair.getType().equals("1")){ // 在线返修
|
|
|
|
|
- if(!mesProductRepair.getState().equals("0") && !mesProductRepair.getState().equals("1")){
|
|
|
|
|
- resp.setResult(Global.FALSE);
|
|
|
|
|
- resp.setMessage("该状态无法修改");
|
|
|
|
|
- return resp;
|
|
|
|
|
- }
|
|
|
|
|
- }else{ // 离线返修
|
|
|
|
|
- if(!mesProductRepair.getState().equals("1")){
|
|
|
|
|
- resp.setResult(Global.FALSE);
|
|
|
|
|
- resp.setMessage("该状态无法修改");
|
|
|
|
|
- return resp;
|
|
|
|
|
|
|
+ String type = mesProductRepair.getType();
|
|
|
|
|
+ if(StringUtils.isEmpty(type) || (!type.equals("1") && !type.equals("2"))){
|
|
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
|
|
+ resp.setMessage("该返修单类型异常");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String state = mesProductRepair.getState();
|
|
|
|
|
+ if(StringUtils.isEmpty(state) || !state.equals("1")){
|
|
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
|
|
+ if("0".equals(state)){
|
|
|
|
|
+ resp.setMessage("该返修单尚未维修");
|
|
|
|
|
+ }else if("2".equals(state)){
|
|
|
|
|
+ resp.setMessage("该返修单已审核");
|
|
|
|
|
+ }else if("3".equals(state)){
|
|
|
|
|
+ resp.setMessage("该工件不可返修");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ resp.setMessage("该返修单状态异常");
|
|
|
}
|
|
}
|
|
|
|
|
+ return resp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
String repairId = mesProductRepair.getId();
|
|
String repairId = mesProductRepair.getId();
|
|
@@ -259,8 +266,14 @@ public class MesProductRepairQualityController extends BaseController {
|
|
|
mesProductRepair.setBackOprno(backOprno);
|
|
mesProductRepair.setBackOprno(backOprno);
|
|
|
mesProductRepairService.update(mesProductRepair);
|
|
mesProductRepairService.update(mesProductRepair);
|
|
|
|
|
|
|
|
- MesProductRepairQuality mesProductRepairQuality = new MesProductRepairQuality();
|
|
|
|
|
- mesProductRepairQuality.setRepairId(repairId);
|
|
|
|
|
|
|
+ MesProductRepairQuality qualityQuery = new MesProductRepairQuality();
|
|
|
|
|
+ qualityQuery.setRepairId(repairId);
|
|
|
|
|
+ qualityQuery.getSqlMap().getOrder().setOrderBy("a.create_date ASC, a.id ASC");
|
|
|
|
|
+ MesProductRepairQuality mesProductRepairQuality = mesProductRepairQualityService.findInfo(qualityQuery);
|
|
|
|
|
+ if(ObjectUtils.isEmpty(mesProductRepairQuality)){
|
|
|
|
|
+ mesProductRepairQuality = new MesProductRepairQuality();
|
|
|
|
|
+ mesProductRepairQuality.setRepairId(repairId);
|
|
|
|
|
+ }
|
|
|
mesProductRepairQuality.setResult(result);
|
|
mesProductRepairQuality.setResult(result);
|
|
|
mesProductRepairQuality.setRemark(remark);
|
|
mesProductRepairQuality.setRemark(remark);
|
|
|
mesProductRepairQuality.setBackOprno(backOprno);
|
|
mesProductRepairQuality.setBackOprno(backOprno);
|
|
@@ -323,7 +336,8 @@ public class MesProductRepairQualityController extends BaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
resp.setResult(Global.TRUE);
|
|
resp.setResult(Global.TRUE);
|
|
|
|
|
+ resp.setMessage("操作成功");
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
+}
|