From 419104df560d427e9cfb610bb6549dcfe695822d Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 02 四月 2025 09:11:12 +0800
Subject: [PATCH] 类名统一,查询启用赋码规则代码提到service
---
flowable/src/main/java/com/ycl/domain/vo/ProcessOvertimeTimesVO.java | 18 +++
business/src/main/java/com/ycl/domain/vo/ProjectOvertimeTimesVO.java | 10 -
business/src/main/java/com/ycl/service/impl/CodingRulerServiceImpl.java | 27 ++++
business/src/main/java/com/ycl/domain/form/ProjectOvertimeTimesForm.java | 11 -
business/src/main/resources/mapper/ProjectOvertimeTimesMapper.xml | 7
flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java | 3
business/src/main/java/com/ycl/domain/query/ProjectOvertimeTimesQuery.java | 4
business/src/main/java/com/ycl/service/impl/ProjectCodingStatusServiceImpl.java | 37 +++---
flowable/src/main/java/com/ycl/domain/vo/ProcessCodingVO.java | 5
flowable/src/main/resources/mapper/ProcessCodingMapper.xml | 4
/dev/null | 37 ------
business/src/main/java/com/ycl/service/CodingRulerService.java | 8 +
business/src/main/java/com/ycl/task/CodingTask.java | 84 ++++++-------
business/src/main/java/com/ycl/mapper/ProjectOvertimeTimesMapper.java | 36 ++++++
business/src/main/java/com/ycl/service/ProjectOvertimeTimesService.java | 15 +-
business/src/main/java/com/ycl/domain/entity/ProjectOvertimeTimes.java | 2
16 files changed, 170 insertions(+), 138 deletions(-)
diff --git a/business/src/main/java/com/ycl/domain/entity/ProjectCodingStatus.java b/business/src/main/java/com/ycl/domain/entity/ProjectOvertimeTimes.java
similarity index 93%
rename from business/src/main/java/com/ycl/domain/entity/ProjectCodingStatus.java
rename to business/src/main/java/com/ycl/domain/entity/ProjectOvertimeTimes.java
index 108e252..45865bd 100644
--- a/business/src/main/java/com/ycl/domain/entity/ProjectCodingStatus.java
+++ b/business/src/main/java/com/ycl/domain/entity/ProjectOvertimeTimes.java
@@ -17,7 +17,7 @@
*/
@Data
@TableName("t_project_overtime_times")
-public class ProjectCodingStatus extends AbsEntity {
+public class ProjectOvertimeTimes extends AbsEntity {
private static final long serialVersionUID = 1L;
diff --git a/business/src/main/java/com/ycl/domain/form/ProjectCodingStatusForm.java b/business/src/main/java/com/ycl/domain/form/ProjectOvertimeTimesForm.java
similarity index 77%
rename from business/src/main/java/com/ycl/domain/form/ProjectCodingStatusForm.java
rename to business/src/main/java/com/ycl/domain/form/ProjectOvertimeTimesForm.java
index 861bfd5..79565c3 100644
--- a/business/src/main/java/com/ycl/domain/form/ProjectCodingStatusForm.java
+++ b/business/src/main/java/com/ycl/domain/form/ProjectOvertimeTimesForm.java
@@ -2,16 +2,15 @@
import com.ycl.common.group.Update;
import com.ycl.common.group.Add;
+import com.ycl.domain.entity.ProjectOvertimeTimes;
import com.ycl.system.domain.base.AbsForm;
-import com.ycl.domain.entity.ProjectCodingStatus;
import org.springframework.beans.BeanUtils;
-import javax.validation.constraints.NotBlank;
+
import javax.validation.constraints.NotNull;
import org.springframework.lang.NonNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import java.util.Date;
/**
* 琛ㄥ崟
@@ -21,7 +20,7 @@
*/
@Data
@ApiModel(value = "ProjectCodingStatus琛ㄥ崟", description = "琛ㄥ崟")
-public class ProjectCodingStatusForm extends AbsForm {
+public class ProjectOvertimeTimesForm extends AbsForm {
@NotNull(message = "涓嶈兘涓虹┖", groups = {Add.class, Update.class})
@ApiModelProperty("瓒呮椂浠诲姟鏁�")
@@ -39,9 +38,9 @@
@ApiModelProperty("椤圭洰绫诲瀷")
private String projectType;
- public static ProjectCodingStatus getEntityByForm(@NonNull ProjectCodingStatusForm form, ProjectCodingStatus entity) {
+ public static ProjectOvertimeTimes getEntityByForm(@NonNull ProjectOvertimeTimesForm form, ProjectOvertimeTimes entity) {
if(entity == null) {
- entity = new ProjectCodingStatus();
+ entity = new ProjectOvertimeTimes();
}
BeanUtils.copyProperties(form, entity);
return entity;
diff --git a/business/src/main/java/com/ycl/domain/query/ProjectCodingStatusQuery.java b/business/src/main/java/com/ycl/domain/query/ProjectOvertimeTimesQuery.java
similarity index 73%
rename from business/src/main/java/com/ycl/domain/query/ProjectCodingStatusQuery.java
rename to business/src/main/java/com/ycl/domain/query/ProjectOvertimeTimesQuery.java
index 6073200..99eaa00 100644
--- a/business/src/main/java/com/ycl/domain/query/ProjectCodingStatusQuery.java
+++ b/business/src/main/java/com/ycl/domain/query/ProjectOvertimeTimesQuery.java
@@ -16,7 +16,7 @@
* @since 2025-04-01
*/
@Data
-@ApiModel(value = "ProjectCodingStatus鏌ヨ鍙傛暟", description = "鏌ヨ鍙傛暟")
-public class ProjectCodingStatusQuery extends AbsQuery {
+@ApiModel(value = "ProjectOvertimeTimesQuery鏌ヨ鍙傛暟", description = "鏌ヨ鍙傛暟")
+public class ProjectOvertimeTimesQuery extends AbsQuery {
}
diff --git a/business/src/main/java/com/ycl/domain/vo/ProjectCodingStatusVO.java b/business/src/main/java/com/ycl/domain/vo/ProjectOvertimeTimesVO.java
similarity index 73%
rename from business/src/main/java/com/ycl/domain/vo/ProjectCodingStatusVO.java
rename to business/src/main/java/com/ycl/domain/vo/ProjectOvertimeTimesVO.java
index 7c38d82..7c26ca1 100644
--- a/business/src/main/java/com/ycl/domain/vo/ProjectCodingStatusVO.java
+++ b/business/src/main/java/com/ycl/domain/vo/ProjectOvertimeTimesVO.java
@@ -1,14 +1,12 @@
package com.ycl.domain.vo;
+import com.ycl.domain.entity.ProjectOvertimeTimes;
import com.ycl.system.domain.base.AbsVo;
-import com.ycl.domain.entity.ProjectCodingStatus;
-import java.util.List;
import org.springframework.lang.NonNull;
import org.springframework.beans.BeanUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import java.util.Date;
/**
* 灞曠ず
@@ -18,7 +16,7 @@
*/
@Data
@ApiModel(value = "鍝嶅簲鏁版嵁", description = "鍝嶅簲鏁版嵁")
-public class ProjectCodingStatusVO extends AbsVo {
+public class ProjectOvertimeTimesVO extends AbsVo {
/** 浠诲姟瓒呮椂鏁�*/
@ApiModelProperty("浠诲姟瓒呮椂鏁�")
@@ -37,9 +35,9 @@
private String projectType;
- public static ProjectCodingStatusVO getVoByEntity(@NonNull ProjectCodingStatus entity, ProjectCodingStatusVO vo) {
+ public static ProjectOvertimeTimesVO getVoByEntity(@NonNull ProjectOvertimeTimes entity, ProjectOvertimeTimesVO vo) {
if(vo == null) {
- vo = new ProjectCodingStatusVO();
+ vo = new ProjectOvertimeTimesVO();
}
BeanUtils.copyProperties(entity, vo);
return vo;
diff --git a/business/src/main/java/com/ycl/mapper/ProjectCodingStatusMapper.java b/business/src/main/java/com/ycl/mapper/ProjectCodingStatusMapper.java
deleted file mode 100644
index 770a2c4..0000000
--- a/business/src/main/java/com/ycl/mapper/ProjectCodingStatusMapper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.ycl.mapper;
-
-import com.ycl.domain.entity.ProjectCodingStatus;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ycl.domain.vo.ProjectCodingStatusVO;
-import com.ycl.domain.form.ProjectCodingStatusForm;
-import com.ycl.domain.query.ProjectCodingStatusQuery;
-import java.util.List;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * Mapper 鎺ュ彛
- *
- * @author zxl
- * @since 2025-04-01
- */
-@Mapper
-public interface ProjectCodingStatusMapper extends BaseMapper<ProjectCodingStatus> {
-
- /**
- * id鏌ユ壘
- * @param id
- * @return
- */
- ProjectCodingStatusVO getById(Integer id);
-
- /**
- * 鍒嗛〉
- */
- IPage getPage(IPage page, @Param("query") ProjectCodingStatusQuery query);
-
- void delAll();
-
-
-}
diff --git a/business/src/main/java/com/ycl/mapper/ProjectOvertimeTimesMapper.java b/business/src/main/java/com/ycl/mapper/ProjectOvertimeTimesMapper.java
new file mode 100644
index 0000000..d0fbccd
--- /dev/null
+++ b/business/src/main/java/com/ycl/mapper/ProjectOvertimeTimesMapper.java
@@ -0,0 +1,36 @@
+package com.ycl.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ycl.domain.entity.ProjectOvertimeTimes;
+import com.ycl.domain.query.ProjectOvertimeTimesQuery;
+import com.ycl.domain.vo.ProjectOvertimeTimesVO;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * Mapper 鎺ュ彛
+ *
+ * @author zxl
+ * @since 2025-04-01
+ */
+@Mapper
+public interface ProjectOvertimeTimesMapper extends BaseMapper<ProjectOvertimeTimes> {
+
+ /**
+ * id鏌ユ壘
+ * @param id
+ * @return
+ */
+ ProjectOvertimeTimesVO getById(Integer id);
+
+ /**
+ * 鍒嗛〉
+ */
+ IPage getPage(IPage page, @Param("query") ProjectOvertimeTimesQuery query);
+
+ void delAll();
+
+
+}
diff --git a/business/src/main/java/com/ycl/service/CodingRulerService.java b/business/src/main/java/com/ycl/service/CodingRulerService.java
index e0f5793..284b526 100644
--- a/business/src/main/java/com/ycl/service/CodingRulerService.java
+++ b/business/src/main/java/com/ycl/service/CodingRulerService.java
@@ -8,7 +8,7 @@
import java.util.List;
/**
- * 鏈嶅姟绫�
+ * 璧嬬爜瑙勫垯鏈嶅姟绫�
*
* @author zxl
* @since 2025-03-18
@@ -68,4 +68,10 @@
* @return
*/
Result changeCodingRulerStatus(Integer id);
+
+ /**
+ * 鑾峰緱鍚姩鐨勮祴鐮佽鍒�
+ * @return 瀛樻斁鐨勫瓧娈� yellowRuler鍚敤鐨勯粍鐮佽鍒欙紝redRuler鍚敤鐨勭孩鐮佽鍒�
+ */
+ Result getStartRuler();
}
diff --git a/business/src/main/java/com/ycl/service/ProjectCodingStatusService.java b/business/src/main/java/com/ycl/service/ProjectOvertimeTimesService.java
similarity index 66%
rename from business/src/main/java/com/ycl/service/ProjectCodingStatusService.java
rename to business/src/main/java/com/ycl/service/ProjectOvertimeTimesService.java
index 8b5aaa2..2793190 100644
--- a/business/src/main/java/com/ycl/service/ProjectCodingStatusService.java
+++ b/business/src/main/java/com/ycl/service/ProjectOvertimeTimesService.java
@@ -1,10 +1,11 @@
package com.ycl.service;
-import com.ycl.domain.entity.ProjectCodingStatus;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.common.base.Result;
-import com.ycl.domain.form.ProjectCodingStatusForm;
-import com.ycl.domain.query.ProjectCodingStatusQuery;
+import com.ycl.domain.entity.ProjectOvertimeTimes;
+import com.ycl.domain.form.ProjectOvertimeTimesForm;
+import com.ycl.domain.query.ProjectOvertimeTimesQuery;
+
import java.util.List;
/**
@@ -13,21 +14,21 @@
* @author zxl
* @since 2025-04-01
*/
-public interface ProjectCodingStatusService extends IService<ProjectCodingStatus> {
+public interface ProjectOvertimeTimesService extends IService<ProjectOvertimeTimes> {
/**
* 娣诲姞
* @param form
* @return
*/
- Result add(ProjectCodingStatusForm form);
+ Result add(ProjectOvertimeTimesForm form);
/**
* 淇敼
* @param form
* @return
*/
- Result update(ProjectCodingStatusForm form);
+ Result update(ProjectOvertimeTimesForm form);
/**
* 鎵归噺鍒犻櫎
@@ -48,7 +49,7 @@
* @param query
* @return
*/
- Result page(ProjectCodingStatusQuery query);
+ Result page(ProjectOvertimeTimesQuery query);
/**
* 鏍规嵁id鏌ユ壘
diff --git a/business/src/main/java/com/ycl/service/impl/CodingRulerServiceImpl.java b/business/src/main/java/com/ycl/service/impl/CodingRulerServiceImpl.java
index 60b119e..e4e63dc 100644
--- a/business/src/main/java/com/ycl/service/impl/CodingRulerServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/CodingRulerServiceImpl.java
@@ -17,6 +17,7 @@
import com.ycl.framework.utils.PageUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.util.Assert;
+import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.stream.Collectors;
@@ -150,4 +151,30 @@
baseMapper.updateById(codingRuler);
return Result.ok(msg);
}
+ /**
+ * 鑾峰緱鍚姩鐨勮祴鐮佽鍒�
+ * @return 瀛樻斁鐨勫瓧娈� yellowRuler鍚敤鐨勯粍鐮佽鍒欙紝redRuler鍚敤鐨勭孩鐮佽鍒�
+ */
+ @Override
+ public Result getStartRuler() {
+ Result result = new Result();
+ //鑾峰緱鍚敤鐨勮祴鐮佽鍒�
+ List<CodingRulerVO> codingRulerVOS = codingRulerMapper.getStartRuler();
+ if (CollectionUtils.isEmpty(codingRulerVOS)){
+ log.error("鏈惎鐢ㄨ祴鐮佽鍒�");
+ return result;
+ }
+ CodingRulerVO yellowRuler = null;
+ CodingRulerVO redRuler = null;
+ for (CodingRulerVO codingRulerVO : codingRulerVOS){
+ if (CodingRulerCodeTypeEnum.YELLOW.getValue().equals(codingRulerVO.getProjectCodeType())){
+ yellowRuler = codingRulerVO;
+ }else if (CodingRulerCodeTypeEnum.RED.getValue().equals(codingRulerVO.getProjectCodeType())){
+ redRuler = codingRulerVO;
+ }
+ }
+ result.put("yellowRuler",yellowRuler);
+ result.put("redRuler",redRuler);
+ return result;
+ }
}
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectCodingStatusServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectCodingStatusServiceImpl.java
index eff9d93..f69e035 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectCodingStatusServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectCodingStatusServiceImpl.java
@@ -1,14 +1,15 @@
package com.ycl.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.ycl.domain.entity.ProjectCodingStatus;
-import com.ycl.mapper.ProjectCodingStatusMapper;
-import com.ycl.service.ProjectCodingStatusService;
+
+import com.ycl.domain.entity.ProjectOvertimeTimes;
+import com.ycl.domain.query.ProjectOvertimeTimesQuery;
import com.ycl.common.base.Result;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ycl.domain.form.ProjectCodingStatusForm;
-import com.ycl.domain.vo.ProjectCodingStatusVO;
-import com.ycl.domain.query.ProjectCodingStatusQuery;
+import com.ycl.domain.form.ProjectOvertimeTimesForm;
+import com.ycl.domain.vo.ProjectOvertimeTimesVO;
+import com.ycl.mapper.ProjectOvertimeTimesMapper;
+import com.ycl.service.ProjectOvertimeTimesService;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import com.ycl.framework.utils.PageUtil;
@@ -26,9 +27,9 @@
*/
@Service
@RequiredArgsConstructor
-public class ProjectCodingStatusServiceImpl extends ServiceImpl<ProjectCodingStatusMapper, ProjectCodingStatus> implements ProjectCodingStatusService {
+public class ProjectCodingStatusServiceImpl extends ServiceImpl<ProjectOvertimeTimesMapper, ProjectOvertimeTimes> implements ProjectOvertimeTimesService {
- private final ProjectCodingStatusMapper projectCodingStatusMapper;
+ private final ProjectOvertimeTimesMapper projectCodingStatusMapper;
/**
* 娣诲姞
@@ -36,8 +37,8 @@
* @return
*/
@Override
- public Result add(ProjectCodingStatusForm form) {
- ProjectCodingStatus entity = ProjectCodingStatusForm.getEntityByForm(form, null);
+ public Result add(ProjectOvertimeTimesForm form) {
+ ProjectOvertimeTimes entity = ProjectOvertimeTimesForm.getEntityByForm(form, null);
baseMapper.insert(entity);
return Result.ok("娣诲姞鎴愬姛");
}
@@ -48,8 +49,8 @@
* @return
*/
@Override
- public Result update(ProjectCodingStatusForm form) {
- ProjectCodingStatus entity = baseMapper.selectById(form.getId());
+ public Result update(ProjectOvertimeTimesForm form) {
+ ProjectOvertimeTimes entity = baseMapper.selectById(form.getId());
// 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
@@ -86,8 +87,8 @@
* @return
*/
@Override
- public Result page(ProjectCodingStatusQuery query) {
- IPage<ProjectCodingStatusVO> page = PageUtil.getPage(query, ProjectCodingStatusVO.class);
+ public Result page(ProjectOvertimeTimesQuery query) {
+ IPage<ProjectOvertimeTimesVO> page = PageUtil.getPage(query, ProjectOvertimeTimesVO.class);
baseMapper.getPage(page, query);
return Result.ok().data(page.getRecords()).total(page.getTotal());
}
@@ -99,7 +100,7 @@
*/
@Override
public Result detail(Integer id) {
- ProjectCodingStatusVO vo = baseMapper.getById(id);
+ ProjectOvertimeTimesVO vo = baseMapper.getById(id);
Assert.notNull(vo, "璁板綍涓嶅瓨鍦�");
return Result.ok().data(vo);
@@ -111,9 +112,9 @@
*/
@Override
public Result all() {
- List<ProjectCodingStatus> entities = baseMapper.selectList(null);
- List<ProjectCodingStatusVO> vos = entities.stream()
- .map(entity -> ProjectCodingStatusVO.getVoByEntity(entity, null))
+ List<ProjectOvertimeTimes> entities = baseMapper.selectList(null);
+ List<ProjectOvertimeTimesVO> vos = entities.stream()
+ .map(entity -> ProjectOvertimeTimesVO.getVoByEntity(entity, null))
.collect(Collectors.toList());
return Result.ok().data(vos);
}
diff --git a/business/src/main/java/com/ycl/task/CodingTask.java b/business/src/main/java/com/ycl/task/CodingTask.java
index 69e97cc..2dd19dd 100644
--- a/business/src/main/java/com/ycl/task/CodingTask.java
+++ b/business/src/main/java/com/ycl/task/CodingTask.java
@@ -2,21 +2,19 @@
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
-import com.ycl.common.enums.business.CodingRulerCodeTypeEnum;
+import com.ycl.common.base.Result;
import com.ycl.common.enums.business.CodingRulerIntervalTypeEnum;
-import com.ycl.common.enums.business.CodingRulerSymbolTypeEnum;
import com.ycl.common.enums.business.ProjectProcessTypeEnum;
import com.ycl.domain.entity.*;
import com.ycl.domain.vo.CodingRulerVO;
import com.ycl.domain.vo.ProcessCodingVO;
-import com.ycl.domain.vo.ProjectCodingStatusVO;
-import com.ycl.domain.vo.ProjectProcessVO;
+import com.ycl.domain.vo.ProcessOvertimeTimesVO;
import com.ycl.factory.FlowServiceFactory;
import com.ycl.mapper.*;
-import com.ycl.service.ProjectCodingStatusService;
-import liquibase.pro.packaged.A;
+import com.ycl.service.CodingRulerService;
+import com.ycl.service.ProjectOvertimeTimesService;
+import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -28,49 +26,41 @@
import java.util.stream.Collectors;
@Slf4j
+@RequiredArgsConstructor
@Component("codingTask")
public class CodingTask extends FlowServiceFactory {
- @Autowired
- private ProjectCodingStatusMapper projectCodingStatusMapper;
- @Autowired
- private ProjectCodingStatusService projectCodingStatusService;
+ private final ProjectOvertimeTimesMapper projectOvertimeTimesMapper;
- @Autowired
- private ProjectProcessMapper projectProcessMapper;
- @Autowired
- private ProjectInfoMapper projectInfoMapper;
- @Autowired
- private CodingRulerMapper codingRulerMapper;
+ private final ProjectOvertimeTimesService projectOvertimeTimesService;
- @Autowired
- private ProcessCodingMapper processCodingMapper;
+ private final ProjectProcessMapper projectProcessMapper;
+ private final ProjectInfoMapper projectInfoMapper;
+ private final CodingRulerService codingRulerService;
+
+ private final ProcessCodingMapper processCodingMapper;
+
+ //璁℃暟椤圭洰瓒呮椂浠诲姟鏁板苟鏇村叿璧嬬爜瑙勫垯杩涜璧嬬爜
public void codingTask(){
log.info("寮�濮嬭绠楅」鐩苟涓旇祴鐮�");
//鑾峰緱鍚敤鐨勮祴鐮佽鍒�
- List<CodingRulerVO> codingRulerVOS = codingRulerMapper.getStartRuler();
+ Result result = codingRulerService.getStartRuler();
+ CodingRulerVO yellowRuler = (CodingRulerVO) result.get("yellowRuler");
+ CodingRulerVO redRuler = (CodingRulerVO) result.get("redRuler");
+
//娌″惎鐢ㄧ洿鎺ョ粨鏉�
- if (CollectionUtils.isEmpty(codingRulerVOS)){
- log.info("鏈惎鐢ㄨ祴鐮佽鍒�");
+ if (Objects.isNull(yellowRuler) && Objects.isNull(redRuler)) {
+ log.error("鏈惎鐢ㄨ祴鐮佽鍒�");
return;
- }
- CodingRulerVO yellowRuler = null;
- CodingRulerVO redRuler = null;
- for (CodingRulerVO codingRulerVO : codingRulerVOS){
- if (CodingRulerCodeTypeEnum.YELLOW.getValue().equals(codingRulerVO.getProjectCodeType())){
- yellowRuler = codingRulerVO;
- }else if (CodingRulerCodeTypeEnum.RED.getValue().equals(codingRulerVO.getProjectCodeType())){
- redRuler = codingRulerVO;
- }
}
//鑾峰緱鎵�鏈� 瓒呮椂浠诲姟鏁颁笌娴佺▼瀹炰緥id
- List<ProcessCodingVO> processCodingVOS = processCodingMapper.countProjectOverTimeNum();
- if (!CollectionUtils.isEmpty(processCodingVOS)){
+ List<ProcessOvertimeTimesVO> processOvertimeTimesVOS = processCodingMapper.countProjectOvertimeTimes();
+ if (!CollectionUtils.isEmpty(processOvertimeTimesVOS)){
//灏嗘祦绋嬪疄渚媔d杞崲涓簂ist
- List<String> processIds = processCodingVOS.stream().map(ProcessCodingVO::getProcessInsId).toList();
+ List<String> processIds = processOvertimeTimesVOS.stream().map(ProcessOvertimeTimesVO::getProcessInsId).toList();
//鑾峰緱鎵�鏈� 鏇村叿娴佺▼瀹氫箟id锛屾祦绋嬬浉鍏抽」鐩甶d锛� key涓烘祦绋媔d
Map<String, ProjectProcess> projectMap = new LambdaQueryChainWrapper<>(projectProcessMapper)
.in(ProjectProcess::getProcessInsId, processIds)
@@ -86,29 +76,29 @@
//鏂板鐨勮褰曢泦鍚�
- List<ProjectCodingStatus> addList = new ArrayList<>();
+ List<ProjectOvertimeTimes> addList = new ArrayList<>();
- for (ProcessCodingVO processCoding : processCodingVOS) {
+ for (ProcessOvertimeTimesVO processOvertimeTimesVO : processOvertimeTimesVOS) {
//鍒ゆ柇 椤圭洰绫诲瀷涓� ProjectProcessTypeEnum.PROJECT 骞朵笖瓒呮椂浠诲姟鏁板ぇ浜�0
- if (processCoding.getTaskOvertimeNum() != 0 && projectMap.containsKey(processCoding.getProcessInsId())) {
- ProjectCodingStatus projectCodingStatus = new ProjectCodingStatus();
- projectCodingStatus.setProjectType(ProjectProcessTypeEnum.PROJECT.getValue());
- projectCodingStatus.setProjectId(projectMap.get(processCoding.getProcessInsId()).getProjectId());
- projectCodingStatus.setProcessInsId(processCoding.getProcessInsId());
- projectCodingStatus.setTaskOvertimeNum(processCoding.getTaskOvertimeNum());
+ if (processOvertimeTimesVO.getTaskOvertimeNum() != 0 && projectMap.containsKey(processOvertimeTimesVO.getProcessInsId())) {
+ ProjectOvertimeTimes projectOvertimeTimes = new ProjectOvertimeTimes();
+ projectOvertimeTimes.setProjectType(ProjectProcessTypeEnum.PROJECT.getValue());
+ projectOvertimeTimes.setProjectId(projectMap.get(processOvertimeTimesVO.getProcessInsId()).getProjectId());
+ projectOvertimeTimes.setProcessInsId(processOvertimeTimesVO.getProcessInsId());
+ projectOvertimeTimes.setTaskOvertimeNum(processOvertimeTimesVO.getTaskOvertimeNum());
//娣诲姞鍒版柊澧為泦鍚堝唴
- addList.add(projectCodingStatus);
+ addList.add(projectOvertimeTimes);
//妫�楠岃祴鐮佽鍒�
- checkCodingType(projectCodingStatus.getTaskOvertimeNum(),
- projectCodingStatus.getProjectId(),
+ checkCodingType(projectOvertimeTimes.getTaskOvertimeNum(),
+ projectOvertimeTimes.getProjectId(),
yellowProjectCodingIds,redProjectCodingIds,
yellowRuler,redRuler);
}
}
if(!CollectionUtils.isEmpty(addList)){
- projectCodingStatusMapper.delAll();
- projectCodingStatusService.saveBatch(addList);
+ projectOvertimeTimesMapper.delAll();
+ projectOvertimeTimesService.saveBatch(addList);
}
//淇敼椤圭洰璧嬬爜
updateProjectCoding(redProjectCodingIds,"red");
diff --git a/business/src/main/resources/mapper/ProjectCodingStatusMapper.xml b/business/src/main/resources/mapper/ProjectOvertimeTimesMapper.xml
similarity index 93%
rename from business/src/main/resources/mapper/ProjectCodingStatusMapper.xml
rename to business/src/main/resources/mapper/ProjectOvertimeTimesMapper.xml
index 1958ff8..2ab0573 100644
--- a/business/src/main/resources/mapper/ProjectCodingStatusMapper.xml
+++ b/business/src/main/resources/mapper/ProjectOvertimeTimesMapper.xml
@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.ProjectCodingStatusMapper">
+<mapper namespace="com.ycl.mapper.ProjectOvertimeTimesMapper">
<!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
- <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectCodingStatusVO">
+ <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectOvertimeTimesVO">
<result column="task_overtime_num" property="taskOvertimeNum" />
<result column="process_ins_id" property="processInsId" />
<result column="project_id" property="projectId" />
<result column="project_type" property="projectType" />
</resultMap>
-
-
-
<delete id="delAll">
DELETE FROM t_project_overtime_times
diff --git a/flowable/src/main/java/com/ycl/domain/vo/ProcessCodingVO.java b/flowable/src/main/java/com/ycl/domain/vo/ProcessCodingVO.java
index 70b4a4f..65ee250 100644
--- a/flowable/src/main/java/com/ycl/domain/vo/ProcessCodingVO.java
+++ b/flowable/src/main/java/com/ycl/domain/vo/ProcessCodingVO.java
@@ -53,11 +53,6 @@
@ApiModelProperty("浠诲姟鐘舵�乬reen/red/yellow")
private String status;
- /** 浠诲姟鐘舵��0杩涜涓�1缁撴潫 */
- @ApiModelProperty("瓒呮椂浠诲姟鏁�")
- private Long taskOvertimeNum;
-
-
/** 浠诲姟瓒呮椂鐘舵�� */
@ApiModelProperty("浠诲姟瓒呮椂鐘舵��")
private String overtimeStatus;
diff --git a/flowable/src/main/java/com/ycl/domain/vo/ProcessOvertimeTimesVO.java b/flowable/src/main/java/com/ycl/domain/vo/ProcessOvertimeTimesVO.java
new file mode 100644
index 0000000..8d433e4
--- /dev/null
+++ b/flowable/src/main/java/com/ycl/domain/vo/ProcessOvertimeTimesVO.java
@@ -0,0 +1,18 @@
+package com.ycl.domain.vo;
+
+import com.ycl.system.domain.base.AbsVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "鍝嶅簲鏁版嵁", description = "鍝嶅簲鏁版嵁")
+public class ProcessOvertimeTimesVO extends AbsVo {
+
+ /** 娴佺▼瀹炰緥id */
+ @ApiModelProperty("娴佺▼瀹炰緥id")
+ private String processInsId;
+ /** 瓒呮椂浠诲姟鏁� */
+ @ApiModelProperty("瓒呮椂浠诲姟鏁�")
+ private Long taskOvertimeNum;
+}
diff --git a/flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java b/flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java
index ee3bb11..9bbc0bc 100644
--- a/flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java
+++ b/flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java
@@ -5,6 +5,7 @@
import com.ycl.domain.entity.ProcessCoding;
import com.ycl.domain.query.ProcessCodingQuery;
import com.ycl.domain.vo.ProcessCodingVO;
+import com.ycl.domain.vo.ProcessOvertimeTimesVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -43,5 +44,5 @@
* 鏌ヨ鍑烘瘡涓祦绋嬪疄渚媔d涓秴鏃剁殑浠诲姟鏁帮紝娴佺▼瀹炰緥id
* @return
*/
- List<ProcessCodingVO> countProjectOverTimeNum();
+ List<ProcessOvertimeTimesVO> countProjectOvertimeTimes();
}
diff --git a/flowable/src/main/resources/mapper/ProcessCodingMapper.xml b/flowable/src/main/resources/mapper/ProcessCodingMapper.xml
index cfb68b1..eebbdf5 100644
--- a/flowable/src/main/resources/mapper/ProcessCodingMapper.xml
+++ b/flowable/src/main/resources/mapper/ProcessCodingMapper.xml
@@ -14,13 +14,13 @@
<result column="status" property="status" />
<result column="overtime_status" property="overtimeStatus" />
</resultMap>
- <resultMap id="projectProcessTaskOverNum" type="com.ycl.domain.vo.ProcessCodingVO">
+ <resultMap id="processOvertimeTimesVO" type="com.ycl.domain.vo.ProcessOvertimeTimesVO">
<id column="id" property="id"/>
<result column="task_overtime_num" property="taskOvertimeNum"/>
<result column="process_ins_id" property="processInsId"/>
</resultMap>
- <select id="countProjectOverTimeNum" resultMap="projectProcessTaskOverNum">
+ <select id="countProjectOvertimeTimes" resultMap="processOvertimeTimesVO">
select TPC.id,
TPC.process_ins_id,
COUNT(TPC.overtime_status) as task_overtime_num
--
Gitblit v1.8.0