|
@@ -4,6 +4,8 @@ import com.steerinfo.auth.utils.JwtUtil;
|
|
import com.steerinfo.ems.Utils.DateUtils;
|
|
import com.steerinfo.ems.Utils.DateUtils;
|
|
import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
|
|
import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
|
|
import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
|
|
import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
|
|
|
|
+import com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper;
|
|
|
|
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
import com.steerinfo.framework.service.pagehelper.PageList;
|
|
import com.steerinfo.framework.service.pagehelper.PageList;
|
|
@@ -43,6 +45,8 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
IEmsGmPcJhService emsGmPcJhService;
|
|
IEmsGmPcJhService emsGmPcJhService;
|
|
@Autowired
|
|
@Autowired
|
|
EmsGmPcJhMapper emsGmPcJhMapper;
|
|
EmsGmPcJhMapper emsGmPcJhMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
|
|
|
|
|
|
@ApiOperation(value="获取列表", notes="分页查询")
|
|
@ApiOperation(value="获取列表", notes="分页查询")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@@ -52,6 +56,27 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
//@RequiresPermissions("emsgmpcjh:view")
|
|
//@RequiresPermissions("emsgmpcjh:view")
|
|
@GetMapping(value = "/")
|
|
@GetMapping(value = "/")
|
|
public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
|
|
public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
|
|
|
|
+ if(parmas.get("grades") != null && !parmas.get("grades").toString().isEmpty()){
|
|
|
|
+ String grades = parmas.get("grades").toString();
|
|
|
|
+ if(!grades.startsWith("'")){
|
|
|
|
+ grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
|
|
|
|
+ }
|
|
|
|
+ parmas.put("grades", grades);
|
|
|
|
+ }
|
|
|
|
+ if(parmas.get("specifications") != null && !parmas.get("specifications").toString().isEmpty()){
|
|
|
|
+ String grades = parmas.get("specifications").toString();
|
|
|
|
+ if(!grades.startsWith("'")){
|
|
|
|
+ grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
|
|
|
|
+ }
|
|
|
|
+ parmas.put("specifications", grades);
|
|
|
|
+ }
|
|
|
|
+ if(parmas.get("lengthTimesWidth") != null && !parmas.get("lengthTimesWidth").toString().isEmpty()){
|
|
|
|
+ String grades = parmas.get("lengthTimesWidth").toString();
|
|
|
|
+ if(!grades.startsWith("'")){
|
|
|
|
+ grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
|
|
|
|
+ }
|
|
|
|
+ parmas.put("lengthTimesWidth", grades);
|
|
|
|
+ }
|
|
PageList<EmsGmPcJh> list = emsGmPcJhService.queryForPage(parmas, pageNum, pageSize);
|
|
PageList<EmsGmPcJh> list = emsGmPcJhService.queryForPage(parmas, pageNum, pageSize);
|
|
return success(list);
|
|
return success(list);
|
|
}
|
|
}
|
|
@@ -84,6 +109,12 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
model.setCreateTime(new Date());
|
|
model.setCreateTime(new Date());
|
|
model.setCreateMan(userId);
|
|
model.setCreateMan(userId);
|
|
EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
|
|
EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
|
|
|
|
+ EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = new EmsProdplanWeightAdjustment();
|
|
|
|
+ emsProdplanWeightAdjustment.setId(model.getId());
|
|
|
|
+ emsProdplanWeightAdjustment.setAuditStatus("0");
|
|
|
|
+ emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
|
|
|
|
+ emsProdplanWeightAdjustment.setPlanWeightOld(model.getPlanWeight());
|
|
|
|
+ emsProdplanWeightAdjustmentMapper.insert(emsProdplanWeightAdjustment);
|
|
return success(emsGmPcJh);
|
|
return success(emsGmPcJh);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -102,7 +133,7 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
model.setKxfWeight(model.getPlanWeight() == null ? new BigDecimal("0"): model.getPlanWeight());
|
|
model.setKxfWeight(model.getPlanWeight() == null ? new BigDecimal("0"): model.getPlanWeight());
|
|
model.setYxfWeight(new BigDecimal("0"));
|
|
model.setYxfWeight(new BigDecimal("0"));
|
|
model.setCreateTime(new Date());
|
|
model.setCreateTime(new Date());
|
|
- model.setState("1");
|
|
|
|
|
|
+ model.setState("2");
|
|
model.setCreateMan(userId);
|
|
model.setCreateMan(userId);
|
|
EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
|
|
EmsGmPcJh emsGmPcJh = emsGmPcJhService.add(model);
|
|
return success(emsGmPcJh);
|
|
return success(emsGmPcJh);
|
|
@@ -129,16 +160,23 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
for (EmsGmPcJh model : models) {
|
|
for (EmsGmPcJh model : models) {
|
|
EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
if(emsGmPcJh.getState().equals("2")) {
|
|
if(emsGmPcJh.getState().equals("2")) {
|
|
- return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
|
|
}
|
|
}
|
|
- if (model.getState().equals("1")) {
|
|
|
|
- return failed(model, "计划号为:" + model.getId() + "已下发无法做修改操作,请取消下发");
|
|
|
|
|
|
+ if (emsGmPcJh.getState().equals("1")) {
|
|
|
|
+ return failed(model, "操作失败,计划号为:" + model.getId() + "正在审核");
|
|
|
|
+ }
|
|
|
|
+ if (emsGmPcJh.getState().equals("3")) {
|
|
|
|
+ return failed(model, "操作失败,计划号为:" + model.getId() + "已接收");
|
|
}
|
|
}
|
|
model.setYxfWeight(new BigDecimal("0"));
|
|
model.setYxfWeight(new BigDecimal("0"));
|
|
model.setKxfWeight(model.getPlanWeight());
|
|
model.setKxfWeight(model.getPlanWeight());
|
|
model.setUpdateMan(userId);
|
|
model.setUpdateMan(userId);
|
|
model.setUpdateTime(new Date());
|
|
model.setUpdateTime(new Date());
|
|
|
|
+ EmsProdplanWeightAdjustment emsProdplanWeightAdjustment = emsProdplanWeightAdjustmentMapper.selectByPrimaryKey(model.getId());
|
|
|
|
+ emsProdplanWeightAdjustment.setPlanWeight(model.getPlanWeight());
|
|
|
|
+ emsProdplanWeightAdjustment.setPlanWeightOld(model.getPlanWeight());
|
|
emsGmPcJhMapper.updateByPrimaryKey(model);
|
|
emsGmPcJhMapper.updateByPrimaryKey(model);
|
|
|
|
+ emsProdplanWeightAdjustmentMapper.updateByPrimaryKey(emsProdplanWeightAdjustment);
|
|
}
|
|
}
|
|
return success();
|
|
return success();
|
|
}
|
|
}
|
|
@@ -151,10 +189,13 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
for (EmsGmPcJh model : models) {
|
|
for (EmsGmPcJh model : models) {
|
|
EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
if(emsGmPcJh.getState().equals("2")) {
|
|
if(emsGmPcJh.getState().equals("2")) {
|
|
- return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
|
|
}
|
|
}
|
|
if (model.getState().equals("1")) {
|
|
if (model.getState().equals("1")) {
|
|
- return failed(model,"计划号为:"+model.getId()+"已下发无法做删除操作,请取消下发");
|
|
|
|
|
|
+ return failed(null,"计划号为:"+model.getId()+"正在审核");
|
|
|
|
+ }
|
|
|
|
+ if (model.getState().equals("3")) {
|
|
|
|
+ return failed(null,"计划号为:"+model.getId()+"已经接收");
|
|
}
|
|
}
|
|
emsGmPcJhMapper.deleteByPrimaryKey(model.getId());
|
|
emsGmPcJhMapper.deleteByPrimaryKey(model.getId());
|
|
}
|
|
}
|
|
@@ -173,16 +214,83 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
for (EmsGmPcJh model : models) {
|
|
for (EmsGmPcJh model : models) {
|
|
EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
if(emsGmPcJh.getState().equals("2")) {
|
|
if(emsGmPcJh.getState().equals("2")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
|
|
|
|
+ }
|
|
|
|
+ if (emsGmPcJh.getState().equals("3")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
|
|
+ }
|
|
|
|
+ if (emsGmPcJh.getState().equals("1")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"正在审核");
|
|
|
|
+ }
|
|
|
|
+ model.setYxfWeight(new BigDecimal("0"));
|
|
|
|
+ model.setKxfWeight(model.getPlanWeight());
|
|
|
|
+ model.setUpdateTime(new Date());
|
|
|
|
+ model.setUpdateMan(userId);
|
|
|
|
+ emsGmPcJhService.updateState(model);
|
|
|
|
+ }
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
+ @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsGmPcJh信息来更新详细信息")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
|
|
|
|
+ @ApiImplicitParam(name = "emsGmPcJh", value = "详细实体emsGmPcJh", required = true, dataType = "EmsGmPcJh")
|
|
|
|
+ })
|
|
|
|
+ //@RequiresPermissions("emsgmpcjh:update")
|
|
|
|
+ @PutMapping(value = "/submitaudit", produces = "application/json;charset=UTF-8")
|
|
|
|
+ public RESTfulResult submitaudit(@RequestBody EmsGmPcJh[] models){
|
|
|
|
+ String userId = JwtUtil.getUseridByToken();
|
|
|
|
+ for (EmsGmPcJh model : models) {
|
|
|
|
+ EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
|
|
+ if(emsGmPcJh.getState().equals("2")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
|
|
|
|
+ }
|
|
|
|
+ if (emsGmPcJh.getState().equals("3")) {
|
|
return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
}
|
|
}
|
|
|
|
+ if (emsGmPcJh.getState().equals("1")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"正在审核");
|
|
|
|
+ }
|
|
model.setYxfWeight(new BigDecimal("0"));
|
|
model.setYxfWeight(new BigDecimal("0"));
|
|
model.setKxfWeight(model.getPlanWeight());
|
|
model.setKxfWeight(model.getPlanWeight());
|
|
model.setUpdateTime(new Date());
|
|
model.setUpdateTime(new Date());
|
|
model.setUpdateMan(userId);
|
|
model.setUpdateMan(userId);
|
|
|
|
+
|
|
|
|
+ emsGmPcJhService.updateState(model);
|
|
|
|
+ }
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
+ //@RequiresPermissions("emsgmpcjh:update")
|
|
|
|
+ @PutMapping(value = "/passaudits", produces = "application/json;charset=UTF-8")
|
|
|
|
+ public RESTfulResult passaudits(@RequestBody EmsGmPcJh[] models){
|
|
|
|
+ String userId = JwtUtil.getUseridByToken();
|
|
|
|
+ for (EmsGmPcJh model : models) {
|
|
|
|
+ EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
|
|
+ if(emsGmPcJh.getState().equals("2")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经下发");
|
|
|
|
+ }
|
|
|
|
+ if (emsGmPcJh.getState().equals("3")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
|
|
+ }
|
|
|
|
+ model.setUpdateMan(userId);
|
|
emsGmPcJhService.updateState(model);
|
|
emsGmPcJhService.updateState(model);
|
|
}
|
|
}
|
|
return success();
|
|
return success();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //@RequiresPermissions("emsgmpcjh:update")
|
|
|
|
+ @PutMapping(value = "/turndown", produces = "application/json;charset=UTF-8")
|
|
|
|
+ public RESTfulResult turndown(@RequestBody EmsGmPcJh[] models){
|
|
|
|
+ String userId = JwtUtil.getUseridByToken();
|
|
|
|
+ for (EmsGmPcJh model : models) {
|
|
|
|
+ EmsGmPcJh emsGmPcJh = this.emsGmPcJhMapper.selectByPrimaryKey(model.getId());
|
|
|
|
+ if (emsGmPcJh.getState().equals("3")) {
|
|
|
|
+ return failed(null,"操作失败,编号为"+emsGmPcJh.getId()+"已经接收");
|
|
|
|
+ }
|
|
|
|
+ emsGmPcJhService.updateState(model);
|
|
|
|
+ }
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
@ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
@@ -201,6 +309,35 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
return success(gmPcJhDataForPage);
|
|
return success(gmPcJhDataForPage);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping("/getXsDdDate")
|
|
|
|
+ public RESTfulResult getXsDdDate(@RequestParam HashMap<String,Object> parmas,Integer pageNum,Integer pageSize){
|
|
|
|
+ PageList<Map<String, Object>> getXsDdDateForPage= emsGmPcJhService.getXsDdDate(parmas, pageNum, pageSize);
|
|
|
|
+ return success(getXsDdDateForPage);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="获取列表", notes="分页模糊查询")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping("/getShData")
|
|
|
|
+ public RESTfulResult getShData(@RequestParam HashMap<String,Object> parmas,Integer pageNum,Integer pageSize){
|
|
|
|
+ if(parmas.get("workprocType") != null && !parmas.get("workprocType").toString().isEmpty()){
|
|
|
|
+ String workprocType = parmas.get("workprocType").toString();
|
|
|
|
+ if(!workprocType.startsWith("'")){
|
|
|
|
+ workprocType = "'" + workprocType.replaceAll(",", "','").replaceAll(",", "','") + "'";
|
|
|
|
+ }
|
|
|
|
+ parmas.put("workprocType", workprocType);
|
|
|
|
+ }
|
|
|
|
+ PageList<Map<String, Object>> xsShData = emsGmPcJhService.getXsShData(parmas, pageNum, pageSize);
|
|
|
|
+ return success(xsShData);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsGmPcJh信息来更新详细信息")
|
|
@ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsGmPcJh信息来更新详细信息")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
|
|
@ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
|
|
@@ -258,4 +395,5 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|