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

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

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