Commit 9495e9bc59f2a22baafd365d4afa0892037d2ca2
1 parent
39b27610
CPS体系驾驶舱-添加定时任务根据考勤记录自动生成过程确认计划,新增相关基础辅助信息查询接口
Showing
52 changed files
with
2090 additions
and
99 deletions
| @@ -4,4 +4,15 @@ public interface Constant { | @@ -4,4 +4,15 @@ public interface Constant { | ||
| 4 | 4 | ||
| 5 | String SUCCESS = "SUCCESS"; | 5 | String SUCCESS = "SUCCESS"; |
| 6 | String ERROR = "ERROR"; | 6 | String ERROR = "ERROR"; |
| 7 | + | ||
| 8 | + /** | ||
| 9 | + * 企业编号字段(Java 属性名,对应数据库列 corp_code),用于 tk.mybatis Example 查询条件 | ||
| 10 | + */ | ||
| 11 | + String CORP_CODE = "corpCode"; | ||
| 12 | + | ||
| 13 | + /** | ||
| 14 | + * 默认企业编号,当 ContextHandler 中未设置 corpCode 时使用 | ||
| 15 | + */ | ||
| 16 | + String DEFAULT_CORP_CODE = "hfca"; | ||
| 17 | + String DEFAULT_USER_ID = "sync_admin"; | ||
| 7 | } | 18 | } |
| @@ -32,4 +32,15 @@ public class AreaController { | @@ -32,4 +32,15 @@ public class AreaController { | ||
| 32 | List<Area> areaList = areaService.listAll(); | 32 | List<Area> areaList = areaService.listAll(); |
| 33 | return new JsonResult<>(true, "成功", areaList); | 33 | return new JsonResult<>(true, "成功", areaList); |
| 34 | } | 34 | } |
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取所有启用状态的区域信息列表 | ||
| 38 | + * | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + @GetMapping("/list/enabled") | ||
| 42 | + public JsonResult listEnabled() { | ||
| 43 | + List<Area> areaList = areaService.listEnabled(); | ||
| 44 | + return new JsonResult<>(true, "成功", areaList); | ||
| 45 | + } | ||
| 35 | } | 46 | } |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.controller; | ||
| 2 | + | ||
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.service.EnumService; | ||
| 4 | +import com.qgutech.qgyun.framework.common.result.JsonResult; | ||
| 5 | +import lombok.extern.slf4j.Slf4j; | ||
| 6 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RestController; | ||
| 9 | + | ||
| 10 | +import javax.annotation.Resource; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 枚举定义信息接口 | ||
| 14 | + */ | ||
| 15 | +@Slf4j | ||
| 16 | +@RestController | ||
| 17 | +@RequestMapping("/enum") | ||
| 18 | +public class EnumController { | ||
| 19 | + | ||
| 20 | + @Resource | ||
| 21 | + private EnumService enumService; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 获取项目中所有枚举的定义常量数组信息 | ||
| 25 | + * | ||
| 26 | + * @return 枚举定义列表 | ||
| 27 | + */ | ||
| 28 | + @GetMapping("/list/all") | ||
| 29 | + public JsonResult listAll() { | ||
| 30 | + return new JsonResult<>(true, "成功", enumService.listAllEnumDefinitions()); | ||
| 31 | + } | ||
| 32 | +} |
| @@ -32,4 +32,15 @@ public class RoomGroupController { | @@ -32,4 +32,15 @@ public class RoomGroupController { | ||
| 32 | List<RoomGroup> roomGroupList = roomGroupService.listAll(); | 32 | List<RoomGroup> roomGroupList = roomGroupService.listAll(); |
| 33 | return new JsonResult<>(true, "成功", roomGroupList); | 33 | return new JsonResult<>(true, "成功", roomGroupList); |
| 34 | } | 34 | } |
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取所有启用状态的室组信息列表 | ||
| 38 | + * | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + @GetMapping("/list/enabled") | ||
| 42 | + public JsonResult listEnabled() { | ||
| 43 | + List<RoomGroup> roomGroupList = roomGroupService.listEnabled(); | ||
| 44 | + return new JsonResult<>(true, "成功", roomGroupList); | ||
| 45 | + } | ||
| 35 | } | 46 | } |
| @@ -32,4 +32,15 @@ public class ShiftController { | @@ -32,4 +32,15 @@ public class ShiftController { | ||
| 32 | List<Shift> shiftList = shiftService.listAll(); | 32 | List<Shift> shiftList = shiftService.listAll(); |
| 33 | return new JsonResult<>(true, "成功", shiftList); | 33 | return new JsonResult<>(true, "成功", shiftList); |
| 34 | } | 34 | } |
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取所有启用状态的班次信息列表 | ||
| 38 | + * | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + @GetMapping("/list/enabled") | ||
| 42 | + public JsonResult listEnabled() { | ||
| 43 | + List<Shift> shiftList = shiftService.listEnabled(); | ||
| 44 | + return new JsonResult<>(true, "成功", shiftList); | ||
| 45 | + } | ||
| 35 | } | 46 | } |
| @@ -32,4 +32,15 @@ public class TeamController { | @@ -32,4 +32,15 @@ public class TeamController { | ||
| 32 | List<Team> teamList = teamService.listAll(); | 32 | List<Team> teamList = teamService.listAll(); |
| 33 | return new JsonResult<>(true, "成功", teamList); | 33 | return new JsonResult<>(true, "成功", teamList); |
| 34 | } | 34 | } |
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取所有启用状态的班组信息列表 | ||
| 38 | + * | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + @GetMapping("/list/enabled") | ||
| 42 | + public JsonResult listEnabled() { | ||
| 43 | + List<Team> teamList = teamService.listEnabled(); | ||
| 44 | + return new JsonResult<>(true, "成功", teamList); | ||
| 45 | + } | ||
| 35 | } | 46 | } |
| @@ -36,4 +36,15 @@ public class WorkshopController { | @@ -36,4 +36,15 @@ public class WorkshopController { | ||
| 36 | List<Workshop> workshopList = workshopService.listAll(); | 36 | List<Workshop> workshopList = workshopService.listAll(); |
| 37 | return new JsonResult<>(true, "成功", workshopList); | 37 | return new JsonResult<>(true, "成功", workshopList); |
| 38 | } | 38 | } |
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 获取所有启用状态的单位(车间)信息列表 | ||
| 42 | + * | ||
| 43 | + * @return | ||
| 44 | + */ | ||
| 45 | + @GetMapping("/list/enabled") | ||
| 46 | + public JsonResult listEnabled() { | ||
| 47 | + List<Workshop> workshopList = workshopService.listEnabled(); | ||
| 48 | + return new JsonResult<>(true, "成功", workshopList); | ||
| 49 | + } | ||
| 39 | } | 50 | } |
| @@ -32,4 +32,15 @@ public class XtLineController { | @@ -32,4 +32,15 @@ public class XtLineController { | ||
| 32 | List<XtLine> xtLineList = xtLineService.listAll(); | 32 | List<XtLine> xtLineList = xtLineService.listAll(); |
| 33 | return new JsonResult<>(true, "成功", xtLineList); | 33 | return new JsonResult<>(true, "成功", xtLineList); |
| 34 | } | 34 | } |
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取所有启用状态的线体信息列表 | ||
| 38 | + * | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + @GetMapping("/list/enabled") | ||
| 42 | + public JsonResult listEnabled() { | ||
| 43 | + List<XtLine> xtLineList = xtLineService.listEnabled(); | ||
| 44 | + return new JsonResult<>(true, "成功", xtLineList); | ||
| 45 | + } | ||
| 35 | } | 46 | } |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.dto; | ||
| 2 | + | ||
| 3 | +import lombok.Getter; | ||
| 4 | +import lombok.Setter; | ||
| 5 | +import lombok.ToString; | ||
| 6 | + | ||
| 7 | +import java.io.Serializable; | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 枚举定义信息(一个枚举类对应一条记录,含其所有常量项) | ||
| 13 | + */ | ||
| 14 | +@Getter | ||
| 15 | +@Setter | ||
| 16 | +@ToString | ||
| 17 | +public class EnumDefinitionDTO implements Serializable { | ||
| 18 | + | ||
| 19 | + private static final long serialVersionUID = 1L; | ||
| 20 | + | ||
| 21 | + /* | ||
| 22 | + * 枚举类名,如 RylbEnum | ||
| 23 | + */ | ||
| 24 | + private String enumName; | ||
| 25 | + | ||
| 26 | + /* | ||
| 27 | + * 枚举业务标识(对应数据库字段/业务含义),如 rylb | ||
| 28 | + */ | ||
| 29 | + private String enumKey; | ||
| 30 | + | ||
| 31 | + /* | ||
| 32 | + * 枚举中文说明,如 人员类别 | ||
| 33 | + */ | ||
| 34 | + private String description; | ||
| 35 | + | ||
| 36 | + /* | ||
| 37 | + * 枚举常量项列表 | ||
| 38 | + */ | ||
| 39 | + private List<Item> items = new ArrayList<>(); | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 枚举常量项 | ||
| 43 | + */ | ||
| 44 | + @Getter | ||
| 45 | + @Setter | ||
| 46 | + @ToString | ||
| 47 | + public static class Item implements Serializable { | ||
| 48 | + | ||
| 49 | + private static final long serialVersionUID = 1L; | ||
| 50 | + | ||
| 51 | + /* | ||
| 52 | + * 枚举常量名,如 QUZHANG | ||
| 53 | + */ | ||
| 54 | + private String name; | ||
| 55 | + | ||
| 56 | + /* | ||
| 57 | + * 数据库存储编号,如 #1# | ||
| 58 | + */ | ||
| 59 | + private String code; | ||
| 60 | + | ||
| 61 | + /* | ||
| 62 | + * 中文描述,如 区长 | ||
| 63 | + */ | ||
| 64 | + private String desc; | ||
| 65 | + | ||
| 66 | + public Item() { | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public Item(String name, String code, String desc) { | ||
| 70 | + this.name = name; | ||
| 71 | + this.code = code; | ||
| 72 | + this.desc = desc; | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | +} |
| @@ -16,6 +16,11 @@ import javax.persistence.Table; | @@ -16,6 +16,11 @@ import javax.persistence.Table; | ||
| 16 | @Table(name = "t_auto_hfca_ixzvok_cnfeci") | 16 | @Table(name = "t_auto_hfca_ixzvok_cnfeci") |
| 17 | public class Area extends BaseCorpModel { | 17 | public class Area extends BaseCorpModel { |
| 18 | 18 | ||
| 19 | + /** | ||
| 20 | + * 状态字段(zt),存储编号:#1#-草稿;#2#-启用;#3#-停用; | ||
| 21 | + */ | ||
| 22 | + public static final String ZT = "zt"; | ||
| 23 | + | ||
| 19 | /* | 24 | /* |
| 20 | * 区域名称 | 25 | * 区域名称 |
| 21 | */ | 26 | */ |
| @@ -24,6 +24,7 @@ public class ProcessConfirmExec extends BaseCorpModel { | @@ -24,6 +24,7 @@ public class ProcessConfirmExec extends BaseCorpModel { | ||
| 24 | public static final String RYLB = "rylb"; | 24 | public static final String RYLB = "rylb"; |
| 25 | public static final String SFYZX = "sfyzx"; | 25 | public static final String SFYZX = "sfyzx"; |
| 26 | public static final String ZT = "zt"; | 26 | public static final String ZT = "zt"; |
| 27 | + public static final String GCQRJHRY = "gcqrjhry"; | ||
| 27 | 28 | ||
| 28 | /* | 29 | /* |
| 29 | * 活动执行日期 | 30 | * 活动执行日期 |
| @@ -17,6 +17,9 @@ import java.util.Date; | @@ -17,6 +17,9 @@ import java.util.Date; | ||
| 17 | @Table(name = "t_auto_hfca_ixzvok_gcjhrywh") | 17 | @Table(name = "t_auto_hfca_ixzvok_gcjhrywh") |
| 18 | public class ProcessConfirmPersonnel extends BaseCorpModel { | 18 | public class ProcessConfirmPersonnel extends BaseCorpModel { |
| 19 | 19 | ||
| 20 | + public static final String RY = "ry"; | ||
| 21 | + public static final String ZT = "zt"; | ||
| 22 | + | ||
| 20 | /* | 23 | /* |
| 21 | * 人员 | 24 | * 人员 |
| 22 | */ | 25 | */ |
| @@ -16,6 +16,11 @@ import javax.persistence.Table; | @@ -16,6 +16,11 @@ import javax.persistence.Table; | ||
| 16 | @Table(name = "t_auto_hfca_ixzvok_efawtt") | 16 | @Table(name = "t_auto_hfca_ixzvok_efawtt") |
| 17 | public class RoomGroup extends BaseCorpModel { | 17 | public class RoomGroup extends BaseCorpModel { |
| 18 | 18 | ||
| 19 | + /** | ||
| 20 | + * 状态字段(zt),存储编号:#1#-草稿;#2#-启用;#3#-停用; | ||
| 21 | + */ | ||
| 22 | + public static final String ZT = "zt"; | ||
| 23 | + | ||
| 19 | /* | 24 | /* |
| 20 | * 室组名称 | 25 | * 室组名称 |
| 21 | */ | 26 | */ |
| @@ -16,6 +16,11 @@ import javax.persistence.Table; | @@ -16,6 +16,11 @@ import javax.persistence.Table; | ||
| 16 | @Table(name = "t_auto_hfca_ixzvok_usnoxx") | 16 | @Table(name = "t_auto_hfca_ixzvok_usnoxx") |
| 17 | public class Shift extends BaseCorpModel { | 17 | public class Shift extends BaseCorpModel { |
| 18 | 18 | ||
| 19 | + /** | ||
| 20 | + * 状态字段(zt),存储编号:#1#-草稿;#2#-启用;#3#-停用; | ||
| 21 | + */ | ||
| 22 | + public static final String ZT = "zt"; | ||
| 23 | + | ||
| 19 | /* | 24 | /* |
| 20 | * 班次名称 | 25 | * 班次名称 |
| 21 | */ | 26 | */ |
| @@ -16,6 +16,11 @@ import javax.persistence.Table; | @@ -16,6 +16,11 @@ import javax.persistence.Table; | ||
| 16 | @Table(name = "t_auto_hfca_ixzvok_bzxxgl") | 16 | @Table(name = "t_auto_hfca_ixzvok_bzxxgl") |
| 17 | public class Team extends BaseCorpModel { | 17 | public class Team extends BaseCorpModel { |
| 18 | 18 | ||
| 19 | + /** | ||
| 20 | + * 状态字段(zt),存储编号:#1#-草稿;#2#-启用;#3#-停用; | ||
| 21 | + */ | ||
| 22 | + public static final String ZT = "zt"; | ||
| 23 | + | ||
| 19 | /* | 24 | /* |
| 20 | * 班组名称 | 25 | * 班组名称 |
| 21 | */ | 26 | */ |
| @@ -18,6 +18,11 @@ import javax.persistence.Transient; | @@ -18,6 +18,11 @@ import javax.persistence.Transient; | ||
| 18 | @Table(name = "t_auto_hfca_ixzvok_phwifn") | 18 | @Table(name = "t_auto_hfca_ixzvok_phwifn") |
| 19 | public class Workshop extends BaseCorpModel { | 19 | public class Workshop extends BaseCorpModel { |
| 20 | 20 | ||
| 21 | + /** | ||
| 22 | + * 状态字段(ieiblp),存储编号:#1#-草稿;#2#-启用;#3#-停用; | ||
| 23 | + */ | ||
| 24 | + public static final String IEIBLP = "ieiblp"; | ||
| 25 | + | ||
| 21 | /* | 26 | /* |
| 22 | * 单位名称 | 27 | * 单位名称 |
| 23 | */ | 28 | */ |
| @@ -16,6 +16,11 @@ import javax.persistence.Table; | @@ -16,6 +16,11 @@ import javax.persistence.Table; | ||
| 16 | @Table(name = "t_auto_hfca_ixzvok_umsoxi") | 16 | @Table(name = "t_auto_hfca_ixzvok_umsoxi") |
| 17 | public class XtLine extends BaseCorpModel { | 17 | public class XtLine extends BaseCorpModel { |
| 18 | 18 | ||
| 19 | + /** | ||
| 20 | + * 状态字段(amoigs),存储编号:#1#-草稿;#2#-启用;#3#-停用; | ||
| 21 | + */ | ||
| 22 | + public static final String AMOIGS = "amoigs"; | ||
| 23 | + | ||
| 19 | /* | 24 | /* |
| 20 | * 线体名称 | 25 | * 线体名称 |
| 21 | */ | 26 | */ |
| @@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; | ||
| 14 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 15 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
| 16 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
| 17 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 17 | import tk.mybatis.mapper.entity.Example; | 18 | import tk.mybatis.mapper.entity.Example; |
| 18 | 19 | ||
| 19 | import javax.annotation.Resource; | 20 | import javax.annotation.Resource; |
| @@ -40,7 +41,7 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | @@ -40,7 +41,7 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | ||
| 40 | Assert.hasLength(id, "id is empty!"); | 41 | Assert.hasLength(id, "id is empty!"); |
| 41 | 42 | ||
| 42 | Example example = new Example(entityClass); | 43 | Example example = new Example(entityClass); |
| 43 | - example.createCriteria().andEqualTo(AbImprovement.ID, id); | 44 | + CorpExample.criteria(example).andEqualTo(AbImprovement.ID, id); |
| 44 | AbImprovement abImprovement = abImprovementMapper.selectOneByExample(example); | 45 | AbImprovement abImprovement = abImprovementMapper.selectOneByExample(example); |
| 45 | if (null == abImprovement) { | 46 | if (null == abImprovement) { |
| 46 | throw new BoException(BoErrorCode.DATA_ERROR); | 47 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -53,7 +54,7 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | @@ -53,7 +54,7 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | ||
| 53 | Assert.notEmpty(ids, "ids is empty!"); | 54 | Assert.notEmpty(ids, "ids is empty!"); |
| 54 | 55 | ||
| 55 | Example example = new Example(entityClass); | 56 | Example example = new Example(entityClass); |
| 56 | - example.createCriteria().andIn(AbImprovement.ID, ids); | 57 | + CorpExample.criteria(example).andIn(AbImprovement.ID, ids); |
| 57 | List<AbImprovement> abImprovementList = abImprovementMapper.selectByExample(example); | 58 | List<AbImprovement> abImprovementList = abImprovementMapper.selectByExample(example); |
| 58 | if (CollectionUtils.isEmpty(abImprovementList)) { | 59 | if (CollectionUtils.isEmpty(abImprovementList)) { |
| 59 | return new ArrayList<>(0); | 60 | return new ArrayList<>(0); |
| @@ -76,7 +77,8 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | @@ -76,7 +77,8 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | ||
| 76 | @Transactional(readOnly = true) | 77 | @Transactional(readOnly = true) |
| 77 | public List<AbImprovement> listAll() { | 78 | public List<AbImprovement> listAll() { |
| 78 | 79 | ||
| 79 | - return abImprovementMapper.selectAll(); | 80 | + Example example = CorpExample.ofCorp(entityClass); |
| 81 | + return abImprovementMapper.selectByExample(example); | ||
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | /** | 84 | /** |
| @@ -99,7 +101,7 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | @@ -99,7 +101,7 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { | ||
| 99 | 101 | ||
| 100 | // 3. 查询该年份的所有AB类改善记录 | 102 | // 3. 查询该年份的所有AB类改善记录 |
| 101 | Example example = new Example(AbImprovement.class); | 103 | Example example = new Example(AbImprovement.class); |
| 102 | - example.createCriteria() | 104 | + CorpExample.criteria(example) |
| 103 | .andBetween(AbImprovement.CREATED_AT, startTime, endTime); | 105 | .andBetween(AbImprovement.CREATED_AT, startTime, endTime); |
| 104 | List<AbImprovement> abImprovementList = abImprovementMapper.selectByExample(example); | 106 | List<AbImprovement> abImprovementList = abImprovementMapper.selectByExample(example); |
| 105 | 107 |
| @@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils; | ||
| 10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 11 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 12 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 13 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 14 | 15 | ||
| 15 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -40,7 +41,7 @@ public class AbImprovementTargetService extends BaseServiceImpl<AbImprovementTar | @@ -40,7 +41,7 @@ public class AbImprovementTargetService extends BaseServiceImpl<AbImprovementTar | ||
| 40 | 41 | ||
| 41 | // 5. 查询该年份的AB类目标信息 | 42 | // 5. 查询该年份的AB类目标信息 |
| 42 | Example targetExample = new Example(entityClass); | 43 | Example targetExample = new Example(entityClass); |
| 43 | - targetExample.createCriteria() | 44 | + CorpExample.criteria(targetExample) |
| 44 | .andBetween(AbImprovementTarget.YEAR, startTime, endTime); | 45 | .andBetween(AbImprovementTarget.YEAR, startTime, endTime); |
| 45 | List<AbImprovementTarget> targetList = abImprovementTargetMapper.selectByExample(targetExample); | 46 | List<AbImprovementTarget> targetList = abImprovementTargetMapper.selectByExample(targetExample); |
| 46 | if (CollectionUtils.isEmpty(targetList)) { | 47 | if (CollectionUtils.isEmpty(targetList)) { |
| @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.AreaMapper; | 7 | import com.qgutech.qgyun.apaas.sync.cps.mapper.AreaMapper; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.model.Area; | 8 | import com.qgutech.qgyun.apaas.sync.cps.model.Area; |
| 8 | import org.apache.commons.collections4.CollectionUtils; | 9 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class AreaService extends BaseServiceImpl<Area> { | @@ -29,7 +31,7 @@ public class AreaService extends BaseServiceImpl<Area> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(Area.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(Area.ID, id); |
| 33 | Area area = areaMapper.selectOneByExample(example); | 35 | Area area = areaMapper.selectOneByExample(example); |
| 34 | if (null == area) { | 36 | if (null == area) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class AreaService extends BaseServiceImpl<Area> { | @@ -42,7 +44,7 @@ public class AreaService extends BaseServiceImpl<Area> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(Area.ID, ids); | 47 | + CorpExample.criteria(example).andIn(Area.ID, ids); |
| 46 | List<Area> areaList = areaMapper.selectByExample(example); | 48 | List<Area> areaList = areaMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(areaList)) { | 49 | if (CollectionUtils.isEmpty(areaList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,21 @@ public class AreaService extends BaseServiceImpl<Area> { | @@ -65,6 +67,21 @@ public class AreaService extends BaseServiceImpl<Area> { | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<Area> listAll() { | 68 | public List<Area> listAll() { |
| 67 | 69 | ||
| 68 | - return areaMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return areaMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询所有启用状态的区域信息列表 | ||
| 76 | + */ | ||
| 77 | + @Transactional(readOnly = true) | ||
| 78 | + public List<Area> listEnabled() { | ||
| 79 | + Example example = new Example(entityClass); | ||
| 80 | + CorpExample.criteria(example).andEqualTo(Area.ZT, DataStatusEnum.QIYONG.getCode()); | ||
| 81 | + List<Area> areaList = areaMapper.selectByExample(example); | ||
| 82 | + if (CollectionUtils.isEmpty(areaList)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + return areaList; | ||
| 69 | } | 86 | } |
| 70 | } | 87 | } |
| @@ -27,6 +27,7 @@ import org.springframework.beans.BeanUtils; | @@ -27,6 +27,7 @@ import org.springframework.beans.BeanUtils; | ||
| 27 | import org.springframework.stereotype.Service; | 27 | import org.springframework.stereotype.Service; |
| 28 | import org.springframework.transaction.annotation.Transactional; | 28 | import org.springframework.transaction.annotation.Transactional; |
| 29 | import org.springframework.util.Assert; | 29 | import org.springframework.util.Assert; |
| 30 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 30 | import tk.mybatis.mapper.entity.Example; | 31 | import tk.mybatis.mapper.entity.Example; |
| 31 | 32 | ||
| 32 | import javax.annotation.Resource; | 33 | import javax.annotation.Resource; |
| @@ -74,7 +75,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | @@ -74,7 +75,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | ||
| 74 | Assert.hasLength(id, "id is empty!"); | 75 | Assert.hasLength(id, "id is empty!"); |
| 75 | 76 | ||
| 76 | Example example = new Example(entityClass); | 77 | Example example = new Example(entityClass); |
| 77 | - example.createCriteria().andEqualTo(CImprovement.ID, id); | 78 | + CorpExample.criteria(example).andEqualTo(CImprovement.ID, id); |
| 78 | CImprovement cImprovement = cImprovementMapper.selectOneByExample(example); | 79 | CImprovement cImprovement = cImprovementMapper.selectOneByExample(example); |
| 79 | if (null == cImprovement) { | 80 | if (null == cImprovement) { |
| 80 | throw new BoException(BoErrorCode.DATA_ERROR); | 81 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -87,7 +88,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | @@ -87,7 +88,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | ||
| 87 | Assert.notEmpty(ids, "ids is empty!"); | 88 | Assert.notEmpty(ids, "ids is empty!"); |
| 88 | 89 | ||
| 89 | Example example = new Example(entityClass); | 90 | Example example = new Example(entityClass); |
| 90 | - example.createCriteria().andIn(CImprovement.ID, ids); | 91 | + CorpExample.criteria(example).andIn(CImprovement.ID, ids); |
| 91 | List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); | 92 | List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); |
| 92 | if (CollectionUtils.isEmpty(cImprovementList)) { | 93 | if (CollectionUtils.isEmpty(cImprovementList)) { |
| 93 | return new ArrayList<>(0); | 94 | return new ArrayList<>(0); |
| @@ -110,7 +111,8 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | @@ -110,7 +111,8 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | ||
| 110 | @Transactional(readOnly = true) | 111 | @Transactional(readOnly = true) |
| 111 | public List<CImprovement> listAll() { | 112 | public List<CImprovement> listAll() { |
| 112 | 113 | ||
| 113 | - return cImprovementMapper.selectAll(); | 114 | + Example example = CorpExample.ofCorp(entityClass); |
| 115 | + return cImprovementMapper.selectByExample(example); | ||
| 114 | } | 116 | } |
| 115 | 117 | ||
| 116 | /** | 118 | /** |
| @@ -139,7 +141,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | @@ -139,7 +141,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | ||
| 139 | 141 | ||
| 140 | // 4. 查询该季度时间范围内的C类改善记录 | 142 | // 4. 查询该季度时间范围内的C类改善记录 |
| 141 | Example example = new Example(CImprovement.class); | 143 | Example example = new Example(CImprovement.class); |
| 142 | - example.createCriteria() | 144 | + CorpExample.criteria(example) |
| 143 | .andBetween(CImprovement.CREATED_AT, startTime, endTime); | 145 | .andBetween(CImprovement.CREATED_AT, startTime, endTime); |
| 144 | List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); | 146 | List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); |
| 145 | 147 | ||
| @@ -302,7 +304,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | @@ -302,7 +304,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { | ||
| 302 | 304 | ||
| 303 | // 5. 查询该季度时间范围内、发起人属于该单位车间人员的C类改善记录 | 305 | // 5. 查询该季度时间范围内、发起人属于该单位车间人员的C类改善记录 |
| 304 | Example example = new Example(CImprovement.class); | 306 | Example example = new Example(CImprovement.class); |
| 305 | - example.createCriteria() | 307 | + CorpExample.criteria(example) |
| 306 | .andBetween(CImprovement.CREATED_AT, startTime, endTime) | 308 | .andBetween(CImprovement.CREATED_AT, startTime, endTime) |
| 307 | .andIn(CImprovement.FQR, personnelYhrySet); | 309 | .andIn(CImprovement.FQR, personnelYhrySet); |
| 308 | List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); | 310 | List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); |
| @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -44,7 +45,7 @@ public class CImprovementTargetService extends BaseServiceImpl<CImprovementTarge | @@ -44,7 +45,7 @@ public class CImprovementTargetService extends BaseServiceImpl<CImprovementTarge | ||
| 44 | 45 | ||
| 45 | // 3. 查询该年份的C类目标信息 | 46 | // 3. 查询该年份的C类目标信息 |
| 46 | Example targetExample = new Example(entityClass); | 47 | Example targetExample = new Example(entityClass); |
| 47 | - targetExample.createCriteria() | 48 | + CorpExample.criteria(targetExample) |
| 48 | .andBetween(CImprovementTarget.YEAR, startTime, endTime); | 49 | .andBetween(CImprovementTarget.YEAR, startTime, endTime); |
| 49 | List<CImprovementTarget> targetList = cImprovementTargetMapper.selectByExample(targetExample); | 50 | List<CImprovementTarget> targetList = cImprovementTargetMapper.selectByExample(targetExample); |
| 50 | if (CollectionUtils.isEmpty(targetList)) { | 51 | if (CollectionUtils.isEmpty(targetList)) { |
| @@ -29,6 +29,7 @@ import org.springframework.beans.BeanUtils; | @@ -29,6 +29,7 @@ import org.springframework.beans.BeanUtils; | ||
| 29 | import org.springframework.stereotype.Service; | 29 | import org.springframework.stereotype.Service; |
| 30 | import org.springframework.transaction.annotation.Transactional; | 30 | import org.springframework.transaction.annotation.Transactional; |
| 31 | import org.springframework.util.Assert; | 31 | import org.springframework.util.Assert; |
| 32 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 32 | import tk.mybatis.mapper.entity.Example; | 33 | import tk.mybatis.mapper.entity.Example; |
| 33 | 34 | ||
| 34 | import javax.annotation.Resource; | 35 | import javax.annotation.Resource; |
| @@ -64,7 +65,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -64,7 +65,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 64 | Assert.hasLength(id, "id is empty!"); | 65 | Assert.hasLength(id, "id is empty!"); |
| 65 | 66 | ||
| 66 | Example example = new Example(entityClass); | 67 | Example example = new Example(entityClass); |
| 67 | - example.createCriteria().andEqualTo(CpsProblem.ID, id); | 68 | + CorpExample.criteria(example).andEqualTo(CpsProblem.ID, id); |
| 68 | CpsProblem cpsProblem = cpsProblemMapper.selectOneByExample(example); | 69 | CpsProblem cpsProblem = cpsProblemMapper.selectOneByExample(example); |
| 69 | if (null == cpsProblem) { | 70 | if (null == cpsProblem) { |
| 70 | throw new BoException(BoErrorCode.DATA_ERROR); | 71 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -77,7 +78,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -77,7 +78,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 77 | Assert.notEmpty(ids, "ids is empty!"); | 78 | Assert.notEmpty(ids, "ids is empty!"); |
| 78 | 79 | ||
| 79 | Example example = new Example(entityClass); | 80 | Example example = new Example(entityClass); |
| 80 | - example.createCriteria().andIn(CpsProblem.ID, ids); | 81 | + CorpExample.criteria(example).andIn(CpsProblem.ID, ids); |
| 81 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); | 82 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); |
| 82 | if (CollectionUtils.isEmpty(cpsProblemList)) { | 83 | if (CollectionUtils.isEmpty(cpsProblemList)) { |
| 83 | return new ArrayList<>(0); | 84 | return new ArrayList<>(0); |
| @@ -100,7 +101,8 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -100,7 +101,8 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 100 | @Transactional(readOnly = true) | 101 | @Transactional(readOnly = true) |
| 101 | public List<CpsProblem> listAll() { | 102 | public List<CpsProblem> listAll() { |
| 102 | 103 | ||
| 103 | - return cpsProblemMapper.selectAll(); | 104 | + Example example = CorpExample.ofCorp(entityClass); |
| 105 | + return cpsProblemMapper.selectByExample(example); | ||
| 104 | } | 106 | } |
| 105 | 107 | ||
| 106 | /** | 108 | /** |
| @@ -114,7 +116,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -114,7 +116,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 114 | Assert.notEmpty(lygcqrzxIds, "lygcqrzxIds is empty!"); | 116 | Assert.notEmpty(lygcqrzxIds, "lygcqrzxIds is empty!"); |
| 115 | 117 | ||
| 116 | Example example = new Example(entityClass); | 118 | Example example = new Example(entityClass); |
| 117 | - example.createCriteria().andIn(CpsProblem.LYGCQRZX, lygcqrzxIds); | 119 | + CorpExample.criteria(example).andIn(CpsProblem.LYGCQRZX, lygcqrzxIds); |
| 118 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); | 120 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); |
| 119 | if (CollectionUtils.isEmpty(cpsProblemList)) { | 121 | if (CollectionUtils.isEmpty(cpsProblemList)) { |
| 120 | return new ArrayList<>(0); | 122 | return new ArrayList<>(0); |
| @@ -142,7 +144,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -142,7 +144,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 142 | 144 | ||
| 143 | // 2. 查询计划解决时间在范围内的所有问题记录 | 145 | // 2. 查询计划解决时间在范围内的所有问题记录 |
| 144 | Example example = new Example(CpsProblem.class); | 146 | Example example = new Example(CpsProblem.class); |
| 145 | - example.createCriteria() | 147 | + CorpExample.criteria(example) |
| 146 | .andBetween(CpsProblem.JHJJSJ, start, end); | 148 | .andBetween(CpsProblem.JHJJSJ, start, end); |
| 147 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); | 149 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); |
| 148 | if (CollectionUtils.isEmpty(cpsProblemList)) { | 150 | if (CollectionUtils.isEmpty(cpsProblemList)) { |
| @@ -249,7 +251,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -249,7 +251,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 249 | 251 | ||
| 250 | // 2. 查询问题记录 | 252 | // 2. 查询问题记录 |
| 251 | Example example = new Example(CpsProblem.class); | 253 | Example example = new Example(CpsProblem.class); |
| 252 | - example.createCriteria() | 254 | + CorpExample.criteria(example) |
| 253 | .andBetween(CpsProblem.JHJJSJ, start, end) | 255 | .andBetween(CpsProblem.JHJJSJ, start, end) |
| 254 | .andEqualTo(CpsProblem.WTZRDW, wtzrdwId) | 256 | .andEqualTo(CpsProblem.WTZRDW, wtzrdwId) |
| 255 | .andEqualTo(CpsProblem.WTCLZT, statusCode); | 257 | .andEqualTo(CpsProblem.WTCLZT, statusCode); |
| @@ -317,7 +319,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -317,7 +319,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 317 | 319 | ||
| 318 | // 2. 查询创建时间在范围内的问题记录 | 320 | // 2. 查询创建时间在范围内的问题记录 |
| 319 | Example example = new Example(CpsProblem.class); | 321 | Example example = new Example(CpsProblem.class); |
| 320 | - example.createCriteria() | 322 | + CorpExample.criteria(example) |
| 321 | .andBetween(CpsProblem.CREATED_AT, start, end); | 323 | .andBetween(CpsProblem.CREATED_AT, start, end); |
| 322 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); | 324 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); |
| 323 | 325 | ||
| @@ -378,7 +380,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | @@ -378,7 +380,7 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { | ||
| 378 | 380 | ||
| 379 | // 2. 查询问题记录 | 381 | // 2. 查询问题记录 |
| 380 | Example example = new Example(CpsProblem.class); | 382 | Example example = new Example(CpsProblem.class); |
| 381 | - example.createCriteria() | 383 | + CorpExample.criteria(example) |
| 382 | .andBetween(CpsProblem.CREATED_AT, start, end) | 384 | .andBetween(CpsProblem.CREATED_AT, start, end) |
| 383 | .andEqualTo(CpsProblem.WTLY, sourceCode); | 385 | .andEqualTo(CpsProblem.WTLY, sourceCode); |
| 384 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); | 386 | List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 2 | + | ||
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.dto.EnumDefinitionDTO; | ||
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.enums.CImprovementStatusEnum; | ||
| 5 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.GcqrZtEnum; | ||
| 7 | +import com.qgutech.qgyun.apaas.sync.cps.enums.GwxzEnum; | ||
| 8 | +import com.qgutech.qgyun.apaas.sync.cps.enums.GwztEnum; | ||
| 9 | +import com.qgutech.qgyun.apaas.sync.cps.enums.MbghlkEnum; | ||
| 10 | +import com.qgutech.qgyun.apaas.sync.cps.enums.PjoExecZtEnum; | ||
| 11 | +import com.qgutech.qgyun.apaas.sync.cps.enums.QuarterEnum; | ||
| 12 | +import com.qgutech.qgyun.apaas.sync.cps.enums.RylbEnum; | ||
| 13 | +import com.qgutech.qgyun.apaas.sync.cps.enums.SflEnum; | ||
| 14 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WorkshopStatusEnum; | ||
| 15 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WtclfsEnum; | ||
| 16 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WtclztEnum; | ||
| 17 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WtlbEnum; | ||
| 18 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WtlyEnum; | ||
| 19 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WtxzEnum; | ||
| 20 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WzxyysEnum; | ||
| 21 | +import com.qgutech.qgyun.apaas.sync.cps.enums.ZyczdwtEnum; | ||
| 22 | +import lombok.extern.slf4j.Slf4j; | ||
| 23 | +import org.springframework.stereotype.Service; | ||
| 24 | + | ||
| 25 | +import java.lang.reflect.Method; | ||
| 26 | +import java.util.ArrayList; | ||
| 27 | +import java.util.List; | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | + * 枚举定义服务:统一对外提供项目中所有枚举的常量数组信息 | ||
| 31 | + */ | ||
| 32 | +@Slf4j | ||
| 33 | +@Service | ||
| 34 | +public class EnumService { | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 获取项目中定义的所有枚举的常量数组信息 | ||
| 38 | + * <p> | ||
| 39 | + * 每个枚举返回:枚举类名、业务标识、中文说明,以及其全部常量项(常量名 + 编号 + 描述)。 | ||
| 40 | + * | ||
| 41 | + * @return 枚举定义列表 | ||
| 42 | + */ | ||
| 43 | + public List<EnumDefinitionDTO> listAllEnumDefinitions() { | ||
| 44 | + List<EnumDefinitionDTO> list = new ArrayList<>(); | ||
| 45 | + list.add(build(RylbEnum.class, "rylb", "人员类别")); | ||
| 46 | + list.add(build(GcqrZtEnum.class, "gcqrZt", "过程确认状态")); | ||
| 47 | + list.add(build(WzxyysEnum.class, "wzxyys", "未执行原因")); | ||
| 48 | + list.add(build(DataStatusEnum.class, "dataStatus", "数据状态")); | ||
| 49 | + list.add(build(WorkshopStatusEnum.class, "workshopStatus", "车间状态")); | ||
| 50 | + list.add(build(CImprovementStatusEnum.class, "cImprovementStatus", "C类改善状态")); | ||
| 51 | + list.add(build(PjoExecZtEnum.class, "pjoExecZt", "PJO计划执行状态")); | ||
| 52 | + list.add(build(GwxzEnum.class, "gwxz", "岗位性质")); | ||
| 53 | + list.add(build(GwztEnum.class, "gwzt", "PJO工位状态")); | ||
| 54 | + list.add(build(QuarterEnum.class, "quarter", "季度")); | ||
| 55 | + list.add(build(MbghlkEnum.class, "mbghlk", "问题层级")); | ||
| 56 | + list.add(build(SflEnum.class, "sfl", "6S分类")); | ||
| 57 | + list.add(build(WtclfsEnum.class, "wtclfs", "问题处理方式")); | ||
| 58 | + list.add(build(WtclztEnum.class, "wtclzt", "问题处理状态")); | ||
| 59 | + list.add(build(WtlbEnum.class, "wtlb", "问题类别")); | ||
| 60 | + list.add(build(WtlyEnum.class, "wtly", "问题来源")); | ||
| 61 | + list.add(build(WtxzEnum.class, "wtxz", "问题性质")); | ||
| 62 | + list.add(build(ZyczdwtEnum.class, "zyczdwt", "组员存在的问题")); | ||
| 63 | + return list; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 反射构建单个枚举的定义信息,读取每个常量的 getCode()/getDesc() | ||
| 68 | + */ | ||
| 69 | + private <E extends Enum<E>> EnumDefinitionDTO build(Class<E> enumClass, String enumKey, String description) { | ||
| 70 | + EnumDefinitionDTO dto = new EnumDefinitionDTO(); | ||
| 71 | + dto.setEnumName(enumClass.getSimpleName()); | ||
| 72 | + dto.setEnumKey(enumKey); | ||
| 73 | + dto.setDescription(description); | ||
| 74 | + | ||
| 75 | + List<EnumDefinitionDTO.Item> items = new ArrayList<>(); | ||
| 76 | + for (E constant : enumClass.getEnumConstants()) { | ||
| 77 | + items.add(new EnumDefinitionDTO.Item( | ||
| 78 | + constant.name(), | ||
| 79 | + invokeStringGetter(constant, "getCode"), | ||
| 80 | + invokeStringGetter(constant, "getDesc"))); | ||
| 81 | + } | ||
| 82 | + dto.setItems(items); | ||
| 83 | + return dto; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 反射调用枚举常量的字符串 getter,方法不存在或异常时返回 null | ||
| 88 | + */ | ||
| 89 | + private String invokeStringGetter(Enum<?> constant, String getterName) { | ||
| 90 | + try { | ||
| 91 | + Method method = constant.getClass().getMethod(getterName); | ||
| 92 | + Object value = method.invoke(constant); | ||
| 93 | + return value == null ? null : value.toString(); | ||
| 94 | + } catch (Exception e) { | ||
| 95 | + log.warn("读取枚举[{}]的{}失败", constant.getClass().getSimpleName(), getterName, e); | ||
| 96 | + return null; | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | +} |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | @@ -29,7 +30,7 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(Personnel.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(Personnel.ID, id); |
| 33 | Personnel personnel = personnelMapper.selectOneByExample(example); | 34 | Personnel personnel = personnelMapper.selectOneByExample(example); |
| 34 | if (null == personnel) { | 35 | if (null == personnel) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | @@ -42,7 +43,7 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(Personnel.ID, ids); | 46 | + CorpExample.criteria(example).andIn(Personnel.ID, ids); |
| 46 | List<Personnel> personnelList = personnelMapper.selectByExample(example); | 47 | List<Personnel> personnelList = personnelMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(personnelList)) { | 48 | if (CollectionUtils.isEmpty(personnelList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,7 +66,8 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | @@ -65,7 +66,8 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<Personnel> listAll() { | 67 | public List<Personnel> listAll() { |
| 67 | 68 | ||
| 68 | - return personnelMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return personnelMapper.selectByExample(example); | ||
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | /** | 73 | /** |
| @@ -81,7 +83,7 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | @@ -81,7 +83,7 @@ public class PersonnelService extends BaseServiceImpl<Personnel> { | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | Example example = new Example(entityClass); | 85 | Example example = new Example(entityClass); |
| 84 | - example.createCriteria().andIn(Personnel.GH, ghSet); | 86 | + CorpExample.criteria(example).andIn(Personnel.GH, ghSet); |
| 85 | List<Personnel> personnelList = personnelMapper.selectByExample(example); | 87 | List<Personnel> personnelList = personnelMapper.selectByExample(example); |
| 86 | if (CollectionUtils.isEmpty(personnelList)) { | 88 | if (CollectionUtils.isEmpty(personnelList)) { |
| 87 | return new HashMap<>(0); | 89 | return new HashMap<>(0); |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class PjoBatchService extends BaseServiceImpl<PjoBatch> { | @@ -29,7 +30,7 @@ public class PjoBatchService extends BaseServiceImpl<PjoBatch> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(PjoBatch.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(PjoBatch.ID, id); |
| 33 | PjoBatch pjoBatch = pjoBatchMapper.selectOneByExample(example); | 34 | PjoBatch pjoBatch = pjoBatchMapper.selectOneByExample(example); |
| 34 | if (null == pjoBatch) { | 35 | if (null == pjoBatch) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class PjoBatchService extends BaseServiceImpl<PjoBatch> { | @@ -42,7 +43,7 @@ public class PjoBatchService extends BaseServiceImpl<PjoBatch> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(PjoBatch.ID, ids); | 46 | + CorpExample.criteria(example).andIn(PjoBatch.ID, ids); |
| 46 | List<PjoBatch> pjoBatchList = pjoBatchMapper.selectByExample(example); | 47 | List<PjoBatch> pjoBatchList = pjoBatchMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(pjoBatchList)) { | 48 | if (CollectionUtils.isEmpty(pjoBatchList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,6 +66,7 @@ public class PjoBatchService extends BaseServiceImpl<PjoBatch> { | @@ -65,6 +66,7 @@ public class PjoBatchService extends BaseServiceImpl<PjoBatch> { | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<PjoBatch> listAll() { | 67 | public List<PjoBatch> listAll() { |
| 67 | 68 | ||
| 68 | - return pjoBatchMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return pjoBatchMapper.selectByExample(example); | ||
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| @@ -26,6 +26,7 @@ import org.springframework.beans.BeanUtils; | @@ -26,6 +26,7 @@ import org.springframework.beans.BeanUtils; | ||
| 26 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
| 27 | import org.springframework.transaction.annotation.Transactional; | 27 | import org.springframework.transaction.annotation.Transactional; |
| 28 | import org.springframework.util.Assert; | 28 | import org.springframework.util.Assert; |
| 29 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 29 | import tk.mybatis.mapper.entity.Example; | 30 | import tk.mybatis.mapper.entity.Example; |
| 30 | 31 | ||
| 31 | import javax.annotation.Resource; | 32 | import javax.annotation.Resource; |
| @@ -69,7 +70,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | @@ -69,7 +70,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | ||
| 69 | Assert.hasLength(id, "id is empty!"); | 70 | Assert.hasLength(id, "id is empty!"); |
| 70 | 71 | ||
| 71 | Example example = new Example(entityClass); | 72 | Example example = new Example(entityClass); |
| 72 | - example.createCriteria().andEqualTo(PjoExec.ID, id); | 73 | + CorpExample.criteria(example).andEqualTo(PjoExec.ID, id); |
| 73 | PjoExec pjoExec = pjoExecMapper.selectOneByExample(example); | 74 | PjoExec pjoExec = pjoExecMapper.selectOneByExample(example); |
| 74 | if (null == pjoExec) { | 75 | if (null == pjoExec) { |
| 75 | throw new BoException(BoErrorCode.DATA_ERROR); | 76 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -82,7 +83,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | @@ -82,7 +83,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | ||
| 82 | Assert.notEmpty(ids, "ids is empty!"); | 83 | Assert.notEmpty(ids, "ids is empty!"); |
| 83 | 84 | ||
| 84 | Example example = new Example(entityClass); | 85 | Example example = new Example(entityClass); |
| 85 | - example.createCriteria().andIn(PjoExec.ID, ids); | 86 | + CorpExample.criteria(example).andIn(PjoExec.ID, ids); |
| 86 | List<PjoExec> pjoExecList = pjoExecMapper.selectByExample(example); | 87 | List<PjoExec> pjoExecList = pjoExecMapper.selectByExample(example); |
| 87 | if (CollectionUtils.isEmpty(pjoExecList)) { | 88 | if (CollectionUtils.isEmpty(pjoExecList)) { |
| 88 | return new ArrayList<>(0); | 89 | return new ArrayList<>(0); |
| @@ -105,7 +106,8 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | @@ -105,7 +106,8 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | ||
| 105 | @Transactional(readOnly = true) | 106 | @Transactional(readOnly = true) |
| 106 | public List<PjoExec> listAll() { | 107 | public List<PjoExec> listAll() { |
| 107 | 108 | ||
| 108 | - return pjoExecMapper.selectAll(); | 109 | + Example example = CorpExample.ofCorp(entityClass); |
| 110 | + return pjoExecMapper.selectByExample(example); | ||
| 109 | } | 111 | } |
| 110 | 112 | ||
| 111 | /** | 113 | /** |
| @@ -136,7 +138,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | @@ -136,7 +138,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | ||
| 136 | 138 | ||
| 137 | // 2. 查询 PJO 开展日期在范围内的记录 | 139 | // 2. 查询 PJO 开展日期在范围内的记录 |
| 138 | Example example = new Example(PjoExec.class); | 140 | Example example = new Example(PjoExec.class); |
| 139 | - example.createCriteria().andBetween(PjoExec.QKXDWK, start, end); | 141 | + CorpExample.criteria(example).andBetween(PjoExec.QKXDWK, start, end); |
| 140 | List<PjoExec> execList = pjoExecMapper.selectByExample(example); | 142 | List<PjoExec> execList = pjoExecMapper.selectByExample(example); |
| 141 | 143 | ||
| 142 | // 3. 计算整体汇总 | 144 | // 3. 计算整体汇总 |
| @@ -314,7 +316,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | @@ -314,7 +316,7 @@ public class PjoExecService extends BaseServiceImpl<PjoExec> { | ||
| 314 | 316 | ||
| 315 | // 2. 构建查询条件(PJO 开展日期范围必带,其余条件非空才追加) | 317 | // 2. 构建查询条件(PJO 开展日期范围必带,其余条件非空才追加) |
| 316 | Example example = new Example(PjoExec.class); | 318 | Example example = new Example(PjoExec.class); |
| 317 | - Example.Criteria criteria = example.createCriteria() | 319 | + Example.Criteria criteria = CorpExample.criteria(example) |
| 318 | .andBetween(PjoExec.QKXDWK, start, end); | 320 | .andBetween(PjoExec.QKXDWK, start, end); |
| 319 | if (StringUtils.isNotBlank(cj)) { | 321 | if (StringUtils.isNotBlank(cj)) { |
| 320 | criteria.andEqualTo(PjoExec.CJ, cj); | 322 | criteria.andEqualTo(PjoExec.CJ, cj); |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class PjoWorkstationExecService extends BaseServiceImpl<PjoWorkstationExe | @@ -29,7 +30,7 @@ public class PjoWorkstationExecService extends BaseServiceImpl<PjoWorkstationExe | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(PjoWorkstationExec.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(PjoWorkstationExec.ID, id); |
| 33 | PjoWorkstationExec pjoWorkstationExec = pjoWorkstationExecMapper.selectOneByExample(example); | 34 | PjoWorkstationExec pjoWorkstationExec = pjoWorkstationExecMapper.selectOneByExample(example); |
| 34 | if (null == pjoWorkstationExec) { | 35 | if (null == pjoWorkstationExec) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class PjoWorkstationExecService extends BaseServiceImpl<PjoWorkstationExe | @@ -42,7 +43,7 @@ public class PjoWorkstationExecService extends BaseServiceImpl<PjoWorkstationExe | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(PjoWorkstationExec.ID, ids); | 46 | + CorpExample.criteria(example).andIn(PjoWorkstationExec.ID, ids); |
| 46 | List<PjoWorkstationExec> pjoWorkstationExecList = pjoWorkstationExecMapper.selectByExample(example); | 47 | List<PjoWorkstationExec> pjoWorkstationExecList = pjoWorkstationExecMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(pjoWorkstationExecList)) { | 48 | if (CollectionUtils.isEmpty(pjoWorkstationExecList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,6 +66,7 @@ public class PjoWorkstationExecService extends BaseServiceImpl<PjoWorkstationExe | @@ -65,6 +66,7 @@ public class PjoWorkstationExecService extends BaseServiceImpl<PjoWorkstationExe | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<PjoWorkstationExec> listAll() { | 67 | public List<PjoWorkstationExec> listAll() { |
| 67 | 68 | ||
| 68 | - return pjoWorkstationExecMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return pjoWorkstationExecMapper.selectByExample(example); | ||
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| @@ -2,6 +2,7 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -2,6 +2,7 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 2 | 2 | ||
| 3 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 3 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 5 | +import com.qgutech.qgyun.apaas.sync.constant.Constant; | ||
| 5 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecDetailDTO; | 6 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecDetailDTO; |
| 6 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecSummaryDTO; | 7 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecSummaryDTO; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.enums.GcqrZtEnum; | 8 | import com.qgutech.qgyun.apaas.sync.cps.enums.GcqrZtEnum; |
| @@ -17,14 +18,20 @@ import com.qgutech.qgyun.apaas.sync.cps.model.Shift; | @@ -17,14 +18,20 @@ import com.qgutech.qgyun.apaas.sync.cps.model.Shift; | ||
| 17 | import com.qgutech.qgyun.apaas.sync.cps.model.Team; | 18 | import com.qgutech.qgyun.apaas.sync.cps.model.Team; |
| 18 | import com.qgutech.qgyun.apaas.sync.cps.model.Workshop; | 19 | import com.qgutech.qgyun.apaas.sync.cps.model.Workshop; |
| 19 | import com.qgutech.qgyun.apaas.sync.cps.model.XtLine; | 20 | import com.qgutech.qgyun.apaas.sync.cps.model.XtLine; |
| 21 | +import com.qgutech.qgyun.apaas.sync.hr.model.AttendanceRecord; | ||
| 22 | +import com.qgutech.qgyun.apaas.sync.hr.service.AttendanceRecordService; | ||
| 23 | +import com.qgutech.qgyun.apaas.sync.org.model.UcUser; | ||
| 24 | +import com.qgutech.qgyun.apaas.sync.org.service.UcUserService; | ||
| 20 | import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils; | 25 | import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils; |
| 21 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 26 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 27 | +import lombok.extern.slf4j.Slf4j; | ||
| 22 | import org.apache.commons.collections4.CollectionUtils; | 28 | import org.apache.commons.collections4.CollectionUtils; |
| 23 | import org.apache.commons.lang3.StringUtils; | 29 | import org.apache.commons.lang3.StringUtils; |
| 24 | import org.springframework.beans.BeanUtils; | 30 | import org.springframework.beans.BeanUtils; |
| 25 | import org.springframework.stereotype.Service; | 31 | import org.springframework.stereotype.Service; |
| 26 | import org.springframework.transaction.annotation.Transactional; | 32 | import org.springframework.transaction.annotation.Transactional; |
| 27 | import org.springframework.util.Assert; | 33 | import org.springframework.util.Assert; |
| 34 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 28 | import tk.mybatis.mapper.entity.Example; | 35 | import tk.mybatis.mapper.entity.Example; |
| 29 | 36 | ||
| 30 | import javax.annotation.Resource; | 37 | import javax.annotation.Resource; |
| @@ -37,6 +44,7 @@ import java.util.stream.Collectors; | @@ -37,6 +44,7 @@ import java.util.stream.Collectors; | ||
| 37 | * ProcessConfirmExec 服务 | 44 | * ProcessConfirmExec 服务 |
| 38 | */ | 45 | */ |
| 39 | @Service | 46 | @Service |
| 47 | +@Slf4j | ||
| 40 | public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExec> { | 48 | public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExec> { |
| 41 | 49 | ||
| 42 | @Resource | 50 | @Resource |
| @@ -66,12 +74,18 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | @@ -66,12 +74,18 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | ||
| 66 | @Resource | 74 | @Resource |
| 67 | private ProcessConfirmPersonnelService processConfirmPersonnelService; | 75 | private ProcessConfirmPersonnelService processConfirmPersonnelService; |
| 68 | 76 | ||
| 77 | + @Resource | ||
| 78 | + private AttendanceRecordService attendanceRecordService; | ||
| 79 | + | ||
| 80 | + @Resource | ||
| 81 | + private UcUserService ucUserService; | ||
| 82 | + | ||
| 69 | @Transactional(readOnly = true) | 83 | @Transactional(readOnly = true) |
| 70 | public ProcessConfirmExec getById(String id) { | 84 | public ProcessConfirmExec getById(String id) { |
| 71 | Assert.hasLength(id, "id is empty!"); | 85 | Assert.hasLength(id, "id is empty!"); |
| 72 | 86 | ||
| 73 | Example example = new Example(entityClass); | 87 | Example example = new Example(entityClass); |
| 74 | - example.createCriteria().andEqualTo(ProcessConfirmExec.ID, id); | 88 | + CorpExample.criteria(example).andEqualTo(ProcessConfirmExec.ID, id); |
| 75 | ProcessConfirmExec processConfirmExec = processConfirmExecMapper.selectOneByExample(example); | 89 | ProcessConfirmExec processConfirmExec = processConfirmExecMapper.selectOneByExample(example); |
| 76 | if (null == processConfirmExec) { | 90 | if (null == processConfirmExec) { |
| 77 | throw new BoException(BoErrorCode.DATA_ERROR); | 91 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -84,7 +98,7 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | @@ -84,7 +98,7 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | ||
| 84 | Assert.notEmpty(ids, "ids is empty!"); | 98 | Assert.notEmpty(ids, "ids is empty!"); |
| 85 | 99 | ||
| 86 | Example example = new Example(entityClass); | 100 | Example example = new Example(entityClass); |
| 87 | - example.createCriteria().andIn(ProcessConfirmExec.ID, ids); | 101 | + CorpExample.criteria(example).andIn(ProcessConfirmExec.ID, ids); |
| 88 | List<ProcessConfirmExec> processConfirmExecList = processConfirmExecMapper.selectByExample(example); | 102 | List<ProcessConfirmExec> processConfirmExecList = processConfirmExecMapper.selectByExample(example); |
| 89 | if (CollectionUtils.isEmpty(processConfirmExecList)) { | 103 | if (CollectionUtils.isEmpty(processConfirmExecList)) { |
| 90 | return new ArrayList<>(0); | 104 | return new ArrayList<>(0); |
| @@ -107,7 +121,8 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | @@ -107,7 +121,8 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | ||
| 107 | @Transactional(readOnly = true) | 121 | @Transactional(readOnly = true) |
| 108 | public List<ProcessConfirmExec> listAll() { | 122 | public List<ProcessConfirmExec> listAll() { |
| 109 | 123 | ||
| 110 | - return processConfirmExecMapper.selectAll(); | 124 | + Example example = CorpExample.ofCorp(entityClass); |
| 125 | + return processConfirmExecMapper.selectByExample(example); | ||
| 111 | } | 126 | } |
| 112 | 127 | ||
| 113 | /** | 128 | /** |
| @@ -136,7 +151,7 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | @@ -136,7 +151,7 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | ||
| 136 | 151 | ||
| 137 | // 2. 查询活动执行日期在范围内的过程确认执行记录 | 152 | // 2. 查询活动执行日期在范围内的过程确认执行记录 |
| 138 | Example example = new Example(ProcessConfirmExec.class); | 153 | Example example = new Example(ProcessConfirmExec.class); |
| 139 | - example.createCriteria() | 154 | + CorpExample.criteria(example) |
| 140 | .andBetween(ProcessConfirmExec.HDZXRQ, start, end); | 155 | .andBetween(ProcessConfirmExec.HDZXRQ, start, end); |
| 141 | List<ProcessConfirmExec> execList = processConfirmExecMapper.selectByExample(example); | 156 | List<ProcessConfirmExec> execList = processConfirmExecMapper.selectByExample(example); |
| 142 | 157 | ||
| @@ -308,7 +323,7 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | @@ -308,7 +323,7 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | ||
| 308 | 323 | ||
| 309 | // 2. 构建查询条件(活动执行日期范围必带,其余条件非空才追加) | 324 | // 2. 构建查询条件(活动执行日期范围必带,其余条件非空才追加) |
| 310 | Example example = new Example(ProcessConfirmExec.class); | 325 | Example example = new Example(ProcessConfirmExec.class); |
| 311 | - Example.Criteria criteria = example.createCriteria() | 326 | + Example.Criteria criteria = CorpExample.criteria(example) |
| 312 | .andBetween(ProcessConfirmExec.HDZXRQ, start, end); | 327 | .andBetween(ProcessConfirmExec.HDZXRQ, start, end); |
| 313 | if (StringUtils.isNotBlank(dw)) { | 328 | if (StringUtils.isNotBlank(dw)) { |
| 314 | criteria.andEqualTo(ProcessConfirmExec.DW, dw); | 329 | criteria.andEqualTo(ProcessConfirmExec.DW, dw); |
| @@ -462,6 +477,188 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | @@ -462,6 +477,188 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe | ||
| 462 | } | 477 | } |
| 463 | 478 | ||
| 464 | /** | 479 | /** |
| 480 | + * 仅周一至周五生成过程确认执行计划的人员类别:经理、高级经理、专家、主管。 | ||
| 481 | + * 其余人员类别(区长、班长、一般员工)不受工作日限制,每天都生成。 | ||
| 482 | + */ | ||
| 483 | + private static final Set<String> WEEKDAY_ONLY_RYLB = new HashSet<>(Arrays.asList( | ||
| 484 | + RylbEnum.GAOJI_JINGLI.getCode(), | ||
| 485 | + RylbEnum.JINGLI.getCode(), | ||
| 486 | + RylbEnum.ZHUGUAN.getCode(), | ||
| 487 | + RylbEnum.ZHUANJIA.getCode())); | ||
| 488 | + | ||
| 489 | + /** | ||
| 490 | + * 根据当天考勤记录自动生成过程确认执行计划 | ||
| 491 | + * <p> | ||
| 492 | + * 业务规则: | ||
| 493 | + * <ul> | ||
| 494 | + * <li>查询当天的考勤记录,考勤工号对应组织用户登录账号以确认唯一人员;</li> | ||
| 495 | + * <li>仅对同时在过程确认维护人员列表(启用)中的人员生成计划;</li> | ||
| 496 | + * <li>有考勤记录的才生成,没有的不生成;</li> | ||
| 497 | + * <li>当天该人员已有计划的不再生成;</li> | ||
| 498 | + * <li>计划过期时间默认为考勤上班打卡时间往后 24 小时;</li> | ||
| 499 | + * <li>按人员类别区分生成日:经理、高级经理、专家、主管仅在周一至周五生成;区长、班长、一般员工不受此限制,每天都生成。</li> | ||
| 500 | + * </ul> | ||
| 501 | + * @param startTime 开始时间 yyyy-MM-dd | ||
| 502 | + * @param endTime 结束时间 yyyy-MM-dd | ||
| 503 | + * @return 本次新生成的过程确认执行计划数量 | ||
| 504 | + */ | ||
| 505 | + @Transactional | ||
| 506 | + public int autoCreateProcessConfirmExecByDailySign(String startTime, String endTime) { | ||
| 507 | + | ||
| 508 | + // 1. 查询当天的考勤记录(入参为空默认当天开始~结束时间) | ||
| 509 | + List<AttendanceRecord> attendanceList = attendanceRecordService.listBySignDateRange(startTime, endTime); | ||
| 510 | + if (CollectionUtils.isEmpty(attendanceList)) { | ||
| 511 | + log.info("当天无考勤记录,不生成过程确认执行计划"); | ||
| 512 | + return 0; | ||
| 513 | + } | ||
| 514 | + | ||
| 515 | + // 2. 提取考勤工号,批量查询组织用户(工号对应登录账号),确认唯一人员 | ||
| 516 | + Set<String> employeeCodes = attendanceList.stream() | ||
| 517 | + .map(AttendanceRecord::getEmployeeCode) | ||
| 518 | + .filter(StringUtils::isNotBlank) | ||
| 519 | + .collect(Collectors.toSet()); | ||
| 520 | + Map<String, UcUser> userMap = ucUserService.mapByLoginNames(employeeCodes); | ||
| 521 | + if (userMap.isEmpty()) { | ||
| 522 | + log.info("考勤工号未匹配到任何组织用户,不生成过程确认执行计划"); | ||
| 523 | + return 0; | ||
| 524 | + } | ||
| 525 | + | ||
| 526 | + // 3. 根据组织用户id批量查询启用状态的过程确认维护人员 | ||
| 527 | + Set<String> userIds = userMap.values().stream() | ||
| 528 | + .map(UcUser::getId) | ||
| 529 | + .collect(Collectors.toSet()); | ||
| 530 | + Map<String, ProcessConfirmPersonnel> personnelMap = processConfirmPersonnelService.mapEnabledByRyIds(userIds); | ||
| 531 | + if (personnelMap.isEmpty()) { | ||
| 532 | + log.info("考勤人员均不在启用状态的过程确认维护人员列表中,不生成过程确认执行计划"); | ||
| 533 | + return 0; | ||
| 534 | + } | ||
| 535 | + | ||
| 536 | + Date start = DateDealUtils.parseStartTimeOrCurrentDayStart(startTime); | ||
| 537 | + Date end = DateDealUtils.parseEndTimeOrCurrentDayEnd(endTime); | ||
| 538 | + // 4. 查询当天已存在的过程确认执行计划,避免重复生成 | ||
| 539 | + Set<String> existingPersonnelIds = listExistingPlanPersonnelIds(start, end); | ||
| 540 | + | ||
| 541 | + // 5. 遍历考勤记录,组装待生成的执行计划 | ||
| 542 | + // 经理、高级经理、专家、主管仅在周一至周五生成,先判断计划日期是否为工作日 | ||
| 543 | + boolean weekday = isWeekday(start); | ||
| 544 | + List<ProcessConfirmExec> toCreateList = new ArrayList<>(); | ||
| 545 | + Set<String> handledPersonnelIds = new HashSet<>(); | ||
| 546 | + for (AttendanceRecord attendance : attendanceList) { | ||
| 547 | + String employeeCode = attendance.getEmployeeCode(); | ||
| 548 | + if (StringUtils.isBlank(employeeCode)) { | ||
| 549 | + continue; | ||
| 550 | + } | ||
| 551 | + // 工号对应组织用户登录账号,确认唯一人员 | ||
| 552 | + UcUser user = userMap.get(employeeCode); | ||
| 553 | + if (user == null) { | ||
| 554 | + continue; | ||
| 555 | + } | ||
| 556 | + // 该人员需在过程确认维护人员列表中 | ||
| 557 | + ProcessConfirmPersonnel personnel = personnelMap.get(user.getId()); | ||
| 558 | + if (personnel == null) { | ||
| 559 | + continue; | ||
| 560 | + } | ||
| 561 | + // 经理、高级经理、专家、主管仅在周一至周五生成;区长、班长、一般员工不受限制 | ||
| 562 | + if (!weekday && WEEKDAY_ONLY_RYLB.contains(personnel.getRylb())) { | ||
| 563 | + continue; | ||
| 564 | + } | ||
| 565 | + // 当天已有计划的不再生成(含本次已处理的,避免同一人多条考勤重复生成) | ||
| 566 | + if (existingPersonnelIds.contains(personnel.getId()) | ||
| 567 | + || !handledPersonnelIds.add(personnel.getId())) { | ||
| 568 | + continue; | ||
| 569 | + } | ||
| 570 | + toCreateList.add(buildDailyExec(attendance, user, personnel, start)); | ||
| 571 | + } | ||
| 572 | + | ||
| 573 | + if (CollectionUtils.isEmpty(toCreateList)) { | ||
| 574 | + log.info("当天考勤人员均已存在过程确认执行计划,无需生成"); | ||
| 575 | + return 0; | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + // 6. 批量保存 | ||
| 579 | + batchInsert(toCreateList); | ||
| 580 | + log.info("根据当天考勤记录生成过程确认执行计划 {} 条", toCreateList.size()); | ||
| 581 | + return toCreateList.size(); | ||
| 582 | + } | ||
| 583 | + | ||
| 584 | + /** | ||
| 585 | + * 查询指定活动执行日期范围内已存在过程确认执行计划的执行人员id集合 | ||
| 586 | + */ | ||
| 587 | + private Set<String> listExistingPlanPersonnelIds(Date start, Date end) { | ||
| 588 | + Example example = new Example(ProcessConfirmExec.class); | ||
| 589 | + CorpExample.criteria(example).andBetween(ProcessConfirmExec.HDZXRQ, start, end); | ||
| 590 | + List<ProcessConfirmExec> execList = processConfirmExecMapper.selectByExample(example); | ||
| 591 | + if (CollectionUtils.isEmpty(execList)) { | ||
| 592 | + return new HashSet<>(0); | ||
| 593 | + } | ||
| 594 | + return execList.stream() | ||
| 595 | + .map(ProcessConfirmExec::getZxry) | ||
| 596 | + .filter(StringUtils::isNotBlank) | ||
| 597 | + .collect(Collectors.toSet()); | ||
| 598 | + } | ||
| 599 | + | ||
| 600 | + /** | ||
| 601 | + * 根据考勤记录、组织用户与过程确认维护人员组装当天的过程确认执行计划 | ||
| 602 | + */ | ||
| 603 | + private ProcessConfirmExec buildDailyExec(AttendanceRecord attendance, UcUser user, | ||
| 604 | + ProcessConfirmPersonnel personnel, Date dayStart) { | ||
| 605 | + ProcessConfirmExec exec = new ProcessConfirmExec(); | ||
| 606 | + // 活动执行日期取当天 | ||
| 607 | + exec.setHdzxrq(dayStart); | ||
| 608 | + // 过程确认计划人员 | ||
| 609 | + exec.setGcqrjhry(personnel.getId()); | ||
| 610 | + // 执行人员为考勤对应的组织用户 | ||
| 611 | + exec.setZxry(user.getId()); | ||
| 612 | + // 工号取考勤记录工号 | ||
| 613 | + exec.setGh(attendance.getEmployeeCode()); | ||
| 614 | + // 人员类别及组织维度信息取自过程确认维护人员 | ||
| 615 | + exec.setRylb(personnel.getRylb()); | ||
| 616 | + exec.setDw(personnel.getSsdw()); | ||
| 617 | + exec.setSz(personnel.getSssz()); | ||
| 618 | + exec.setQy(personnel.getSsqy()); | ||
| 619 | + exec.setBz(personnel.getSsbz()); | ||
| 620 | + exec.setXt(personnel.getSsxt()); | ||
| 621 | + // 过期时间默认为考勤上班打卡时间往后 24 小时 | ||
| 622 | + exec.setGqsj(resolveExpireTime(attendance)); | ||
| 623 | + // 初始状态为待确认,未执行 | ||
| 624 | + exec.setZt(GcqrZtEnum.DAIQUEREN.getCode()); | ||
| 625 | + exec.setSfyzx(Boolean.FALSE); | ||
| 626 | + exec.setCorpCode(Constant.DEFAULT_CORP_CODE); | ||
| 627 | + return exec; | ||
| 628 | + } | ||
| 629 | + | ||
| 630 | + /** | ||
| 631 | + * 计算计划过期时间:考勤上班打卡时间往后 24 小时; | ||
| 632 | + * 上班打卡时间为空时依次回退到考勤日期、当前时间 | ||
| 633 | + */ | ||
| 634 | + private Date resolveExpireTime(AttendanceRecord attendance) { | ||
| 635 | + Date base = attendance.getClockInTime(); | ||
| 636 | + if (base == null) { | ||
| 637 | + base = attendance.getSignDate(); | ||
| 638 | + } | ||
| 639 | + if (base == null) { | ||
| 640 | + base = new Date(); | ||
| 641 | + } | ||
| 642 | + Calendar cal = Calendar.getInstance(); | ||
| 643 | + cal.setTime(base); | ||
| 644 | + cal.add(Calendar.HOUR_OF_DAY, 24); | ||
| 645 | + return cal.getTime(); | ||
| 646 | + } | ||
| 647 | + | ||
| 648 | + /** | ||
| 649 | + * 判断日期是否为工作日(周一至周五) | ||
| 650 | + * | ||
| 651 | + * @param date 待判断日期 | ||
| 652 | + * @return true-工作日;false-周六或周日 | ||
| 653 | + */ | ||
| 654 | + private boolean isWeekday(Date date) { | ||
| 655 | + Calendar cal = Calendar.getInstance(); | ||
| 656 | + cal.setTime(date); | ||
| 657 | + int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); | ||
| 658 | + return dayOfWeek != Calendar.SATURDAY && dayOfWeek != Calendar.SUNDAY; | ||
| 659 | + } | ||
| 660 | + | ||
| 661 | + /** | ||
| 465 | * 保留两位小数,四舍五入 | 662 | * 保留两位小数,四舍五入 |
| 466 | */ | 663 | */ |
| 467 | private double round2(double value) { | 664 | private double round2(double value) { |
| @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.ProcessConfirmPersonnelMapper; | 7 | import com.qgutech.qgyun.apaas.sync.cps.mapper.ProcessConfirmPersonnelMapper; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.model.ProcessConfirmPersonnel; | 8 | import com.qgutech.qgyun.apaas.sync.cps.model.ProcessConfirmPersonnel; |
| 8 | import org.apache.commons.collections4.CollectionUtils; | 9 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class ProcessConfirmPersonnelService extends BaseServiceImpl<ProcessConfi | @@ -29,7 +31,7 @@ public class ProcessConfirmPersonnelService extends BaseServiceImpl<ProcessConfi | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(ProcessConfirmPersonnel.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(ProcessConfirmPersonnel.ID, id); |
| 33 | ProcessConfirmPersonnel processConfirmPersonnel = processConfirmPersonnelMapper.selectOneByExample(example); | 35 | ProcessConfirmPersonnel processConfirmPersonnel = processConfirmPersonnelMapper.selectOneByExample(example); |
| 34 | if (null == processConfirmPersonnel) { | 36 | if (null == processConfirmPersonnel) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class ProcessConfirmPersonnelService extends BaseServiceImpl<ProcessConfi | @@ -42,7 +44,7 @@ public class ProcessConfirmPersonnelService extends BaseServiceImpl<ProcessConfi | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(ProcessConfirmPersonnel.ID, ids); | 47 | + CorpExample.criteria(example).andIn(ProcessConfirmPersonnel.ID, ids); |
| 46 | List<ProcessConfirmPersonnel> processConfirmPersonnelList = processConfirmPersonnelMapper.selectByExample(example); | 48 | List<ProcessConfirmPersonnel> processConfirmPersonnelList = processConfirmPersonnelMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(processConfirmPersonnelList)) { | 49 | if (CollectionUtils.isEmpty(processConfirmPersonnelList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,49 @@ public class ProcessConfirmPersonnelService extends BaseServiceImpl<ProcessConfi | @@ -65,6 +67,49 @@ public class ProcessConfirmPersonnelService extends BaseServiceImpl<ProcessConfi | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<ProcessConfirmPersonnel> listAll() { | 68 | public List<ProcessConfirmPersonnel> listAll() { |
| 67 | 69 | ||
| 68 | - return processConfirmPersonnelMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return processConfirmPersonnelMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 根据人员(组织用户id)集合批量查询启用状态的过程确认维护人员 | ||
| 76 | + * | ||
| 77 | + * @param ryIds 人员(组织用户id)集合 | ||
| 78 | + * @return 启用状态的过程确认维护人员列表,无匹配时返回空列表 | ||
| 79 | + */ | ||
| 80 | + @Transactional(readOnly = true) | ||
| 81 | + public List<ProcessConfirmPersonnel> listEnabledByRyIds(Collection<String> ryIds) { | ||
| 82 | + if (CollectionUtils.isEmpty(ryIds)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + Example example = new Example(entityClass); | ||
| 87 | + CorpExample.criteria(example) | ||
| 88 | + .andIn(ProcessConfirmPersonnel.RY, ryIds) | ||
| 89 | + .andEqualTo(ProcessConfirmPersonnel.ZT, DataStatusEnum.QIYONG.getCode()); | ||
| 90 | + List<ProcessConfirmPersonnel> processConfirmPersonnelList = processConfirmPersonnelMapper.selectByExample(example); | ||
| 91 | + if (CollectionUtils.isEmpty(processConfirmPersonnelList)) { | ||
| 92 | + return new ArrayList<>(0); | ||
| 93 | + } | ||
| 94 | + return processConfirmPersonnelList; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + /** | ||
| 98 | + * 根据人员(组织用户id)集合批量查询启用状态的过程确认维护人员,构建 ry -> ProcessConfirmPersonnel 映射 | ||
| 99 | + * | ||
| 100 | + * @param ryIds 人员(组织用户id)集合 | ||
| 101 | + * @return ry 到过程确认维护人员的映射,无匹配时返回空 Map | ||
| 102 | + */ | ||
| 103 | + @Transactional(readOnly = true) | ||
| 104 | + public Map<String, ProcessConfirmPersonnel> mapEnabledByRyIds(Collection<String> ryIds) { | ||
| 105 | + List<ProcessConfirmPersonnel> processConfirmPersonnelList = listEnabledByRyIds(ryIds); | ||
| 106 | + if (CollectionUtils.isEmpty(processConfirmPersonnelList)) { | ||
| 107 | + return new HashMap<>(0); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + return processConfirmPersonnelList.stream() | ||
| 111 | + .filter(item -> item.getRy() != null) | ||
| 112 | + .collect(Collectors.toMap(ProcessConfirmPersonnel::getRy, | ||
| 113 | + processConfirmPersonnel -> processConfirmPersonnel, (existing, replacement) -> existing)); | ||
| 69 | } | 114 | } |
| 70 | } | 115 | } |
| @@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils; | ||
| 12 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 13 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; |
| 14 | import org.springframework.util.Assert; | 14 | import org.springframework.util.Assert; |
| 15 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 15 | import tk.mybatis.mapper.entity.Example; | 16 | import tk.mybatis.mapper.entity.Example; |
| 16 | 17 | ||
| 17 | import javax.annotation.Resource; | 18 | import javax.annotation.Resource; |
| @@ -32,7 +33,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | @@ -32,7 +33,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | ||
| 32 | Assert.hasLength(id, "id is empty!"); | 33 | Assert.hasLength(id, "id is empty!"); |
| 33 | 34 | ||
| 34 | Example example = new Example(entityClass); | 35 | Example example = new Example(entityClass); |
| 35 | - example.createCriteria().andEqualTo(QuarterPersonnel.ID, id); | 36 | + CorpExample.criteria(example).andEqualTo(QuarterPersonnel.ID, id); |
| 36 | QuarterPersonnel quarterPersonnel = quarterPersonnelMapper.selectOneByExample(example); | 37 | QuarterPersonnel quarterPersonnel = quarterPersonnelMapper.selectOneByExample(example); |
| 37 | if (null == quarterPersonnel) { | 38 | if (null == quarterPersonnel) { |
| 38 | throw new BoException(BoErrorCode.DATA_ERROR); | 39 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -45,7 +46,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | @@ -45,7 +46,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | ||
| 45 | Assert.notEmpty(ids, "ids is empty!"); | 46 | Assert.notEmpty(ids, "ids is empty!"); |
| 46 | 47 | ||
| 47 | Example example = new Example(entityClass); | 48 | Example example = new Example(entityClass); |
| 48 | - example.createCriteria().andIn(QuarterPersonnel.ID, ids); | 49 | + CorpExample.criteria(example).andIn(QuarterPersonnel.ID, ids); |
| 49 | List<QuarterPersonnel> quarterPersonnelList = quarterPersonnelMapper.selectByExample(example); | 50 | List<QuarterPersonnel> quarterPersonnelList = quarterPersonnelMapper.selectByExample(example); |
| 50 | if (CollectionUtils.isEmpty(quarterPersonnelList)) { | 51 | if (CollectionUtils.isEmpty(quarterPersonnelList)) { |
| 51 | return new ArrayList<>(0); | 52 | return new ArrayList<>(0); |
| @@ -68,7 +69,8 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | @@ -68,7 +69,8 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | ||
| 68 | @Transactional(readOnly = true) | 69 | @Transactional(readOnly = true) |
| 69 | public List<QuarterPersonnel> listAll() { | 70 | public List<QuarterPersonnel> listAll() { |
| 70 | 71 | ||
| 71 | - return quarterPersonnelMapper.selectAll(); | 72 | + Example example = CorpExample.ofCorp(entityClass); |
| 73 | + return quarterPersonnelMapper.selectByExample(example); | ||
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | /** | 76 | /** |
| @@ -88,7 +90,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | @@ -88,7 +90,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | ||
| 88 | Date yearStartTime = DateDealUtils.parseYearStartTime(queryYear); | 90 | Date yearStartTime = DateDealUtils.parseYearStartTime(queryYear); |
| 89 | Date yearEndTime = DateDealUtils.parseYearEndTime(queryYear); | 91 | Date yearEndTime = DateDealUtils.parseYearEndTime(queryYear); |
| 90 | Example example = new Example(entityClass); | 92 | Example example = new Example(entityClass); |
| 91 | - example.createCriteria() | 93 | + CorpExample.criteria(example) |
| 92 | .andBetween(QuarterPersonnel.YEAR, yearStartTime, yearEndTime) | 94 | .andBetween(QuarterPersonnel.YEAR, yearStartTime, yearEndTime) |
| 93 | .andEqualTo(QuarterPersonnel.JDXX, quarter.getCode()); | 95 | .andEqualTo(QuarterPersonnel.JDXX, quarter.getCode()); |
| 94 | List<QuarterPersonnel> quarterPersonnelList = quarterPersonnelMapper.selectByExample(example); | 96 | List<QuarterPersonnel> quarterPersonnelList = quarterPersonnelMapper.selectByExample(example); |
| @@ -120,7 +122,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | @@ -120,7 +122,7 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { | ||
| 120 | 122 | ||
| 121 | // 3. 查询该年份季度该室组下的季度人员信息 | 123 | // 3. 查询该年份季度该室组下的季度人员信息 |
| 122 | Example example = new Example(entityClass); | 124 | Example example = new Example(entityClass); |
| 123 | - example.createCriteria() | 125 | + CorpExample.criteria(example) |
| 124 | .andBetween(QuarterPersonnel.YEAR, yearStartTime, yearEndTime) | 126 | .andBetween(QuarterPersonnel.YEAR, yearStartTime, yearEndTime) |
| 125 | .andEqualTo(QuarterPersonnel.JDXX, quarter.getCode()) | 127 | .andEqualTo(QuarterPersonnel.JDXX, quarter.getCode()) |
| 126 | .andEqualTo(QuarterPersonnel.SHSZ, roomGroupId); | 128 | .andEqualTo(QuarterPersonnel.SHSZ, roomGroupId); |
| @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.RoomGroupMapper; | 7 | import com.qgutech.qgyun.apaas.sync.cps.mapper.RoomGroupMapper; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.model.RoomGroup; | 8 | import com.qgutech.qgyun.apaas.sync.cps.model.RoomGroup; |
| 8 | import org.apache.commons.collections4.CollectionUtils; | 9 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> { | @@ -29,7 +31,7 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(RoomGroup.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(RoomGroup.ID, id); |
| 33 | RoomGroup roomGroup = roomGroupMapper.selectOneByExample(example); | 35 | RoomGroup roomGroup = roomGroupMapper.selectOneByExample(example); |
| 34 | if (null == roomGroup) { | 36 | if (null == roomGroup) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> { | @@ -42,7 +44,7 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(RoomGroup.ID, ids); | 47 | + CorpExample.criteria(example).andIn(RoomGroup.ID, ids); |
| 46 | List<RoomGroup> roomGroupList = roomGroupMapper.selectByExample(example); | 48 | List<RoomGroup> roomGroupList = roomGroupMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(roomGroupList)) { | 49 | if (CollectionUtils.isEmpty(roomGroupList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,21 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> { | @@ -65,6 +67,21 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> { | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<RoomGroup> listAll() { | 68 | public List<RoomGroup> listAll() { |
| 67 | 69 | ||
| 68 | - return roomGroupMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return roomGroupMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询所有启用状态的室组信息列表 | ||
| 76 | + */ | ||
| 77 | + @Transactional(readOnly = true) | ||
| 78 | + public List<RoomGroup> listEnabled() { | ||
| 79 | + Example example = new Example(entityClass); | ||
| 80 | + CorpExample.criteria(example).andEqualTo(RoomGroup.ZT, DataStatusEnum.QIYONG.getCode()); | ||
| 81 | + List<RoomGroup> roomGroupList = roomGroupMapper.selectByExample(example); | ||
| 82 | + if (CollectionUtils.isEmpty(roomGroupList)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + return roomGroupList; | ||
| 69 | } | 86 | } |
| 70 | } | 87 | } |
| @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.ShiftMapper; | 7 | import com.qgutech.qgyun.apaas.sync.cps.mapper.ShiftMapper; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.model.Shift; | 8 | import com.qgutech.qgyun.apaas.sync.cps.model.Shift; |
| 8 | import org.apache.commons.collections4.CollectionUtils; | 9 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class ShiftService extends BaseServiceImpl<Shift> { | @@ -29,7 +31,7 @@ public class ShiftService extends BaseServiceImpl<Shift> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(Shift.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(Shift.ID, id); |
| 33 | Shift shift = shiftMapper.selectOneByExample(example); | 35 | Shift shift = shiftMapper.selectOneByExample(example); |
| 34 | if (null == shift) { | 36 | if (null == shift) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class ShiftService extends BaseServiceImpl<Shift> { | @@ -42,7 +44,7 @@ public class ShiftService extends BaseServiceImpl<Shift> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(Shift.ID, ids); | 47 | + CorpExample.criteria(example).andIn(Shift.ID, ids); |
| 46 | List<Shift> shiftList = shiftMapper.selectByExample(example); | 48 | List<Shift> shiftList = shiftMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(shiftList)) { | 49 | if (CollectionUtils.isEmpty(shiftList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,21 @@ public class ShiftService extends BaseServiceImpl<Shift> { | @@ -65,6 +67,21 @@ public class ShiftService extends BaseServiceImpl<Shift> { | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<Shift> listAll() { | 68 | public List<Shift> listAll() { |
| 67 | 69 | ||
| 68 | - return shiftMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return shiftMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询所有启用状态的班次信息列表 | ||
| 76 | + */ | ||
| 77 | + @Transactional(readOnly = true) | ||
| 78 | + public List<Shift> listEnabled() { | ||
| 79 | + Example example = new Example(entityClass); | ||
| 80 | + CorpExample.criteria(example).andEqualTo(Shift.ZT, DataStatusEnum.QIYONG.getCode()); | ||
| 81 | + List<Shift> shiftList = shiftMapper.selectByExample(example); | ||
| 82 | + if (CollectionUtils.isEmpty(shiftList)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + return shiftList; | ||
| 69 | } | 86 | } |
| 70 | } | 87 | } |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class StdActivityCaseService extends BaseServiceImpl<StdActivityCase> { | @@ -29,7 +30,7 @@ public class StdActivityCaseService extends BaseServiceImpl<StdActivityCase> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(StdActivityCase.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(StdActivityCase.ID, id); |
| 33 | StdActivityCase stdActivityCase = stdActivityCaseMapper.selectOneByExample(example); | 34 | StdActivityCase stdActivityCase = stdActivityCaseMapper.selectOneByExample(example); |
| 34 | if (null == stdActivityCase) { | 35 | if (null == stdActivityCase) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class StdActivityCaseService extends BaseServiceImpl<StdActivityCase> { | @@ -42,7 +43,7 @@ public class StdActivityCaseService extends BaseServiceImpl<StdActivityCase> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(StdActivityCase.ID, ids); | 46 | + CorpExample.criteria(example).andIn(StdActivityCase.ID, ids); |
| 46 | List<StdActivityCase> stdActivityCaseList = stdActivityCaseMapper.selectByExample(example); | 47 | List<StdActivityCase> stdActivityCaseList = stdActivityCaseMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(stdActivityCaseList)) { | 48 | if (CollectionUtils.isEmpty(stdActivityCaseList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,6 +66,7 @@ public class StdActivityCaseService extends BaseServiceImpl<StdActivityCase> { | @@ -65,6 +66,7 @@ public class StdActivityCaseService extends BaseServiceImpl<StdActivityCase> { | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<StdActivityCase> listAll() { | 67 | public List<StdActivityCase> listAll() { |
| 67 | 68 | ||
| 68 | - return stdActivityCaseMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return stdActivityCaseMapper.selectByExample(example); | ||
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.TeamMapper; | 7 | import com.qgutech.qgyun.apaas.sync.cps.mapper.TeamMapper; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.model.Team; | 8 | import com.qgutech.qgyun.apaas.sync.cps.model.Team; |
| 8 | import org.apache.commons.collections4.CollectionUtils; | 9 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class TeamService extends BaseServiceImpl<Team> { | @@ -29,7 +31,7 @@ public class TeamService extends BaseServiceImpl<Team> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(Team.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(Team.ID, id); |
| 33 | Team team = teamMapper.selectOneByExample(example); | 35 | Team team = teamMapper.selectOneByExample(example); |
| 34 | if (null == team) { | 36 | if (null == team) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class TeamService extends BaseServiceImpl<Team> { | @@ -42,7 +44,7 @@ public class TeamService extends BaseServiceImpl<Team> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(Team.ID, ids); | 47 | + CorpExample.criteria(example).andIn(Team.ID, ids); |
| 46 | List<Team> teamList = teamMapper.selectByExample(example); | 48 | List<Team> teamList = teamMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(teamList)) { | 49 | if (CollectionUtils.isEmpty(teamList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,21 @@ public class TeamService extends BaseServiceImpl<Team> { | @@ -65,6 +67,21 @@ public class TeamService extends BaseServiceImpl<Team> { | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<Team> listAll() { | 68 | public List<Team> listAll() { |
| 67 | 69 | ||
| 68 | - return teamMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return teamMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询所有启用状态的班组信息列表 | ||
| 76 | + */ | ||
| 77 | + @Transactional(readOnly = true) | ||
| 78 | + public List<Team> listEnabled() { | ||
| 79 | + Example example = new Example(entityClass); | ||
| 80 | + CorpExample.criteria(example).andEqualTo(Team.ZT, DataStatusEnum.QIYONG.getCode()); | ||
| 81 | + List<Team> teamList = teamMapper.selectByExample(example); | ||
| 82 | + if (CollectionUtils.isEmpty(teamList)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + return teamList; | ||
| 69 | } | 86 | } |
| 70 | } | 87 | } |
| @@ -2,6 +2,7 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -2,6 +2,7 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 2 | 2 | ||
| 3 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 3 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 5 | +import com.qgutech.qgyun.apaas.sync.cps.enums.WorkshopStatusEnum; | ||
| 5 | import com.qgutech.qgyun.apaas.sync.cps.mapper.WorkshopMapper; | 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.WorkshopMapper; |
| 6 | import com.qgutech.qgyun.apaas.sync.cps.model.Workshop; | 7 | import com.qgutech.qgyun.apaas.sync.cps.model.Workshop; |
| 7 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 8 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| @@ -9,6 +10,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +10,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class WorkshopService extends BaseServiceImpl<Workshop> { | @@ -29,7 +31,7 @@ public class WorkshopService extends BaseServiceImpl<Workshop> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(Workshop.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(Workshop.ID, id); |
| 33 | Workshop workshop = workshopMapper.selectOneByExample(example); | 35 | Workshop workshop = workshopMapper.selectOneByExample(example); |
| 34 | if (null == workshop) { | 36 | if (null == workshop) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class WorkshopService extends BaseServiceImpl<Workshop> { | @@ -42,7 +44,7 @@ public class WorkshopService extends BaseServiceImpl<Workshop> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(Workshop.ID, ids); | 47 | + CorpExample.criteria(example).andIn(Workshop.ID, ids); |
| 46 | List<Workshop> workshopList = workshopMapper.selectByExample(example); | 48 | List<Workshop> workshopList = workshopMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(workshopList)) { | 49 | if (CollectionUtils.isEmpty(workshopList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,21 @@ public class WorkshopService extends BaseServiceImpl<Workshop> { | @@ -65,6 +67,21 @@ public class WorkshopService extends BaseServiceImpl<Workshop> { | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<Workshop> listAll() { | 68 | public List<Workshop> listAll() { |
| 67 | 69 | ||
| 68 | - return workshopMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return workshopMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询所有启用状态的单位(车间)信息列表 | ||
| 76 | + */ | ||
| 77 | + @Transactional(readOnly = true) | ||
| 78 | + public List<Workshop> listEnabled() { | ||
| 79 | + Example example = new Example(entityClass); | ||
| 80 | + CorpExample.criteria(example).andEqualTo(Workshop.IEIBLP, WorkshopStatusEnum.ENABLED.getCode()); | ||
| 81 | + List<Workshop> workshopList = workshopMapper.selectByExample(example); | ||
| 82 | + if (CollectionUtils.isEmpty(workshopList)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + return workshopList; | ||
| 69 | } | 86 | } |
| 70 | } | 87 | } |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class WorkstationService extends BaseServiceImpl<Workstation> { | @@ -29,7 +30,7 @@ public class WorkstationService extends BaseServiceImpl<Workstation> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(Workstation.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(Workstation.ID, id); |
| 33 | Workstation workstation = workstationMapper.selectOneByExample(example); | 34 | Workstation workstation = workstationMapper.selectOneByExample(example); |
| 34 | if (null == workstation) { | 35 | if (null == workstation) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class WorkstationService extends BaseServiceImpl<Workstation> { | @@ -42,7 +43,7 @@ public class WorkstationService extends BaseServiceImpl<Workstation> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(Workstation.ID, ids); | 46 | + CorpExample.criteria(example).andIn(Workstation.ID, ids); |
| 46 | List<Workstation> workstationList = workstationMapper.selectByExample(example); | 47 | List<Workstation> workstationList = workstationMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(workstationList)) { | 48 | if (CollectionUtils.isEmpty(workstationList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,6 +66,7 @@ public class WorkstationService extends BaseServiceImpl<Workstation> { | @@ -65,6 +66,7 @@ public class WorkstationService extends BaseServiceImpl<Workstation> { | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<Workstation> listAll() { | 67 | public List<Workstation> listAll() { |
| 67 | 68 | ||
| 68 | - return workstationMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return workstationMapper.selectByExample(example); | ||
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | @@ -3,12 +3,14 @@ package com.qgutech.qgyun.apaas.sync.cps.service; | ||
| 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum; | ||
| 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.XtLineMapper; | 7 | import com.qgutech.qgyun.apaas.sync.cps.mapper.XtLineMapper; |
| 7 | import com.qgutech.qgyun.apaas.sync.cps.model.XtLine; | 8 | import com.qgutech.qgyun.apaas.sync.cps.model.XtLine; |
| 8 | import org.apache.commons.collections4.CollectionUtils; | 9 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 12 | import org.springframework.util.Assert; |
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| 13 | 15 | ||
| 14 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| @@ -29,7 +31,7 @@ public class XtLineService extends BaseServiceImpl<XtLine> { | @@ -29,7 +31,7 @@ public class XtLineService extends BaseServiceImpl<XtLine> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 31 | Assert.hasLength(id, "id is empty!"); |
| 30 | 32 | ||
| 31 | Example example = new Example(entityClass); | 33 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(XtLine.ID, id); | 34 | + CorpExample.criteria(example).andEqualTo(XtLine.ID, id); |
| 33 | XtLine xtLine = xtLineMapper.selectOneByExample(example); | 35 | XtLine xtLine = xtLineMapper.selectOneByExample(example); |
| 34 | if (null == xtLine) { | 36 | if (null == xtLine) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 37 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +44,7 @@ public class XtLineService extends BaseServiceImpl<XtLine> { | @@ -42,7 +44,7 @@ public class XtLineService extends BaseServiceImpl<XtLine> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 44 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 45 | ||
| 44 | Example example = new Example(entityClass); | 46 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(XtLine.ID, ids); | 47 | + CorpExample.criteria(example).andIn(XtLine.ID, ids); |
| 46 | List<XtLine> xtLineList = xtLineMapper.selectByExample(example); | 48 | List<XtLine> xtLineList = xtLineMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(xtLineList)) { | 49 | if (CollectionUtils.isEmpty(xtLineList)) { |
| 48 | return new ArrayList<>(0); | 50 | return new ArrayList<>(0); |
| @@ -65,6 +67,21 @@ public class XtLineService extends BaseServiceImpl<XtLine> { | @@ -65,6 +67,21 @@ public class XtLineService extends BaseServiceImpl<XtLine> { | ||
| 65 | @Transactional(readOnly = true) | 67 | @Transactional(readOnly = true) |
| 66 | public List<XtLine> listAll() { | 68 | public List<XtLine> listAll() { |
| 67 | 69 | ||
| 68 | - return xtLineMapper.selectAll(); | 70 | + Example example = CorpExample.ofCorp(entityClass); |
| 71 | + return xtLineMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询所有启用状态的线体信息列表 | ||
| 76 | + */ | ||
| 77 | + @Transactional(readOnly = true) | ||
| 78 | + public List<XtLine> listEnabled() { | ||
| 79 | + Example example = new Example(entityClass); | ||
| 80 | + CorpExample.criteria(example).andEqualTo(XtLine.AMOIGS, DataStatusEnum.QIYONG.getCode()); | ||
| 81 | + List<XtLine> xtLineList = xtLineMapper.selectByExample(example); | ||
| 82 | + if (CollectionUtils.isEmpty(xtLineList)) { | ||
| 83 | + return new ArrayList<>(0); | ||
| 84 | + } | ||
| 85 | + return xtLineList; | ||
| 69 | } | 86 | } |
| 70 | } | 87 | } |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.task; | ||
| 2 | + | ||
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.service.ProcessConfirmExecService; | ||
| 4 | +import lombok.extern.slf4j.Slf4j; | ||
| 5 | +import org.springframework.scheduling.annotation.Scheduled; | ||
| 6 | +import org.springframework.stereotype.Service; | ||
| 7 | + | ||
| 8 | +import javax.annotation.Resource; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @author cq | ||
| 12 | + * @since 2026-09-23 | ||
| 13 | + * Cps体系相关定制业务定时任务 | ||
| 14 | + */ | ||
| 15 | +@Slf4j | ||
| 16 | +@Service | ||
| 17 | +public class CpsScheduledTask { | ||
| 18 | + | ||
| 19 | + @Resource | ||
| 20 | + private ProcessConfirmExecService processConfirmExecService; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 根据每日考勤记录自动生成过程确认计划 | ||
| 24 | + * 定时任务执行-每隔30分钟执行一次 | ||
| 25 | + */ | ||
| 26 | + @Scheduled(cron = "0 21 * * * ?") | ||
| 27 | + public void autoCreateProcessConfirmExecByDailySign() { | ||
| 28 | + try { | ||
| 29 | + int count = processConfirmExecService.autoCreateProcessConfirmExecByDailySign(null, null); | ||
| 30 | + log.info("定时任务[根据每日考勤记录自动生成过程确认计划]执行完成,新生成计划 {} 条", count); | ||
| 31 | + } catch (Exception e) { | ||
| 32 | + e.printStackTrace(); | ||
| 33 | + log.error("定时任务[根据每日考勤记录自动生成过程确认计划]执行异常", e); | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | +} |
| 1 | package com.qgutech.qgyun.apaas.sync.filter; | 1 | package com.qgutech.qgyun.apaas.sync.filter; |
| 2 | 2 | ||
| 3 | +import com.qgutech.qgyun.apaas.sync.constant.Constant; | ||
| 3 | import com.qgutech.qgyun.framework.common.context.ContextHandler; | 4 | import com.qgutech.qgyun.framework.common.context.ContextHandler; |
| 4 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
| 5 | import org.apache.commons.lang3.StringUtils; | 6 | import org.apache.commons.lang3.StringUtils; |
| @@ -36,8 +37,9 @@ public class ExecutionContextFilter implements Filter { | @@ -36,8 +37,9 @@ public class ExecutionContextFilter implements Filter { | ||
| 36 | HttpServletResponse response = (HttpServletResponse) servletResponse; | 37 | HttpServletResponse response = (HttpServletResponse) servletResponse; |
| 37 | String userId = request.getParameter("userId"); | 38 | String userId = request.getParameter("userId"); |
| 38 | 39 | ||
| 39 | - ContextHandler.setCorpCode("hfca"); | ||
| 40 | - ContextHandler.setUserId(""); | 40 | + //设置默认的corpCode和userId |
| 41 | + ContextHandler.setCorpCode(Constant.DEFAULT_CORP_CODE); | ||
| 42 | + ContextHandler.setUserId(Constant.DEFAULT_USER_ID); | ||
| 41 | if (StringUtils.isNotBlank(userId)) { | 43 | if (StringUtils.isNotBlank(userId)) { |
| 42 | ContextHandler.setUserId(userId); | 44 | ContextHandler.setUserId(userId); |
| 43 | } | 45 | } |
| 1 | +package com.qgutech.qgyun.apaas.sync.hr.model; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.qgutech.qgyun.framework.database.model.BaseCorpModel; | ||
| 5 | +import lombok.Getter; | ||
| 6 | +import lombok.Setter; | ||
| 7 | +import lombok.ToString; | ||
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | + | ||
| 10 | +import javax.persistence.Table; | ||
| 11 | +import java.util.Date; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 人事系统-考勤记录信息 | ||
| 15 | + */ | ||
| 16 | +@Getter | ||
| 17 | +@Setter | ||
| 18 | +@ToString | ||
| 19 | +@Table(name = "t_auto_hfca_ijuiwo_gbjuvp") | ||
| 20 | +public class AttendanceRecord extends BaseCorpModel { | ||
| 21 | + | ||
| 22 | + public static final String EMPLOYEE_CODE = "employeeCode"; | ||
| 23 | + public static final String SIGN_DATE = "signDate"; | ||
| 24 | + public static final String CLOCK_IN_TIME = "clockInTime"; | ||
| 25 | + | ||
| 26 | + /* | ||
| 27 | + * 工号 | ||
| 28 | + */ | ||
| 29 | + private String employeeCode; | ||
| 30 | + | ||
| 31 | + /* | ||
| 32 | + * 岗位层级 | ||
| 33 | + */ | ||
| 34 | + private String postLevel; | ||
| 35 | + | ||
| 36 | + /* | ||
| 37 | + * 考勤日期 | ||
| 38 | + */ | ||
| 39 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 40 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 41 | + private Date signDate; | ||
| 42 | + | ||
| 43 | + /* | ||
| 44 | + * 班次名称 | ||
| 45 | + */ | ||
| 46 | + private String timeclassname; | ||
| 47 | + | ||
| 48 | + /* | ||
| 49 | + * 上班打卡时间 | ||
| 50 | + */ | ||
| 51 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 52 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 53 | + private Date clockInTime; | ||
| 54 | + | ||
| 55 | + /* | ||
| 56 | + * 下班打卡时间 | ||
| 57 | + */ | ||
| 58 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 59 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 60 | + private Date clockOutTime; | ||
| 61 | + | ||
| 62 | + /* | ||
| 63 | + * 排班上班时间 | ||
| 64 | + */ | ||
| 65 | + private String shiftWorkTime; | ||
| 66 | + | ||
| 67 | + /* | ||
| 68 | + * 排班下班时间 | ||
| 69 | + */ | ||
| 70 | + private String shiftClosingTime; | ||
| 71 | + | ||
| 72 | + /* | ||
| 73 | + * 姓名 | ||
| 74 | + */ | ||
| 75 | + private String name; | ||
| 76 | +} |
| 1 | +package com.qgutech.qgyun.apaas.sync.hr.service; | ||
| 2 | + | ||
| 3 | +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | ||
| 4 | +import com.qgutech.qgyun.apaas.sync.base.BoException; | ||
| 5 | +import com.qgutech.qgyun.apaas.sync.hr.mapper.AttendanceRecordMapper; | ||
| 6 | +import com.qgutech.qgyun.apaas.sync.hr.model.AttendanceRecord; | ||
| 7 | +import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils; | ||
| 8 | +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | ||
| 9 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | +import org.springframework.transaction.annotation.Transactional; | ||
| 12 | +import org.springframework.util.Assert; | ||
| 13 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 14 | +import tk.mybatis.mapper.entity.Example; | ||
| 15 | + | ||
| 16 | +import javax.annotation.Resource; | ||
| 17 | +import java.util.*; | ||
| 18 | +import java.util.stream.Collectors; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * 人事系统-考勤记录服务 | ||
| 22 | + */ | ||
| 23 | +@Service | ||
| 24 | +public class AttendanceRecordService extends BaseServiceImpl<AttendanceRecord> { | ||
| 25 | + | ||
| 26 | + @Resource | ||
| 27 | + private AttendanceRecordMapper attendanceRecordMapper; | ||
| 28 | + | ||
| 29 | + @Transactional(readOnly = true) | ||
| 30 | + public AttendanceRecord getById(String id) { | ||
| 31 | + Assert.hasLength(id, "id is empty!"); | ||
| 32 | + | ||
| 33 | + Example example = new Example(entityClass); | ||
| 34 | + CorpExample.criteria(example).andEqualTo(AttendanceRecord.ID, id); | ||
| 35 | + AttendanceRecord attendanceRecord = attendanceRecordMapper.selectOneByExample(example); | ||
| 36 | + if (null == attendanceRecord) { | ||
| 37 | + throw new BoException(BoErrorCode.DATA_ERROR); | ||
| 38 | + } | ||
| 39 | + return attendanceRecord; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Transactional(readOnly = true) | ||
| 43 | + public List<AttendanceRecord> listByIds(Collection<String> ids) { | ||
| 44 | + Assert.notEmpty(ids, "ids is empty!"); | ||
| 45 | + | ||
| 46 | + Example example = new Example(entityClass); | ||
| 47 | + CorpExample.criteria(example).andIn(AttendanceRecord.ID, ids); | ||
| 48 | + List<AttendanceRecord> attendanceRecordList = attendanceRecordMapper.selectByExample(example); | ||
| 49 | + if (CollectionUtils.isEmpty(attendanceRecordList)) { | ||
| 50 | + return new ArrayList<>(0); | ||
| 51 | + } | ||
| 52 | + return attendanceRecordList; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + @Transactional(readOnly = true) | ||
| 56 | + public Map<String, AttendanceRecord> mapByIds(Collection<String> ids) { | ||
| 57 | + Assert.notEmpty(ids, "ids is empty!"); | ||
| 58 | + | ||
| 59 | + List<AttendanceRecord> attendanceRecordList = listByIds(ids); | ||
| 60 | + if (CollectionUtils.isEmpty(attendanceRecordList)) { | ||
| 61 | + return new HashMap<>(0); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + return attendanceRecordList.stream().collect(Collectors.toMap(AttendanceRecord::getId, attendanceRecord -> attendanceRecord)); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + @Transactional(readOnly = true) | ||
| 68 | + public List<AttendanceRecord> listAll() { | ||
| 69 | + | ||
| 70 | + Example example = CorpExample.ofCorp(entityClass); | ||
| 71 | + return attendanceRecordMapper.selectByExample(example); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 查询指定考勤日期范围内的考勤记录列表 | ||
| 76 | + * <p> | ||
| 77 | + * 开始、结束时间为空时默认使用当前天的开始(00:00:00)和结束(23:59:59)时间 | ||
| 78 | + * | ||
| 79 | + * @param startTime 开始时间,格式:yyyy-MM-dd [HH:mm:ss],可为空(默认当天 00:00:00) | ||
| 80 | + * @param endTime 结束时间,格式:yyyy-MM-dd [HH:mm:ss],可为空(默认当天 23:59:59) | ||
| 81 | + * @return 考勤日期在范围内的考勤记录列表 | ||
| 82 | + */ | ||
| 83 | + @Transactional(readOnly = true) | ||
| 84 | + public List<AttendanceRecord> listBySignDateRange(String startTime, String endTime) { | ||
| 85 | + Date start = DateDealUtils.parseStartTimeOrCurrentDayStart(startTime); | ||
| 86 | + Date end = DateDealUtils.parseEndTimeOrCurrentDayEnd(endTime); | ||
| 87 | + Assert.notNull(start, "startTime is invalid!"); | ||
| 88 | + Assert.notNull(end, "endTime is invalid!"); | ||
| 89 | + Assert.isTrue(!start.after(end), "startTime must be earlier than endTime!"); | ||
| 90 | + | ||
| 91 | + Example example = new Example(entityClass); | ||
| 92 | + CorpExample.criteria(example).andBetween(AttendanceRecord.SIGN_DATE, start, end); | ||
| 93 | + List<AttendanceRecord> attendanceRecordList = attendanceRecordMapper.selectByExample(example); | ||
| 94 | + if (CollectionUtils.isEmpty(attendanceRecordList)) { | ||
| 95 | + return new ArrayList<>(0); | ||
| 96 | + } | ||
| 97 | + return attendanceRecordList; | ||
| 98 | + } | ||
| 99 | +} |
| @@ -21,6 +21,7 @@ import java.util.Date; | @@ -21,6 +21,7 @@ import java.util.Date; | ||
| 21 | public class UcUser extends BaseCorpModel { | 21 | public class UcUser extends BaseCorpModel { |
| 22 | 22 | ||
| 23 | public static final String NAME = "name"; | 23 | public static final String NAME = "name"; |
| 24 | + public static final String LOGIN_NAME = "loginName"; | ||
| 24 | 25 | ||
| 25 | /* | 26 | /* |
| 26 | * 姓名 | 27 | * 姓名 |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class UcOrgService extends BaseServiceImpl<UcOrg> { | @@ -29,7 +30,7 @@ public class UcOrgService extends BaseServiceImpl<UcOrg> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(UcOrg.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(UcOrg.ID, id); |
| 33 | UcOrg ucOrg = ucOrgMapper.selectOneByExample(example); | 34 | UcOrg ucOrg = ucOrgMapper.selectOneByExample(example); |
| 34 | if (null == ucOrg) { | 35 | if (null == ucOrg) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class UcOrgService extends BaseServiceImpl<UcOrg> { | @@ -42,7 +43,7 @@ public class UcOrgService extends BaseServiceImpl<UcOrg> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(UcOrg.ID, ids); | 46 | + CorpExample.criteria(example).andIn(UcOrg.ID, ids); |
| 46 | List<UcOrg> ucOrgList = ucOrgMapper.selectByExample(example); | 47 | List<UcOrg> ucOrgList = ucOrgMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(ucOrgList)) { | 48 | if (CollectionUtils.isEmpty(ucOrgList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,6 +66,7 @@ public class UcOrgService extends BaseServiceImpl<UcOrg> { | @@ -65,6 +66,7 @@ public class UcOrgService extends BaseServiceImpl<UcOrg> { | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<UcOrg> listAll() { | 67 | public List<UcOrg> listAll() { |
| 67 | 68 | ||
| 68 | - return ucOrgMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return ucOrgMapper.selectByExample(example); | ||
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | @@ -9,6 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
| 11 | import org.springframework.util.Assert; | 11 | import org.springframework.util.Assert; |
| 12 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | ||
| 12 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 13 | 14 | ||
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; |
| @@ -29,7 +30,7 @@ public class UcUserService extends BaseServiceImpl<UcUser> { | @@ -29,7 +30,7 @@ public class UcUserService extends BaseServiceImpl<UcUser> { | ||
| 29 | Assert.hasLength(id, "id is empty!"); | 30 | Assert.hasLength(id, "id is empty!"); |
| 30 | 31 | ||
| 31 | Example example = new Example(entityClass); | 32 | Example example = new Example(entityClass); |
| 32 | - example.createCriteria().andEqualTo(UcUser.ID, id); | 33 | + CorpExample.criteria(example).andEqualTo(UcUser.ID, id); |
| 33 | UcUser ucUser = ucUserMapper.selectOneByExample(example); | 34 | UcUser ucUser = ucUserMapper.selectOneByExample(example); |
| 34 | if (null == ucUser) { | 35 | if (null == ucUser) { |
| 35 | throw new BoException(BoErrorCode.DATA_ERROR); | 36 | throw new BoException(BoErrorCode.DATA_ERROR); |
| @@ -42,7 +43,7 @@ public class UcUserService extends BaseServiceImpl<UcUser> { | @@ -42,7 +43,7 @@ public class UcUserService extends BaseServiceImpl<UcUser> { | ||
| 42 | Assert.notEmpty(ids, "ids is empty!"); | 43 | Assert.notEmpty(ids, "ids is empty!"); |
| 43 | 44 | ||
| 44 | Example example = new Example(entityClass); | 45 | Example example = new Example(entityClass); |
| 45 | - example.createCriteria().andIn(UcUser.ID, ids); | 46 | + CorpExample.criteria(example).andIn(UcUser.ID, ids); |
| 46 | List<UcUser> ucUserList = ucUserMapper.selectByExample(example); | 47 | List<UcUser> ucUserList = ucUserMapper.selectByExample(example); |
| 47 | if (CollectionUtils.isEmpty(ucUserList)) { | 48 | if (CollectionUtils.isEmpty(ucUserList)) { |
| 48 | return new ArrayList<>(0); | 49 | return new ArrayList<>(0); |
| @@ -65,6 +66,46 @@ public class UcUserService extends BaseServiceImpl<UcUser> { | @@ -65,6 +66,46 @@ public class UcUserService extends BaseServiceImpl<UcUser> { | ||
| 65 | @Transactional(readOnly = true) | 66 | @Transactional(readOnly = true) |
| 66 | public List<UcUser> listAll() { | 67 | public List<UcUser> listAll() { |
| 67 | 68 | ||
| 68 | - return ucUserMapper.selectAll(); | 69 | + Example example = CorpExample.ofCorp(entityClass); |
| 70 | + return ucUserMapper.selectByExample(example); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 根据登录名集合批量查询组织用户 | ||
| 75 | + * | ||
| 76 | + * @param loginNames 登录名集合 | ||
| 77 | + * @return 匹配的组织用户列表,无匹配时返回空列表 | ||
| 78 | + */ | ||
| 79 | + @Transactional(readOnly = true) | ||
| 80 | + public List<UcUser> listByLoginNames(Collection<String> loginNames) { | ||
| 81 | + if (CollectionUtils.isEmpty(loginNames)) { | ||
| 82 | + return new ArrayList<>(0); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + Example example = new Example(entityClass); | ||
| 86 | + CorpExample.criteria(example).andIn(UcUser.LOGIN_NAME, loginNames); | ||
| 87 | + List<UcUser> ucUserList = ucUserMapper.selectByExample(example); | ||
| 88 | + if (CollectionUtils.isEmpty(ucUserList)) { | ||
| 89 | + return new ArrayList<>(0); | ||
| 90 | + } | ||
| 91 | + return ucUserList; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + /** | ||
| 95 | + * 根据登录名集合批量查询组织用户,构建 loginName -> UcUser 映射 | ||
| 96 | + * | ||
| 97 | + * @param loginNames 登录名集合 | ||
| 98 | + * @return loginName 到组织用户的映射,无匹配时返回空 Map | ||
| 99 | + */ | ||
| 100 | + @Transactional(readOnly = true) | ||
| 101 | + public Map<String, UcUser> mapByLoginNames(Collection<String> loginNames) { | ||
| 102 | + List<UcUser> ucUserList = listByLoginNames(loginNames); | ||
| 103 | + if (CollectionUtils.isEmpty(ucUserList)) { | ||
| 104 | + return new HashMap<>(0); | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + return ucUserList.stream() | ||
| 108 | + .filter(item -> item.getLoginName() != null) | ||
| 109 | + .collect(Collectors.toMap(UcUser::getLoginName, ucUser -> ucUser, (existing, replacement) -> existing)); | ||
| 69 | } | 110 | } |
| 70 | } | 111 | } |
| 1 | +package com.qgutech.qgyun.apaas.sync.utils; | ||
| 2 | + | ||
| 3 | +import com.qgutech.qgyun.apaas.sync.constant.Constant; | ||
| 4 | +import com.qgutech.qgyun.framework.common.context.ContextHandler; | ||
| 5 | +import org.apache.commons.lang3.StringUtils; | ||
| 6 | +import tk.mybatis.mapper.entity.Example; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 企业(corpCode)查询条件辅助工具。 | ||
| 10 | + * <p> | ||
| 11 | + * 项目中所有实体均继承 {@code BaseCorpModel},含 corpCode(公司编号,对应列 corp_code)属性。 | ||
| 12 | + * 为保证多企业数据隔离,所有实体查询都需统一带上 corpCode 过滤条件。本工具集中提供: | ||
| 13 | + * <ul> | ||
| 14 | + * <li>{@link #currentCorpCode()}:获取当前企业编号,优先取 ContextHandler,为空时默认 {@code hfca};</li> | ||
| 15 | + * <li>{@link #criteria(Example)}:创建已带 corpCode 条件的 Criteria,替代 {@code example.createCriteria()};</li> | ||
| 16 | + * <li>{@link #ofCorp(Class)}:创建仅带 corpCode 条件的 Example,替代无条件的 {@code selectAll()} 全量查询。</li> | ||
| 17 | + * </ul> | ||
| 18 | + */ | ||
| 19 | +public final class CorpExample { | ||
| 20 | + | ||
| 21 | + private CorpExample() { | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 获取当前企业编号:优先取 {@link ContextHandler#getCorpCode()},为空时返回默认值 {@code hfca}。 | ||
| 26 | + * <p> | ||
| 27 | + * Web 请求由过滤器写入 corpCode;定时任务等非 Web 场景下 ContextHandler 可能为空,此时回退默认值。 | ||
| 28 | + * | ||
| 29 | + * @return 当前企业编号 | ||
| 30 | + */ | ||
| 31 | + public static String currentCorpCode() { | ||
| 32 | + String corpCode = ContextHandler.getCorpCode(); | ||
| 33 | + return StringUtils.isNotBlank(corpCode) ? corpCode : Constant.DEFAULT_CORP_CODE; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 在给定 Example 上创建 Criteria,并统一追加 corpCode 过滤条件。 | ||
| 38 | + * <p> | ||
| 39 | + * 用于替代 {@code example.createCriteria()},返回的 Criteria 可继续链式追加其它条件。 | ||
| 40 | + * | ||
| 41 | + * @param example tk.mybatis Example 对象 | ||
| 42 | + * @return 已带 corpCode 条件的 Criteria | ||
| 43 | + */ | ||
| 44 | + public static Example.Criteria criteria(Example example) { | ||
| 45 | + return example.createCriteria().andEqualTo(Constant.CORP_CODE, currentCorpCode()); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 创建仅带 corpCode 过滤条件的 Example,用于替代无条件的 {@code mapper.selectAll()} 全量查询。 | ||
| 50 | + * | ||
| 51 | + * @param entityClass 实体类型 | ||
| 52 | + * @return 已带 corpCode 条件的 Example | ||
| 53 | + */ | ||
| 54 | + public static Example ofCorp(Class<?> entityClass) { | ||
| 55 | + Example example = new Example(entityClass); | ||
| 56 | + criteria(example); | ||
| 57 | + return example; | ||
| 58 | + } | ||
| 59 | +} |
| @@ -200,4 +200,48 @@ public class DateDealUtils { | @@ -200,4 +200,48 @@ public class DateDealUtils { | ||
| 200 | } | 200 | } |
| 201 | return parseEndTime(dateStr); | 201 | return parseEndTime(dateStr); |
| 202 | } | 202 | } |
| 203 | + | ||
| 204 | + /** | ||
| 205 | + * 获取当前天的开始时间(今天 00:00:00.000) | ||
| 206 | + */ | ||
| 207 | + public static Date getCurrentDayStartTime() { | ||
| 208 | + Calendar cal = Calendar.getInstance(); | ||
| 209 | + cal.set(Calendar.HOUR_OF_DAY, 0); | ||
| 210 | + cal.set(Calendar.MINUTE, 0); | ||
| 211 | + cal.set(Calendar.SECOND, 0); | ||
| 212 | + cal.set(Calendar.MILLISECOND, 0); | ||
| 213 | + return cal.getTime(); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + /** | ||
| 217 | + * 获取当前天的结束时间(今天 23:59:59.999) | ||
| 218 | + */ | ||
| 219 | + public static Date getCurrentDayEndTime() { | ||
| 220 | + Calendar cal = Calendar.getInstance(); | ||
| 221 | + cal.set(Calendar.HOUR_OF_DAY, 23); | ||
| 222 | + cal.set(Calendar.MINUTE, 59); | ||
| 223 | + cal.set(Calendar.SECOND, 59); | ||
| 224 | + cal.set(Calendar.MILLISECOND, 999); | ||
| 225 | + return cal.getTime(); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + /** | ||
| 229 | + * 解析开始时间字符串,为空时默认返回当前天开始时间 | ||
| 230 | + */ | ||
| 231 | + public static Date parseStartTimeOrCurrentDayStart(String dateStr) { | ||
| 232 | + if (dateStr == null || dateStr.trim().isEmpty()) { | ||
| 233 | + return getCurrentDayStartTime(); | ||
| 234 | + } | ||
| 235 | + return parseStartTime(dateStr); | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + /** | ||
| 239 | + * 解析结束时间字符串,为空时默认返回当前天结束时间 | ||
| 240 | + */ | ||
| 241 | + public static Date parseEndTimeOrCurrentDayEnd(String dateStr) { | ||
| 242 | + if (dateStr == null || dateStr.trim().isEmpty()) { | ||
| 243 | + return getCurrentDayEndTime(); | ||
| 244 | + } | ||
| 245 | + return parseEndTime(dateStr); | ||
| 246 | + } | ||
| 203 | } | 247 | } |
| @@ -22,28 +22,41 @@ | @@ -22,28 +22,41 @@ | ||
| 22 | - [5. PJO计划执行接口](#5-pjo计划执行接口) | 22 | - [5. PJO计划执行接口](#5-pjo计划执行接口) |
| 23 | - [5.1 根据PJO开展日期范围汇总PJO计划执行统计信息](#51-根据pjo开展日期范围汇总pjo计划执行统计信息) | 23 | - [5.1 根据PJO开展日期范围汇总PJO计划执行统计信息](#51-根据pjo开展日期范围汇总pjo计划执行统计信息) |
| 24 | - [5.2 根据条件查询人员PJO计划明细列表](#52-根据条件查询人员pjo计划明细列表) | 24 | - [5.2 根据条件查询人员PJO计划明细列表](#52-根据条件查询人员pjo计划明细列表) |
| 25 | +- [6. 枚举定义接口](#6-枚举定义接口) | ||
| 26 | + - [6.1 获取所有枚举定义常量数组信息](#61-获取所有枚举定义常量数组信息) | ||
| 27 | +- [7. 基础信息接口](#7-基础信息接口) | ||
| 28 | + - [7.1 获取所有启用的线体列表](#71-获取所有启用的线体列表) | ||
| 29 | + - [7.2 获取所有启用的单位(车间)列表](#72-获取所有启用的单位车间列表) | ||
| 30 | + - [7.3 获取所有启用的室组列表](#73-获取所有启用的室组列表) | ||
| 31 | + - [7.4 获取所有启用的区域列表](#74-获取所有启用的区域列表) | ||
| 32 | + - [7.5 获取所有启用的班组列表](#75-获取所有启用的班组列表) | ||
| 33 | + - [7.6 获取所有启用的班次列表](#76-获取所有启用的班次列表) | ||
| 25 | 34 | ||
| 26 | --- | 35 | --- |
| 27 | 36 | ||
| 28 | ## 通用说明 | 37 | ## 通用说明 |
| 38 | +### 环境域名 | ||
| 39 | +uat3环境: https://uat3.qgutech.com/fkyycustom | ||
| 29 | 40 | ||
| 30 | ### 统一响应格式 | 41 | ### 统一响应格式 |
| 31 | 42 | ||
| 32 | -所有接口返回统一的 `JsonResult` 结构: | 43 | +所有接口返回统一的 `JsonResult` 结构(字段顺序以实际序列化为准): |
| 33 | 44 | ||
| 34 | ```json | 45 | ```json |
| 35 | { | 46 | { |
| 36 | "success": true, | 47 | "success": true, |
| 37 | - "message": "成功", | ||
| 38 | - "data": [] | 48 | + "data": [], |
| 49 | + "msg": "成功", | ||
| 50 | + "errCode": null | ||
| 39 | } | 51 | } |
| 40 | ``` | 52 | ``` |
| 41 | 53 | ||
| 42 | | 字段 | 类型 | 说明 | | 54 | | 字段 | 类型 | 说明 | |
| 43 | |------|------|------| | 55 | |------|------|------| |
| 44 | | success | Boolean | 请求是否成功 | | 56 | | success | Boolean | 请求是否成功 | |
| 45 | -| message | String | 响应消息 | | ||
| 46 | | data | Object/Array | 响应数据体 | | 57 | | data | Object/Array | 响应数据体 | |
| 58 | +| msg | String | 响应消息 | | ||
| 59 | +| errCode | String | 错误码,成功时为 null | | ||
| 47 | 60 | ||
| 48 | ### 枚举值说明 | 61 | ### 枚举值说明 |
| 49 | 62 | ||
| @@ -186,6 +199,32 @@ | @@ -186,6 +199,32 @@ | ||
| 186 | 199 | ||
| 187 | > 说明:`zyczdwt` 字段值为 `#1#-无` 表示第三阶段未发现问题;其余任意非空值均表示第三阶段发现了一个问题。 | 200 | > 说明:`zyczdwt` 字段值为 `#1#-无` 表示第三阶段未发现问题;其余任意非空值均表示第三阶段发现了一个问题。 |
| 188 | 201 | ||
| 202 | +#### 数据状态枚举(DataStatusEnum) | ||
| 203 | + | ||
| 204 | +| 编号 | 描述 | | ||
| 205 | +|------|------| | ||
| 206 | +| #1# | 草稿 | | ||
| 207 | +| #2# | 启用 | | ||
| 208 | +| #3# | 停用 | | ||
| 209 | + | ||
| 210 | +#### 车间状态枚举(WorkshopStatusEnum) | ||
| 211 | + | ||
| 212 | +| 编号 | 描述 | | ||
| 213 | +|------|------| | ||
| 214 | +| #1# | 草稿 | | ||
| 215 | +| #2# | 启用 | | ||
| 216 | +| #3# | 停用 | | ||
| 217 | + | ||
| 218 | +#### PJO工位状态枚举(GwztEnum) | ||
| 219 | + | ||
| 220 | +| 编号 | 描述 | | ||
| 221 | +|------|------| | ||
| 222 | +| #1# | 未选中 | | ||
| 223 | +| #2# | 已选中 | | ||
| 224 | +| #3# | 已释放 | | ||
| 225 | + | ||
| 226 | +> 说明:以上全部枚举(含未在此列出的)均可通过 [`GET /enum/list/all`](#61-获取所有枚举定义常量数组信息) 接口一次性获取。 | ||
| 227 | + | ||
| 189 | --- | 228 | --- |
| 190 | 229 | ||
| 191 | ## 1. AB类改善接口 | 230 | ## 1. AB类改善接口 |
| @@ -221,7 +260,7 @@ | @@ -221,7 +260,7 @@ | ||
| 221 | ```json | 260 | ```json |
| 222 | { | 261 | { |
| 223 | "success": true, | 262 | "success": true, |
| 224 | - "message": "成功", | 263 | + "msg": "成功", |
| 225 | "data": [ | 264 | "data": [ |
| 226 | { | 265 | { |
| 227 | "id": "abc123", | 266 | "id": "abc123", |
| @@ -273,7 +312,7 @@ | @@ -273,7 +312,7 @@ | ||
| 273 | ```json | 312 | ```json |
| 274 | { | 313 | { |
| 275 | "success": true, | 314 | "success": true, |
| 276 | - "message": "成功", | 315 | + "msg": "成功", |
| 277 | "data": [ | 316 | "data": [ |
| 278 | { | 317 | { |
| 279 | "dwcj": "workshop001", | 318 | "dwcj": "workshop001", |
| @@ -333,7 +372,7 @@ | @@ -333,7 +372,7 @@ | ||
| 333 | ```json | 372 | ```json |
| 334 | { | 373 | { |
| 335 | "success": true, | 374 | "success": true, |
| 336 | - "message": "成功", | 375 | + "msg": "成功", |
| 337 | "data": [ | 376 | "data": [ |
| 338 | { | 377 | { |
| 339 | "id": "c123", | 378 | "id": "c123", |
| @@ -402,7 +441,7 @@ | @@ -402,7 +441,7 @@ | ||
| 402 | ```json | 441 | ```json |
| 403 | { | 442 | { |
| 404 | "success": true, | 443 | "success": true, |
| 405 | - "message": "成功", | 444 | + "msg": "成功", |
| 406 | "data": [ | 445 | "data": [ |
| 407 | { | 446 | { |
| 408 | "szxx": "rg001", | 447 | "szxx": "rg001", |
| @@ -488,7 +527,7 @@ | @@ -488,7 +527,7 @@ | ||
| 488 | ```json | 527 | ```json |
| 489 | { | 528 | { |
| 490 | "success": true, | 529 | "success": true, |
| 491 | - "message": "成功", | 530 | + "msg": "成功", |
| 492 | "data": [ | 531 | "data": [ |
| 493 | { | 532 | { |
| 494 | "id": "c123", | 533 | "id": "c123", |
| @@ -593,7 +632,7 @@ | @@ -593,7 +632,7 @@ | ||
| 593 | ```json | 632 | ```json |
| 594 | { | 633 | { |
| 595 | "success": true, | 634 | "success": true, |
| 596 | - "message": "成功", | 635 | + "msg": "成功", |
| 597 | "data": [ | 636 | "data": [ |
| 598 | { | 637 | { |
| 599 | "id": "p123", | 638 | "id": "p123", |
| @@ -672,7 +711,7 @@ | @@ -672,7 +711,7 @@ | ||
| 672 | ```json | 711 | ```json |
| 673 | { | 712 | { |
| 674 | "success": true, | 713 | "success": true, |
| 675 | - "message": "成功", | 714 | + "msg": "成功", |
| 676 | "data": [ | 715 | "data": [ |
| 677 | { | 716 | { |
| 678 | "wtzrdw": "workshop001", | 717 | "wtzrdw": "workshop001", |
| @@ -793,7 +832,7 @@ | @@ -793,7 +832,7 @@ | ||
| 793 | ```json | 832 | ```json |
| 794 | { | 833 | { |
| 795 | "success": true, | 834 | "success": true, |
| 796 | - "message": "成功", | 835 | + "msg": "成功", |
| 797 | "data": [ | 836 | "data": [ |
| 798 | { | 837 | { |
| 799 | "id": "p123", | 838 | "id": "p123", |
| @@ -889,7 +928,7 @@ | @@ -889,7 +928,7 @@ | ||
| 889 | ```json | 928 | ```json |
| 890 | { | 929 | { |
| 891 | "success": true, | 930 | "success": true, |
| 892 | - "message": "成功", | 931 | + "msg": "成功", |
| 893 | "data": [ | 932 | "data": [ |
| 894 | { | 933 | { |
| 895 | "wtly": "#1#", | 934 | "wtly": "#1#", |
| @@ -945,7 +984,7 @@ | @@ -945,7 +984,7 @@ | ||
| 945 | ```json | 984 | ```json |
| 946 | { | 985 | { |
| 947 | "success": true, | 986 | "success": true, |
| 948 | - "message": "成功", | 987 | + "msg": "成功", |
| 949 | "data": [ | 988 | "data": [ |
| 950 | { | 989 | { |
| 951 | "id": "p123", | 990 | "id": "p123", |
| @@ -1054,7 +1093,7 @@ | @@ -1054,7 +1093,7 @@ | ||
| 1054 | ```json | 1093 | ```json |
| 1055 | { | 1094 | { |
| 1056 | "success": true, | 1095 | "success": true, |
| 1057 | - "message": "成功", | 1096 | + "msg": "成功", |
| 1058 | "data": [ | 1097 | "data": [ |
| 1059 | { | 1098 | { |
| 1060 | "id": "a8IaDbP2C79yQsAY6Vv", | 1099 | "id": "a8IaDbP2C79yQsAY6Vv", |
| @@ -1125,7 +1164,7 @@ | @@ -1125,7 +1164,7 @@ | ||
| 1125 | ```json | 1164 | ```json |
| 1126 | { | 1165 | { |
| 1127 | "success": true, | 1166 | "success": true, |
| 1128 | - "message": "成功", | 1167 | + "msg": "成功", |
| 1129 | "data": { | 1168 | "data": { |
| 1130 | "dw": null, | 1169 | "dw": null, |
| 1131 | "dwName": null, | 1170 | "dwName": null, |
| @@ -1305,7 +1344,7 @@ | @@ -1305,7 +1344,7 @@ | ||
| 1305 | ```json | 1344 | ```json |
| 1306 | { | 1345 | { |
| 1307 | "success": true, | 1346 | "success": true, |
| 1308 | - "message": "成功", | 1347 | + "msg": "成功", |
| 1309 | "data": [ | 1348 | "data": [ |
| 1310 | { | 1349 | { |
| 1311 | "id": "a8IaDbP2C79yQsAY6Vv", | 1350 | "id": "a8IaDbP2C79yQsAY6Vv", |
| @@ -1412,7 +1451,7 @@ | @@ -1412,7 +1451,7 @@ | ||
| 1412 | ```json | 1451 | ```json |
| 1413 | { | 1452 | { |
| 1414 | "success": true, | 1453 | "success": true, |
| 1415 | - "message": "成功", | 1454 | + "msg": "成功", |
| 1416 | "data": { | 1455 | "data": { |
| 1417 | "totalCount": 6, | 1456 | "totalCount": 6, |
| 1418 | "executedCount": 5, | 1457 | "executedCount": 5, |
| @@ -1591,7 +1630,7 @@ | @@ -1591,7 +1630,7 @@ | ||
| 1591 | ```json | 1630 | ```json |
| 1592 | { | 1631 | { |
| 1593 | "success": true, | 1632 | "success": true, |
| 1594 | - "message": "成功", | 1633 | + "msg": "成功", |
| 1595 | "data": [ | 1634 | "data": [ |
| 1596 | { | 1635 | { |
| 1597 | "id": "53DfARB8Lllis48Qc5S", | 1636 | "id": "53DfARB8Lllis48Qc5S", |
| @@ -1700,3 +1739,358 @@ | @@ -1700,3 +1739,358 @@ | ||
| 1700 | ] | 1739 | ] |
| 1701 | } | 1740 | } |
| 1702 | ``` | 1741 | ``` |
| 1742 | + | ||
| 1743 | +--- | ||
| 1744 | + | ||
| 1745 | +## 6. 枚举定义接口 | ||
| 1746 | + | ||
| 1747 | +### 6.1 获取所有枚举定义常量数组信息 | ||
| 1748 | + | ||
| 1749 | +**接口路径:** `GET /enum/list/all` | ||
| 1750 | + | ||
| 1751 | +**接口说明:** 统一返回项目中定义的所有业务枚举的常量数组信息,供前端下拉框、状态映射等场景使用。每个枚举返回枚举类名、业务标识、中文说明以及其全部常量项(常量名 + 编号 + 描述)。 | ||
| 1752 | + | ||
| 1753 | +**请求参数:** 无 | ||
| 1754 | + | ||
| 1755 | +**响应数据:** `List<EnumDefinitionDTO>` | ||
| 1756 | + | ||
| 1757 | +**响应字段说明:** | ||
| 1758 | + | ||
| 1759 | +| 字段 | 类型 | 说明 | | ||
| 1760 | +|------|------|------| | ||
| 1761 | +| enumName | String | 枚举类名,如 RylbEnum | | ||
| 1762 | +| enumKey | String | 业务标识,如 rylb | | ||
| 1763 | +| description | String | 枚举中文说明,如 人员类别 | | ||
| 1764 | +| items | Array | 枚举常量项数组 | | ||
| 1765 | +| items[].name | String | 枚举常量名,如 QIYONG | | ||
| 1766 | +| items[].code | String | 常量编号,如 #2# | | ||
| 1767 | +| items[].desc | String | 常量描述,如 启用 | | ||
| 1768 | + | ||
| 1769 | +**响应示例:** | ||
| 1770 | + | ||
| 1771 | +```json | ||
| 1772 | +{ | ||
| 1773 | + "success": true, | ||
| 1774 | + "data": [ | ||
| 1775 | + { | ||
| 1776 | + "enumName": "RylbEnum", | ||
| 1777 | + "enumKey": "rylb", | ||
| 1778 | + "description": "人员类别", | ||
| 1779 | + "items": [ | ||
| 1780 | + { "name": "QUZHANG", "code": "#1#", "desc": "区长" }, | ||
| 1781 | + { "name": "BANZHANG", "code": "#2#", "desc": "班长" }, | ||
| 1782 | + { "name": "YIBANYUANGONG", "code": "#7#", "desc": "一般员工" } | ||
| 1783 | + ] | ||
| 1784 | + }, | ||
| 1785 | + { | ||
| 1786 | + "enumName": "DataStatusEnum", | ||
| 1787 | + "enumKey": "dataStatus", | ||
| 1788 | + "description": "数据状态", | ||
| 1789 | + "items": [ | ||
| 1790 | + { "name": "CAOGAO", "code": "#1#", "desc": "草稿" }, | ||
| 1791 | + { "name": "QIYONG", "code": "#2#", "desc": "启用" }, | ||
| 1792 | + { "name": "TINGYONG", "code": "#3#", "desc": "停用" } | ||
| 1793 | + ] | ||
| 1794 | + }, | ||
| 1795 | + { | ||
| 1796 | + "enumName": "GcqrZtEnum", | ||
| 1797 | + "enumKey": "gcqrZt", | ||
| 1798 | + "description": "过程确认状态", | ||
| 1799 | + "items": [ | ||
| 1800 | + { "name": "DAIQUEREN", "code": "#1#", "desc": "待确认" }, | ||
| 1801 | + { "name": "WEIZHIXING", "code": "#2#", "desc": "未执行" }, | ||
| 1802 | + { "name": "YIZHIXING", "code": "#3#", "desc": "已执行" }, | ||
| 1803 | + { "name": "YIYUQI", "code": "#4#", "desc": "已逾期" } | ||
| 1804 | + ] | ||
| 1805 | + } | ||
| 1806 | + ], | ||
| 1807 | + "msg": "成功", | ||
| 1808 | + "errCode": null | ||
| 1809 | +} | ||
| 1810 | +``` | ||
| 1811 | + | ||
| 1812 | +> 说明:示例仅列出部分枚举,实际返回包含项目中定义的全部枚举(人员类别、过程确认状态、未执行原因、数据状态、车间状态、C类改善状态、PJO执行状态、岗位性质、PJO工位状态、季度、问题层级、6S分类、问题处理方式、问题处理状态、问题类别、问题来源、问题性质、组员存在的问题等)。 | ||
| 1813 | + | ||
| 1814 | +--- | ||
| 1815 | + | ||
| 1816 | +## 7. 基础信息接口 | ||
| 1817 | + | ||
| 1818 | +> 本章节接口均返回对应实体中「状态为启用(#2#)」的数据记录列表。所有实体均继承基础字段:id(记录ID)、corpCode(企业编码)、createdAt(创建时间)、createdBy(创建人)、updatedAt(更新时间)、updatedBy(更新人)。 | ||
| 1819 | + | ||
| 1820 | +### 7.1 获取所有启用的线体列表 | ||
| 1821 | + | ||
| 1822 | +**接口路径:** `GET /xtLine/list/enabled` | ||
| 1823 | + | ||
| 1824 | +**接口说明:** 获取所有启用状态(amoigs = #2#)的线体信息列表。 | ||
| 1825 | + | ||
| 1826 | +**请求参数:** 无 | ||
| 1827 | + | ||
| 1828 | +**响应数据:** `List<XtLine>` | ||
| 1829 | + | ||
| 1830 | +**响应字段说明:** | ||
| 1831 | + | ||
| 1832 | +| 字段 | 类型 | 说明 | | ||
| 1833 | +|------|------|------| | ||
| 1834 | +| id | String | 记录ID | | ||
| 1835 | +| xtmc | String | 线体名称 | | ||
| 1836 | +| xtbh | String | 线体编号 | | ||
| 1837 | +| xtfzr | String | 线体负责人 | | ||
| 1838 | +| amoigs | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) | | ||
| 1839 | + | ||
| 1840 | +**响应示例:** | ||
| 1841 | + | ||
| 1842 | +```json | ||
| 1843 | +{ | ||
| 1844 | + "success": true, | ||
| 1845 | + "data": [ | ||
| 1846 | + { | ||
| 1847 | + "id": "6J4vk1uvwmoj6e3AL2G", | ||
| 1848 | + "corpCode": "qgutech", | ||
| 1849 | + "xtmc": "B线", | ||
| 1850 | + "xtbh": "B", | ||
| 1851 | + "xtfzr": "jU1pkX6iMiZjUPP19MP", | ||
| 1852 | + "amoigs": "#2#", | ||
| 1853 | + "createdAt": "2026-09-10 10:00:00", | ||
| 1854 | + "updatedAt": null | ||
| 1855 | + } | ||
| 1856 | + ], | ||
| 1857 | + "msg": "成功", | ||
| 1858 | + "errCode": null | ||
| 1859 | +} | ||
| 1860 | +``` | ||
| 1861 | + | ||
| 1862 | +### 7.2 获取所有启用的单位(车间)列表 | ||
| 1863 | + | ||
| 1864 | +**接口路径:** `GET /workshop/list/enabled` | ||
| 1865 | + | ||
| 1866 | +**接口说明:** 获取所有启用状态(ieiblp = #2#)的单位(车间)信息列表。 | ||
| 1867 | + | ||
| 1868 | +**请求参数:** 无 | ||
| 1869 | + | ||
| 1870 | +**响应数据:** `List<Workshop>` | ||
| 1871 | + | ||
| 1872 | +**响应字段说明:** | ||
| 1873 | + | ||
| 1874 | +| 字段 | 类型 | 说明 | | ||
| 1875 | +|------|------|------| | ||
| 1876 | +| id | String | 记录ID | | ||
| 1877 | +| dwmc | String | 单位名称 | | ||
| 1878 | +| dwbh | String | 单位编号 | | ||
| 1879 | +| ssxt | String | 所属线体id | | ||
| 1880 | +| dwfzr | String | 单位负责人 | | ||
| 1881 | +| sszz | String | 所属组织 | | ||
| 1882 | +| ieiblp | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) | | ||
| 1883 | +| statusDesc | String | 状态中文描述(非数据库字段) | | ||
| 1884 | + | ||
| 1885 | +**响应示例:** | ||
| 1886 | + | ||
| 1887 | +```json | ||
| 1888 | +{ | ||
| 1889 | + "success": true, | ||
| 1890 | + "data": [ | ||
| 1891 | + { | ||
| 1892 | + "id": "ahImSLxXBuQkFtU8Ace", | ||
| 1893 | + "corpCode": "qgutech", | ||
| 1894 | + "dwmc": "总装车间", | ||
| 1895 | + "dwbh": "104", | ||
| 1896 | + "ssxt": "6J4vk1uvwmoj6e3AL2G", | ||
| 1897 | + "dwfzr": "jU1pkX6iMiZjUPP19MP", | ||
| 1898 | + "sszz": "orgXXX", | ||
| 1899 | + "ieiblp": "#2#", | ||
| 1900 | + "statusDesc": "启用", | ||
| 1901 | + "createdAt": "2026-09-10 10:00:00", | ||
| 1902 | + "updatedAt": null | ||
| 1903 | + } | ||
| 1904 | + ], | ||
| 1905 | + "msg": "成功", | ||
| 1906 | + "errCode": null | ||
| 1907 | +} | ||
| 1908 | +``` | ||
| 1909 | + | ||
| 1910 | +### 7.3 获取所有启用的室组列表 | ||
| 1911 | + | ||
| 1912 | +**接口路径:** `GET /roomGroup/list/enabled` | ||
| 1913 | + | ||
| 1914 | +**接口说明:** 获取所有启用状态(zt = #2#)的室组信息列表。 | ||
| 1915 | + | ||
| 1916 | +**请求参数:** 无 | ||
| 1917 | + | ||
| 1918 | +**响应数据:** `List<RoomGroup>` | ||
| 1919 | + | ||
| 1920 | +**响应字段说明:** | ||
| 1921 | + | ||
| 1922 | +| 字段 | 类型 | 说明 | | ||
| 1923 | +|------|------|------| | ||
| 1924 | +| id | String | 记录ID | | ||
| 1925 | +| szmc | String | 室组名称 | | ||
| 1926 | +| szbh | String | 室组编号 | | ||
| 1927 | +| szfzr | String | 室组负责人 | | ||
| 1928 | +| ssdw | String | 所属单位(车间)id | | ||
| 1929 | +| sszz | String | 所属组织 | | ||
| 1930 | +| zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) | | ||
| 1931 | + | ||
| 1932 | +**响应示例:** | ||
| 1933 | + | ||
| 1934 | +```json | ||
| 1935 | +{ | ||
| 1936 | + "success": true, | ||
| 1937 | + "data": [ | ||
| 1938 | + { | ||
| 1939 | + "id": "rgXXX", | ||
| 1940 | + "corpCode": "qgutech", | ||
| 1941 | + "szmc": "总装室", | ||
| 1942 | + "szbh": "201", | ||
| 1943 | + "szfzr": "jU1pkX6iMiZjUPP19MP", | ||
| 1944 | + "ssdw": "ahImSLxXBuQkFtU8Ace", | ||
| 1945 | + "sszz": "orgXXX", | ||
| 1946 | + "zt": "#2#", | ||
| 1947 | + "createdAt": "2026-09-10 10:00:00", | ||
| 1948 | + "updatedAt": null | ||
| 1949 | + } | ||
| 1950 | + ], | ||
| 1951 | + "msg": "成功", | ||
| 1952 | + "errCode": null | ||
| 1953 | +} | ||
| 1954 | +``` | ||
| 1955 | + | ||
| 1956 | +### 7.4 获取所有启用的区域列表 | ||
| 1957 | + | ||
| 1958 | +**接口路径:** `GET /area/list/enabled` | ||
| 1959 | + | ||
| 1960 | +**接口说明:** 获取所有启用状态(zt = #2#)的区域信息列表。 | ||
| 1961 | + | ||
| 1962 | +**请求参数:** 无 | ||
| 1963 | + | ||
| 1964 | +**响应数据:** `List<Area>` | ||
| 1965 | + | ||
| 1966 | +**响应字段说明:** | ||
| 1967 | + | ||
| 1968 | +| 字段 | 类型 | 说明 | | ||
| 1969 | +|------|------|------| | ||
| 1970 | +| id | String | 记录ID | | ||
| 1971 | +| qymc | String | 区域名称 | | ||
| 1972 | +| qybh | String | 区域编号 | | ||
| 1973 | +| qyfzr | String | 区域负责人 | | ||
| 1974 | +| sscj | String | 所属车间id | | ||
| 1975 | +| sssz | String | 所属室组id | | ||
| 1976 | +| sszz | String | 所属组织 | | ||
| 1977 | +| zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) | | ||
| 1978 | + | ||
| 1979 | +**响应示例:** | ||
| 1980 | + | ||
| 1981 | +```json | ||
| 1982 | +{ | ||
| 1983 | + "success": true, | ||
| 1984 | + "data": [ | ||
| 1985 | + { | ||
| 1986 | + "id": "fmGDmYdCswHy1AfNO7R", | ||
| 1987 | + "corpCode": "qgutech", | ||
| 1988 | + "qymc": "底盘分装", | ||
| 1989 | + "qybh": "51", | ||
| 1990 | + "qyfzr": "jU1pkX6iMiZjUPP19MP", | ||
| 1991 | + "sscj": "ahImSLxXBuQkFtU8Ace", | ||
| 1992 | + "sssz": "rgXXX", | ||
| 1993 | + "sszz": "orgXXX", | ||
| 1994 | + "zt": "#2#", | ||
| 1995 | + "createdAt": "2026-09-10 10:00:00", | ||
| 1996 | + "updatedAt": null | ||
| 1997 | + } | ||
| 1998 | + ], | ||
| 1999 | + "msg": "成功", | ||
| 2000 | + "errCode": null | ||
| 2001 | +} | ||
| 2002 | +``` | ||
| 2003 | + | ||
| 2004 | +### 7.5 获取所有启用的班组列表 | ||
| 2005 | + | ||
| 2006 | +**接口路径:** `GET /team/list/enabled` | ||
| 2007 | + | ||
| 2008 | +**接口说明:** 获取所有启用状态(zt = #2#)的班组信息列表。 | ||
| 2009 | + | ||
| 2010 | +**请求参数:** 无 | ||
| 2011 | + | ||
| 2012 | +**响应数据:** `List<Team>` | ||
| 2013 | + | ||
| 2014 | +**响应字段说明:** | ||
| 2015 | + | ||
| 2016 | +| 字段 | 类型 | 说明 | | ||
| 2017 | +|------|------|------| | ||
| 2018 | +| id | String | 记录ID | | ||
| 2019 | +| bzmc | String | 班组名称 | | ||
| 2020 | +| bzbh | String | 班组编号 | | ||
| 2021 | +| bzfzr | String | 班组负责人 | | ||
| 2022 | +| ssqy | String | 所属区域id | | ||
| 2023 | +| bc | String | 班次id | | ||
| 2024 | +| iytfgx | String | 是否同步工序 | | ||
| 2025 | +| bzcy | String | 班组成员 | | ||
| 2026 | +| sszz | String | 所属组织 | | ||
| 2027 | +| zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) | | ||
| 2028 | + | ||
| 2029 | +**响应示例:** | ||
| 2030 | + | ||
| 2031 | +```json | ||
| 2032 | +{ | ||
| 2033 | + "success": true, | ||
| 2034 | + "data": [ | ||
| 2035 | + { | ||
| 2036 | + "id": "GQ8wL2PXGUutYA7HKks", | ||
| 2037 | + "corpCode": "qgutech", | ||
| 2038 | + "bzmc": "发动机分装班", | ||
| 2039 | + "bzbh": "142", | ||
| 2040 | + "bzfzr": "jU1pkX6iMiZjUPP19MP", | ||
| 2041 | + "ssqy": "fmGDmYdCswHy1AfNO7R", | ||
| 2042 | + "bc": "04XZ79FFFNlMQvVRbNC", | ||
| 2043 | + "iytfgx": null, | ||
| 2044 | + "bzcy": "jU1pkX6iMiZjUPP19MP", | ||
| 2045 | + "sszz": "orgXXX", | ||
| 2046 | + "zt": "#2#", | ||
| 2047 | + "createdAt": "2026-09-10 10:00:00", | ||
| 2048 | + "updatedAt": null | ||
| 2049 | + } | ||
| 2050 | + ], | ||
| 2051 | + "msg": "成功", | ||
| 2052 | + "errCode": null | ||
| 2053 | +} | ||
| 2054 | +``` | ||
| 2055 | + | ||
| 2056 | +### 7.6 获取所有启用的班次列表 | ||
| 2057 | + | ||
| 2058 | +**接口路径:** `GET /shift/list/enabled` | ||
| 2059 | + | ||
| 2060 | +**接口说明:** 获取所有启用状态(zt = #2#)的班次信息列表。 | ||
| 2061 | + | ||
| 2062 | +**请求参数:** 无 | ||
| 2063 | + | ||
| 2064 | +**响应数据:** `List<Shift>` | ||
| 2065 | + | ||
| 2066 | +**响应字段说明:** | ||
| 2067 | + | ||
| 2068 | +| 字段 | 类型 | 说明 | | ||
| 2069 | +|------|------|------| | ||
| 2070 | +| id | String | 记录ID | | ||
| 2071 | +| bcmc | String | 班次名称 | | ||
| 2072 | +| bcbh | String | 班次编号 | | ||
| 2073 | +| bclx | String | 班次类型 | | ||
| 2074 | +| zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) | | ||
| 2075 | + | ||
| 2076 | +**响应示例:** | ||
| 2077 | + | ||
| 2078 | +```json | ||
| 2079 | +{ | ||
| 2080 | + "success": true, | ||
| 2081 | + "data": [ | ||
| 2082 | + { | ||
| 2083 | + "id": "04XZ79FFFNlMQvVRbNC", | ||
| 2084 | + "corpCode": "qgutech", | ||
| 2085 | + "bcmc": "白班", | ||
| 2086 | + "bcbh": "1", | ||
| 2087 | + "bclx": "正常班", | ||
| 2088 | + "zt": "#2#", | ||
| 2089 | + "createdAt": "2026-09-10 10:00:00", | ||
| 2090 | + "updatedAt": null | ||
| 2091 | + } | ||
| 2092 | + ], | ||
| 2093 | + "msg": "成功", | ||
| 2094 | + "errCode": null | ||
| 2095 | +} | ||
| 2096 | +``` |
| 1 | 接口示例 | 1 | 接口示例 |
| 2 | AB类改善模块: | 2 | AB类改善模块: |
| 3 | +1、AB类改善柱状图-数据来源; | ||
| 4 | +请求url:http://localhost:8003/abImprovement/summary/year | ||
| 5 | +出参示例: | ||
| 6 | +{ | ||
| 7 | + "success": true, | ||
| 8 | + "data": [ | ||
| 9 | + { | ||
| 10 | + "dwcj": "KJxOJQBiZd816rg4Eeb", | ||
| 11 | + "dwcjName": "涂装车间", | ||
| 12 | + "dwcjCode": "101", | ||
| 13 | + "year": "2026", | ||
| 14 | + "totalQnjyjz": 2000000, | ||
| 15 | + "mb": 1800000, | ||
| 16 | + "completionRate": 111.11 | ||
| 17 | + }, | ||
| 18 | + { | ||
| 19 | + "dwcj": "GUGXUW77KKfQRu4BFgx", | ||
| 20 | + "dwcjName": "冲压车间", | ||
| 21 | + "dwcjCode": "102", | ||
| 22 | + "year": "2026", | ||
| 23 | + "totalQnjyjz": 2300000, | ||
| 24 | + "mb": 2300000, | ||
| 25 | + "completionRate": 100 | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + "dwcj": "ahImSLxXBuQkFtU8Ace", | ||
| 29 | + "dwcjName": "总装车间", | ||
| 30 | + "dwcjCode": "104", | ||
| 31 | + "year": "2026", | ||
| 32 | + "totalQnjyjz": 1500000, | ||
| 33 | + "mb": 2000000, | ||
| 34 | + "completionRate": 75 | ||
| 35 | + }, | ||
| 36 | + { | ||
| 37 | + "dwcj": "fajFKONK5pKiFcyzqDT", | ||
| 38 | + "dwcjName": "焊装车间", | ||
| 39 | + "dwcjCode": "105", | ||
| 40 | + "year": "2026", | ||
| 41 | + "totalQnjyjz": 1900000, | ||
| 42 | + "mb": 2500000, | ||
| 43 | + "completionRate": 76 | ||
| 44 | + } | ||
| 45 | + ], | ||
| 46 | + "msg": "成功", | ||
| 47 | + "errCode": null | ||
| 48 | +} | ||
| 3 | 49 | ||
| 4 | C类改善模块: | 50 | C类改善模块: |
| 5 | 1、C类改善柱状图数据来源-根据季度获取每个室组的汇总统计信息; | 51 | 1、C类改善柱状图数据来源-根据季度获取每个室组的汇总统计信息; |
| @@ -49,3 +49,504 @@ CREATE TABLE `t_apaas_uc_org` | @@ -49,3 +49,504 @@ CREATE TABLE `t_apaas_uc_org` | ||
| 49 | `sorts` double (21,6) DEFAULT NULL, | 49 | `sorts` double (21,6) DEFAULT NULL, |
| 50 | PRIMARY KEY (`id`) USING BTREE | 50 | PRIMARY KEY (`id`) USING BTREE |
| 51 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | 51 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 52 | + | ||
| 53 | +--人事系统-考勤记录 | ||
| 54 | +CREATE TABLE `t_auto_hfca_ijuiwo_gbjuvp` | ||
| 55 | +( | ||
| 56 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 57 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 58 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 59 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 60 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 61 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 62 | + `employee_code` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 63 | + `post_level` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 64 | + `sign_date` datetime(3) DEFAULT NULL, | ||
| 65 | + `timeclassname` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 66 | + `name` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 67 | + `clock_in_time` datetime(3) DEFAULT NULL, | ||
| 68 | + `clock_out_time` datetime(3) DEFAULT NULL, | ||
| 69 | + `shift_work_time` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 70 | + `shift_closing_time` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 71 | + PRIMARY KEY (`id`) | ||
| 72 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 73 | + | ||
| 74 | + | ||
| 75 | +/**************基础信息*************/ | ||
| 76 | +--线体信息 | ||
| 77 | +CREATE TABLE `t_auto_hfca_ixzvok_umsoxi` | ||
| 78 | +( | ||
| 79 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 80 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 81 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 82 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 83 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 84 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 85 | + `xtmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 86 | + `xtbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 87 | + `xtfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 88 | + `amoigs` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 89 | + PRIMARY KEY (`id`) | ||
| 90 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 91 | + | ||
| 92 | + | ||
| 93 | +--单位(车间)信息 | ||
| 94 | +CREATE TABLE `t_auto_hfca_ixzvok_phwifn` | ||
| 95 | +( | ||
| 96 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 97 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 98 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 99 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 100 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 101 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 102 | + `dwmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 103 | + `dwbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 104 | + `ssxt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 105 | + `dwfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 106 | + `sszz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 107 | + `ieiblp` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 108 | + PRIMARY KEY (`id`) | ||
| 109 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 110 | + | ||
| 111 | +--班次信息 | ||
| 112 | +CREATE TABLE `t_auto_hfca_ixzvok_usnoxx` | ||
| 113 | +( | ||
| 114 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 115 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 116 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 117 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 118 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 119 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 120 | + `bcmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 121 | + `bcbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 122 | + `bclx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 123 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 124 | + PRIMARY KEY (`id`) | ||
| 125 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 126 | + | ||
| 127 | + | ||
| 128 | +--室组信息 | ||
| 129 | +CREATE TABLE `t_auto_hfca_ixzvok_efawtt` | ||
| 130 | +( | ||
| 131 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 132 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 133 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 134 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 135 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 136 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 137 | + `szmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 138 | + `szbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 139 | + `szfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 140 | + `ssdw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 141 | + `sszz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 142 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 143 | + PRIMARY KEY (`id`) | ||
| 144 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 145 | + | ||
| 146 | +--区域信息 | ||
| 147 | +CREATE TABLE `t_auto_hfca_ixzvok_cnfeci` | ||
| 148 | +( | ||
| 149 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 150 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 151 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 152 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 153 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 154 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 155 | + `qymc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 156 | + `qybh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 157 | + `qyfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 158 | + `sscj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 159 | + `sssz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 160 | + `sszz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 161 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 162 | + PRIMARY KEY (`id`) | ||
| 163 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 164 | + | ||
| 165 | +--班组信息 | ||
| 166 | +CREATE TABLE `t_auto_hfca_ixzvok_bzxxgl` | ||
| 167 | +( | ||
| 168 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 169 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 170 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 171 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 172 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 173 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 174 | + `bzmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 175 | + `bzbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 176 | + `bzfzr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 177 | + `ssqy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 178 | + `bc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 179 | + `iytfgx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 180 | + `bzcy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 181 | + `sszz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 182 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 183 | + PRIMARY KEY (`id`) | ||
| 184 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 185 | + | ||
| 186 | + | ||
| 187 | +--人员信息 | ||
| 188 | +CREATE TABLE `t_auto_hfca_ixzvok_bzcygl` | ||
| 189 | +( | ||
| 190 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 191 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 192 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 193 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 194 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 195 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 196 | + `ssbz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 197 | + `xm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 198 | + `ry` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 199 | + `ssbm` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 200 | + `gh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 201 | + `ssdw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 202 | + `sssz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 203 | + `ssqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 204 | + PRIMARY KEY (`id`) | ||
| 205 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 206 | + | ||
| 207 | + | ||
| 208 | +--工位信息 | ||
| 209 | +CREATE TABLE `t_auto_hfca_ixzvok_jtcffk` | ||
| 210 | +( | ||
| 211 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 212 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 213 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 214 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 215 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 216 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 217 | + `gwmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 218 | + `gwbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 219 | + `gwxz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 220 | + `ssqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 221 | + `ssbz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 222 | + `sscj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 223 | + `ssqz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 224 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 225 | + `xt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 226 | + `byiwiz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 227 | + PRIMARY KEY (`id`) | ||
| 228 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 229 | + | ||
| 230 | + | ||
| 231 | +--季度人员信息 | ||
| 232 | +CREATE TABLE `t_auto_hfca_ixzvok_wltctp` | ||
| 233 | +( | ||
| 234 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 235 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 236 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 237 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 238 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 239 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 240 | + `jdxx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 241 | + `yhry` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 242 | + `rygh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 243 | + `shdw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 244 | + `shsz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 245 | + `ssqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 246 | + `ssbz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 247 | + `year` datetime(3) DEFAULT NULL, | ||
| 248 | + PRIMARY KEY (`id`) | ||
| 249 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 250 | + | ||
| 251 | + | ||
| 252 | +/***********过程确认************/ | ||
| 253 | +--过程确认维护人员信息 | ||
| 254 | +CREATE TABLE `t_auto_hfca_ixzvok_gcjhrywh` | ||
| 255 | +( | ||
| 256 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 257 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 258 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 259 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 260 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 261 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 262 | + `hdzxrq` datetime(3) DEFAULT NULL, | ||
| 263 | + `zxry` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 264 | + `hdzxrxm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 265 | + `gh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 266 | + `gzdw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 267 | + `rylb` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 268 | + `szqymc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 269 | + `bz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 270 | + `xt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 271 | + `bc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 272 | + `gqsj` datetime(3) DEFAULT NULL, | ||
| 273 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 274 | + `gczx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 275 | + `wzxyy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 276 | + `sffxwt` tinyint(1) DEFAULT NULL, | ||
| 277 | + `dwmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 278 | + `dwbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 279 | + `dwfzr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 280 | + `ry` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 281 | + `ryssdw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 282 | + `sssz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 283 | + `ssbz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 284 | + `sz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 285 | + `qy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 286 | + `ssqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 287 | + `eaohkg` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 288 | + `gcqrjhry` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 289 | + `dw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 290 | + `ssdw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 291 | + `ssxt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 292 | + `ryxm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 293 | + `sfyzx` tinyint(1) DEFAULT NULL, | ||
| 294 | + PRIMARY KEY (`id`) | ||
| 295 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 296 | + | ||
| 297 | + | ||
| 298 | +--过程确认计划执行记录信息 | ||
| 299 | +CREATE TABLE `t_auto_hfca_ixzvok_gcqrjhzx` | ||
| 300 | +( | ||
| 301 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 302 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 303 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 304 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 305 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 306 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 307 | + `hdzxrq` datetime(3) DEFAULT NULL, | ||
| 308 | + `gcqrjhry` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 309 | + `zxry` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 310 | + `gh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 311 | + `rylb` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 312 | + `dw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 313 | + `sz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 314 | + `qy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 315 | + `bz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 316 | + `xt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 317 | + `bc` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 318 | + `gqsj` datetime(3) DEFAULT NULL, | ||
| 319 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 320 | + `sfyzx` tinyint(1) DEFAULT NULL, | ||
| 321 | + `wzxyysm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 322 | + `sffxwt` tinyint(1) DEFAULT NULL, | ||
| 323 | + `wzxyys` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 324 | + PRIMARY KEY (`id`) | ||
| 325 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 326 | + | ||
| 327 | + | ||
| 328 | +/**********PJO计划**********/ | ||
| 329 | +--PJO计划批次信息 | ||
| 330 | +CREATE TABLE `t_auto_hfca_ixzvok_ouziyg` | ||
| 331 | +( | ||
| 332 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 333 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 334 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 335 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 336 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 337 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 338 | + `pcbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 339 | + `pczxr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 340 | + `pczxksrq` datetime(3) DEFAULT NULL, | ||
| 341 | + `pczxjsrq` datetime(3) DEFAULT NULL, | ||
| 342 | + `zxqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 343 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 344 | + `pcmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 345 | + PRIMARY KEY (`id`) | ||
| 346 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 347 | + | ||
| 348 | +--PJO计划工位执行情况信息 | ||
| 349 | +CREATE TABLE `t_auto_hfca_ixzvok_kjpssd` | ||
| 350 | +( | ||
| 351 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 352 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 353 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 354 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 355 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 356 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 357 | + `gwzt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 358 | + `pjopc` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 359 | + `gw` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 360 | + `clbcfl` double (21,6) DEFAULT NULL, | ||
| 361 | + `gwmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 362 | + `gwbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 363 | + `sscj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 364 | + `ssqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 365 | + `gwzxssbz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 366 | + PRIMARY KEY (`id`) | ||
| 367 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 368 | + | ||
| 369 | + | ||
| 370 | +--PJO计划执行信息 | ||
| 371 | +CREATE TABLE `t_auto_hfca_ixzvok_wmkgsv` | ||
| 372 | +( | ||
| 373 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 374 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 375 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 376 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 377 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 378 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 379 | + `drscbc` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 380 | + `qkxdwk` datetime(3) DEFAULT NULL, | ||
| 381 | + `pjozxr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 382 | + `pjopc` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 383 | + `cj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 384 | + `cx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 385 | + `cpsqy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 386 | + `bz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 387 | + `pjogcrxm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 388 | + `gwxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 389 | + `sspc` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 390 | + `gwxz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 391 | + `pjosfzckz` tinyint(1) DEFAULT NULL, | ||
| 392 | + `gchtxzyyc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 393 | + `gchtxcyyc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 394 | + `gcdwt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 395 | + `gcgjjh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 396 | + `lfwkuc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 397 | + `zyczdwt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 398 | + `zdbgwdgsjy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 399 | + `lvqwyc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 400 | + `zyqm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 401 | + `zysfyjy` tinyint(1) DEFAULT NULL, | ||
| 402 | + `cyjy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 403 | + `zyjy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 404 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 405 | + `qy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 406 | + `gwxx2` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 407 | + `zyqmb` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 408 | + `gwzx1` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 409 | + `gwzx2` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 410 | + `xt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 411 | + PRIMARY KEY (`id`) | ||
| 412 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 413 | + | ||
| 414 | + | ||
| 415 | +/***********问题管理***********/ | ||
| 416 | +--CPS体系问题记录信息 | ||
| 417 | +CREATE TABLE `t_auto_hfca_ixzvok_cpstxw` | ||
| 418 | +( | ||
| 419 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 420 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 421 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 422 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 423 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 424 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 425 | + `wtbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 426 | + `wtly` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 427 | + `wttcr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 428 | + `gzdw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 429 | + `szqymc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 430 | + `rylb` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 431 | + `wtms` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 432 | + `wtdw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 433 | + `wtfj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 434 | + `wtssbk` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 435 | + `wtlb` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 436 | + `wtxz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 437 | + `sfl` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 438 | + `wtsfgb` tinyint(1) DEFAULT NULL, | ||
| 439 | + `sz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 440 | + `mbghlk` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 441 | + `wtclfs` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 442 | + `tntpvy` datetime(3) DEFAULT NULL, | ||
| 443 | + `gzap` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 444 | + `wtsjz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 445 | + `wtjjcs` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 446 | + `wtzghfj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 447 | + `wtclr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 448 | + `wtclzt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 449 | + `lywt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 450 | + `zcwt` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 451 | + `qy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 452 | + `bz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 453 | + `lylx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 454 | + `jhjjsj` datetime(3) DEFAULT NULL, | ||
| 455 | + `wtclfs2` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 456 | + `gzap2` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 457 | + `wtsjz2` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 458 | + `wtclfs3` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 459 | + `gzap3` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 460 | + `wtsjz3` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 461 | + `process_instance_id` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 462 | + `approval_status` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 463 | + PRIMARY KEY (`id`) | ||
| 464 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 465 | + | ||
| 466 | + | ||
| 467 | +/********改善管理*********/ | ||
| 468 | +--AB类改善 | ||
| 469 | +CREATE TABLE `t_auto_hfca_ixzvok_sfikan` | ||
| 470 | +( | ||
| 471 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 472 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 473 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 474 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 475 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 476 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 477 | + `lcslmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 478 | + `dwcj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 479 | + `sqr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 480 | + `sqbm` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 481 | + `sqrq` datetime(3) DEFAULT NULL, | ||
| 482 | + `lxr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 483 | + `qnjyjz` double (21,6) DEFAULT NULL, | ||
| 484 | + `gslx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 485 | + `tdrs` double (21,6) DEFAULT NULL, | ||
| 486 | + PRIMARY KEY (`id`) | ||
| 487 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 488 | + | ||
| 489 | + | ||
| 490 | +--C类改善 | ||
| 491 | +CREATE TABLE `t_auto_hfca_ixzvok_clgsgl` | ||
| 492 | +( | ||
| 493 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 494 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 495 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 496 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 497 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 498 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 499 | + `yh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 500 | + `ygh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 501 | + `lywt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 502 | + `wtbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 503 | + `bm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 504 | + `szqymc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 505 | + `sfwtlg` tinyint(1) DEFAULT NULL, | ||
| 506 | + `sfscjb` tinyint(1) DEFAULT NULL, | ||
| 507 | + `bz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 508 | + `gsmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 509 | + `qzqr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 510 | + `gsyqr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 511 | + `sftsyxal` tinyint(1) DEFAULT NULL, | ||
| 512 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 513 | + `wtsm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 514 | + `gshxg` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 515 | + `fqr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 516 | + `szmc` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 517 | + `process_instance_id` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 518 | + `approval_status` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 519 | + `sftsjdz` tinyint(1) DEFAULT NULL, | ||
| 520 | + PRIMARY KEY (`id`) | ||
| 521 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 522 | + | ||
| 523 | + | ||
| 524 | +--标准活动优秀案例 | ||
| 525 | +CREATE TABLE `t_auto_hfca_ixzvok_bzhdyx` | ||
| 526 | +( | ||
| 527 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | ||
| 528 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | ||
| 529 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | ||
| 530 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | ||
| 531 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | ||
| 532 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | ||
| 533 | + `hdzxr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 534 | + `ygbh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 535 | + `gzdw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 536 | + `szqymc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 537 | + `xt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 538 | + `wtbm` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 539 | + `tjalfj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 540 | + `qz` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 541 | + `bdwcps` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 542 | + `dwldsh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 543 | + `_c_sftscp` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 544 | + `sftscp` tinyint(1) DEFAULT NULL, | ||
| 545 | + `sz` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 546 | + `bdwcpstxy` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 547 | + `sftscps` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 548 | + `zt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 549 | + `process_instance_id` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 550 | + `approval_status` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 551 | + PRIMARY KEY (`id`) | ||
| 552 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |