Compare commits

...

2 Commits

  1. 1
      src/main/java/com/biutag/supervision/flow/action/SaveAction.java
  2. 4
      src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionUpdateParam.java
  3. 12
      src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionAddRequest.java
  4. 12
      src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionUpdateRequest.java
  5. 6
      src/main/java/com/biutag/supervision/pojo/vo/complaintCollection/ComplaintCollectionDetailVo.java
  6. 98
      src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java
  7. 8
      src/main/resources/mapper/ComplaintCollectionMapper.xml

1
src/main/java/com/biutag/supervision/flow/action/SaveAction.java

@ -23,6 +23,7 @@ public class SaveAction implements Action {
public void next(ActionDto actionDto) { public void next(ActionDto actionDto) {
VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class);
Negative negative = negativeService.getById(actionDto.getNegativeId()); Negative negative = negativeService.getById(actionDto.getNegativeId());
verifyData.setSkipInitView(true);
applyCompletionAction.updateNegative(negative, verifyData); applyCompletionAction.updateNegative(negative, verifyData);
} }

4
src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionUpdateParam.java

@ -48,10 +48,10 @@ public class ComplaintCollectionUpdateParam {
@Schema(description = "联系电话") @Schema(description = "联系电话")
private String responderPhone; private String responderPhone;
@Schema(description = "被投诉二级机构Id") @Schema(description = "涉及二级机构Id")
private String secondDepartId; private String secondDepartId;
@Schema(description = "被投诉二级机构") @Schema(description = "涉及二级机构")
private String secondDepartName; private String secondDepartName;
@Schema(description = "来信内容") @Schema(description = "来信内容")

12
src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionAddRequest.java

@ -54,11 +54,11 @@ public class ComplaintCollectionAddRequest implements ParamChecked {
@Schema(description = "联系电话") @Schema(description = "联系电话")
private String responderPhone; private String responderPhone;
@Schema(description = "被投诉二级机构Id") @Schema(description = "涉及单位Id")
private String secondDepartId; private String involveDepartId;
@Schema(description = "被投诉二级机构") @Schema(description = "涉及单位名称")
private String secondDepartName; private String involveDepartName;
@Schema(description = "来信内容") @Schema(description = "来信内容")
private String thingDesc; private String thingDesc;
@ -163,8 +163,8 @@ public class ComplaintCollectionAddRequest implements ParamChecked {
if (StrUtil.isNotBlank(responderIdCode) && !IdcardUtil.isValidCard(responderIdCode)){ if (StrUtil.isNotBlank(responderIdCode) && !IdcardUtil.isValidCard(responderIdCode)){
throw new IllegalArgumentException("身份证格式不对!"); throw new IllegalArgumentException("身份证格式不对!");
} }
if (StrUtil.hasBlank(secondDepartId,secondDepartName)) { if (StrUtil.hasBlank(involveDepartId,involveDepartName)) {
throw new IllegalArgumentException("被投诉二级机构不能为空"); throw new IllegalArgumentException("涉及单位不能为空");
} }
if (StrUtil.isBlank(thingDesc)) { if (StrUtil.isBlank(thingDesc)) {

12
src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionUpdateRequest.java

@ -42,11 +42,11 @@ public class ComplaintCollectionUpdateRequest implements ParamChecked {
@Schema(description = "联系电话") @Schema(description = "联系电话")
private String responderPhone; private String responderPhone;
@Schema(description = "被投诉二级机构Id") @Schema(description = "被投诉机构Id")
private String secondDepartId; private String involveDepartId;
@Schema(description = "被投诉二级机构") @Schema(description = "被投诉机构")
private String secondDepartName; private String involveDepartName;
@Schema(description = "来信内容") @Schema(description = "来信内容")
private String thingDesc; private String thingDesc;
@ -91,8 +91,8 @@ public class ComplaintCollectionUpdateRequest implements ParamChecked {
&& StrUtil.isBlank(responderName) && StrUtil.isBlank(responderName)
&& StrUtil.isBlank(responderIdCode) && StrUtil.isBlank(responderIdCode)
&& StrUtil.isBlank(responderPhone) && StrUtil.isBlank(responderPhone)
&& StrUtil.isBlank(secondDepartId) && StrUtil.isBlank(involveDepartId)
&& StrUtil.isBlank(secondDepartName) && StrUtil.isBlank(involveDepartName)
&& StrUtil.isBlank(thingDesc) && StrUtil.isBlank(thingDesc)
&& CollectionUtil.isEmpty(involveProblemIdList) && CollectionUtil.isEmpty(involveProblemIdList)
&& StrUtil.isBlank(repeatt) && StrUtil.isBlank(repeatt)

6
src/main/java/com/biutag/supervision/pojo/vo/complaintCollection/ComplaintCollectionDetailVo.java

@ -41,6 +41,12 @@ public class ComplaintCollectionDetailVo {
@Schema(description = "联系电话") @Schema(description = "联系电话")
private String responderPhone; private String responderPhone;
@Schema(description = "涉及单位ID")
private String involveDepartId;
@Schema(description = "涉及单位名称")
private String involveDepartName;
@Schema(description = "被投诉二级机构ID") @Schema(description = "被投诉二级机构ID")
private String secondDepartId; private String secondDepartId;

98
src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java

@ -119,10 +119,32 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
} }
} }
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam();
supDepartQueryParam.setId(request.getSecondDepartId()); supDepartQueryParam.setId(request.getInvolveDepartId());
List<SupDepart> supDepartList = supDepartResourceService.query(supDepartQueryParam); List<SupDepart> supDepartList = supDepartResourceService.query(supDepartQueryParam);
if (CollectionUtil.isEmpty(supDepartList) || supDepartList.get(0).getLevel()!=2){ if (CollectionUtil.isEmpty(supDepartList)) {
throw new IllegalStateException("请选择正确的二级机构"); throw new IllegalStateException("请选择正确的涉及单位");
}
SupDepart supDepart = supDepartList.get(0);
String secondDepartId = null;
String secondDepartName = null;
String thirdDepartId = null;
String thirdDepartName = null;
if (supDepart.getLevel() == 3) {
// 查出父级2级
SupDepartQueryParam parentParam = new SupDepartQueryParam();
parentParam.setId(supDepart.getPid());
List<SupDepart> parentList = supDepartResourceService.query(parentParam);
SupDepart parent = CollectionUtil.isNotEmpty(parentList) ? parentList.get(0) : null;
thirdDepartId = supDepart.getId();
thirdDepartName = supDepart.getShortName();
secondDepartId = parent != null ? parent.getId() : null;
secondDepartName = parent != null ? parent.getShortName() : null;
} else if (supDepart.getLevel() == 2) {
secondDepartId = supDepart.getId();
secondDepartName = supDepart.getShortName();
} else {
throw new IllegalStateException("涉及单位只支持2级或3级");
} }
// 手动创建 ComplaintCollection,只设置特有字段 // 手动创建 ComplaintCollection,只设置特有字段
ComplaintCollection complaintCollection = new ComplaintCollection(); ComplaintCollection complaintCollection = new ComplaintCollection();
@ -133,8 +155,10 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
complaintCollection.setLeadApproval(request.getLeadApproval()); complaintCollection.setLeadApproval(request.getLeadApproval());
complaintCollection.setTag(request.getTag()); complaintCollection.setTag(request.getTag());
complaintCollection.setHandleMethod(request.getHandleMethod()); complaintCollection.setHandleMethod(request.getHandleMethod());
complaintCollection.setSecondDepartId(request.getSecondDepartId()); complaintCollection.setSecondDepartId(secondDepartId);
complaintCollection.setSecondDepartName(request.getSecondDepartName()); complaintCollection.setSecondDepartName(secondDepartName);
complaintCollection.setThirdDepartId(thirdDepartId);
complaintCollection.setThirdDepartName(thirdDepartName);
// 生成编号 // 生成编号
if (StrUtil.isBlank(request.getOriginId())) { if (StrUtil.isBlank(request.getOriginId())) {
complaintCollection.setOriginId(SfssUtil.generateIdWithPrefix(request.getSourceTable())); complaintCollection.setOriginId(SfssUtil.generateIdWithPrefix(request.getSourceTable()));
@ -204,11 +228,42 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
if (!exists) { if (!exists) {
throw new NoSuchElementException("未找到可修改信息"); throw new NoSuchElementException("未找到可修改信息");
} }
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); // 涉及单位校验(可以是2级或3级)
supDepartQueryParam.setId(request.getSecondDepartId()); String involveDepartId = request.getInvolveDepartId();
List<SupDepart> supDepartList = supDepartResourceService.query(supDepartQueryParam); String involveDepartName = request.getInvolveDepartName();
if (CollectionUtil.isEmpty(supDepartList) || supDepartList.get(0).getLevel()!=2){ String secondDepartId = null;
throw new IllegalStateException("请选择正确的二级机构"); String secondDepartName = null;
String thirdDepartId = null;
String thirdDepartName = null;
if (StrUtil.isNotBlank(involveDepartId)) {
// 先查出自己
SupDepartQueryParam departParam = new SupDepartQueryParam();
departParam.setId(involveDepartId);
List<SupDepart> departList = supDepartResourceService.query(departParam);
if (CollectionUtil.isEmpty(departList)) {
throw new IllegalStateException("请选择正确的涉及机构");
}
SupDepart depart = departList.get(0);
// 再查出父级
SupDepartQueryParam parentParam = new SupDepartQueryParam();
parentParam.setId(depart.getPid());
List<SupDepart> parentList = supDepartResourceService.query(parentParam);
SupDepart parent = CollectionUtil.isNotEmpty(parentList) ? parentList.get(0) : null;
// 根据级别判断
if (depart.getLevel() == 3) {
thirdDepartId = depart.getId();
thirdDepartName = depart.getShortName();
secondDepartId = parent != null ? parent.getId() : null;
secondDepartName = parent != null ? parent.getShortName() : null;
} else if (depart.getLevel() == 2) {
secondDepartId = depart.getId();
secondDepartName = depart.getShortName();
} else {
throw new IllegalStateException("涉及机构只支持2级或3级");
}
} }
// 手动创建 ComplaintCollectionUpdateParam,只设置特有字段 // 手动创建 ComplaintCollectionUpdateParam,只设置特有字段
ComplaintCollectionUpdateParam updateParam = new ComplaintCollectionUpdateParam(); ComplaintCollectionUpdateParam updateParam = new ComplaintCollectionUpdateParam();
@ -224,8 +279,10 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
// tag 处理 // tag 处理
updateParam.setTags(request.getTags()); updateParam.setTags(request.getTags());
updateParam.setHandleMethod(request.getHandleMethod()); updateParam.setHandleMethod(request.getHandleMethod());
updateParam.setSecondDepartId(request.getSecondDepartId()); updateParam.setSecondDepartId(secondDepartId);
updateParam.setSecondDepartName(request.getSecondDepartName()); updateParam.setSecondDepartName(secondDepartName);
updateParam.setThirdDepartId(thirdDepartId);
updateParam.setThirdDepartName(thirdDepartName);
// 5) 更新(只更新非空字段) // 5) 更新(只更新非空字段)
boolean ok = complaintCollectionResourceService.updateSelectiveById(updateParam); boolean ok = complaintCollectionResourceService.updateSelectiveById(updateParam);
if (!ok) { if (!ok) {
@ -238,7 +295,8 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
negativeDto.setDiscoveryTime(request.getDiscoveryTime()); negativeDto.setDiscoveryTime(request.getDiscoveryTime());
negativeDto.setInvolveProblem(request.getInvolveProblemIdList()); negativeDto.setInvolveProblem(request.getInvolveProblemIdList());
negativeDto.setThingDesc(request.getThingDesc()); negativeDto.setThingDesc(request.getThingDesc());
negativeDto.setInvolveDepartId(request.getSecondDepartId()); negativeDto.setInvolveDepartId(request.getInvolveDepartId());
negativeDto.setInvolveDepartName(request.getInvolveDepartName());
// 问题来源 // 问题来源
if (ComplaintCollectionSourceTableEnum.LEADER_ASSIGN.getCode().equals(request.getSourceTable())) { if (ComplaintCollectionSourceTableEnum.LEADER_ASSIGN.getCode().equals(request.getSourceTable())) {
negativeDto.setProblemSourcesCode(request.getSourceTableSubOne()); negativeDto.setProblemSourcesCode(request.getSourceTableSubOne());
@ -671,6 +729,8 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
vo.setInvolveProblem(negative.getInvolveProblem()); vo.setInvolveProblem(negative.getInvolveProblem());
vo.setBusinessTypeCode(negative.getBusinessTypeCode()); vo.setBusinessTypeCode(negative.getBusinessTypeCode());
vo.setBusinessTypeName(negative.getBusinessTypeName()); vo.setBusinessTypeName(negative.getBusinessTypeName());
vo.setInvolveDepartId(negative.getInvolveDepartId());
vo.setInvolveDepartName(negative.getInvolveDepartName());
} }
} }
@ -724,10 +784,14 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
// 业务类别 // 业务类别
dto.setBusinessTypeCode(request.getBusinessTypeCode()); dto.setBusinessTypeCode(request.getBusinessTypeCode());
// 涉及单位 - 使用被投诉二级机构 // 设置涉及单位到 negativeDto(优先使用3级,没有就用2级)
dto.setInvolveDepartId(request.getSecondDepartId()); if (StrUtil.isNotBlank(complaintCollection.getThirdDepartId())) {
dto.setInvolveDepartName(request.getSecondDepartName()); dto.setInvolveDepartId(complaintCollection.getThirdDepartId());
dto.setInvolveDepartName(complaintCollection.getThirdDepartName());
} else {
dto.setInvolveDepartId(complaintCollection.getSecondDepartId());
dto.setInvolveDepartName(complaintCollection.getSecondDepartName());
}
// 内容描述 // 内容描述
dto.setThingDesc(request.getThingDesc()); dto.setThingDesc(request.getThingDesc());

8
src/main/resources/mapper/ComplaintCollectionMapper.xml

@ -222,13 +222,19 @@
n.check_status_code AS checkStatusCode, n.check_status_code AS checkStatusCode,
n.checkStatusName AS checkStatusName, n.checkStatusName AS checkStatusName,
n.check_status_desc AS checkStatusDesc, n.check_status_desc AS checkStatusDesc,
n.involveDepartName AS involveDepartName, -- 涉及单位名称:如果部门是3级则拼接父级名称
CONCAT(
CASE WHEN sd_involve.level = 3 THEN CONCAT(sd_parent.short_name, '/') ELSE '' END,
n.involveDepartName
) AS involveDepartName,
n.handle_second_depart_id AS handleSecondDepartId, n.handle_second_depart_id AS handleSecondDepartId,
n.handle_second_depart_name AS handleSecondDepartName, n.handle_second_depart_name AS handleSecondDepartName,
n.handle_three_depart_id AS handleThreeDepartId, n.handle_three_depart_id AS handleThreeDepartId,
n.handle_three_depart_name AS handleThreeDepartName n.handle_three_depart_name AS handleThreeDepartName
FROM complaint_collection cc FROM complaint_collection cc
LEFT JOIN negative n ON n.id = cc.negative_id LEFT JOIN negative n ON n.id = cc.negative_id
LEFT JOIN sup_depart sd_involve ON sd_involve.id = n.involveDepartId
LEFT JOIN sup_depart sd_parent ON sd_parent.id = sd_involve.pid
<where> <where>
<if test="param.sourceTable != null and param.sourceTable != ''"> <if test="param.sourceTable != null and param.sourceTable != ''">
AND cc.source_table = #{param.sourceTable} AND cc.source_table = #{param.sourceTable}

Loading…
Cancel
Save