Browse Source

fix: 修复BUG

main
wxc 1 year ago
parent
commit
690e513987
  1. 15
      sql/1107.sql
  2. 8
      src/main/java/com/biutag/supervision/common/validation/AddGroup.java
  3. 8
      src/main/java/com/biutag/supervision/common/validation/EditGroup.java
  4. 2
      src/main/java/com/biutag/supervision/constants/AppConstants.java
  5. 4
      src/main/java/com/biutag/supervision/controller/StatisticsController.java
  6. 10
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java
  7. 12
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java
  8. 12
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  9. 45
      src/main/java/com/biutag/supervision/job/DepartJob.java
  10. 8
      src/main/java/com/biutag/supervision/mapper/DepartNegativeRateMapper.java
  11. 6
      src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java
  12. 2
      src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java
  13. 31
      src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java
  14. 32
      src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java
  15. 2
      src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java
  16. 12
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  17. 2
      src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java
  18. 4
      src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java
  19. 2
      src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java
  20. 2
      src/main/java/com/biutag/supervision/pojo/model/UserAuth.java
  21. 3
      src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java
  22. 2
      src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java
  23. 4
      src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java
  24. 2
      src/main/java/com/biutag/supervision/service/BaseUserService.java
  25. 11
      src/main/java/com/biutag/supervision/service/DepartNegativeRateService.java
  26. 18
      src/main/java/com/biutag/supervision/service/ModelClueService.java
  27. 2
      src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java
  28. 10
      src/main/java/com/biutag/supervision/service/NegativeQueryService.java
  29. 4
      src/main/java/com/biutag/supervision/service/NegativeTaskService.java
  30. 6
      src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java
  31. 6
      src/main/resources/application-local.yml
  32. 8
      src/main/resources/mapper/ProfileDepartMapper.xml
  33. 4
      src/main/resources/mapper/ProfilePoliceMapper.xml
  34. 2
      src/test/java/com/biutag/supervision/tools/GenCodeTests.java

15
sql/1107.sql

@ -0,0 +1,15 @@
CREATE TABLE `depart_negative_rate` (
`depart_id` varchar(40) NOT NULL,
`month` varchar(7) NOT NULL COMMENT '月份',
`incidence_rate` double(10,4) DEFAULT NULL COMMENT '问题发生率',
`incidence_factor` double(10,4) DEFAULT NULL COMMENT '问题发生率系数',
`incidence_rate_tied` double(10,4) DEFAULT NULL COMMENT '单位平均问题发生率',
PRIMARY KEY (`depart_id`,`month`) USING BTREE
) ENGINE=InnoDB COMMENT='单位问题发生率';
ALTER TABLE `negative`.`negative`
ADD COLUMN `verify_situation` varchar(255) COMMENT '核查办理情况';
ALTER TABLE `negative`.`negative`
ADD COLUMN `verify_file_situation` varchar(255) COMMENT '佐证材料情况';

8
src/main/java/com/biutag/supervision/common/validation/AddGroup.java

@ -0,0 +1,8 @@
package com.biutag.supervision.common.validation;
/**
* @author wxc
* @date 2024/11/7
*/
public interface AddGroup {
}

8
src/main/java/com/biutag/supervision/common/validation/EditGroup.java

@ -0,0 +1,8 @@
package com.biutag.supervision.common.validation;
/**
* @author wxc
* @date 2024/11/7
*/
public interface EditGroup {
}

2
src/main/java/com/biutag/supervision/constants/AppConstants.java

