Commit ccf364cc authored by 朱晨阳's avatar 朱晨阳

添加整改类型

parent 1f5f3c6d
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.hygf.api.Enum.RectificationOrderEnum;
......@@ -67,8 +69,8 @@ public class HygfRectificationOrderController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增审核单", notes = "新增审核单")
public ResponseModel<HygfRectificationOrderDto> save(@RequestBody HygfRectificationOrderDto model) {
model = hygfRectificationOrderServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
model = hygfRectificationOrderServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
......@@ -81,8 +83,8 @@ public class HygfRectificationOrderController extends BaseController {
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新审核单", notes = "根据sequenceNbr更新审核单")
public ResponseModel<HygfRectificationOrderDto> updateBySequenceNbrHygfRectificationOrder(@RequestBody HygfRectificationOrderDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(hygfRectificationOrderServiceImpl.updateWithModel(model));
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(hygfRectificationOrderServiceImpl.updateWithModel(model));
}
/**
......@@ -108,10 +110,10 @@ public class HygfRectificationOrderController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个审核单", notes = "根据sequenceNbr查询单个审核单")
public ResponseModel<HygfRectificationOrder> selectOne(@PathVariable Long sequenceNbr) {
HygfRectificationOrder hygfRectificationOrder = hygfRectificationOrderServiceImpl.getBaseMapper().selectById(sequenceNbr);
HygfRectificationOrder hygfRectificationOrder = hygfRectificationOrderServiceImpl.getBaseMapper().selectById(sequenceNbr);
RectificationRoleEnum enums = RectificationRoleEnum.getNodeByName(hygfRectificationOrder.getRectificationSource());
hygfRectificationOrder.setRectificationSourceName(enums!=null?enums.name():null);
return ResponseHelper.buildResponse(hygfRectificationOrder);
return ResponseHelper.buildResponse(hygfRectificationOrder);
}
/**
......@@ -152,22 +154,32 @@ public class HygfRectificationOrderController extends BaseController {
Page<HygfRectificationOrder> page = hygfRectificationOrderServiceImpl.queryForHygfRectificationOrderPage(current, size, workOrderPowerStationNodes, peasantHouseholeId,status);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{
if (longs.contains(areaId) && e.getRectificationSource().equals("area")){
e.setIsAudit("0");
}else if (longs.contains(engineeringId) && e.getRectificationSource().equals("engineering")){
e.setIsAudit("0");
}else if (longs.contains(designId) && e.getRectificationSource().equals("design")){
e.setIsAudit("0");
}else if (longs.contains(deveEngineeringId)&& (e.getRectificationStatus().equals("待审核") || e.getRectificationStatus().equals("整改中"))){
e.setIsAudit("0");
}else {
e.setIsAudit("1");
}
});
page.getRecords().forEach(e->{
if(e.getRectificationIdea() != null && e.getRectificationIdea().size() > 0) {
List<String> types = new ArrayList<>();
e.getRectificationIdea().forEach(t -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(t));
types.add(jsonObject.getString("type"));
});
e.setRectificationType(String.join(",", types));
}
if (longs.contains(areaId) && e.getRectificationSource().equals("area")){
e.setIsAudit("0");
}else if (longs.contains(engineeringId) && e.getRectificationSource().equals("engineering")){
e.setIsAudit("0");
}else if (longs.contains(designId) && e.getRectificationSource().equals("design")){
e.setIsAudit("0");
}else if (longs.contains(deveEngineeringId)&& (e.getRectificationStatus().equals("待审核") || e.getRectificationStatus().equals("整改中"))){
e.setIsAudit("0");
}else {
e.setIsAudit("1");
}
});
}
return ResponseHelper.buildResponse(page);
return ResponseHelper.buildResponse(page);
}
......@@ -219,9 +231,21 @@ public class HygfRectificationOrderController extends BaseController {
}
Page<HygfRectificationOrder> page = hygfRectificationOrderServiceImpl.queryForHygfRectificationOrderPage(current, size, workOrderPowerStationNodes, peasantHouseholeId,status);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{
if(e.getRectificationIdea() != null && e.getRectificationIdea().size() > 0) {
List<String> types = new ArrayList<>();
e.getRectificationIdea().forEach(t -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(t));
types.add(jsonObject.getString("type"));
});
e.setRectificationType(String.join(",", types));
}
if (longs.contains(areaId) && e.getRectificationSource().equals("bw-area") &&rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(engineeringId) && e.getRectificationSource().equals("bw-engineering")&& rectificationSource.contains(e.getRectificationSource())){
......@@ -240,7 +264,6 @@ public class HygfRectificationOrderController extends BaseController {
}
/**
* 列表分页查询
*
......@@ -301,6 +324,16 @@ public class HygfRectificationOrderController extends BaseController {
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{
if(e.getRectificationIdea() != null && e.getRectificationIdea().size() > 0) {
List<String> types = new ArrayList<>();
e.getRectificationIdea().forEach(t -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(t));
types.add(jsonObject.getString("type"));
});
e.setRectificationType(String.join(",", types));
}
if (longs.contains(areaId) && e.getRectificationSource().equals("ys-area") && rectificationSource.contains(e.getRectificationSource()) ){
e.setIsAudit("0");
}else if (longs.contains(tourongId) && e.getRectificationSource().equals("ys-tourong")&& rectificationSource.contains(e.getRectificationSource())){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment