提交 e7cde6e5 authored 作者: Matrix's avatar Matrix

[核查模块] 修正了代码规约

上级 e7783a53
...@@ -11,8 +11,17 @@ import lombok.AllArgsConstructor; ...@@ -11,8 +11,17 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public enum AreaLevel { public enum AreaLevel {
/**
* 省级地区
*/
PROVINCE(1, "省级"), PROVINCE(1, "省级"),
/**
* 市级地区
*/
CITY(2, "市级"), CITY(2, "市级"),
/**
* 县级地区
*/
COUNTY(3, "县级"); COUNTY(3, "县级");
public int id; public int id;
......
...@@ -4,7 +4,7 @@ import com.google.common.collect.ImmutableMap; ...@@ -4,7 +4,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.tykj.dev.config.GlobalMap; import com.tykj.dev.config.GlobalMap;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.confirmcheck.Service.ConfirmCheckService; import com.tykj.dev.device.confirmcheck.service.ConfirmCheckService;
import com.tykj.dev.device.confirmcheck.entity.cache.AreaCache; import com.tykj.dev.device.confirmcheck.entity.cache.AreaCache;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckBill; import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckBill;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail; import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail;
...@@ -55,11 +55,11 @@ import static java.util.stream.Collectors.*; ...@@ -55,11 +55,11 @@ import static java.util.stream.Collectors.*;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
@SuppressWarnings({"OptionalGetWithoutIsPresent"}) @SuppressWarnings("ALL")
@RestController @RestController
@RequestMapping(value = "/check/confirm") @RequestMapping(value = "/check/confirm")
@AutoDocument @AutoDocument
@Transactional @Transactional(rollbackFor = Exception.class)
@Slf4j @Slf4j
@Api(tags = "核查模块", description = "核查模块", position = 1) @Api(tags = "核查模块", description = "核查模块", position = 1)
public class DeviceCheckController { public class DeviceCheckController {
...@@ -83,7 +83,7 @@ public class DeviceCheckController { ...@@ -83,7 +83,7 @@ public class DeviceCheckController {
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired @Autowired
private AuthenticationUtils AuthenticationUtils; private AuthenticationUtils authenticationUtils;
@Autowired @Autowired
private AreaCache areaCache; private AreaCache areaCache;
@Autowired @Autowired
...@@ -136,7 +136,7 @@ public class DeviceCheckController { ...@@ -136,7 +136,7 @@ public class DeviceCheckController {
resultIds.put("detailId", new ArrayList<>()); resultIds.put("detailId", new ArrayList<>());
resultIds.put("taskId", new ArrayList<>()); resultIds.put("taskId", new ArrayList<>());
Map<String, Integer> areaStatIdMap = new HashMap<>(); Map<String, Integer> areaStatIdMap = new HashMap<>(16);
// 发起省级的统计 - 获得所有的市级单位 // 发起省级的统计 - 获得所有的市级单位
List<Units> cityUnits = unitsRepo.findAllByLevel(2); List<Units> cityUnits = unitsRepo.findAllByLevel(2);
...@@ -334,7 +334,7 @@ public class DeviceCheckController { ...@@ -334,7 +334,7 @@ public class DeviceCheckController {
// 2-2 构建发起单位的 统计任务 // 2-2 构建发起单位的 统计任务
TaskBto provStatTask = new Task(CHECK_STAT_0.id, CONFIRM_CHECK_STAT.name, 0, ".0.", CONFIRM_CHECK_STAT.id, statId, startUnitId) TaskBto provStatTask = new Task(CHECK_STAT_0.id, CONFIRM_CHECK_STAT.name, 0, ".0.", CONFIRM_CHECK_STAT.id, statId, startUnitId)
.parse2Bto(); .parse2Bto();
provStatTask.getInvolveUserIdList().add(AuthenticationUtils.getAuthentication().getCurrentUserInfo().getUserId()); provStatTask.getInvolveUserIdList().add(authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId());
provStatTask.getInvolveUserIdList().add(-1); provStatTask.getInvolveUserIdList().add(-1);
provStatTask.setCurrentPoint(1); provStatTask.setCurrentPoint(1);
provStatTask = taskService.start(provStatTask); provStatTask = taskService.start(provStatTask);
...@@ -399,14 +399,14 @@ public class DeviceCheckController { ...@@ -399,14 +399,14 @@ public class DeviceCheckController {
//1. 更新checkDetail //1. 更新checkDetail
log.info("[核查模块] 专管员A正在进行详情账单核查,且指定下一个审核人B id 为 {}", assignUserId); log.info("[核查模块] 专管员A正在进行详情账单核查,且指定下一个审核人B id 为 {}", assignUserId);
String detailString = transUtil.devLib2String(devLibVo.getDevInLibrary(), devLibVo.getDevNotInLibrary()); String detailString = transUtil.devLib2String(devLibVo.getDevInLibrary(), devLibVo.getDevNotInLibrary());
User currentUser = Objects.requireNonNull(AuthenticationUtils.getAuthentication()).getCurrentUserInfo(); User currentUser = Objects.requireNonNull(authenticationUtils.getAuthentication()).getCurrentUserInfo();
long count = devLibVo.getDevInLibrary().stream() long count = devLibVo.getDevInLibrary().stream()
.filter(deviceInLibVo -> deviceInLibVo.getProofResult() == 1) .filter(deviceInLibVo -> deviceInLibVo.getProofResult() == 1)
.count(); .count();
detailRepo.updateCheckDetail(id, detailString, checkResult, currentUser.getUserId(), assignUserId, (int) count); detailRepo.updateCheckDetail(id, detailString, checkResult, currentUser.getUserId(), assignUserId, (int) count);
//2. 推进TASK 状态 //2. 推进TASK 状态
TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id); TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id);
currentTask.getInvolveUserIdList().set(0, AuthenticationUtils.getAuthentication().getCurrentUserInfo().getUserId()); currentTask.getInvolveUserIdList().set(0, authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId());
taskService.moveToNext(currentTask, assignUserId); taskService.moveToNext(currentTask, assignUserId);
log.info("[核查模块] A岗核查操作成功"); log.info("[核查模块] A岗核查操作成功");
//3.将父级以及父级的父级的状态更改为正在进行 找到父级的stat对象 //3.将父级以及父级的父级的状态更改为正在进行 找到父级的stat对象
......
...@@ -19,6 +19,7 @@ import java.util.Date; ...@@ -19,6 +19,7 @@ import java.util.Date;
* *
* @author matrix * @author matrix
*/ */
@SuppressWarnings("ALL")
@Data @Data
@Entity @Entity
@NoArgsConstructor @NoArgsConstructor
......
...@@ -24,6 +24,7 @@ import java.util.stream.Collectors; ...@@ -24,6 +24,7 @@ import java.util.stream.Collectors;
* *
* @author matrix * @author matrix
*/ */
@SuppressWarnings("ALL")
@Data @Data
@Entity @Entity
@SQLDelete(sql = "update device_check_detail set delete_tag = 1 where id = ?") @SQLDelete(sql = "update device_check_detail set delete_tag = 1 where id = ?")
......
...@@ -13,6 +13,7 @@ import java.util.List; ...@@ -13,6 +13,7 @@ import java.util.List;
* @author Matrix <xhyrzldf@gmail.com> * @author Matrix <xhyrzldf@gmail.com>
* @since 2020/8/17 at 6:20 下午 * @since 2020/8/17 at 6:20 下午
*/ */
@SuppressWarnings("ALL")
@Data @Data
@ApiModel("核查发起对象") @ApiModel("核查发起对象")
public class CheckBillVo { public class CheckBillVo {
......
...@@ -14,6 +14,7 @@ import java.util.List; ...@@ -14,6 +14,7 @@ import java.util.List;
* @author Matrix <xhyrzldf@gmail.com> * @author Matrix <xhyrzldf@gmail.com>
* @since 2020/8/17 at 8:46 下午 * @since 2020/8/17 at 8:46 下午
*/ */
@SuppressWarnings("ALL")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
......
...@@ -26,6 +26,7 @@ import java.util.stream.Collectors; ...@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
* @author Matrix <xhyrzldf@gmail.com> * @author Matrix <xhyrzldf@gmail.com>
* @since 2020/8/15 at 7:13 下午 * @since 2020/8/15 at 7:13 下午
*/ */
@SuppressWarnings("ALL")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
......
...@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* @author dengdiyi * @author dengdiyi
*/ */
@SuppressWarnings("ALL")
@Transactional @Transactional
public interface DeviceCheckDetailDao extends JpaRepository<DeviceCheckDetail, Integer>, JpaSpecificationExecutor<DeviceCheckDetail> { public interface DeviceCheckDetailDao extends JpaRepository<DeviceCheckDetail, Integer>, JpaSpecificationExecutor<DeviceCheckDetail> {
......
package com.tykj.dev.device.confirmcheck.Service; package com.tykj.dev.device.confirmcheck.service;
import com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo; import com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import java.time.LocalDate;
/** /**
* CheckStatService. * CheckStatService.
* *
......
package com.tykj.dev.device.confirmcheck.Service.impl; package com.tykj.dev.device.confirmcheck.service.impl;
import com.tykj.dev.device.confirmcheck.Service.ConfirmCheckService; import com.tykj.dev.device.confirmcheck.service.ConfirmCheckService;
import com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo; import com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo;
import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatRepo; import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatRepo;
import com.tykj.dev.device.confirmcheck.utils.ObjTransUtil; import com.tykj.dev.device.confirmcheck.utils.ObjTransUtil;
......
...@@ -40,6 +40,7 @@ import java.util.stream.Collectors; ...@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
* @author Matrix <xhyrzldf@gmail.com> * @author Matrix <xhyrzldf@gmail.com>
* @since 2020/8/17 at 8:45 下午 * @since 2020/8/17 at 8:45 下午
*/ */
@SuppressWarnings("ALL")
@Component @Component
public class ObjTransUtil { public class ObjTransUtil {
......
...@@ -14,8 +14,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -14,8 +14,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
"com.tykj.dev.*", "com.tykj.dev.*",
} }
) )
public class finalcheckApp { public class FinalcheckApp {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(finalcheckApp.class, args); SpringApplication.run(FinalcheckApp.class, args);
} }
} }
...@@ -12,6 +12,7 @@ import com.tykj.dev.misc.exception.ApiException; ...@@ -12,6 +12,7 @@ import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -79,12 +80,6 @@ public class FinalCheckController { ...@@ -79,12 +80,6 @@ public class FinalCheckController {
} }
// @GetMapping("/test")
// @ApiOperation(value = "测试接口")
public ResponseEntity test() {
return ResponseEntity.ok(4);
}
@GetMapping("/reports") @GetMapping("/reports")
@ApiOperation(value = "查询所有决算报告(不附带详情数据)") @ApiOperation(value = "查询所有决算报告(不附带详情数据)")
public Page<FinalReportVo> findAllReports( public Page<FinalReportVo> findAllReports(
...@@ -122,7 +117,7 @@ public class FinalCheckController { ...@@ -122,7 +117,7 @@ public class FinalCheckController {
TemplateExportParams params = new TemplateExportParams(); TemplateExportParams params = new TemplateExportParams();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>(16);
map.put("name", reportVo.getName()); map.put("name", reportVo.getName());
map.put("unitName", reportVo.getUnitName()); map.put("unitName", reportVo.getUnitName());
map.put("startTime", localDateToDate(reportVo.getStartTime())); map.put("startTime", localDateToDate(reportVo.getStartTime()));
...@@ -131,7 +126,7 @@ public class FinalCheckController { ...@@ -131,7 +126,7 @@ public class FinalCheckController {
List<Map<String, String>> listMap = new ArrayList<>(); List<Map<String, String>> listMap = new ArrayList<>();
for (int i = 0; i < reportVo.getDetails().size(); i++) { for (int i = 0; i < reportVo.getDetails().size(); i++) {
Map<String, String> lm = new HashMap<>(); Map<String, String> lm = new HashMap<>(16);
FinalDetailVo detail = reportVo.getDetails().get(i); FinalDetailVo detail = reportVo.getDetails().get(i);
lm.put("order", i + 1 + ""); lm.put("order", i + 1 + "");
lm.put("model", detail.getModel()); lm.put("model", detail.getModel());
...@@ -148,9 +143,10 @@ public class FinalCheckController { ...@@ -148,9 +143,10 @@ public class FinalCheckController {
listMap.add(lm); listMap.add(lm);
} }
if (listMap.size() <= 15) { int defaultSize = 15;
for (int i = 0; i < 15 - listMap.size(); i++) { if (listMap.size() <= defaultSize) {
Map<String, String> lm = new HashMap<>(); for (int i = 0; i < defaultSize - listMap.size(); i++) {
Map<String, String> lm = new HashMap<>(16);
lm.put("order", " "); lm.put("order", " ");
lm.put("model", ""); lm.put("model", "");
lm.put("type", ""); lm.put("type", "");
......
...@@ -15,5 +15,11 @@ import java.util.Optional; ...@@ -15,5 +15,11 @@ import java.util.Optional;
*/ */
public interface FinalDetailDao extends JpaRepository<FinalDetail, Integer>, JpaSpecificationExecutor<FinalDetail> { public interface FinalDetailDao extends JpaRepository<FinalDetail, Integer>, JpaSpecificationExecutor<FinalDetail> {
/**
* 根据reportId获得报告详情列表
*
* @param reportId 报告概览id
* @return 报告详情列表
*/
Optional<List<FinalDetail>> findByReportId(Integer reportId); Optional<List<FinalDetail>> findByReportId(Integer reportId);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论