@ -7,7 +7,7 @@ public class AppConstants {
// 单位
public static final String DICT_CONTENT_ROOT_PARENT_CODE = "-1";
public static final Integer DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = -1;
public static final String DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = "-1";
// 管理员类型类型(超级管理员)
public static final String USER_TYPE_SUPER = "super";

4
src/main/java/com/biutag/supervision/controller/StatisticsController.java

@ -64,7 +64,9 @@ public class StatisticsController {
})
);
long delayCount = negativeService.count(new LambdaUpdateWrapper<Negative>()
.eq(Negative::getExtensionApplyFlag, false)
.and(query -> {
query.eq(Negative::getExtensionApplyFlag, false).or().gt(Negative::getExtensionDays, 0);
})
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()

10
src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java

@ -75,7 +75,7 @@ public class ProfileDepartController {
profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList());
List<Negative> list = negativeService.list(new LambdaQueryWrapper<Negative>().eq(Negative::getInvolveDepartId, departId)
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())));
List<String> negativeIds = list.stream().map(Negative::getId).toList();
int negativePoliceSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue()));
@ -91,7 +91,7 @@ public class ProfileDepartController {
.eq(BusinessDepart::getDepartId, departId))
.stream().mapToInt(BusinessDepart::getNumber).sum();
int jcj110Size = negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_110.getValue())
.eq(Negative::getInvolveDepartId, departId)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size();
@ -101,7 +101,7 @@ public class ProfileDepartController {
.eq(BusinessDepart::getDepartId, departId))
.stream().mapToInt(BusinessDepart::getNumber).sum();
int jcj122Size = negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_122.getValue())
.eq(Negative::getInvolveDepartId, departId)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size();
@ -112,7 +112,7 @@ public class ProfileDepartController {
.eq(BusinessDepart::getDepartId, departId))
.stream().mapToInt(BusinessDepart::getNumber).sum();
int zfbaSize = negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue())
.eq(Negative::getInvolveDepartId, departId)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size();
@ -161,7 +161,7 @@ public class ProfileDepartController {
long value = negativeService.count(new LambdaQueryWrapper<Negative>()
.eq(Negative::getInvolveDepartId, departId)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))
.apply(" DATE_FORMAT(crtTime, '%Y年%m月') = '" + month + "'"));
.apply(" DATE_FORMAT(DiscoveryTime, '%Y年%m月') = '" + month + "'"));
values.add(value);
}
JSONObject jsonObject = new JSONObject().fluentPut("months", months).fluentPut("values", values);

12
src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java

@ -85,7 +85,7 @@ public class ProfilePoliceController {
Set<String> negativeIds = negativeBlameService.list(new LambdaQueryWrapper<NegativeBlame>().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet());
int jcj110Size = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_110.getValue())
.in(Negative::getId, negativeIds)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size();
@ -97,7 +97,7 @@ public class ProfilePoliceController {
.stream().mapToInt(BusinessPolice::getNumber).sum();
int jcj122Size = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_122.getValue())
.in(Negative::getId, negativeIds)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size();
@ -109,7 +109,7 @@ public class ProfilePoliceController {
.eq(BusinessPolice::getPoliceName, profilePolice.getPoliceInfo().getName()))
.stream().mapToInt(BusinessPolice::getNumber).sum();
int zfbaSize = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue())
.in(Negative::getId, negativeIds)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size();
@ -118,7 +118,7 @@ public class ProfilePoliceController {
.setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize);
List<Negative> list = negativeIds.isEmpty() ? new ArrayList<>() : negativeService.list(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.in(Negative::getId, negativeIds)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())));
// 问题来源占比
@ -159,7 +159,7 @@ public class ProfilePoliceController {
return Result.success(new Page<Negative>().setRecords(new ArrayList<>()).setTotal(0));
}
Page<Negative> pageData = negativeService.page(page, new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.between(Negative::getDiscoveryTime, beginTime, endTime)
.in(Negative::getId, negativeIds)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())));
return Result.success(pageData);
@ -178,7 +178,7 @@ public class ProfilePoliceController {
long value = negativeIds.isEmpty() ? 0 : negativeService.count(new LambdaQueryWrapper<Negative>()
.in(Negative::getId, negativeIds)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))
.apply(" DATE_FORMAT(crtTime, '%Y年%m月') = '" + month + "'"));
.apply(" DATE_FORMAT(DiscoveryTime, '%Y年%m月') = '" + month + "'"));
values.add(value);
}
JSONObject jsonObject = new JSONObject().fluentPut("months", months).fluentPut("values", values);

