Compare commits

..

No commits in common. '17ed15f08e362adb62ae79a0619833b6e3b82169' and '0d35e4b1ac89ce45b4ca71f0330311c7180995ef' have entirely different histories.

  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,7 +23,6 @@ public class SaveAction implements Action {
public void next(ActionDto actionDto) {
VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class);
Negative negative = negativeService.getById(actionDto.getNegativeId());
verifyData.setSkipInitView(true);
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 = "联系电话")
private String responderPhone;
@Schema(description = "涉及二级机构Id")
@Schema(description = "被投诉二级机构Id")
private String secondDepartId;
@Schema(description = "涉及二级机构")
@Schema(description = "被投诉二级机构")
private String secondDepartName;
@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 = "联系电话")
private String responderPhone;
@Schema(description = "涉及单位Id")
private String involveDepartId;
@Schema(description = "被投诉二级机构Id")
private String secondDepartId;
@Schema(description = "涉及单位名称")
private String involveDepartName;
@Schema(description = "被投诉二级机构")
private String secondDepartName;
@Schema(description = "来信内容")
private String thingDesc;
@ -163,8 +163,8 @@ public class ComplaintCollectionAddRequest implements ParamChecked {
if (StrUtil.isNotBlank(responderIdCode) && !IdcardUtil.isValidCard(responderIdCode)){
throw new IllegalArgumentException("身份证格式不对!");
}
if (StrUtil.hasBlank(involveDepartId,involveDepartName)) {
throw new IllegalArgumentException("涉及单位不能为空");
if (StrUtil.hasBlank(secondDepartId,secondDepartName)) {
throw new IllegalArgumentException("被投诉二级机构不能为空");
}
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 = "联系电话")
private String responderPhone;
@Schema(description = "被投诉机构Id")
private String involveDepartId;
@Schema(description = "被投诉二级机构Id")
private String secondDepartId;
@Schema(description = "被投诉机构")
private String involveDepartName;
@Schema(description = "被投诉二级机构")
private String secondDepartName;
@Schema(description = "来信内容")
private String thingDesc;
@ -91,8 +91,8 @@ public class ComplaintCollectionUpdateRequest implements ParamChecked {
&& StrUtil.isBlank(responderName)
&& StrUtil.isBlank(responderIdCode)
&& StrUtil.isBlank(responderPhone)
&& StrUtil.isBlank(involveDepartId)
&& StrUtil.isBlank(involveDepartName)
&& StrUtil.isBlank(secondDepartId)
&& StrUtil.isBlank(secondDepartName)
&& StrUtil.isBlank(thingDesc)
&& CollectionUtil.isEmpty(involveProblemIdList)
&& StrUtil.isBlank(repeatt)

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

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

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

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

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

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

Loading…
Cancel
Save