12
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.common.validation.AddGroup;
import com.biutag.supervision.common.validation.EditGroup;
import com.biutag.supervision.flow.FlowService;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.domain.NegativeDetail;
@ -16,8 +18,10 @@ import com.biutag.supervision.pojo.vo.NegativeQueryVo;
import com.biutag.supervision.service.NegativeQueryService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeTaskService;
import com.biutag.supervision.util.JSON;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
@ -46,12 +50,12 @@ public class NegativeController {
}
@PostMapping
public Result<Boolean> add(@Valid @RequestBody NegativeDto negativeDto) {
public Result<Boolean> add(@Validated(AddGroup.class) @RequestBody NegativeDto negativeDto) {
return Result.success(negativeService.save(negativeDto));
}
@PutMapping
public Result<Boolean> update(@Valid @RequestBody NegativeDto negativeDto) {
public Result<Boolean> update(@Validated(EditGroup.class) @RequestBody NegativeDto negativeDto) {
if (StrUtil.isBlank(negativeDto.getId())) {
throw new RuntimeException("数据异常,请系统联系管理员【问题ID为空】");
}
@ -62,7 +66,7 @@ public class NegativeController {
.set(Negative::getBusinessTypeCode, negativeDto.getBusinessTypeCode())
.set(Negative::getBusinessTypeName, negativeDto.getBusinessTypeName())
.set(Negative::getCaseNumber, negativeDto.getCaseNumber())
.set(Negative::getInvolveProblem, negativeDto.getInvolveProblem())
.set(Negative::getInvolveProblem, JSON.toJSONString(negativeDto.getInvolveProblem()))
.set(Negative::getPoliceType, negativeDto.getPoliceType())
.set(Negative::getPoliceTypeName, negativeDto.getPoliceTypeName())
.set(Negative::getDiscoveryTime, negativeDto.getDiscoveryTime())
@ -70,6 +74,8 @@ public class NegativeController {
.set(Negative::getResponderName, negativeDto.getResponderName())
.set(Negative::getContactPhone, negativeDto.getContactPhone())
.set(Negative::getThingDesc, negativeDto.getThingDesc())
.set(Negative::getSpecialSupervision, negativeDto.getSpecialSupervision())
.set(Negative::getReportNumber, negativeDto.getReportNumber())
.set(Negative::getUpdTime, LocalDateTime.now());
negativeService.update(updateWrapper);
return Result.success();

45
src/main/java/com/biutag/supervision/job/DepartJob.java

@ -1,15 +1,21 @@
package com.biutag.supervision.job;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.pojo.entity.BusinessDepart;
import com.biutag.supervision.pojo.entity.DepartNegativeRate;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.service.SupDepartPoliceSizeService;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.service.*;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -24,6 +30,12 @@ public class DepartJob {
private final SupDepartPoliceSizeService departPoliceSizeService;
private final DepartNegativeRateService departNegativeRateService;
private final BusinessDepartService businessDepartService;
private final NegativeService negativeService;
@Async
public void updateDepartPath() {
List<SupDepart> departs = departService.list();
@ -37,9 +49,9 @@ public class DepartJob {
}
/**
* 1个小时
* 每天更新一次
*/
// @Scheduled(fixedRate = 1000 * 60 * 60)
@Scheduled(cron = "0 0 0 * * ?")
public void updatePoliceSize() {
List<SupDepart> departs = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getLevel, 3));
departs.forEach(item -> {
@ -47,4 +59,29 @@ public class DepartJob {
});
}
/**
* 每月1-10号零点更新
*/
@Scheduled(cron = "0 0 1 * * ?")
public void updateDepartNegativeRate() {
String month = "2024-10";
List<SupDepart> departs = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getLevel, 3));
LocalDateTime beginTime = LocalDateTime.of(2024, 10, 1, 0, 0, 0);
LocalDateTime endTime = LocalDateTime.of(2024, 10, 31, 0, 0, 0);
List<DepartNegativeRate> list = departs.stream().map(depart -> {
DepartNegativeRate rate = new DepartNegativeRate();
rate.setMonth(month);
rate.setDepartId(depart.getId());
int sum = businessDepartService.list(new LambdaQueryWrapper<BusinessDepart>().between(BusinessDepart::getDate, beginTime, endTime)
.eq(BusinessDepart::getDepartId, depart.getId())).stream().mapToInt(BusinessDepart::getNumber).sum();
long count = negativeService.count(new LambdaQueryWrapper<Negative>().between(Negative::getDiscoveryTime, beginTime, endTime)
.eq(Negative::getInvolveDepartId, depart.getId())
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())));
rate.setIncidenceRate(sum == 0 ? 0 : NumberUtil.div(count, sum));
return rate;
}).toList();
departNegativeRateService.saveOrUpdateBatch(list);
}
}

8
src/main/java/com/biutag/supervision/mapper/DepartNegativeRateMapper.java

@ -0,0 +1,8 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.DepartNegativeRate;
public interface DepartNegativeRateMapper extends BaseMapper<DepartNegativeRate> {
}

6
src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java

@ -172,6 +172,12 @@ public class NegativeVo {
private String caseNumber;
// 专项督察
private String specialSupervision;
// 通报期数
private String reportNumber;
// 涉及人员
private List<Blame> blames = new ArrayList<>();

2
src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java

@ -13,6 +13,6 @@ public class PoliceAuth {
private List<String> departs;
private List<Integer> sources;
private List<String> sources;
}

31
src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java

@ -1,5 +1,7 @@
package com.biutag.supervision.pojo.dto;
import com.biutag.supervision.common.validation.AddGroup;
import com.biutag.supervision.common.validation.EditGroup;
import com.biutag.supervision.pojo.vo.FileVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
@ -16,6 +18,7 @@ import java.util.Map;
@Getter
public class NegativeDto {
@NotBlank(message = "问题来源不能为空", groups = {EditGroup.class})
private String id;
private String originId;
@ -24,24 +27,24 @@ public class NegativeDto {
private LocalDateTime happenTime;
// 问题发现时间
@NotNull
@NotNull(groups = {AddGroup.class, EditGroup.class})
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm")
private LocalDateTime discoveryTime;
// 问题来源
@NotBlank(message = "问题来源不能为空")
@NotBlank(message = "问题来源不能为空", groups = {AddGroup.class, EditGroup.class})
private String problemSourcesCode;
// 问题来源
@NotBlank(message = "问题来源不能为空")
@NotBlank(message = "问题来源不能为空", groups = {AddGroup.class, EditGroup.class})
private String problemSources;
// 业务类别
@NotBlank(message = "业务类别不能为空")
@NotBlank(message = "业务类别不能为空", groups = {AddGroup.class, EditGroup.class})
private String businessTypeCode;
// 业务类别名称
@NotBlank(message = "业务类别不能为空")
@NotBlank(message = "业务类别不能为空", groups = {AddGroup.class, EditGroup.class})
private String businessTypeName;
private String policeTypeName;
@ -59,7 +62,7 @@ public class NegativeDto {
private String contactPhone;
// 简要描述
@NotBlank(message = "简要描述不能为空")
@NotBlank(message = "简要描述不能为空", groups = {AddGroup.class, EditGroup.class})
private String thingDesc;
private List<FileVo> thingFiles = new ArrayList<>();
@ -69,21 +72,21 @@ public class NegativeDto {
// 涉及单位
private String involveDepartId;
@NotBlank(message = "主办层级不能为空")
@NotBlank(message = "主办层级不能为空", groups = {AddGroup.class})
private String hostLevel;
// 办理时限
@NotBlank(message = "办理时限不能为空")
@NotBlank(message = "办理时限不能为空", groups = {AddGroup.class})
private String timeLimit;
// 审批流程
@NotBlank(message = "审批流程不能为空")
@NotBlank(message = "审批流程不能为空", groups = {AddGroup.class})
private String approvalFlow;
@NotBlank(message = "指定具体办理单位不能为空")
@NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class})
private String departId;
@NotBlank(message = "指定具体办理单位不能为空")
@NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class})
private String departName;
// 最大签收时长(天)
@ -98,4 +101,10 @@ public class NegativeDto {
// 涉及案件/警情编号
private String caseNumber;
// 专项督察
private String specialSupervision;
// 通报期数
private String reportNumber;
}

32
src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java

@ -0,0 +1,32 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class DepartNegativeRate {
//
@TableId
private String departId;
// 月份
@TableId
private String month;
// 问题发生率
@TableField("incidence_rate")
private Double incidenceRate;
// 问题发生率系数
@TableField("incidence_factor")
private Double incidenceFactor;
// 单位平均问题发生率
@TableField("incidence_rate_tied")
private Double incidenceRateTied;
}

2
src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java

@ -16,6 +16,6 @@ public class NegSourceAuthority {
private String idCode;
// 可查看的来源
private Integer source;
private String source;
}

12
src/main/java/com/biutag/supervision/pojo/entity/Negative.java

@ -252,4 +252,16 @@ public class Negative {
// 当前处理对象
private String currentProcessingObject;
// 专项督察
private String specialSupervision;
// 通报期数
private String reportNumber;
// 核查办理情况
private String verifySituation;
// 佐证材料情况
private String verifyFileSituation;
}

2
src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java

@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
public class NegativeProblemRelation {

4
src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java

@ -14,11 +14,11 @@ public class SupDictProblemSource {
//
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String id;
//
@TableField("parent_id")
private Integer parentId;
private String parentId;
//
@TableField("label")

2
src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java

@ -14,7 +14,7 @@ import java.time.LocalDateTime;
public class SupDictProblemType {
@TableId(type = IdType.AUTO)
private Integer id;
private String id;
// 类型名称
@TableField("name")

2
src/main/java/com/biutag/supervision/pojo/model/UserAuth.java

@ -28,7 +28,7 @@ public class UserAuth implements Serializable {
private List<String> roleCodes;
// 权限(问题来源)
private List<Integer> authSources;
private List<String> authSources;
private List<String> authDepartIds;

3
src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java

@ -53,4 +53,7 @@ public class NegativeQueryParam extends BasePage {
private String handleDepartId;
// 是否延期
private Boolean extensionFlag;
}

2
src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java

@ -12,7 +12,7 @@ import java.util.List;
@Getter
public class DictContentTree {
private Integer id;
private String id;
// 类型名称
private String name;

4
src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java

@ -10,9 +10,9 @@ import java.util.List;
@Getter
public class DictProblemSourceTree {
private Integer id;
private String id;
private Integer parentId;
private String parentId;
private String label;

2
src/main/java/com/biutag/supervision/service/BaseUserService.java

@ -75,8 +75,8 @@ public class BaseUserService extends ServiceImpl<BaseUserMapper, BaseUser> {
BaseUser baseUser = new BaseUser();
BeanUtils.copyProperties(userDto, baseUser);
baseUser.setUpdateTime(LocalDateTime.now());
if (!userDto.getRoleIds().isEmpty()) {
roleUserService.remove(userDto.getUserId());
if (!userDto.getRoleIds().isEmpty()) {
roleUserService.saveBatch(userDto.getRoleIds().stream().map(roleId -> {
BaseRoleUser baseRoleUser = new BaseRoleUser();
baseRoleUser.setUserId(userDto.getUserId());

11
src/main/java/com/biutag/supervision/service/DepartNegativeRateService.java

@ -0,0 +1,11 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.DepartNegativeRate;
import com.biutag.supervision.mapper.DepartNegativeRateMapper;
import org.springframework.stereotype.Service;
@Service
public class DepartNegativeRateService extends ServiceImpl<DepartNegativeRateMapper, DepartNegativeRate> {
}

18
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -129,6 +129,14 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
@Transactional(rollbackFor = Exception.class)
public boolean distribution(List<ModelClue> modelClues, Model model, String taskName, List<FileVo> thingFiles) {
LocalDateTime now = LocalDateTime.now();
ModelClueTask modelClueTask = new ModelClueTask();
modelClueTask.setTaskName(taskName);
modelClueTask.setModelId(model.getId());
modelClueTask.setSize(modelClues.size());
modelClueTask.setDistributionTime(now);
// 下发方式
modelClueTask.setDistributionMethod(model.getDistributionMethod());
modelClueTaskService.save(modelClueTask);
modelClues.forEach(item -> {
if (Objects.isNull(item.getInvolveDepartId())) {
throw new RuntimeException("涉及单位不能为空...");
@ -176,16 +184,10 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
item.setDistributionState(DistributionStateEnum.DISTRIBUTED.getValue());
item.setUpdateTime(LocalDateTime.now());
item.setNegativeId(negative.getId());
item.setTaskId(modelClueTask.getId());
updateById(item);
});
ModelClueTask modelClueTask = new ModelClueTask();
modelClueTask.setTaskName(taskName);
modelClueTask.setModelId(model.getId());
modelClueTask.setSize(modelClues.size());
modelClueTask.setDistributionTime(now);
// 下发方式
modelClueTask.setDistributionMethod(model.getDistributionMethod());
modelClueTaskService.save(modelClueTask);
return true;
}

2
src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java

@ -14,7 +14,7 @@ import java.util.List;
public class NegSourceAuthorityService extends ServiceImpl<NegSourceAuthorityMapper, NegSourceAuthority> {
@Transactional(rollbackFor = Exception.class)
public boolean save(String idCode, List<Integer> sources) {
public boolean save(String idCode, List<String> sources) {
remove(new LambdaQueryWrapper<NegSourceAuthority>().eq(NegSourceAuthority::getIdCode, idCode));
if (sources.isEmpty()) {
return true;

10
src/main/java/com/biutag/supervision/service/NegativeQueryService.java

@ -100,6 +100,16 @@ public class NegativeQueryService {
queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList());
}
}
// 是否延期
if (Objects.nonNull(param.getExtensionFlag())) {
if (param.getExtensionFlag()) {
queryWrapper.and(query -> {
query.eq(Negative::getExtensionApplyFlag, false).or().gt(Negative::getExtensionDays, 0);
});
} else {
queryWrapper.eq(Negative::getExtensionApplyFlag, true).or().isNull(Negative::getExtensionDays);
}
}
Page<Negative> page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
long l = System.currentTimeMillis();
List<NegativeQueryVo> list = page.getRecords().stream().map(item -> {

4
src/main/java/com/biutag/supervision/service/NegativeTaskService.java

@ -62,7 +62,7 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
}
@Async
public boolean updateExcel(List<NegativeQueryVo> data, String negativeTaskId) {
public void updateExcel(List<NegativeQueryVo> data, String negativeTaskId) {
List<ExportNegativeVo> list = data.stream().map(item -> {
ExportNegativeVo vo = new ExportNegativeVo();
BeanUtils.copyProperties(item, vo);
@ -81,7 +81,7 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
ByteArrayOutputStream os = new ByteArrayOutputStream();
EasyExcel.write(os, ExportNegativeVo.class).inMemory(Boolean.TRUE).sheet("问题台账").doWrite(list);
String filePath = fileService.upload(new ByteArrayInputStream(os.toByteArray()), os.size(), ".xlsx");
return update(new LambdaUpdateWrapper<NegativeTask>().eq(NegativeTask::getId, negativeTaskId)
update(new LambdaUpdateWrapper<NegativeTask>().eq(NegativeTask::getId, negativeTaskId)
.set(NegativeTask::getStatus, NegativeTaskStatusEnum.SUCCESS.getValue())
.set(NegativeTask::getFilePath, filePath)
.set(NegativeTask::getUpdTime, LocalDateTime.now()));

6
src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java

@ -19,14 +19,14 @@ public class SupDictProblemSourceService extends ServiceImpl<SupDictProblemSourc
public List<DictProblemSourceTree> buildTree() {
List<SupDictProblemSource> dictProblemSources = list(new LambdaQueryWrapper<SupDictProblemSource>().orderByAsc(SupDictProblemSource::getSort));
Map<Integer, List<DictProblemSourceTree>> childMap = new HashMap<>();
Map<String, List<DictProblemSourceTree>> childMap = new HashMap<>();
List<DictProblemSourceTree> tree = new ArrayList<>();
for (SupDictProblemSource dictProblemSource : dictProblemSources) {
DictProblemSourceTree node = new DictProblemSourceTree();
BeanUtils.copyProperties(dictProblemSource, node);
List<DictProblemSourceTree> children = childMap.computeIfAbsent(node.getParentId(), k -> new ArrayList<>());
children.add(node);
Integer parentId = node.getParentId();
String parentId = node.getParentId();
if (AppConstants.DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE.equals(parentId)) {
tree.add(node);
}
@ -37,7 +37,7 @@ public class SupDictProblemSourceService extends ServiceImpl<SupDictProblemSourc
return tree;
}
private static DictProblemSourceTree buildTreeRecursive(DictProblemSourceTree node, Map<Integer, List<DictProblemSourceTree>> childMap) {
private static DictProblemSourceTree buildTreeRecursive(DictProblemSourceTree node, Map<String, List<DictProblemSourceTree>> childMap) {
List<DictProblemSourceTree> children = childMap.get(node.getId());
if (children != null) {
node.getChildren().addAll(children.stream()

6
src/main/resources/application-local.yml

@ -19,9 +19,9 @@ spring:
port: 6379
password: 123456
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#mybatis-plus:
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
fdfs:
tracker-list: #TrackerList参数,支持多个

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

@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) d
LEFT JOIN negative n ON n.involveDepartId = d.depart_id
AND n.checkStatus IN ( '1', '2' )
AND n.crtTime BETWEEN #{beginTime} AND #{endTime}
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
LEFT JOIN negative_blame nb ON n.id = nb.negativeId
WHERE
1 = 1
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative_blame nb ON p.id_code = nb.blameIdCode
LEFT JOIN negative n ON nb.negativeId = n.id
AND n.checkStatus IN ( '1', '2' )
AND n.crtTime BETWEEN #{beginTime} AND #{endTime}
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
WHERE p.org_id = #{departId} and n.id is not null
GROUP BY
p.name,
@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative n ON n.id = nb.negativeId
AND n.checkStatus IN ( '1', '2' )
AND n.involveDepartId = #{departId}
AND n.crtTime BETWEEN #{beginTime} AND #{endTime}
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
WHERE
pt.`level` = 1
GROUP BY
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative n ON n.id = nb.negativeId
AND n.checkStatus IN ( '1', '2' )
AND n.involveDepartId = #{departId}
AND n.crtTime BETWEEN #{beginTime} AND #{endTime}
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
where
pr.`threeLevelContent` is not null
GROUP BY

4
src/main/resources/mapper/ProfilePoliceMapper.xml

@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative_blame nb ON p.id_code = nb.blameIdCode
LEFT JOIN negative n ON nb.negativeId = n.id
AND n.checkStatus IN ( '1', '2' )
AND n.crtTime BETWEEN #{beginTime} AND #{endTime}
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
WHERE
1 = 1
<if test="name != null and name != ''">
@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative_blame nb ON pr.blameId = nb.blameId AND nb.blameIdCode = #{idCode}
LEFT JOIN negative n ON n.id = nb.negativeId
AND n.checkStatus IN ( '1', '2' )
AND n.crtTime BETWEEN #{beginTime} AND #{endTime}
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
WHERE
pt.`level` = 1
GROUP BY

2
src/test/java/com/biutag/supervision/tools/GenCodeTests.java

@ -25,7 +25,7 @@ public class GenCodeTests {
@Test
public void genEntity() throws TemplateException, IOException {
String tableName = "file_class";
String tableName = "depart_negative_rate";
String tableSchema = "negative";
boolean genMapper = true;
boolean genService = true;

Loading…
Cancel
Save