Commit d8d61cef3bf3bbf7d8f4315374bdd3db4b9c1329

Authored by 陈强
1 parent 46e80ac4

IPO看板驾驶舱-特色公告、多能工、5S责任图、员工每日出勤、区域记分卡等模块内容接口新增

Showing 74 changed files with 4373 additions and 46 deletions

Too many changes to show.

To preserve performance only 74 of 76 files are displayed.

... ... @@ -6,6 +6,7 @@ import com.qgutech.qgyun.framework.common.result.JsonResult;
6 6 import lombok.extern.slf4j.Slf4j;
7 7 import org.springframework.web.bind.annotation.GetMapping;
8 8 import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
9 10 import org.springframework.web.bind.annotation.RestController;
10 11
11 12 import javax.annotation.Resource;
... ... @@ -34,13 +35,14 @@ public class AreaController {
34 35 }
35 36
36 37 /**
37   - * 获取所有启用状态的区域信息列表
  38 + * 获取所有启用状态的区域信息列表,可按所属室组筛选
38 39 *
  40 + * @param sssz 所属室组(RoomGroup)id,可不传
39 41 * @return
40 42 */
41 43 @GetMapping("/list/enabled")
42   - public JsonResult listEnabled() {
43   - List<Area> areaList = areaService.listEnabled();
  44 + public JsonResult listEnabled(@RequestParam(required = false) String sssz) {
  45 + List<Area> areaList = areaService.listEnabled(sssz);
44 46 return new JsonResult<>(true, "成功", areaList);
45 47 }
46 48 }
... ...
... ... @@ -6,6 +6,7 @@ import com.qgutech.qgyun.framework.common.result.JsonResult;
6 6 import lombok.extern.slf4j.Slf4j;
7 7 import org.springframework.web.bind.annotation.GetMapping;
8 8 import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
9 10 import org.springframework.web.bind.annotation.RestController;
10 11
11 12 import javax.annotation.Resource;
... ... @@ -34,13 +35,14 @@ public class RoomGroupController {
34 35 }
35 36
36 37 /**
37   - * 获取所有启用状态的室组信息列表
  38 + * 获取所有启用状态的室组信息列表,可按所属单位筛选
38 39 *
  40 + * @param ssdw 所属单位(Workshop)id,可不传
39 41 * @return
40 42 */
41 43 @GetMapping("/list/enabled")
42   - public JsonResult listEnabled() {
43   - List<RoomGroup> roomGroupList = roomGroupService.listEnabled();
  44 + public JsonResult listEnabled(@RequestParam(required = false) String ssdw) {
  45 + List<RoomGroup> roomGroupList = roomGroupService.listEnabled(ssdw);
44 46 return new JsonResult<>(true, "成功", roomGroupList);
45 47 }
46 48 }
... ...
... ... @@ -6,6 +6,7 @@ import com.qgutech.qgyun.framework.common.result.JsonResult;
6 6 import lombok.extern.slf4j.Slf4j;
7 7 import org.springframework.web.bind.annotation.GetMapping;
8 8 import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
9 10 import org.springframework.web.bind.annotation.RestController;
10 11
11 12 import javax.annotation.Resource;
... ... @@ -34,13 +35,14 @@ public class TeamController {
34 35 }
35 36
36 37 /**
37   - * 获取所有启用状态的班组信息列表
  38 + * 获取所有启用状态的班组信息列表,可按所属区域筛选
38 39 *
  40 + * @param ssqy 所属区域(Area)id,可不传
39 41 * @return
40 42 */
41 43 @GetMapping("/list/enabled")
42   - public JsonResult listEnabled() {
43   - List<Team> teamList = teamService.listEnabled();
  44 + public JsonResult listEnabled(@RequestParam(required = false) String ssqy) {
  45 + List<Team> teamList = teamService.listEnabled(ssqy);
44 46 return new JsonResult<>(true, "成功", teamList);
45 47 }
46 48 }
... ...
... ... @@ -6,6 +6,7 @@ import com.qgutech.qgyun.framework.common.result.JsonResult;
6 6 import lombok.extern.slf4j.Slf4j;
7 7 import org.springframework.web.bind.annotation.GetMapping;
8 8 import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
9 10 import org.springframework.web.bind.annotation.RestController;
10 11
11 12 import javax.annotation.Resource;
... ... @@ -38,13 +39,14 @@ public class WorkshopController {
38 39 }
39 40
40 41 /**
41   - * 获取所有启用状态的单位(车间)信息列表
  42 + * 获取所有启用状态的单位(车间)信息列表,可按所属线体筛选
42 43 *
  44 + * @param ssxt 所属线体(XtLine)id,可不传
43 45 * @return
44 46 */
45 47 @GetMapping("/list/enabled")
46   - public JsonResult listEnabled() {
47   - List<Workshop> workshopList = workshopService.listEnabled();
  48 + public JsonResult listEnabled(@RequestParam(required = false) String ssxt) {
  49 + List<Workshop> workshopList = workshopService.listEnabled(ssxt);
48 50 return new JsonResult<>(true, "成功", workshopList);
49 51 }
50 52 }
... ...
... ... @@ -21,6 +21,11 @@ public class Area extends BaseCorpModel {
21 21 */
22 22 public static final String ZT = "zt";
23 23
  24 + /**
  25 + * 所属室组字段(sssz),存储室组(RoomGroup)的 id
  26 + */
  27 + public static final String SSSZ = "sssz";
  28 +
24 29 /*
25 30 * 区域名称
26 31 */
... ...
... ... @@ -21,6 +21,11 @@ public class RoomGroup extends BaseCorpModel {
21 21 */
22 22 public static final String ZT = "zt";
23 23
  24 + /**
  25 + * 所属单位字段(ssdw),存储单位车间(Workshop)的 id
  26 + */
  27 + public static final String SSDW = "ssdw";
  28 +
24 29 /*
25 30 * 室组名称
26 31 */
... ...
... ... @@ -21,6 +21,11 @@ public class Team extends BaseCorpModel {
21 21 */
22 22 public static final String ZT = "zt";
23 23
  24 + /**
  25 + * 所属区域字段(ssqy),存储区域(Area)的 id
  26 + */
  27 + public static final String SSQY = "ssqy";
  28 +
24 29 /*
25 30 * 班组名称
26 31 */
... ...
... ... @@ -23,6 +23,11 @@ public class Workshop extends BaseCorpModel {
23 23 */
24 24 public static final String IEIBLP = "ieiblp";
25 25
  26 + /**
  27 + * 所属线体字段(ssxt),存储线体(XtLine)的 id
  28 + */
  29 + public static final String SSXT = "ssxt";
  30 +
26 31 /*
27 32 * 单位名称
28 33 */
... ...
... ... @@ -7,6 +7,7 @@ import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum;
7 7 import com.qgutech.qgyun.apaas.sync.cps.mapper.AreaMapper;
8 8 import com.qgutech.qgyun.apaas.sync.cps.model.Area;
9 9 import org.apache.commons.collections4.CollectionUtils;
  10 +import org.apache.commons.lang3.StringUtils;
10 11 import org.springframework.stereotype.Service;
11 12 import org.springframework.transaction.annotation.Transactional;
12 13 import org.springframework.util.Assert;
... ... @@ -72,12 +73,18 @@ public class AreaService extends BaseServiceImpl<Area> {
72 73 }
73 74
74 75 /**
75   - * 查询所有启用状态的区域信息列表
  76 + * 查询所有启用状态的区域信息列表,可按所属室组筛选
  77 + *
  78 + * @param sssz 所属室组(RoomGroup)id,为空时不按室组筛选
76 79 */
77 80 @Transactional(readOnly = true)
78   - public List<Area> listEnabled() {
  81 + public List<Area> listEnabled(String sssz) {
79 82 Example example = new Example(entityClass);
80   - CorpExample.criteria(example).andEqualTo(Area.ZT, DataStatusEnum.QIYONG.getCode());
  83 + Example.Criteria criteria = CorpExample.criteria(example)
  84 + .andEqualTo(Area.ZT, DataStatusEnum.QIYONG.getCode());
  85 + if (StringUtils.isNotBlank(sssz)) {
  86 + criteria.andEqualTo(Area.SSSZ, sssz);
  87 + }
81 88 List<Area> areaList = areaMapper.selectByExample(example);
82 89 if (CollectionUtils.isEmpty(areaList)) {
83 90 return new ArrayList<>(0);
... ...
... ... @@ -7,6 +7,7 @@ import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum;
7 7 import com.qgutech.qgyun.apaas.sync.cps.mapper.RoomGroupMapper;
8 8 import com.qgutech.qgyun.apaas.sync.cps.model.RoomGroup;
9 9 import org.apache.commons.collections4.CollectionUtils;
  10 +import org.apache.commons.lang3.StringUtils;
10 11 import org.springframework.stereotype.Service;
11 12 import org.springframework.transaction.annotation.Transactional;
12 13 import org.springframework.util.Assert;
... ... @@ -72,12 +73,18 @@ public class RoomGroupService extends BaseServiceImpl<RoomGroup> {
72 73 }
73 74
74 75 /**
75   - * 查询所有启用状态的室组信息列表
  76 + * 查询所有启用状态的室组信息列表,可按所属单位筛选
  77 + *
  78 + * @param ssdw 所属单位(Workshop)id,为空时不按单位筛选
76 79 */
77 80 @Transactional(readOnly = true)
78   - public List<RoomGroup> listEnabled() {
  81 + public List<RoomGroup> listEnabled(String ssdw) {
79 82 Example example = new Example(entityClass);
80   - CorpExample.criteria(example).andEqualTo(RoomGroup.ZT, DataStatusEnum.QIYONG.getCode());
  83 + Example.Criteria criteria = CorpExample.criteria(example)
  84 + .andEqualTo(RoomGroup.ZT, DataStatusEnum.QIYONG.getCode());
  85 + if (StringUtils.isNotBlank(ssdw)) {
  86 + criteria.andEqualTo(RoomGroup.SSDW, ssdw);
  87 + }
81 88 List<RoomGroup> roomGroupList = roomGroupMapper.selectByExample(example);
82 89 if (CollectionUtils.isEmpty(roomGroupList)) {
83 90 return new ArrayList<>(0);
... ...
... ... @@ -7,6 +7,7 @@ import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum;
7 7 import com.qgutech.qgyun.apaas.sync.cps.mapper.TeamMapper;
8 8 import com.qgutech.qgyun.apaas.sync.cps.model.Team;
9 9 import org.apache.commons.collections4.CollectionUtils;
  10 +import org.apache.commons.lang3.StringUtils;
10 11 import org.springframework.stereotype.Service;
11 12 import org.springframework.transaction.annotation.Transactional;
12 13 import org.springframework.util.Assert;
... ... @@ -72,12 +73,18 @@ public class TeamService extends BaseServiceImpl<Team> {
72 73 }
73 74
74 75 /**
75   - * 查询所有启用状态的班组信息列表
  76 + * 查询所有启用状态的班组信息列表,可按所属区域筛选
  77 + *
  78 + * @param ssqy 所属区域(Area)id,为空时不按区域筛选
76 79 */
77 80 @Transactional(readOnly = true)
78   - public List<Team> listEnabled() {
  81 + public List<Team> listEnabled(String ssqy) {
79 82 Example example = new Example(entityClass);
80   - CorpExample.criteria(example).andEqualTo(Team.ZT, DataStatusEnum.QIYONG.getCode());
  83 + Example.Criteria criteria = CorpExample.criteria(example)
  84 + .andEqualTo(Team.ZT, DataStatusEnum.QIYONG.getCode());
  85 + if (StringUtils.isNotBlank(ssqy)) {
  86 + criteria.andEqualTo(Team.SSQY, ssqy);
  87 + }
81 88 List<Team> teamList = teamMapper.selectByExample(example);
82 89 if (CollectionUtils.isEmpty(teamList)) {
83 90 return new ArrayList<>(0);
... ...
... ... @@ -7,6 +7,7 @@ import com.qgutech.qgyun.apaas.sync.cps.mapper.WorkshopMapper;
7 7 import com.qgutech.qgyun.apaas.sync.cps.model.Workshop;
8 8 import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
9 9 import org.apache.commons.collections4.CollectionUtils;
  10 +import org.apache.commons.lang3.StringUtils;
10 11 import org.springframework.stereotype.Service;
11 12 import org.springframework.transaction.annotation.Transactional;
12 13 import org.springframework.util.Assert;
... ... @@ -72,12 +73,18 @@ public class WorkshopService extends BaseServiceImpl<Workshop> {
72 73 }
73 74
74 75 /**
75   - * 查询所有启用状态的单位(车间)信息列表
  76 + * 查询所有启用状态的单位(车间)信息列表,可按所属线体筛选
  77 + *
  78 + * @param ssxt 所属线体(XtLine)id,为空时不按线体筛选
76 79 */
77 80 @Transactional(readOnly = true)
78   - public List<Workshop> listEnabled() {
  81 + public List<Workshop> listEnabled(String ssxt) {
79 82 Example example = new Example(entityClass);
80   - CorpExample.criteria(example).andEqualTo(Workshop.IEIBLP, WorkshopStatusEnum.ENABLED.getCode());
  83 + Example.Criteria criteria = CorpExample.criteria(example)
  84 + .andEqualTo(Workshop.IEIBLP, WorkshopStatusEnum.ENABLED.getCode());
  85 + if (StringUtils.isNotBlank(ssxt)) {
  86 + criteria.andEqualTo(Workshop.SSXT, ssxt);
  87 + }
81 88 List<Workshop> workshopList = workshopMapper.selectByExample(example);
82 89 if (CollectionUtils.isEmpty(workshopList)) {
83 90 return new ArrayList<>(0);
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.Announcement;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AnnouncementService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import javax.annotation.Resource;
  13 +import java.util.List;
  14 +
  15 +/**
  16 + * 公告信息接口
  17 + */
  18 +@Slf4j
  19 +@RestController
  20 +@RequestMapping("/announcement")
  21 +public class AnnouncementController {
  22 +
  23 + @Resource
  24 + private AnnouncementService announcementService;
  25 +
  26 + /**
  27 + * 获取所有公告信息列表
  28 + *
  29 + * @return
  30 + */
  31 + @GetMapping("/list/all")
  32 + public JsonResult listAll() {
  33 + List<Announcement> list = announcementService.listAll();
  34 + return new JsonResult<>(true, "成功", list);
  35 + }
  36 +
  37 + /**
  38 + * 获取启用状态的特色公告列表,可按线体、车间、室组、区域条件筛选。
  39 + * <p>
  40 + * 无归属信息的公告(全局公告)恒返回;仅有某一维度归属信息的公告,
  41 + * 在入参对应维度为空或与之相等时返回。返回列表含线体/车间/室组/区域名称与编号。
  42 + *
  43 + * @param xtxx 线体(XtLine)id,可不传
  44 + * @param cjxx 车间(Workshop)id,可不传
  45 + * @param szxx 室组(RoomGroup)id,可不传
  46 + * @param qyxx 区域(Area)id,可不传
  47 + * @return
  48 + */
  49 + @GetMapping("/list/enabled")
  50 + public JsonResult listEnabled(@RequestParam(required = false) String xtxx,
  51 + @RequestParam(required = false) String cjxx,
  52 + @RequestParam(required = false) String szxx,
  53 + @RequestParam(required = false) String qyxx) {
  54 + List<Announcement> list = announcementService.listEnabledByCondition(xtxx, cjxx, szxx, qyxx);
  55 + return new JsonResult<>(true, "成功", list);
  56 + }
  57 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicator;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaBlockIndicatorService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 区域板块指标信息接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/areaBlockIndicator")
  20 +public class AreaBlockIndicatorController {
  21 +
  22 + @Resource
  23 + private AreaBlockIndicatorService areaBlockIndicatorService;
  24 +
  25 + /**
  26 + * 获取所有区域板块指标信息列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<AreaBlockIndicator> list = areaBlockIndicatorService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicatorDaily;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaBlockIndicatorDailyService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 区域板块指标每日明细接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/areaBlockIndicatorDaily")
  20 +public class AreaBlockIndicatorDailyController {
  21 +
  22 + @Resource
  23 + private AreaBlockIndicatorDailyService areaBlockIndicatorDailyService;
  24 +
  25 + /**
  26 + * 获取所有区域板块指标每日明细列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<AreaBlockIndicatorDaily> list = areaBlockIndicatorDailyService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeAttendance;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaEmployeeAttendanceService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 区域员工考勤信息接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/areaEmployeeAttendance")
  20 +public class AreaEmployeeAttendanceController {
  21 +
  22 + @Resource
  23 + private AreaEmployeeAttendanceService areaEmployeeAttendanceService;
  24 +
  25 + /**
  26 + * 获取所有区域员工考勤信息列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<AreaEmployeeAttendance> list = areaEmployeeAttendanceService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.dto.AttendanceDailySummaryDTO;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeAttendanceDetail;
  5 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaEmployeeAttendanceDetailService;
  6 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.springframework.web.bind.annotation.GetMapping;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import javax.annotation.Resource;
  14 +import java.util.List;
  15 +
  16 +/**
  17 + * 区域员工考勤明细接口
  18 + */
  19 +@Slf4j
  20 +@RestController
  21 +@RequestMapping("/areaEmployeeAttendanceDetail")
  22 +public class AreaEmployeeAttendanceDetailController {
  23 +
  24 + @Resource
  25 + private AreaEmployeeAttendanceDetailService areaEmployeeAttendanceDetailService;
  26 +
  27 + /**
  28 + * 获取所有区域员工考勤明细列表
  29 + *
  30 + * @return
  31 + */
  32 + @GetMapping("/list/all")
  33 + public JsonResult listAll() {
  34 + List<AreaEmployeeAttendanceDetail> list = areaEmployeeAttendanceDetailService.listAll();
  35 + return new JsonResult<>(true, "成功", list);
  36 + }
  37 +
  38 + /**
  39 + * 根据区域、月份返回该月每日考勤汇总信息列表(按考勤日期分组)。
  40 + * <p>
  41 + * 每日总记录条数为区域应到人数(ydrs),假别为出勤的记录条数为实到人数(sdrs)。
  42 + * 年份固定取当前年。
  43 + *
  44 + * @param qyxx 区域(Area)id,必传
  45 + * @param month 月份(1-12),必传
  46 + * @return
  47 + */
  48 + @GetMapping("/summary/daily")
  49 + public JsonResult summaryDaily(@RequestParam String qyxx, @RequestParam Integer month) {
  50 + List<AttendanceDailySummaryDTO> list = areaEmployeeAttendanceDetailService.summaryDailyByMonth(qyxx, month);
  51 + return new JsonResult<>(true, "成功", list);
  52 + }
  53 +
  54 + /**
  55 + * 根据区域、日期获取当日非出勤(假别不为出勤)的考勤明细列表,列表关联信息补充完整。
  56 + *
  57 + * @param qyxx 区域(Area)id,必传
  58 + * @param date 考勤日期(yyyy-MM-dd),必传
  59 + * @return
  60 + */
  61 + @GetMapping("/list/nonAttendance")
  62 + public JsonResult listNonAttendance(@RequestParam String qyxx, @RequestParam String date) {
  63 + List<AreaEmployeeAttendanceDetail> list = areaEmployeeAttendanceDetailService.listNonAttendanceByDate(qyxx, date);
  64 + return new JsonResult<>(true, "成功", list);
  65 + }
  66 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeChange;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaEmployeeChangeService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 区域员工变化明细接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/areaEmployeeChange")
  20 +public class AreaEmployeeChangeController {
  21 +
  22 + @Resource
  23 + private AreaEmployeeChangeService areaEmployeeChangeService;
  24 +
  25 + /**
  26 + * 获取所有区域员工变化明细列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<AreaEmployeeChange> list = areaEmployeeChangeService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployee;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaEmployeeService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 区域员工信息接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/areaEmployee")
  20 +public class AreaEmployeeController {
  21 +
  22 + @Resource
  23 + private AreaEmployeeService areaEmployeeService;
  24 +
  25 + /**
  26 + * 获取所有区域员工信息列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<AreaEmployee> list = areaEmployeeService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeResignation;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaEmployeeResignationService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 区域员工离职明细接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/areaEmployeeResignation")
  20 +public class AreaEmployeeResignationController {
  21 +
  22 + @Resource
  23 + private AreaEmployeeResignationService areaEmployeeResignationService;
  24 +
  25 + /**
  26 + * 获取所有区域员工离职明细列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<AreaEmployeeResignation> list = areaEmployeeResignationService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaScorecard;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.AreaScorecardService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import javax.annotation.Resource;
  13 +import java.util.Calendar;
  14 +import java.util.List;
  15 +
  16 +/**
  17 + * 区域记分卡接口
  18 + */
  19 +@Slf4j
  20 +@RestController
  21 +@RequestMapping("/areaScorecard")
  22 +public class AreaScorecardController {
  23 +
  24 + @Resource
  25 + private AreaScorecardService areaScorecardService;
  26 +
  27 + /**
  28 + * 获取所有区域记分卡列表
  29 + *
  30 + * @return
  31 + */
  32 + @GetMapping("/list/all")
  33 + public JsonResult listAll() {
  34 + List<AreaScorecard> list = areaScorecardService.listAll();
  35 + return new JsonResult<>(true, "成功", list);
  36 + }
  37 +
  38 + /**
  39 + * 按区域和月份查询记分卡列表
  40 + *
  41 + * @param qyxx 区域信息,可为空
  42 + * @param month 月份(1-12),可为空,默认当前月
  43 + * @return 记分卡列表
  44 + */
  45 + @GetMapping("/list/byMonth")
  46 + public JsonResult listByMonth(@RequestParam(required = false) String qyxx,
  47 + @RequestParam(required = false) Integer month) {
  48 + // 如果月份为空,默认当前月
  49 + if (month == null) {
  50 + Calendar calendar = Calendar.getInstance();
  51 + month = calendar.get(Calendar.MONTH) + 1;
  52 + }
  53 +
  54 + // 将月份转换为枚举格式:1 -> #1#, 2 -> #2#, ..., 12 -> #12#
  55 + String yuefem = "#" + month + "#";
  56 +
  57 + List<AreaScorecard> list = areaScorecardService.listByQyxxAndYuefem(qyxx, yuefem);
  58 + return new JsonResult<>(true, "成功", list);
  59 + }
  60 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.FiveSMap;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.FiveSMapService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import javax.annotation.Resource;
  13 +import java.util.List;
  14 +
  15 +/**
  16 + * 5S责任图接口
  17 + */
  18 +@Slf4j
  19 +@RestController
  20 +@RequestMapping("/fiveSMap")
  21 +public class FiveSMapController {
  22 +
  23 + @Resource
  24 + private FiveSMapService fiveSMapService;
  25 +
  26 + /**
  27 + * 获取所有5S责任图列表
  28 + *
  29 + * @return
  30 + */
  31 + @GetMapping("/list/all")
  32 + public JsonResult listAll() {
  33 + List<FiveSMap> list = fiveSMapService.listAll();
  34 + return new JsonResult<>(true, "成功", list);
  35 + }
  36 +
  37 + /**
  38 + * 根据区域获取该区域下的 5S 责任图列表
  39 + *
  40 + * @param qyxx 区域(Area)id,必传
  41 + * @return
  42 + */
  43 + @GetMapping("/list/area")
  44 + public JsonResult listByArea(@RequestParam String qyxx) {
  45 + List<FiveSMap> list = fiveSMapService.listByArea(qyxx);
  46 + return new JsonResult<>(true, "成功", list);
  47 + }
  48 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.dto.MultiSkilledWorkerSummaryDTO;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.MultiSkilledWorker;
  5 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.MultiSkilledWorkerService;
  6 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.springframework.web.bind.annotation.GetMapping;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import javax.annotation.Resource;
  14 +import java.util.List;
  15 +
  16 +/**
  17 + * 多能工信息接口
  18 + */
  19 +@Slf4j
  20 +@RestController
  21 +@RequestMapping("/multiSkilledWorker")
  22 +public class MultiSkilledWorkerController {
  23 +
  24 + @Resource
  25 + private MultiSkilledWorkerService multiSkilledWorkerService;
  26 +
  27 + /**
  28 + * 获取所有多能工信息列表
  29 + *
  30 + * @return
  31 + */
  32 + @GetMapping("/list/all")
  33 + public JsonResult listAll() {
  34 + List<MultiSkilledWorker> list = multiSkilledWorkerService.listAll();
  35 + return new JsonResult<>(true, "成功", list);
  36 + }
  37 +
  38 + /**
  39 + * 根据区域获取该区域下的多能工记录,并对员工、工位分别汇总整合。
  40 + * <p>
  41 + * 一个接口同时返回:员工列表(去重)、工位列表(去重)、
  42 + * 员工工位等级信息列表(多能工明细,已补全线体/车间/室组/区域/班组/员工/工位/区域员工等完整关联信息)。
  43 + *
  44 + * @param qyxx 区域(Area)id,必传
  45 + * @return
  46 + */
  47 + @GetMapping("/summary/area")
  48 + public JsonResult summaryByArea(@RequestParam String qyxx) {
  49 + MultiSkilledWorkerSummaryDTO summary = multiSkilledWorkerService.summaryByArea(qyxx);
  50 + return new JsonResult<>(true, "成功", summary);
  51 + }
  52 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.controller;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.SafetyObservation;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.service.SafetyObservationService;
  5 +import com.qgutech.qgyun.framework.common.result.JsonResult;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import javax.annotation.Resource;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 安全观察与履职检查接口
  16 + */
  17 +@Slf4j
  18 +@RestController
  19 +@RequestMapping("/safetyObservation")
  20 +public class SafetyObservationController {
  21 +
  22 + @Resource
  23 + private SafetyObservationService safetyObservationService;
  24 +
  25 + /**
  26 + * 获取所有安全观察与履职检查列表
  27 + *
  28 + * @return
  29 + */
  30 + @GetMapping("/list/all")
  31 + public JsonResult listAll() {
  32 + List<SafetyObservation> list = safetyObservationService.listAll();
  33 + return new JsonResult<>(true, "成功", list);
  34 + }
  35 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.dto;
  2 +
  3 +import lombok.Getter;
  4 +import lombok.Setter;
  5 +import lombok.ToString;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * 区域员工考勤每日汇总结果
  11 + */
  12 +@Getter
  13 +@Setter
  14 +@ToString
  15 +public class AttendanceDailySummaryDTO implements Serializable {
  16 +
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /*
  20 + * 考勤日期(yyyy-MM-dd)
  21 + */
  22 + private String date;
  23 +
  24 + /*
  25 + * 应到人数(当日该区域考勤明细总记录条数)
  26 + */
  27 + private Integer ydrs;
  28 +
  29 + /*
  30 + * 实到人数(当日该区域假别为出勤的考勤明细记录条数)
  31 + */
  32 + private Integer sdrs;
  33 +
  34 + public AttendanceDailySummaryDTO() {
  35 + }
  36 +
  37 + public AttendanceDailySummaryDTO(String date, Integer ydrs, Integer sdrs) {
  38 + this.date = date;
  39 + this.ydrs = ydrs;
  40 + this.sdrs = sdrs;
  41 + }
  42 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.dto;
  2 +
  3 +import lombok.Getter;
  4 +import lombok.Setter;
  5 +import lombok.ToString;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * 多能工-员工汇总项(按员工去重)
  11 + */
  12 +@Getter
  13 +@Setter
  14 +@ToString
  15 +public class MultiSkilledEmployeeDTO implements Serializable {
  16 +
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /*
  20 + * 员工信息ID(组织用户ID)
  21 + */
  22 + private String ygxx;
  23 +
  24 + /*
  25 + * 员工姓名(关联组织用户 UcUser)
  26 + */
  27 + private String ygName;
  28 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.dto;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.MultiSkilledWorker;
  4 +import lombok.Getter;
  5 +import lombok.Setter;
  6 +import lombok.ToString;
  7 +
  8 +import java.io.Serializable;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 多能工按区域汇总结果。
  13 + * <p>
  14 + * 一个接口同时返回三部分:员工列表(按员工去重)、工位列表(按工位去重)、
  15 + * 员工工位等级信息列表(多能工明细,含线体/车间/室组/区域/班组/员工/工位/区域员工等完整关联信息)。
  16 + */
  17 +@Getter
  18 +@Setter
  19 +@ToString
  20 +public class MultiSkilledWorkerSummaryDTO implements Serializable {
  21 +
  22 + private static final long serialVersionUID = 1L;
  23 +
  24 + /*
  25 + * 员工列表(按员工去重汇总)
  26 + */
  27 + private List<MultiSkilledEmployeeDTO> employeeList;
  28 +
  29 + /*
  30 + * 工位列表(按工位去重汇总)
  31 + */
  32 + private List<MultiSkilledWorkstationDTO> workstationList;
  33 +
  34 + /*
  35 + * 员工工位等级信息列表(多能工明细,含完整关联信息)
  36 + */
  37 + private List<MultiSkilledWorker> workerLevelList;
  38 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.dto;
  2 +
  3 +import lombok.Getter;
  4 +import lombok.Setter;
  5 +import lombok.ToString;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * 多能工-工位汇总项(按工位去重)
  11 + */
  12 +@Getter
  13 +@Setter
  14 +@ToString
  15 +public class MultiSkilledWorkstationDTO implements Serializable {
  16 +
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /*
  20 + * 工位信息ID(停线工位ID)
  21 + */
  22 + private String gwxx;
  23 +
  24 + /*
  25 + * 工位名称(关联停线工位 StopWorkstation)
  26 + */
  27 + private String gwmc;
  28 +
  29 + /*
  30 + * 工位编号(关联停线工位 StopWorkstation)
  31 + */
  32 + private String gwbh;
  33 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 抽查项目枚举(安全观察与履职检查)
  7 + * <p>
  8 + * 数据库字段 ccxm 存储编号(多选,逗号分隔):
  9 + * #1#-安全职责,#2#-个人安全行为承诺书,#3#-停止、呼叫、等待,#4#-安全互联互保,
  10 + * #5#-作业指导书、安全操作规范,#6#-过程(设备点检)确认表,#7#-MSDS或化学品告知卡,
  11 + * #8#-班组危险源,#9#-班组环境因素、废弃物分类,#10#-班组安全教育、典型案例
  12 + */
  13 +@Getter
  14 +public enum CcxmEnum {
  15 +
  16 + AQZZ("#1#", "安全职责"),
  17 + GRAQXWCNS("#2#", "个人安全行为承诺书"),
  18 + TZHHDD("#3#", "停止、呼叫、等待"),
  19 + AQHLHB("#4#", "安全互联互保"),
  20 + ZYZDSAQCZGF("#5#", "作业指导书、安全操作规范"),
  21 + GCSBDJQRB("#6#", "过程(设备点检)确认表"),
  22 + MSDSHXPGZK("#7#", "MSDS或化学品告知卡"),
  23 + BZWXY("#8#", "班组危险源"),
  24 + BZHJYSFQWFL("#9#", "班组环境因素、废弃物分类"),
  25 + BZAQJYDXAL("#10#", "班组安全教育、典型案例");
  26 +
  27 + private final String code;
  28 + private final String desc;
  29 +
  30 + CcxmEnum(String code, String desc) {
  31 + this.code = code;
  32 + this.desc = desc;
  33 + }
  34 +
  35 + public static CcxmEnum fromCode(String code) {
  36 + if (code == null) {
  37 + return null;
  38 + }
  39 + for (CcxmEnum item : values()) {
  40 + if (item.code.equals(code)) {
  41 + return item;
  42 + }
  43 + }
  44 + if (!code.startsWith("#")) {
  45 + String wrapped = "#" + code + "#";
  46 + for (CcxmEnum item : values()) {
  47 + if (item.code.equals(wrapped)) {
  48 + return item;
  49 + }
  50 + }
  51 + }
  52 + return null;
  53 + }
  54 +
  55 + public static String getDescByCode(String code) {
  56 + CcxmEnum item = fromCode(code);
  57 + return item != null ? item.getDesc() : code;
  58 + }
  59 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 检查结果枚举(安全观察与履职检查)
  7 + * <p>
  8 + * 数据库字段存储编号:
  9 + * #1#-正常,#2#-异常,#3#-不涉及
  10 + */
  11 +@Getter
  12 +public enum CheckResultEnum {
  13 +
  14 + ZHENGCHANG("#1#", "正常"),
  15 + YICHANG("#2#", "异常"),
  16 + BUSHEJI("#3#", "不涉及");
  17 +
  18 + private final String code;
  19 + private final String desc;
  20 +
  21 + CheckResultEnum(String code, String desc) {
  22 + this.code = code;
  23 + this.desc = desc;
  24 + }
  25 +
  26 + public static CheckResultEnum fromCode(String code) {
  27 + if (code == null) {
  28 + return null;
  29 + }
  30 + for (CheckResultEnum item : values()) {
  31 + if (item.code.equals(code)) {
  32 + return item;
  33 + }
  34 + }
  35 + if (!code.startsWith("#")) {
  36 + String wrapped = "#" + code + "#";
  37 + for (CheckResultEnum item : values()) {
  38 + if (item.code.equals(wrapped)) {
  39 + return item;
  40 + }
  41 + }
  42 + }
  43 + return null;
  44 + }
  45 +
  46 + public static String getDescByCode(String code) {
  47 + CheckResultEnum item = fromCode(code);
  48 + return item != null ? item.getDesc() : code;
  49 + }
  50 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 公告类型枚举
  7 + * <p>
  8 + * 数据库字段 gglx 存储编号:
  9 + * #1#-通知,#2#-提醒,#3#-警示,#4#-表彰
  10 + */
  11 +@Getter
  12 +public enum GglxEnum {
  13 +
  14 + TONGZHI("#1#", "通知"),
  15 + TIXING("#2#", "提醒"),
  16 + JINGSHI("#3#", "警示"),
  17 + BIAOZHANG("#4#", "表彰");
  18 +
  19 + private final String code;
  20 + private final String desc;
  21 +
  22 + GglxEnum(String code, String desc) {
  23 + this.code = code;
  24 + this.desc = desc;
  25 + }
  26 +
  27 + public static GglxEnum fromCode(String code) {
  28 + if (code == null) {
  29 + return null;
  30 + }
  31 + for (GglxEnum item : values()) {
  32 + if (item.code.equals(code)) {
  33 + return item;
  34 + }
  35 + }
  36 + if (!code.startsWith("#")) {
  37 + String wrapped = "#" + code + "#";
  38 + for (GglxEnum item : values()) {
  39 + if (item.code.equals(wrapped)) {
  40 + return item;
  41 + }
  42 + }
  43 + }
  44 + return null;
  45 + }
  46 +
  47 + public static String getDescByCode(String code) {
  48 + GglxEnum item = fromCode(code);
  49 + return item != null ? item.getDesc() : code;
  50 + }
  51 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 假别枚举(区域员工考勤明细/变化明细)
  7 + * <p>
  8 + * 数据库字段 jbem 存储编号:
  9 + * #1#-出勤,#2#-正常休息,#3#-离职,#4#-病假,#5#-年休,#6#-婚假,
  10 + * #7#-公假,#8#-出差,#9#-支援,#10#-护理假,#11#-产假
  11 + */
  12 +@Getter
  13 +public enum JbEnum {
  14 +
  15 + CHUQIN("#1#", "出勤"),
  16 + ZHENGCHANGXIUXI("#2#", "正常休息"),
  17 + LIZHI("#3#", "离职"),
  18 + BINGJIA("#4#", "病假"),
  19 + NIANXIU("#5#", "年休"),
  20 + HUNJIA("#6#", "婚假"),
  21 + GONGJIA("#7#", "公假"),
  22 + CHUCHAI("#8#", "出差"),
  23 + ZHIYUAN("#9#", "支援"),
  24 + HULIJIA("#10#", "护理假"),
  25 + CHANJIA("#11#", "产假");
  26 +
  27 + private final String code;
  28 + private final String desc;
  29 +
  30 + JbEnum(String code, String desc) {
  31 + this.code = code;
  32 + this.desc = desc;
  33 + }
  34 +
  35 + public static JbEnum fromCode(String code) {
  36 + if (code == null) {
  37 + return null;
  38 + }
  39 + for (JbEnum item : values()) {
  40 + if (item.code.equals(code)) {
  41 + return item;
  42 + }
  43 + }
  44 + if (!code.startsWith("#")) {
  45 + String wrapped = "#" + code + "#";
  46 + for (JbEnum item : values()) {
  47 + if (item.code.equals(wrapped)) {
  48 + return item;
  49 + }
  50 + }
  51 + }
  52 + return null;
  53 + }
  54 +
  55 + public static String getDescByCode(String code) {
  56 + JbEnum item = fromCode(code);
  57 + return item != null ? item.getDesc() : code;
  58 + }
  59 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 多能工等级枚举
  7 + * <p>
  8 + * 数据库字段 level 存储编号:
  9 + * #1#-1级,#2#-2级,#3#-3级,#4#-4级
  10 + */
  11 +@Getter
  12 +public enum LevelEnum {
  13 +
  14 + YIJI("#1#", "1级"),
  15 + ERJI("#2#", "2级"),
  16 + SANJI("#3#", "3级"),
  17 + SIJI("#4#", "4级");
  18 +
  19 + private final String code;
  20 + private final String desc;
  21 +
  22 + LevelEnum(String code, String desc) {
  23 + this.code = code;
  24 + this.desc = desc;
  25 + }
  26 +
  27 + public static LevelEnum fromCode(String code) {
  28 + if (code == null) {
  29 + return null;
  30 + }
  31 + for (LevelEnum item : values()) {
  32 + if (item.code.equals(code)) {
  33 + return item;
  34 + }
  35 + }
  36 + if (!code.startsWith("#")) {
  37 + String wrapped = "#" + code + "#";
  38 + for (LevelEnum item : values()) {
  39 + if (item.code.equals(wrapped)) {
  40 + return item;
  41 + }
  42 + }
  43 + }
  44 + return null;
  45 + }
  46 +
  47 + public static String getDescByCode(String code) {
  48 + LevelEnum item = fromCode(code);
  49 + return item != null ? item.getDesc() : code;
  50 + }
  51 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 用工形式枚举(区域员工信息)
  7 + * <p>
  8 + * 数据库字段 ygxs 存储编号:
  9 + * #1#-合同工,#2#-劳务工,#3#-实习生,#4#-临时工
  10 + */
  11 +@Getter
  12 +public enum YgxsEnum {
  13 +
  14 + HETONGGONG("#1#", "合同工"),
  15 + LAOWUGONG("#2#", "劳务工"),
  16 + SHIXISHENG("#3#", "实习生"),
  17 + LINSHIGONG("#4#", "临时工");
  18 +
  19 + private final String code;
  20 + private final String desc;
  21 +
  22 + YgxsEnum(String code, String desc) {
  23 + this.code = code;
  24 + this.desc = desc;
  25 + }
  26 +
  27 + public static YgxsEnum fromCode(String code) {
  28 + if (code == null) {
  29 + return null;
  30 + }
  31 + for (YgxsEnum item : values()) {
  32 + if (item.code.equals(code)) {
  33 + return item;
  34 + }
  35 + }
  36 + if (!code.startsWith("#")) {
  37 + String wrapped = "#" + code + "#";
  38 + for (YgxsEnum item : values()) {
  39 + if (item.code.equals(wrapped)) {
  40 + return item;
  41 + }
  42 + }
  43 + }
  44 + return null;
  45 + }
  46 +
  47 + public static String getDescByCode(String code) {
  48 + YgxsEnum item = fromCode(code);
  49 + return item != null ? item.getDesc() : code;
  50 + }
  51 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 月份枚举(区域记分卡)
  7 + * <p>
  8 + * 数据库字段 yuefem 存储编号:
  9 + * #1#-1月,#2#-2月,...,#12#-12月
  10 + */
  11 +@Getter
  12 +public enum YuefemEnum {
  13 +
  14 + YIYUE("#1#", "1月"),
  15 + ERYUE("#2#", "2月"),
  16 + SANYUE("#3#", "3月"),
  17 + SIYUE("#4#", "4月"),
  18 + WUYUE("#5#", "5月"),
  19 + LIUYUE("#6#", "6月"),
  20 + QIYUE("#7#", "7月"),
  21 + BAYUE("#8#", "8月"),
  22 + JIUYUE("#9#", "9月"),
  23 + SHIYUE("#10#", "10月"),
  24 + SHIYIYUE("#11#", "11月"),
  25 + SHIERYUE("#12#", "12月");
  26 +
  27 + private final String code;
  28 + private final String desc;
  29 +
  30 + YuefemEnum(String code, String desc) {
  31 + this.code = code;
  32 + this.desc = desc;
  33 + }
  34 +
  35 + public static YuefemEnum fromCode(String code) {
  36 + if (code == null) {
  37 + return null;
  38 + }
  39 + for (YuefemEnum item : values()) {
  40 + if (item.code.equals(code)) {
  41 + return item;
  42 + }
  43 + }
  44 + if (!code.startsWith("#")) {
  45 + String wrapped = "#" + code + "#";
  46 + for (YuefemEnum item : values()) {
  47 + if (item.code.equals(wrapped)) {
  48 + return item;
  49 + }
  50 + }
  51 + }
  52 + return null;
  53 + }
  54 +
  55 + public static String getDescByCode(String code) {
  56 + YuefemEnum item = fromCode(code);
  57 + return item != null ? item.getDesc() : code;
  58 + }
  59 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.enums;
  2 +
  3 +import lombok.Getter;
  4 +
  5 +/**
  6 + * 职位枚举(区域员工信息)
  7 + * <p>
  8 + * 数据库字段 zw 存储编号:
  9 + * #1#-区长,#2#-班长,#3#-异常,#4#-安全,#5#-质量,#6#-现场员工
  10 + */
  11 +@Getter
  12 +public enum ZwEnum {
  13 +
  14 + QUZHANG("#1#", "区长"),
  15 + BANZHANG("#2#", "班长"),
  16 + YICHANG("#3#", "员工"),
  17 + ANQUAN("#4#", "安全员"),
  18 + ZHILIANG("#5#", "质量员"),
  19 + XIANCHANGYUANGONG("#6#", "现场员");
  20 +
  21 + private final String code;
  22 + private final String desc;
  23 +
  24 + ZwEnum(String code, String desc) {
  25 + this.code = code;
  26 + this.desc = desc;
  27 + }
  28 +
  29 + public static ZwEnum fromCode(String code) {
  30 + if (code == null) {
  31 + return null;
  32 + }
  33 + for (ZwEnum item : values()) {
  34 + if (item.code.equals(code)) {
  35 + return item;
  36 + }
  37 + }
  38 + if (!code.startsWith("#")) {
  39 + String wrapped = "#" + code + "#";
  40 + for (ZwEnum item : values()) {
  41 + if (item.code.equals(wrapped)) {
  42 + return item;
  43 + }
  44 + }
  45 + }
  46 + return null;
  47 + }
  48 +
  49 + public static String getDescByCode(String code) {
  50 + ZwEnum item = fromCode(code);
  51 + return item != null ? item.getDesc() : code;
  52 + }
  53 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.Announcement;
  5 +
  6 +public interface AnnouncementMapper extends QguBaseMapper<Announcement> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicatorDaily;
  5 +
  6 +public interface AreaBlockIndicatorDailyMapper extends QguBaseMapper<AreaBlockIndicatorDaily> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicator;
  5 +
  6 +public interface AreaBlockIndicatorMapper extends QguBaseMapper<AreaBlockIndicator> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeAttendanceDetail;
  5 +
  6 +public interface AreaEmployeeAttendanceDetailMapper extends QguBaseMapper<AreaEmployeeAttendanceDetail> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeAttendance;
  5 +
  6 +public interface AreaEmployeeAttendanceMapper extends QguBaseMapper<AreaEmployeeAttendance> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeChange;
  5 +
  6 +public interface AreaEmployeeChangeMapper extends QguBaseMapper<AreaEmployeeChange> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployee;
  5 +
  6 +public interface AreaEmployeeMapper extends QguBaseMapper<AreaEmployee> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeResignation;
  5 +
  6 +public interface AreaEmployeeResignationMapper extends QguBaseMapper<AreaEmployeeResignation> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaScorecard;
  5 +
  6 +public interface AreaScorecardMapper extends QguBaseMapper<AreaScorecard> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.FiveSMap;
  5 +
  6 +public interface FiveSMapMapper extends QguBaseMapper<FiveSMap> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.MultiSkilledWorker;
  5 +
  6 +public interface MultiSkilledWorkerMapper extends QguBaseMapper<MultiSkilledWorker> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.mapper;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.SafetyObservation;
  5 +
  6 +public interface SafetyObservationMapper extends QguBaseMapper<SafetyObservation> {
  7 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.GglxEnum;
  5 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  6 +import lombok.Getter;
  7 +import lombok.Setter;
  8 +import lombok.ToString;
  9 +
  10 +import javax.persistence.Table;
  11 +import javax.persistence.Transient;
  12 +
  13 +/**
  14 + * 公告信息
  15 + */
  16 +@Getter
  17 +@Setter
  18 +@ToString
  19 +@Table(name = "t_auto_hfca_zlujkl_tzeeoq")
  20 +public class Announcement extends BaseCorpModel {
  21 +
  22 + public static final String XTXX = "xtxx";
  23 + public static final String CJXX = "cjxx";
  24 + public static final String SZXX = "szxx";
  25 + public static final String QYXX = "qyxx";
  26 + public static final String GGLX = "gglx";
  27 + public static final String ZT = "zt";
  28 +
  29 + /*
  30 + * 线体信息
  31 + */
  32 + private String xtxx;
  33 +
  34 + /*
  35 + * 车间信息
  36 + */
  37 + private String cjxx;
  38 +
  39 + /*
  40 + * 室组信息
  41 + */
  42 + private String szxx;
  43 +
  44 + /*
  45 + * 区域信息
  46 + */
  47 + private String qyxx;
  48 +
  49 + /*
  50 + * 公告类型-枚举:#1#-通知,#2#-提醒,#3#-警示,#4#-表彰
  51 + */
  52 + private String gglx;
  53 +
  54 + /*
  55 + * 公告内容
  56 + */
  57 + private String ggnr;
  58 +
  59 + /*
  60 + * 状态-枚举:#1#-草稿,#2#-启用,#3#-停用
  61 + */
  62 + private String zt;
  63 +
  64 + /**********非持久化字段*********/
  65 + /*
  66 + * 公告类型中文描述(非数据库字段,用于前端展示)
  67 + */
  68 + @Transient
  69 + private String gglxDesc;
  70 +
  71 + /*
  72 + * 状态中文描述(非数据库字段,用于前端展示)
  73 + */
  74 + @Transient
  75 + private String ztDesc;
  76 +
  77 + /*
  78 + * 线体名称(非数据库字段,关联 XtLine 填充)
  79 + */
  80 + @Transient
  81 + private String xtmc;
  82 +
  83 + /*
  84 + * 线体编号(非数据库字段,关联 XtLine 填充)
  85 + */
  86 + @Transient
  87 + private String xtbh;
  88 +
  89 + /*
  90 + * 车间(单位)名称(非数据库字段,关联 Workshop 填充)
  91 + */
  92 + @Transient
  93 + private String dwmc;
  94 +
  95 + /*
  96 + * 车间(单位)编号(非数据库字段,关联 Workshop 填充)
  97 + */
  98 + @Transient
  99 + private String dwbh;
  100 +
  101 + /*
  102 + * 室组名称(非数据库字段,关联 RoomGroup 填充)
  103 + */
  104 + @Transient
  105 + private String szmc;
  106 +
  107 + /*
  108 + * 室组编号(非数据库字段,关联 RoomGroup 填充)
  109 + */
  110 + @Transient
  111 + private String szbh;
  112 +
  113 + /*
  114 + * 区域名称(非数据库字段,关联 Area 填充)
  115 + */
  116 + @Transient
  117 + private String qymc;
  118 +
  119 + /*
  120 + * 区域编号(非数据库字段,关联 Area 填充)
  121 + */
  122 + @Transient
  123 + private String qybh;
  124 +
  125 + /**
  126 + * 获取公告类型中文描述
  127 + *
  128 + * @return 公告类型中文描述
  129 + */
  130 + public String getGglxDesc() {
  131 + return GglxEnum.getDescByCode(this.gglx);
  132 + }
  133 +
  134 + /**
  135 + * 获取状态中文描述
  136 + *
  137 + * @return 状态中文描述
  138 + */
  139 + public String getZtDesc() {
  140 + return DataStatusEnum.getDescByCode(this.zt);
  141 + }
  142 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum;
  4 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  5 +import lombok.Getter;
  6 +import lombok.Setter;
  7 +import lombok.ToString;
  8 +
  9 +import javax.persistence.Table;
  10 +import javax.persistence.Transient;
  11 +
  12 +/**
  13 + * 区域板块指标信息
  14 + */
  15 +@Getter
  16 +@Setter
  17 +@ToString
  18 +@Table(name = "t_auto_hfca_zlujkl_tqcghb")
  19 +public class AreaBlockIndicator extends BaseCorpModel {
  20 +
  21 + public static final String XTXX = "xtxx";
  22 + public static final String CJXX = "cjxx";
  23 + public static final String SZXX = "szxx";
  24 + public static final String QYXX = "qyxx";
  25 + public static final String BKXX = "bkxx";
  26 + public static final String ZT = "zt";
  27 +
  28 + /*
  29 + * 线体信息
  30 + */
  31 + private String xtxx;
  32 +
  33 + /*
  34 + * 车间信息
  35 + */
  36 + private String cjxx;
  37 +
  38 + /*
  39 + * 室组信息
  40 + */
  41 + private String szxx;
  42 +
  43 + /*
  44 + * 区域信息
  45 + */
  46 + private String qyxx;
  47 +
  48 + /*
  49 + * 板块信息
  50 + */
  51 + private String bkxx;
  52 +
  53 + /*
  54 + * 指标
  55 + */
  56 + private String zhib;
  57 +
  58 + /*
  59 + * 状态-枚举:#1#-草稿,#2#-启用,#3#-停用
  60 + */
  61 + private String zt;
  62 +
  63 + /**********非持久化字段*********/
  64 + /*
  65 + * 状态中文描述(非数据库字段,用于前端展示)
  66 + */
  67 + @Transient
  68 + private String ztDesc;
  69 +
  70 + /**
  71 + * 获取状态中文描述
  72 + *
  73 + * @return 状态中文描述
  74 + */
  75 + public String getZtDesc() {
  76 + return DataStatusEnum.getDescByCode(this.zt);
  77 + }
  78 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.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_zlujkl_lpuzga")
  20 +public class AreaBlockIndicatorDaily extends BaseCorpModel {
  21 +
  22 + public static final String SJQKDATE = "sjqkDate";
  23 + public static final String XTXX = "xtxx";
  24 + public static final String CJXX = "cjxx";
  25 + public static final String SZXX = "szxx";
  26 + public static final String QYXX = "qyxx";
  27 + public static final String BKXX = "bkxx";
  28 + public static final String ZHIBXX = "zhibxx";
  29 +
  30 + /*
  31 + * 日期
  32 + */
  33 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  34 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  35 + private Date sjqkDate;
  36 +
  37 + /*
  38 + * 线体信息
  39 + */
  40 + private String xtxx;
  41 +
  42 + /*
  43 + * 车间信息
  44 + */
  45 + private String cjxx;
  46 +
  47 + /*
  48 + * 室组信息
  49 + */
  50 + private String szxx;
  51 +
  52 + /*
  53 + * 区域信息
  54 + */
  55 + private String qyxx;
  56 +
  57 + /*
  58 + * 板块信息
  59 + */
  60 + private String bkxx;
  61 +
  62 + /*
  63 + * 指标信息
  64 + */
  65 + private String zhibxx;
  66 +
  67 + /*
  68 + * 实际值
  69 + */
  70 + private Double realVal;
  71 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.YgxsEnum;
  5 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.ZwEnum;
  6 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  7 +import lombok.Getter;
  8 +import lombok.Setter;
  9 +import lombok.ToString;
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +
  12 +import javax.persistence.Table;
  13 +import javax.persistence.Transient;
  14 +import java.util.Date;
  15 +
  16 +/**
  17 + * 区域员工信息
  18 + */
  19 +@Getter
  20 +@Setter
  21 +@ToString
  22 +@Table(name = "t_auto_hfca_zlujkl_zzumlq")
  23 +public class AreaEmployee extends BaseCorpModel {
  24 +
  25 + public static final String XTXX = "xtxx";
  26 + public static final String CJXX = "cjxx";
  27 + public static final String SZXX = "szxx";
  28 + public static final String QYXX = "qyxx";
  29 + public static final String BZXX = "bzxx";
  30 + public static final String ZW = "zw";
  31 + public static final String YGXS = "ygxs";
  32 +
  33 + /*
  34 + * 线体信息
  35 + */
  36 + private String xtxx;
  37 +
  38 + /*
  39 + * 车间信息
  40 + */
  41 + private String cjxx;
  42 +
  43 + /*
  44 + * 室组信息
  45 + */
  46 + private String szxx;
  47 +
  48 + /*
  49 + * 区域信息
  50 + */
  51 + private String qyxx;
  52 +
  53 + /*
  54 + * 班组信息
  55 + */
  56 + private String bzxx;
  57 +
  58 + /*
  59 + * 员工姓名
  60 + */
  61 + private String ygxm;
  62 +
  63 + /*
  64 + * 员工号
  65 + */
  66 + private String ygh;
  67 +
  68 + /*
  69 + * 职位-枚举:#1#-区长,#2#-班长,#3#-异常,#4#-安全,#5#-质量,#6#-现场员
  70 + */
  71 + private String zw;
  72 +
  73 + /*
  74 + * 入职时间
  75 + */
  76 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  77 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  78 + private Date rzrq;
  79 +
  80 + /*
  81 + * 住址
  82 + */
  83 + private String zz;
  84 +
  85 + /*
  86 + * 用工形式-枚举:#1#-合同工,#2#-劳务工,#3#-实习生,#4#-临时工
  87 + */
  88 + private String ygxs;
  89 +
  90 + /*
  91 + * OIS
  92 + */
  93 + private String ois;
  94 +
  95 + /**********非持久化字段*********/
  96 + /*
  97 + * 职位中文描述(非数据库字段,用于前端展示)
  98 + */
  99 + @Transient
  100 + private String zwDesc;
  101 +
  102 + /*
  103 + * 用工形式中文描述(非数据库字段,用于前端展示)
  104 + */
  105 + @Transient
  106 + private String ygxsDesc;
  107 +
  108 + /**
  109 + * 获取职位中文描述
  110 + *
  111 + * @return 职位中文描述
  112 + */
  113 + public String getZwDesc() {
  114 + return ZwEnum.getDescByCode(this.zw);
  115 + }
  116 +
  117 + /**
  118 + * 获取用工形式中文描述
  119 + *
  120 + * @return 用工形式中文描述
  121 + */
  122 + public String getYgxsDesc() {
  123 + return YgxsEnum.getDescByCode(this.ygxs);
  124 + }
  125 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.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_zlujkl_uwjpei")
  20 +public class AreaEmployeeAttendance extends BaseCorpModel {
  21 +
  22 + public static final String KQRQ = "kqrq";
  23 + public static final String XTXX = "xtxx";
  24 + public static final String BCXX = "bcxx";
  25 + public static final String CJXX = "cjxx";
  26 + public static final String SZXX = "szxx";
  27 + public static final String QYXX = "qyxx";
  28 +
  29 + /*
  30 + * 考勤日期
  31 + */
  32 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  33 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  34 + private Date kqrq;
  35 +
  36 + /*
  37 + * 线体信息
  38 + */
  39 + private String xtxx;
  40 +
  41 + /*
  42 + * 班次信息
  43 + */
  44 + private String bcxx;
  45 +
  46 + /*
  47 + * 车间信息
  48 + */
  49 + private String cjxx;
  50 +
  51 + /*
  52 + * 室组信息
  53 + */
  54 + private String szxx;
  55 +
  56 + /*
  57 + * 区域信息
  58 + */
  59 + private String qyxx;
  60 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.JbEnum;
  5 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.ZwEnum;
  6 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  7 +import lombok.Getter;
  8 +import lombok.Setter;
  9 +import lombok.ToString;
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +
  12 +import javax.persistence.Table;
  13 +import javax.persistence.Transient;
  14 +import java.util.Date;
  15 +
  16 +/**
  17 + * 区域员工考勤明细
  18 + */
  19 +@Getter
  20 +@Setter
  21 +@ToString
  22 +@Table(name = "t_auto_hfca_zlujkl_aaimmb")
  23 +public class AreaEmployeeAttendanceDetail extends BaseCorpModel {
  24 +
  25 + public static final String KQRQ = "kqrq";
  26 + public static final String QYYGXX = "qyygxx";
  27 + public static final String QYXX = "qyxx";
  28 + public static final String BZXX = "bzxx";
  29 + public static final String JBEM = "jbem";
  30 + public static final String QYYGKQXX = "qyygkqxx";
  31 + public static final String QYYGBHMX = "qyygbhmxxx";
  32 + public static final String QYYGLZMCXX = "qyyglzmcxx";
  33 +
  34 + /*
  35 + * 考勤日期
  36 + */
  37 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  38 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  39 + private Date kqrq;
  40 +
  41 + /*
  42 + * 区域员工信息
  43 + */
  44 + private String qyygxx;
  45 +
  46 + /*
  47 + * 区域信息
  48 + */
  49 + private String qyxx;
  50 +
  51 + /*
  52 + * 班组信息
  53 + */
  54 + private String bzxx;
  55 +
  56 + /*
  57 + * 员工姓名
  58 + */
  59 + private String ygxm;
  60 +
  61 + /*
  62 + * 员工号
  63 + */
  64 + private String ygh;
  65 +
  66 + /*
  67 + * 职位-枚举:#1#-区长,#2#-班长,#3#-员工,#4#-安全员,#5#-质量员,#6#-现场员
  68 + */
  69 + private String zw;
  70 +
  71 + /*
  72 + * 岗位
  73 + */
  74 + private String gangw;
  75 +
  76 + /*
  77 + * 假别-枚举:#1#-出勤,#2#-正常休息,#3#-离职,...
  78 + */
  79 + private String jbem;
  80 +
  81 + /*
  82 + * 假别时长(小时)
  83 + */
  84 + private Double jbsc;
  85 +
  86 + /*
  87 + * 顶岗人员姓名
  88 + */
  89 + private String dgryxm;
  90 +
  91 + /*
  92 + * 首台车流水号
  93 + */
  94 + private String stclsh;
  95 +
  96 + /*
  97 + * 尾台车流水号
  98 + */
  99 + private String wtclsh;
  100 +
  101 + /*
  102 + * 区域员工考勤信息
  103 + */
  104 + private String qyygkqxx;
  105 +
  106 + /*
  107 + * 区域员工离职明细
  108 + */
  109 + private String qyygbhmxxx;
  110 +
  111 + /*
  112 + * 区域员工变化明细
  113 + */
  114 + private String qyyglzmcxx;
  115 +
  116 + /**********非持久化字段*********/
  117 + /*
  118 + * 职位中文描述(非数据库字段,用于前端展示)
  119 + */
  120 + @Transient
  121 + private String zwDesc;
  122 +
  123 + /*
  124 + * 假别中文描述(非数据库字段,用于前端展示)
  125 + */
  126 + @Transient
  127 + private String jbemDesc;
  128 +
  129 + /*
  130 + * 区域名称(非数据库字段,关联 Area 填充)
  131 + */
  132 + @Transient
  133 + private String qymc;
  134 +
  135 + /*
  136 + * 区域编号(非数据库字段,关联 Area 填充)
  137 + */
  138 + @Transient
  139 + private String qybh;
  140 +
  141 + /*
  142 + * 班组名称(非数据库字段,关联 Team 填充)
  143 + */
  144 + @Transient
  145 + private String bzmc;
  146 +
  147 + /*
  148 + * 班组编号(非数据库字段,关联 Team 填充)
  149 + */
  150 + @Transient
  151 + private String bzbh;
  152 +
  153 + /**
  154 + * 获取职位中文描述
  155 + *
  156 + * @return 职位中文描述
  157 + */
  158 + public String getZwDesc() {
  159 + return ZwEnum.getDescByCode(this.zw);
  160 + }
  161 +
  162 + /**
  163 + * 获取假别中文描述
  164 + *
  165 + * @return 假别中文描述
  166 + */
  167 + public String getJbemDesc() {
  168 + return JbEnum.getDescByCode(this.jbem);
  169 + }
  170 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.JbEnum;
  5 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.ZwEnum;
  6 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  7 +import lombok.Getter;
  8 +import lombok.Setter;
  9 +import lombok.ToString;
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +
  12 +import javax.persistence.Table;
  13 +import javax.persistence.Transient;
  14 +import java.util.Date;
  15 +
  16 +/**
  17 + * 区域员工变化明细
  18 + */
  19 +@Getter
  20 +@Setter
  21 +@ToString
  22 +@Table(name = "t_auto_hfca_zlujkl_jqdips")
  23 +public class AreaEmployeeChange extends BaseCorpModel {
  24 +
  25 + public static final String QYYGXX = "qyygxx";
  26 + public static final String QYXX = "qyxx";
  27 + public static final String BZXX = "bzxx";
  28 + public static final String ZWEM = "zwem";
  29 + public static final String BHDATE = "bhDate";
  30 + public static final String JBEM = "jbem";
  31 +
  32 + /*
  33 + * 区域员工信息
  34 + */
  35 + private String qyygxx;
  36 +
  37 + /*
  38 + * 区域信息
  39 + */
  40 + private String qyxx;
  41 +
  42 + /*
  43 + * 班组信息
  44 + */
  45 + private String bzxx;
  46 +
  47 + /*
  48 + * 员工姓名
  49 + */
  50 + private String yg;
  51 +
  52 + /*
  53 + * 员工号
  54 + */
  55 + private String ygh;
  56 +
  57 + /*
  58 + * 职位-枚举:#1#-区长,#2#-班长,#3#-员工,#4#-安全员,#5#-质量员,#6#-现场员
  59 + */
  60 + private String zwem;
  61 +
  62 + /*
  63 + * 岗位
  64 + */
  65 + private String gangw;
  66 +
  67 + /*
  68 + * 变化日期
  69 + */
  70 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  71 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  72 + private Date bhDate;
  73 +
  74 + /*
  75 + * 假别-枚举:#1#-出勤,#2#-正常休息,#3#-离职,...
  76 + */
  77 + private String jbem;
  78 +
  79 + /*
  80 + * 假别时长(小时)
  81 + */
  82 + private Double jbsc;
  83 +
  84 + /*
  85 + * 顶岗人员姓名
  86 + */
  87 + private String dgryxm;
  88 +
  89 + /*
  90 + * 首台车流水号
  91 + */
  92 + private String stclsh;
  93 +
  94 + /*
  95 + * 尾台车流水号
  96 + */
  97 + private String wtclsh;
  98 +
  99 + /**********非持久化字段*********/
  100 + /*
  101 + * 职位中文描述(非数据库字段,用于前端展示)
  102 + */
  103 + @Transient
  104 + private String zwemDesc;
  105 +
  106 + /*
  107 + * 假别中文描述(非数据库字段,用于前端展示)
  108 + */
  109 + @Transient
  110 + private String jbemDesc;
  111 +
  112 + /**
  113 + * 获取职位中文描述
  114 + *
  115 + * @return 职位中文描述
  116 + */
  117 + public String getZwemDesc() {
  118 + return ZwEnum.getDescByCode(this.zwem);
  119 + }
  120 +
  121 + /**
  122 + * 获取假别中文描述
  123 + *
  124 + * @return 假别中文描述
  125 + */
  126 + public String getJbemDesc() {
  127 + return JbEnum.getDescByCode(this.jbem);
  128 + }
  129 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.ZwEnum;
  4 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  5 +import lombok.Getter;
  6 +import lombok.Setter;
  7 +import lombok.ToString;
  8 +
  9 +import javax.persistence.Table;
  10 +import javax.persistence.Transient;
  11 +
  12 +/**
  13 + * 区域员工离职明细
  14 + */
  15 +@Getter
  16 +@Setter
  17 +@ToString
  18 +@Table(name = "t_auto_hfca_zlujkl_qfamxy")
  19 +public class AreaEmployeeResignation extends BaseCorpModel {
  20 +
  21 + public static final String QYYGXX = "qyygxx";
  22 + public static final String QYXX = "qyxx";
  23 + public static final String BZXX = "bzxx";
  24 + public static final String ZWEM = "zwem";
  25 +
  26 + /*
  27 + * 区域员工信息
  28 + */
  29 + private String qyygxx;
  30 +
  31 + /*
  32 + * 区域信息
  33 + */
  34 + private String qyxx;
  35 +
  36 + /*
  37 + * 班组信息
  38 + */
  39 + private String bzxx;
  40 +
  41 + /*
  42 + * 员工姓名
  43 + */
  44 + private String yg;
  45 +
  46 + /*
  47 + * 员工号
  48 + */
  49 + private String ygh;
  50 +
  51 + /*
  52 + * 职位-枚举:#1#-区长,#2#-班长,#3#-员工,#4#-安全员,#5#-质量员,#6#-现场员
  53 + */
  54 + private String zwem;
  55 +
  56 + /*
  57 + * 岗位
  58 + */
  59 + private String gangw;
  60 +
  61 + /**********非持久化字段*********/
  62 + /*
  63 + * 职位中文描述(非数据库字段,用于前端展示)
  64 + */
  65 + @Transient
  66 + private String zwemDesc;
  67 +
  68 + /**
  69 + * 获取职位中文描述
  70 + *
  71 + * @return 职位中文描述
  72 + */
  73 + public String getZwemDesc() {
  74 + return ZwEnum.getDescByCode(this.zwem);
  75 + }
  76 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.YuefemEnum;
  5 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  6 +import lombok.Getter;
  7 +import lombok.Setter;
  8 +import lombok.ToString;
  9 +import org.springframework.format.annotation.DateTimeFormat;
  10 +
  11 +import javax.persistence.Table;
  12 +import javax.persistence.Transient;
  13 +import java.util.Date;
  14 +
  15 +/**
  16 + * 区域记分卡
  17 + */
  18 +@Getter
  19 +@Setter
  20 +@ToString
  21 +@Table(name = "t_auto_hfca_zlujkl_qfiace")
  22 +public class AreaScorecard extends BaseCorpModel {
  23 +
  24 + public static final String YEAR = "year";
  25 + public static final String XTXX = "xtxx";
  26 + public static final String CJXX = "cjxx";
  27 + public static final String SZXX = "szxx";
  28 + public static final String QYXX = "qyxx";
  29 + public static final String BKXX = "bkxx";
  30 + public static final String ZHIBXX = "zhibxx";
  31 + public static final String YUEFEM = "yuefem";
  32 +
  33 + /*
  34 + * 年份
  35 + */
  36 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  37 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  38 + private Date year;
  39 +
  40 + /*
  41 + * 线体信息
  42 + */
  43 + private String xtxx;
  44 +
  45 + /*
  46 + * 车间信息
  47 + */
  48 + private String cjxx;
  49 +
  50 + /*
  51 + * 室组信息
  52 + */
  53 + private String szxx;
  54 +
  55 + /*
  56 + * 区域信息
  57 + */
  58 + private String qyxx;
  59 +
  60 + /*
  61 + * 板块信息
  62 + */
  63 + private String bkxx;
  64 +
  65 + /*
  66 + * 指标信息
  67 + */
  68 + private String zhibxx;
  69 +
  70 + /*
  71 + * 月份-枚举:#1#-1月,#2#-2月,...,#12#-12月
  72 + */
  73 + private String yuefem;
  74 +
  75 + /*
  76 + * 是否达标
  77 + */
  78 + private Boolean sfdbFlag;
  79 +
  80 + /*
  81 + * 目标值(数值)
  82 + */
  83 + private Double mbVal;
  84 +
  85 + /*
  86 + * 实际值(数值)
  87 + */
  88 + private Double realVal;
  89 +
  90 + /**********非持久化字段*********/
  91 + /*
  92 + * 月份中文描述(非数据库字段,用于前端展示)
  93 + */
  94 + @Transient
  95 + private String yuefemDesc;
  96 +
  97 + /*
  98 + * 区域名称(非数据库字段,关联 Area 填充)
  99 + */
  100 + @Transient
  101 + private String qymc;
  102 +
  103 + /*
  104 + * 区域编号(非数据库字段,关联 Area 填充)
  105 + */
  106 + @Transient
  107 + private String qybh;
  108 +
  109 + /*
  110 + * 板块名称(非数据库字段,关联 BlockInfo 填充)
  111 + */
  112 + @Transient
  113 + private String bkmc;
  114 +
  115 + /*
  116 + * 板块编码(非数据库字段,关联 BlockInfo 填充)
  117 + */
  118 + @Transient
  119 + private String bkbm;
  120 +
  121 + /*
  122 + * 板块序号(非数据库字段,关联 BlockInfo 填充,用于排序)
  123 + */
  124 + @Transient
  125 + private String bkxh;
  126 +
  127 + /*
  128 + * 指标名称(非数据库字段,关联 AreaBlockIndicator 填充)
  129 + */
  130 + @Transient
  131 + private String zhibmc;
  132 +
  133 + /**
  134 + * 获取月份中文描述
  135 + *
  136 + * @return 月份中文描述
  137 + */
  138 + public String getYuefemDesc() {
  139 + return YuefemEnum.getDescByCode(this.yuefem);
  140 + }
  141 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  4 +import lombok.Getter;
  5 +import lombok.Setter;
  6 +import lombok.ToString;
  7 +
  8 +import javax.persistence.Table;
  9 +
  10 +/**
  11 + * 5S责任图
  12 + */
  13 +@Getter
  14 +@Setter
  15 +@ToString
  16 +@Table(name = "t_auto_hfca_zlujkl_xaibhg")
  17 +public class FiveSMap extends BaseCorpModel {
  18 +
  19 + public static final String DWCJXX = "dwcjxx";
  20 + public static final String SZXX = "szxx";
  21 + public static final String QYXX = "qyxx";
  22 +
  23 + /*
  24 + * 单位车间信息
  25 + */
  26 + private String dwcjxx;
  27 +
  28 + /*
  29 + * 室组信息
  30 + */
  31 + private String szxx;
  32 +
  33 + /*
  34 + * 区域信息
  35 + */
  36 + private String qyxx;
  37 +
  38 + /*
  39 + * 5S责任图(图片)
  40 + */
  41 + private String zrtpImg;
  42 +
  43 + /*
  44 + * 备注
  45 + */
  46 + private String remark;
  47 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.LevelEnum;
  4 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  5 +import lombok.Getter;
  6 +import lombok.Setter;
  7 +import lombok.ToString;
  8 +
  9 +import javax.persistence.Table;
  10 +import javax.persistence.Transient;
  11 +
  12 +/**
  13 + * 多能工信息
  14 + */
  15 +@Getter
  16 +@Setter
  17 +@ToString
  18 +@Table(name = "t_auto_hfca_zlujkl_yzswum")
  19 +public class MultiSkilledWorker extends BaseCorpModel {
  20 +
  21 + public static final String XTXX = "xtxx";
  22 + public static final String CJXX = "cjxx";
  23 + public static final String SZXX = "szxx";
  24 + public static final String QYXX = "qyxx";
  25 + public static final String BZXX = "bzxx";
  26 + public static final String YGXX = "ygxx";
  27 + public static final String GWXX = "gwxx";
  28 + public static final String LEVEL = "level";
  29 + public static final String QYYGXX = "qyygxx";
  30 +
  31 + /*
  32 + * 线体信息
  33 + */
  34 + private String xtxx;
  35 +
  36 + /*
  37 + * 车间信息
  38 + */
  39 + private String cjxx;
  40 +
  41 + /*
  42 + * 室组信息
  43 + */
  44 + private String szxx;
  45 +
  46 + /*
  47 + * 区域信息
  48 + */
  49 + private String qyxx;
  50 +
  51 + /*
  52 + * 班组信息
  53 + */
  54 + private String bzxx;
  55 +
  56 + /*
  57 + * 员工信息(组织用户)
  58 + */
  59 + private String ygxx;
  60 +
  61 + /*
  62 + * 工位信息
  63 + */
  64 + private String gwxx;
  65 +
  66 + /*
  67 + * 等级-枚举:#1#-1级,#2#-2级,#3#-3级,#4#-4级
  68 + */
  69 + private String level;
  70 +
  71 + /*
  72 + * 区域员工信息
  73 + */
  74 + private String qyygxx;
  75 +
  76 + /**********非持久化字段*********/
  77 + /*
  78 + * 等级中文描述(非数据库字段,用于前端展示)
  79 + */
  80 + @Transient
  81 + private String levelDesc;
  82 +
  83 + /*
  84 + * 线体名称(非数据库字段,关联 XtLine 填充)
  85 + */
  86 + @Transient
  87 + private String xtmc;
  88 +
  89 + /*
  90 + * 线体编号(非数据库字段,关联 XtLine 填充)
  91 + */
  92 + @Transient
  93 + private String xtbh;
  94 +
  95 + /*
  96 + * 车间(单位)名称(非数据库字段,关联 Workshop 填充)
  97 + */
  98 + @Transient
  99 + private String dwmc;
  100 +
  101 + /*
  102 + * 车间(单位)编号(非数据库字段,关联 Workshop 填充)
  103 + */
  104 + @Transient
  105 + private String dwbh;
  106 +
  107 + /*
  108 + * 室组名称(非数据库字段,关联 RoomGroup 填充)
  109 + */
  110 + @Transient
  111 + private String szmc;
  112 +
  113 + /*
  114 + * 室组编号(非数据库字段,关联 RoomGroup 填充)
  115 + */
  116 + @Transient
  117 + private String szbh;
  118 +
  119 + /*
  120 + * 区域名称(非数据库字段,关联 Area 填充)
  121 + */
  122 + @Transient
  123 + private String qymc;
  124 +
  125 + /*
  126 + * 区域编号(非数据库字段,关联 Area 填充)
  127 + */
  128 + @Transient
  129 + private String qybh;
  130 +
  131 + /*
  132 + * 班组名称(非数据库字段,关联 Team 填充)
  133 + */
  134 + @Transient
  135 + private String bzmc;
  136 +
  137 + /*
  138 + * 班组编号(非数据库字段,关联 Team 填充)
  139 + */
  140 + @Transient
  141 + private String bzbh;
  142 +
  143 + /*
  144 + * 员工姓名(非数据库字段,关联 UcUser 填充)
  145 + */
  146 + @Transient
  147 + private String ygName;
  148 +
  149 + /*
  150 + * 工位名称(非数据库字段,关联 StopWorkstation 填充)
  151 + */
  152 + @Transient
  153 + private String gwmc;
  154 +
  155 + /*
  156 + * 工位编号(非数据库字段,关联 StopWorkstation 填充)
  157 + */
  158 + @Transient
  159 + private String gwbh;
  160 +
  161 + /*
  162 + * 区域员工姓名(非数据库字段,关联 AreaEmployee 填充)
  163 + */
  164 + @Transient
  165 + private String qyygxm;
  166 +
  167 + /*
  168 + * 区域员工号(非数据库字段,关联 AreaEmployee 填充)
  169 + */
  170 + @Transient
  171 + private String qyygh;
  172 +
  173 + /**
  174 + * 获取等级中文描述
  175 + *
  176 + * @return 等级中文描述
  177 + */
  178 + public String getLevelDesc() {
  179 + return LevelEnum.getDescByCode(this.level);
  180 + }
  181 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.CcxmEnum;
  5 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.CheckResultEnum;
  6 +import com.qgutech.qgyun.framework.database.model.BaseCorpModel;
  7 +import lombok.Getter;
  8 +import lombok.Setter;
  9 +import lombok.ToString;
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +
  12 +import javax.persistence.Table;
  13 +import javax.persistence.Transient;
  14 +import java.util.Date;
  15 +
  16 +/**
  17 + * 安全观察与履职检查
  18 + */
  19 +@Getter
  20 +@Setter
  21 +@ToString
  22 +@Table(name = "t_auto_hfca_zlujkl_dnqsvp")
  23 +public class SafetyObservation extends BaseCorpModel {
  24 +
  25 + public static final String QYXX = "qyxx";
  26 + public static final String BZXX = "bzxx";
  27 + public static final String JCRQ = "jcrq";
  28 + public static final String GCGW = "gcgw";
  29 + public static final String BGCR = "bgcr";
  30 +
  31 + /*
  32 + * 区域信息
  33 + */
  34 + private String qyxx;
  35 +
  36 + /*
  37 + * 班组信息
  38 + */
  39 + private String bzxx;
  40 +
  41 + /*
  42 + * 检查日期
  43 + */
  44 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  45 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  46 + private Date jcrq;
  47 +
  48 + /*
  49 + * 观察工位
  50 + */
  51 + private String gcgw;
  52 +
  53 + /*
  54 + * 被观察人
  55 + */
  56 + private String bgcr;
  57 +
  58 + /*
  59 + * 说明
  60 + */
  61 + private String ibpfgw;
  62 +
  63 + /*
  64 + * 是否其他
  65 + */
  66 + private String ifqtio;
  67 +
  68 + /*
  69 + * 人员发现观察者后未调整行为-枚举:#1#-正常,#2#-异常,#3#-不涉及
  70 + */
  71 + private String ryfxgczhwtzxw;
  72 +
  73 + /*
  74 + * 没有调整劳保用品-枚举:#1#-正常,#2#-异常,#3#-不涉及
  75 + */
  76 + private String mytzlbyp;
  77 +
  78 + /*
  79 + * 没有改变工作姿势-枚举:#1#-正常,#2#-异常,#3#-不涉及
  80 + */
  81 + private String mygbgzzt;
  82 +
  83 + /*
  84 + * 没有停止工作-枚举:#1#-正常,#2#-异常,#3#-不涉及
  85 + */
  86 + private String mytzgz;
  87 +
  88 + /*
  89 + * 没有降速运行-枚举:#1#-正常,#2#-异常,#3#-不涉及
  90 + */
  91 + private String myjsyx;
  92 +
  93 + /*
  94 + * 劳保用品正确佩戴-枚举:#1#-正常,#2#-异常,#3#-不涉及
  95 + */
  96 + private String lbypzqpd;
  97 +
  98 + /*
  99 + * 头部-枚举:#1#-正常,#2#-异常,#3#-不涉及
  100 + */
  101 + private String tbxx;
  102 +
  103 + /*
  104 + * 眼部及脸-枚举:#1#-正常,#2#-异常,#3#-不涉及
  105 + */
  106 + private String ybjl;
  107 +
  108 + /*
  109 + * 耳部-枚举:#1#-正常,#2#-异常,#3#-不涉及
  110 + */
  111 + private String ebxx;
  112 +
  113 + /*
  114 + * 呼吸系统-枚举:#1#-正常,#2#-异常,#3#-不涉及
  115 + */
  116 + private String hxxt;
  117 +
  118 + /*
  119 + * 胳膊和手-枚举:#1#-正常,#2#-异常,#3#-不涉及
  120 + */
  121 + private String gbhs;
  122 +
  123 + /*
  124 + * 身躯-枚举:#1#-正常,#2#-异常,#3#-不涉及
  125 + */
  126 + private String sq;
  127 +
  128 + /*
  129 + * 腿部及脚-枚举:#1#-正常,#2#-异常,#3#-不涉及
  130 + */
  131 + private String tbjj;
  132 +
  133 + /*
  134 + * 符合操作规程-枚举:#1#-正常,#2#-异常,#3#-不涉及
  135 + */
  136 + private String fhczgc;
  137 +
  138 + /*
  139 + * 正确使用-枚举:#1#-正常,#2#-异常,#3#-不涉及
  140 + */
  141 + private String zqsy;
  142 +
  143 + /*
  144 + * 工具外壳无破损-枚举:#1#-正常,#2#-异常,#3#-不涉及
  145 + */
  146 + private String gjwkwps;
  147 +
  148 + /*
  149 + * 工具工作状况良好-枚举:#1#-正常,#2#-异常,#3#-不涉及
  150 + */
  151 + private String gjgzzklh;
  152 +
  153 + /*
  154 + * 设备正常运行-枚举:#1#-正常,#2#-异常,#3#-不涉及
  155 + */
  156 + private String sbzcyx;
  157 +
  158 + /*
  159 + * 作业环境状况良好-枚举:#1#-正常,#2#-异常,#3#-不涉及
  160 + */
  161 + private String zyhjzklh;
  162 +
  163 + /*
  164 + * 照明光线良好-枚举:#1#-正常,#2#-异常,#3#-不涉及
  165 + */
  166 + private String zmgxlh;
  167 +
  168 + /*
  169 + * 材料摆放整齐-枚举:#1#-正常,#2#-异常,#3#-不涉及
  170 + */
  171 + private String clbfzq;
  172 +
  173 + /*
  174 + * 通风良好-枚举:#1#-正常,#2#-异常,#3#-不涉及
  175 + */
  176 + private String tflh;
  177 +
  178 + /*
  179 + * 地面整洁-枚举:#1#-正常,#2#-异常,#3#-不涉及
  180 + */
  181 + private String dmzj;
  182 +
  183 + /*
  184 + * 无碰头风险-枚举:#1#-正常,#2#-异常,#3#-不涉及
  185 + */
  186 + private String wptfx;
  187 +
  188 + /*
  189 + * 临边洞口有防护-枚举:#1#-正常,#2#-异常,#3#-不涉及
  190 + */
  191 + private String lbdkyfh;
  192 +
  193 + /*
  194 + * 安全通道畅通-枚举:#1#-正常,#2#-异常,#3#-不涉及
  195 + */
  196 + private String aqtdct;
  197 +
  198 + /*
  199 + * 人员所处的位置风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  200 + */
  201 + private String wzfxkk;
  202 +
  203 + /*
  204 + * 被撞风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  205 + */
  206 + private String bzfxkk;
  207 +
  208 + /*
  209 + * 夹住、挤压风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  210 + */
  211 + private String jzjyfxkk;
  212 +
  213 + /*
  214 + * 跌倒或绊倒风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  215 + */
  216 + private String ddhbdfxkk;
  217 +
  218 + /*
  219 + * 高处坠落风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  220 + */
  221 + private String gcdlfxkk;
  222 +
  223 + /*
  224 + * 接触极端温度风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  225 + */
  226 + private String jdwdfxkk;
  227 +
  228 + /*
  229 + * 触电风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  230 + */
  231 + private String cdfxkk;
  232 +
  233 + /*
  234 + * 接触有害物质风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  235 + */
  236 + private String yhwzfxkk;
  237 +
  238 + /*
  239 + * 吸入有害物质风险可控-枚举:#1#-正常,#2#-异常,#3#-不涉及
  240 + */
  241 + private String xryhwzfxkk;
  242 +
  243 + /*
  244 + * 作业标准及符合度-枚举:#1#-正常,#2#-异常,#3#-不涉及
  245 + */
  246 + private String zybz;
  247 +
  248 + /*
  249 + * 有作业指导文件且现场可获取-枚举:#1#-正常,#2#-异常,#3#-不涉及
  250 + */
  251 + private String zyzdwj;
  252 +
  253 + /*
  254 + * 作业指导文件具有可操作性-枚举:#1#-正常,#2#-异常,#3#-不涉及
  255 + */
  256 + private String zyzdwjkczx;
  257 +
  258 + /*
  259 + * 按作业指导文件作业-枚举:#1#-正常,#2#-异常,#3#-不涉及
  260 + */
  261 + private String zyzdwjzy;
  262 +
  263 + /*
  264 + * 按ECPL要求上锁挂牌-枚举:#1#-正常,#2#-异常,#3#-不涉及
  265 + */
  266 + private String aecplyqgsp;
  267 +
  268 + /*
  269 + * 遵守非标作业执行要求-枚举:#1#-正常,#2#-异常,#3#-不涉及
  270 + */
  271 + private String zsfbzyzxyq;
  272 +
  273 + /*
  274 + * 遵守危险作业执行要求-枚举:#1#-正常,#2#-异常,#3#-不涉及
  275 + */
  276 + private String zswxzyzxyq;
  277 +
  278 + /*
  279 + * 抽查项目-枚举(多选):#1#-安全职责,#2#-个人安全行为承诺书,...
  280 + */
  281 + private String ccxm;
  282 +
  283 + /*
  284 + * 抽查结果-枚举:#1#-正常,#2#-异常,#3#-不涉及
  285 + */
  286 + private String ccjg;
  287 +
  288 + /*
  289 + * 记录以下内容及其原因:员工不安全行为、不安全状态、履职检查不合格项目
  290 + */
  291 + private String jlnryy;
  292 +
  293 + /*
  294 + * 询问员工(不安全行为或不安全状态/抽问内容未掌握)可能导致的后果
  295 + */
  296 + private String xwyg;
  297 +
  298 + /*
  299 + * 沟通员工安全作业方式或改善措施
  300 + */
  301 + private String gtygaq;
  302 +
  303 + /*
  304 + * 鼓励与建议
  305 + */
  306 + private String glyjy;
  307 +
  308 + /*
  309 + * gykuog
  310 + */
  311 + private String gykuog;
  312 +
  313 + /*
  314 + * hghmqi
  315 + */
  316 + private String hghmqi;
  317 +
  318 + /*
  319 + * wfoiev
  320 + */
  321 + private String wfoiev;
  322 +
  323 + /*
  324 + * mivqpz
  325 + */
  326 + private String mivqpz;
  327 +
  328 + /*
  329 + * vivwyg
  330 + */
  331 + private String vivwyg;
  332 +
  333 + /*
  334 + * ctbjdl
  335 + */
  336 + private String ctbjdl;
  337 +
  338 + /*
  339 + * ozhpmw
  340 + */
  341 + private String ozhpmw;
  342 +
  343 + /**********非持久化字段*********/
  344 + /*
  345 + * 抽查结果中文描述(非数据库字段,用于前端展示)
  346 + */
  347 + @Transient
  348 + private String ccjgDesc;
  349 +
  350 + /**
  351 + * 获取抽查结果中文描述
  352 + *
  353 + * @return 抽查结果中文描述
  354 + */
  355 + public String getCcjgDesc() {
  356 + return CheckResultEnum.getDescByCode(this.ccjg);
  357 + }
  358 +}
... ...
... ... @@ -20,7 +20,6 @@ public class WorkshopWorkPlan extends BaseCorpModel {
20 20
21 21 public static final String GZJHMC = "gzjhmc";
22 22 public static final String DWXX = "dwxx";
23   - public static final String GZJHZT = "gzjhzt";
24 23
25 24 /*
26 25 * 工作计划序号
... ... @@ -63,11 +62,6 @@ public class WorkshopWorkPlan extends BaseCorpModel {
63 62 private Boolean jhsfkq;
64 63
65 64 /*
66   - * 工作计划状态-枚举:#1#-进行中,#2#-已完成,#3#-已逾期;
67   - */
68   - private String gzjhzt;
69   -
70   - /*
71 65 * 板块信息
72 66 */
73 67 private String bkxx;
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cps.enums.DataStatusEnum;
  7 +import com.qgutech.qgyun.apaas.sync.cps.model.Area;
  8 +import com.qgutech.qgyun.apaas.sync.cps.model.RoomGroup;
  9 +import com.qgutech.qgyun.apaas.sync.cps.model.Workshop;
  10 +import com.qgutech.qgyun.apaas.sync.cps.model.XtLine;
  11 +import com.qgutech.qgyun.apaas.sync.cps.service.AreaService;
  12 +import com.qgutech.qgyun.apaas.sync.cps.service.RoomGroupService;
  13 +import com.qgutech.qgyun.apaas.sync.cps.service.WorkshopService;
  14 +import com.qgutech.qgyun.apaas.sync.cps.service.XtLineService;
  15 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AnnouncementMapper;
  16 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.Announcement;
  17 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  18 +import org.apache.commons.collections4.CollectionUtils;
  19 +import org.apache.commons.lang3.StringUtils;
  20 +import org.springframework.stereotype.Service;
  21 +import org.springframework.transaction.annotation.Transactional;
  22 +import org.springframework.util.Assert;
  23 +import tk.mybatis.mapper.entity.Example;
  24 +
  25 +import javax.annotation.Resource;
  26 +import java.util.*;
  27 +import java.util.stream.Collectors;
  28 +
  29 +/**
  30 + * Announcement 服务
  31 + */
  32 +@Service
  33 +public class AnnouncementService extends BaseServiceImpl<Announcement> {
  34 +
  35 + @Resource
  36 + private AnnouncementMapper announcementMapper;
  37 +
  38 + @Resource
  39 + private XtLineService xtLineService;
  40 +
  41 + @Resource
  42 + private WorkshopService workshopService;
  43 +
  44 + @Resource
  45 + private RoomGroupService roomGroupService;
  46 +
  47 + @Resource
  48 + private AreaService areaService;
  49 +
  50 + @Transactional(readOnly = true)
  51 + public Announcement getById(String id) {
  52 + Assert.hasLength(id, "id is empty!");
  53 +
  54 + Example example = new Example(entityClass);
  55 + CorpExample.criteria(example).andEqualTo(Announcement.ID, id);
  56 + Announcement announcement = announcementMapper.selectOneByExample(example);
  57 + if (null == announcement) {
  58 + throw new BoException(BoErrorCode.DATA_ERROR);
  59 + }
  60 + return announcement;
  61 + }
  62 +
  63 + @Transactional(readOnly = true)
  64 + public List<Announcement> listByIds(Collection<String> ids) {
  65 + Assert.notEmpty(ids, "ids is empty!");
  66 +
  67 + Example example = new Example(entityClass);
  68 + CorpExample.criteria(example).andIn(Announcement.ID, ids);
  69 + List<Announcement> list = announcementMapper.selectByExample(example);
  70 + if (CollectionUtils.isEmpty(list)) {
  71 + return new ArrayList<>(0);
  72 + }
  73 + return list;
  74 + }
  75 +
  76 + @Transactional(readOnly = true)
  77 + public Map<String, Announcement> mapByIds(Collection<String> ids) {
  78 + Assert.notEmpty(ids, "ids is empty!");
  79 +
  80 + List<Announcement> list = listByIds(ids);
  81 + if (CollectionUtils.isEmpty(list)) {
  82 + return new HashMap<>(0);
  83 + }
  84 +
  85 + return list.stream().collect(Collectors.toMap(Announcement::getId, item -> item));
  86 + }
  87 +
  88 + @Transactional(readOnly = true)
  89 + public List<Announcement> listAll() {
  90 +
  91 + Example example = CorpExample.ofCorp(entityClass);
  92 + return announcementMapper.selectByExample(example);
  93 + }
  94 +
  95 + /**
  96 + * 查询启用状态的特色公告列表,可按线体、车间、室组、区域条件筛选。
  97 + * <p>
  98 + * 匹配规则(四个维度独立判断,入参为空表示该维度不参与筛选):对线体/车间/室组/区域
  99 + * 每个维度,当「公告该维度为空」或「入参该维度为空」或「两者相等」时视为该维度匹配,
  100 + * 四个维度全部匹配才返回。因此:无任何归属信息的公告(全局公告)恒返回;仅有某一
  101 + * 维度信息的公告,在入参对应维度为空或与之相等时返回。
  102 + * 返回列表会补全线体/车间/室组/区域的名称与编号等关联信息。
  103 + *
  104 + * @param xtxx 线体(XtLine)id,可不传
  105 + * @param cjxx 车间(Workshop)id,可不传
  106 + * @param szxx 室组(RoomGroup)id,可不传
  107 + * @param qyxx 区域(Area)id,可不传
  108 + * @return 启用状态且符合条件的公告列表
  109 + */
  110 + @Transactional(readOnly = true)
  111 + public List<Announcement> listEnabledByCondition(String xtxx, String cjxx, String szxx, String qyxx) {
  112 + // 1. 查询当前企业下所有启用状态的公告
  113 + Example example = new Example(entityClass);
  114 + CorpExample.criteria(example).andEqualTo(Announcement.ZT, DataStatusEnum.QIYONG.getCode());
  115 + List<Announcement> enabledList = announcementMapper.selectByExample(example);
  116 + if (CollectionUtils.isEmpty(enabledList)) {
  117 + return new ArrayList<>(0);
  118 + }
  119 +
  120 + // 2. 按线体/车间/室组/区域维度过滤(入参为空或公告该维度为空或相等即匹配)
  121 + List<Announcement> resultList = enabledList.stream()
  122 + .filter(item -> matchDimension(item.getXtxx(), xtxx)
  123 + && matchDimension(item.getCjxx(), cjxx)
  124 + && matchDimension(item.getSzxx(), szxx)
  125 + && matchDimension(item.getQyxx(), qyxx))
  126 + .collect(Collectors.toList());
  127 + if (CollectionUtils.isEmpty(resultList)) {
  128 + return new ArrayList<>(0);
  129 + }
  130 +
  131 + // 3. 补全线体/车间/室组/区域名称、编号等关联信息
  132 + fillRelatedInfo(resultList);
  133 + return resultList;
  134 + }
  135 +
  136 + /**
  137 + * 单个归属维度匹配判断:公告维度值或入参维度值为空视为不限制,否则需相等。
  138 + */
  139 + private boolean matchDimension(String announcementValue, String conditionValue) {
  140 + return StringUtils.isBlank(announcementValue)
  141 + || StringUtils.isBlank(conditionValue)
  142 + || announcementValue.equals(conditionValue);
  143 + }
  144 +
  145 + /**
  146 + * 批量补全公告关联的线体/车间/室组/区域名称与编号。
  147 + */
  148 + private void fillRelatedInfo(List<Announcement> list) {
  149 + // 收集各维度关联 id
  150 + Set<String> xtIds = new HashSet<>();
  151 + Set<String> dwIds = new HashSet<>();
  152 + Set<String> szIds = new HashSet<>();
  153 + Set<String> qyIds = new HashSet<>();
  154 + for (Announcement item : list) {
  155 + if (StringUtils.isNotBlank(item.getXtxx())) {
  156 + xtIds.add(item.getXtxx());
  157 + }
  158 + if (StringUtils.isNotBlank(item.getCjxx())) {
  159 + dwIds.add(item.getCjxx());
  160 + }
  161 + if (StringUtils.isNotBlank(item.getSzxx())) {
  162 + szIds.add(item.getSzxx());
  163 + }
  164 + if (StringUtils.isNotBlank(item.getQyxx())) {
  165 + qyIds.add(item.getQyxx());
  166 + }
  167 + }
  168 +
  169 + // 批量查询关联实体(空集合时不调用,避免 mapByIds 断言报错)
  170 + Map<String, XtLine> xtMap = CollectionUtils.isEmpty(xtIds) ? new HashMap<>(0) : xtLineService.mapByIds(xtIds);
  171 + Map<String, Workshop> dwMap = CollectionUtils.isEmpty(dwIds) ? new HashMap<>(0) : workshopService.mapByIds(dwIds);
  172 + Map<String, RoomGroup> szMap = CollectionUtils.isEmpty(szIds) ? new HashMap<>(0) : roomGroupService.mapByIds(szIds);
  173 + Map<String, Area> qyMap = CollectionUtils.isEmpty(qyIds) ? new HashMap<>(0) : areaService.mapByIds(qyIds);
  174 +
  175 + // 回填名称、编号
  176 + for (Announcement item : list) {
  177 + XtLine xtLine = xtMap.get(item.getXtxx());
  178 + if (null != xtLine) {
  179 + item.setXtmc(xtLine.getXtmc());
  180 + item.setXtbh(xtLine.getXtbh());
  181 + }
  182 + Workshop workshop = dwMap.get(item.getCjxx());
  183 + if (null != workshop) {
  184 + item.setDwmc(workshop.getDwmc());
  185 + item.setDwbh(workshop.getDwbh());
  186 + }
  187 + RoomGroup roomGroup = szMap.get(item.getSzxx());
  188 + if (null != roomGroup) {
  189 + item.setSzmc(roomGroup.getSzmc());
  190 + item.setSzbh(roomGroup.getSzbh());
  191 + }
  192 + Area area = qyMap.get(item.getQyxx());
  193 + if (null != area) {
  194 + item.setQymc(area.getQymc());
  195 + item.setQybh(area.getQybh());
  196 + }
  197 + }
  198 + }
  199 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaBlockIndicatorDailyMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicatorDaily;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * AreaBlockIndicatorDaily 服务
  21 + */
  22 +@Service
  23 +public class AreaBlockIndicatorDailyService extends BaseServiceImpl<AreaBlockIndicatorDaily> {
  24 +
  25 + @Resource
  26 + private AreaBlockIndicatorDailyMapper areaBlockIndicatorDailyMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public AreaBlockIndicatorDaily getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(AreaBlockIndicatorDaily.ID, id);
  34 + AreaBlockIndicatorDaily areaBlockIndicatorDaily = areaBlockIndicatorDailyMapper.selectOneByExample(example);
  35 + if (null == areaBlockIndicatorDaily) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return areaBlockIndicatorDaily;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<AreaBlockIndicatorDaily> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(AreaBlockIndicatorDaily.ID, ids);
  47 + List<AreaBlockIndicatorDaily> list = areaBlockIndicatorDailyMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, AreaBlockIndicatorDaily> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<AreaBlockIndicatorDaily> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(AreaBlockIndicatorDaily::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<AreaBlockIndicatorDaily> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return areaBlockIndicatorDailyMapper.selectByExample(example);
  71 + }
  72 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaBlockIndicatorMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicator;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * AreaBlockIndicator 服务
  21 + */
  22 +@Service
  23 +public class AreaBlockIndicatorService extends BaseServiceImpl<AreaBlockIndicator> {
  24 +
  25 + @Resource
  26 + private AreaBlockIndicatorMapper areaBlockIndicatorMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public AreaBlockIndicator getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(AreaBlockIndicator.ID, id);
  34 + AreaBlockIndicator areaBlockIndicator = areaBlockIndicatorMapper.selectOneByExample(example);
  35 + if (null == areaBlockIndicator) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return areaBlockIndicator;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<AreaBlockIndicator> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(AreaBlockIndicator.ID, ids);
  47 + List<AreaBlockIndicator> list = areaBlockIndicatorMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, AreaBlockIndicator> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<AreaBlockIndicator> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(AreaBlockIndicator::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<AreaBlockIndicator> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return areaBlockIndicatorMapper.selectByExample(example);
  71 + }
  72 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cps.model.Area;
  7 +import com.qgutech.qgyun.apaas.sync.cps.model.Team;
  8 +import com.qgutech.qgyun.apaas.sync.cps.service.AreaService;
  9 +import com.qgutech.qgyun.apaas.sync.cps.service.TeamService;
  10 +import com.qgutech.qgyun.apaas.sync.cpsipo.dto.AttendanceDailySummaryDTO;
  11 +import com.qgutech.qgyun.apaas.sync.cpsipo.enums.JbEnum;
  12 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaEmployeeAttendanceDetailMapper;
  13 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeAttendanceDetail;
  14 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  15 +import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils;
  16 +import org.apache.commons.collections4.CollectionUtils;
  17 +import org.apache.commons.lang3.StringUtils;
  18 +import org.springframework.stereotype.Service;
  19 +import org.springframework.transaction.annotation.Transactional;
  20 +import org.springframework.util.Assert;
  21 +import tk.mybatis.mapper.entity.Example;
  22 +
  23 +import javax.annotation.Resource;
  24 +import java.text.SimpleDateFormat;
  25 +import java.util.*;
  26 +import java.util.stream.Collectors;
  27 +
  28 +/**
  29 + * AreaEmployeeAttendanceDetail 服务
  30 + */
  31 +@Service
  32 +public class AreaEmployeeAttendanceDetailService extends BaseServiceImpl<AreaEmployeeAttendanceDetail> {
  33 +
  34 + @Resource
  35 + private AreaEmployeeAttendanceDetailMapper areaEmployeeAttendanceDetailMapper;
  36 +
  37 + @Resource
  38 + private AreaService areaService;
  39 +
  40 + @Resource
  41 + private TeamService teamService;
  42 +
  43 + @Transactional(readOnly = true)
  44 + public AreaEmployeeAttendanceDetail getById(String id) {
  45 + Assert.hasLength(id, "id is empty!");
  46 +
  47 + Example example = new Example(entityClass);
  48 + CorpExample.criteria(example).andEqualTo(AreaEmployeeAttendanceDetail.ID, id);
  49 + AreaEmployeeAttendanceDetail areaEmployeeAttendanceDetail = areaEmployeeAttendanceDetailMapper.selectOneByExample(example);
  50 + if (null == areaEmployeeAttendanceDetail) {
  51 + throw new BoException(BoErrorCode.DATA_ERROR);
  52 + }
  53 + return areaEmployeeAttendanceDetail;
  54 + }
  55 +
  56 + @Transactional(readOnly = true)
  57 + public List<AreaEmployeeAttendanceDetail> listByIds(Collection<String> ids) {
  58 + Assert.notEmpty(ids, "ids is empty!");
  59 +
  60 + Example example = new Example(entityClass);
  61 + CorpExample.criteria(example).andIn(AreaEmployeeAttendanceDetail.ID, ids);
  62 + List<AreaEmployeeAttendanceDetail> list = areaEmployeeAttendanceDetailMapper.selectByExample(example);
  63 + if (CollectionUtils.isEmpty(list)) {
  64 + return new ArrayList<>(0);
  65 + }
  66 + return list;
  67 + }
  68 +
  69 + @Transactional(readOnly = true)
  70 + public Map<String, AreaEmployeeAttendanceDetail> mapByIds(Collection<String> ids) {
  71 + Assert.notEmpty(ids, "ids is empty!");
  72 +
  73 + List<AreaEmployeeAttendanceDetail> list = listByIds(ids);
  74 + if (CollectionUtils.isEmpty(list)) {
  75 + return new HashMap<>(0);
  76 + }
  77 +
  78 + return list.stream().collect(Collectors.toMap(AreaEmployeeAttendanceDetail::getId, item -> item));
  79 + }
  80 +
  81 + @Transactional(readOnly = true)
  82 + public List<AreaEmployeeAttendanceDetail> listAll() {
  83 +
  84 + Example example = CorpExample.ofCorp(entityClass);
  85 + return areaEmployeeAttendanceDetailMapper.selectByExample(example);
  86 + }
  87 +
  88 + /**
  89 + * 根据区域、月份汇总该月每日考勤信息(按考勤日期分组)。
  90 + * <p>
  91 + * 每日总记录条数为区域应到人数(ydrs),假别为出勤(JbEnum.CHUQIN)的记录条数为实到人数(sdrs)。
  92 + * 年份固定取当前年,month(1-12)必传;结果按日期升序。
  93 + *
  94 + * @param qyxx 区域(Area)id,必传
  95 + * @param month 月份(1-12),必传
  96 + * @return 该月每日考勤汇总列表
  97 + */
  98 + @Transactional(readOnly = true)
  99 + public List<AttendanceDailySummaryDTO> summaryDailyByMonth(String qyxx, Integer month) {
  100 + Assert.hasLength(qyxx, "qyxx is empty!");
  101 + Assert.notNull(month, "month is empty!");
  102 +
  103 + // 年份固定取当前年(year 传 null),month 必传
  104 + Date start = DateDealUtils.getMonthStartTime(null, month);
  105 + Date end = DateDealUtils.getMonthEndTime(null, month);
  106 +
  107 + Example example = new Example(entityClass);
  108 + CorpExample.criteria(example)
  109 + .andEqualTo(AreaEmployeeAttendanceDetail.QYXX, qyxx)
  110 + .andBetween(AreaEmployeeAttendanceDetail.KQRQ, start, end);
  111 + List<AreaEmployeeAttendanceDetail> list = areaEmployeeAttendanceDetailMapper.selectByExample(example);
  112 + if (CollectionUtils.isEmpty(list)) {
  113 + return new ArrayList<>(0);
  114 + }
  115 +
  116 + // 按考勤日期分组
  117 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
  118 + Map<String, List<AreaEmployeeAttendanceDetail>> dailyGroup = list.stream()
  119 + .filter(item -> item.getKqrq() != null)
  120 + .collect(Collectors.groupingBy(item -> dateFormat.format(item.getKqrq())));
  121 +
  122 + List<AttendanceDailySummaryDTO> result = new ArrayList<>();
  123 + for (Map.Entry<String, List<AreaEmployeeAttendanceDetail>> entry : dailyGroup.entrySet()) {
  124 + List<AreaEmployeeAttendanceDetail> dayList = entry.getValue();
  125 + // 应到人数:当日该区域考勤明细总记录条数
  126 + int ydrs = dayList.size();
  127 + // 实到人数:当日假别为出勤的记录条数
  128 + int sdrs = (int) dayList.stream()
  129 + .filter(item -> JbEnum.CHUQIN == JbEnum.fromCode(item.getJbem()))
  130 + .count();
  131 + result.add(new AttendanceDailySummaryDTO(entry.getKey(), ydrs, sdrs));
  132 + }
  133 +
  134 + // 按日期升序
  135 + result.sort(Comparator.comparing(AttendanceDailySummaryDTO::getDate));
  136 + return result;
  137 + }
  138 +
  139 + /**
  140 + * 根据区域、日期查询当日非出勤(假别不为出勤)的考勤明细列表,并补全关联信息。
  141 + * <p>
  142 + * 非出勤判定:假别 jbem 解析后不等于 {@link JbEnum#CHUQIN}(含假别为空或其他假别)。
  143 + * 返回列表补全区域名称/编号(关联 Area)与班组名称/编号(关联 Team)。
  144 + *
  145 + * @param qyxx 区域(Area)id,必传
  146 + * @param date 考勤日期(yyyy-MM-dd),必传
  147 + * @return 当日该区域非出勤的考勤明细列表
  148 + */
  149 + @Transactional(readOnly = true)
  150 + public List<AreaEmployeeAttendanceDetail> listNonAttendanceByDate(String qyxx, String date) {
  151 + Assert.hasLength(qyxx, "qyxx is empty!");
  152 + Assert.hasLength(date, "date is empty!");
  153 +
  154 + Date start = DateDealUtils.parseStartTime(date);
  155 + Date end = DateDealUtils.parseEndTime(date);
  156 +
  157 + Example example = new Example(entityClass);
  158 + CorpExample.criteria(example)
  159 + .andEqualTo(AreaEmployeeAttendanceDetail.QYXX, qyxx)
  160 + .andBetween(AreaEmployeeAttendanceDetail.KQRQ, start, end);
  161 + List<AreaEmployeeAttendanceDetail> list = areaEmployeeAttendanceDetailMapper.selectByExample(example);
  162 + if (CollectionUtils.isEmpty(list)) {
  163 + return new ArrayList<>(0);
  164 + }
  165 +
  166 + // 过滤出非出勤记录(假别解析后不等于出勤,含假别为空或其他假别)
  167 + List<AreaEmployeeAttendanceDetail> resultList = list.stream()
  168 + .filter(item -> JbEnum.CHUQIN != JbEnum.fromCode(item.getJbem()))
  169 + .collect(Collectors.toList());
  170 + if (CollectionUtils.isEmpty(resultList)) {
  171 + return new ArrayList<>(0);
  172 + }
  173 +
  174 + // 补全区域、班组名称与编号
  175 + fillRelatedInfo(resultList);
  176 + return resultList;
  177 + }
  178 +
  179 + /**
  180 + * 批量补全考勤明细关联的区域、班组名称与编号。
  181 + */
  182 + private void fillRelatedInfo(List<AreaEmployeeAttendanceDetail> list) {
  183 + // 收集关联 id
  184 + Set<String> qyIds = new HashSet<>();
  185 + Set<String> bzIds = new HashSet<>();
  186 + for (AreaEmployeeAttendanceDetail item : list) {
  187 + if (StringUtils.isNotBlank(item.getQyxx())) {
  188 + qyIds.add(item.getQyxx());
  189 + }
  190 + if (StringUtils.isNotBlank(item.getBzxx())) {
  191 + bzIds.add(item.getBzxx());
  192 + }
  193 + }
  194 +
  195 + // 批量查询关联实体(空集合时不调用,避免 mapByIds 断言报错)
  196 + Map<String, Area> qyMap = CollectionUtils.isEmpty(qyIds) ? new HashMap<>(0) : areaService.mapByIds(qyIds);
  197 + Map<String, Team> bzMap = CollectionUtils.isEmpty(bzIds) ? new HashMap<>(0) : teamService.mapByIds(bzIds);
  198 +
  199 + // 回填名称、编号
  200 + for (AreaEmployeeAttendanceDetail item : list) {
  201 + Area area = qyMap.get(item.getQyxx());
  202 + if (null != area) {
  203 + item.setQymc(area.getQymc());
  204 + item.setQybh(area.getQybh());
  205 + }
  206 + Team team = bzMap.get(item.getBzxx());
  207 + if (null != team) {
  208 + item.setBzmc(team.getBzmc());
  209 + item.setBzbh(team.getBzbh());
  210 + }
  211 + }
  212 + }
  213 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaEmployeeAttendanceMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeAttendance;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * AreaEmployeeAttendance 服务
  21 + */
  22 +@Service
  23 +public class AreaEmployeeAttendanceService extends BaseServiceImpl<AreaEmployeeAttendance> {
  24 +
  25 + @Resource
  26 + private AreaEmployeeAttendanceMapper areaEmployeeAttendanceMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public AreaEmployeeAttendance getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(AreaEmployeeAttendance.ID, id);
  34 + AreaEmployeeAttendance areaEmployeeAttendance = areaEmployeeAttendanceMapper.selectOneByExample(example);
  35 + if (null == areaEmployeeAttendance) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return areaEmployeeAttendance;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<AreaEmployeeAttendance> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(AreaEmployeeAttendance.ID, ids);
  47 + List<AreaEmployeeAttendance> list = areaEmployeeAttendanceMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, AreaEmployeeAttendance> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<AreaEmployeeAttendance> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(AreaEmployeeAttendance::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<AreaEmployeeAttendance> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return areaEmployeeAttendanceMapper.selectByExample(example);
  71 + }
  72 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaEmployeeChangeMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeChange;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * AreaEmployeeChange 服务
  21 + */
  22 +@Service
  23 +public class AreaEmployeeChangeService extends BaseServiceImpl<AreaEmployeeChange> {
  24 +
  25 + @Resource
  26 + private AreaEmployeeChangeMapper areaEmployeeChangeMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public AreaEmployeeChange getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(AreaEmployeeChange.ID, id);
  34 + AreaEmployeeChange areaEmployeeChange = areaEmployeeChangeMapper.selectOneByExample(example);
  35 + if (null == areaEmployeeChange) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return areaEmployeeChange;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<AreaEmployeeChange> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(AreaEmployeeChange.ID, ids);
  47 + List<AreaEmployeeChange> list = areaEmployeeChangeMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, AreaEmployeeChange> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<AreaEmployeeChange> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(AreaEmployeeChange::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<AreaEmployeeChange> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return areaEmployeeChangeMapper.selectByExample(example);
  71 + }
  72 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaEmployeeResignationMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployeeResignation;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * AreaEmployeeResignation 服务
  21 + */
  22 +@Service
  23 +public class AreaEmployeeResignationService extends BaseServiceImpl<AreaEmployeeResignation> {
  24 +
  25 + @Resource
  26 + private AreaEmployeeResignationMapper areaEmployeeResignationMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public AreaEmployeeResignation getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(AreaEmployeeResignation.ID, id);
  34 + AreaEmployeeResignation areaEmployeeResignation = areaEmployeeResignationMapper.selectOneByExample(example);
  35 + if (null == areaEmployeeResignation) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return areaEmployeeResignation;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<AreaEmployeeResignation> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(AreaEmployeeResignation.ID, ids);
  47 + List<AreaEmployeeResignation> list = areaEmployeeResignationMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, AreaEmployeeResignation> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<AreaEmployeeResignation> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(AreaEmployeeResignation::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<AreaEmployeeResignation> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return areaEmployeeResignationMapper.selectByExample(example);
  71 + }
  72 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaEmployeeMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployee;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * AreaEmployee 服务
  21 + */
  22 +@Service
  23 +public class AreaEmployeeService extends BaseServiceImpl<AreaEmployee> {
  24 +
  25 + @Resource
  26 + private AreaEmployeeMapper areaEmployeeMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public AreaEmployee getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(AreaEmployee.ID, id);
  34 + AreaEmployee areaEmployee = areaEmployeeMapper.selectOneByExample(example);
  35 + if (null == areaEmployee) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return areaEmployee;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<AreaEmployee> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(AreaEmployee.ID, ids);
  47 + List<AreaEmployee> list = areaEmployeeMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, AreaEmployee> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<AreaEmployee> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(AreaEmployee::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<AreaEmployee> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return areaEmployeeMapper.selectByExample(example);
  71 + }
  72 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.apaas.sync.cps.model.Area;
  4 +import com.qgutech.qgyun.apaas.sync.cps.service.AreaService;
  5 +import com.qgutech.qgyun.apaas.sync.cpsfzzk.model.BlockInfo;
  6 +import com.qgutech.qgyun.apaas.sync.cpsfzzk.service.BlockInfoService;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaBlockIndicator;
  8 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  9 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  10 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  11 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.AreaScorecardMapper;
  12 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaScorecard;
  13 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  14 +import org.apache.commons.collections4.CollectionUtils;
  15 +import org.apache.commons.lang3.StringUtils;
  16 +import org.springframework.stereotype.Service;
  17 +import org.springframework.transaction.annotation.Transactional;
  18 +import org.springframework.util.Assert;
  19 +import tk.mybatis.mapper.entity.Example;
  20 +
  21 +import javax.annotation.Resource;
  22 +import java.util.*;
  23 +import java.util.stream.Collectors;
  24 +
  25 +/**
  26 + * AreaScorecard 服务
  27 + */
  28 +@Service
  29 +public class AreaScorecardService extends BaseServiceImpl<AreaScorecard> {
  30 +
  31 + @Resource
  32 + private AreaScorecardMapper areaScorecardMapper;
  33 +
  34 + @Resource
  35 + private AreaService areaService;
  36 +
  37 + @Resource
  38 + private BlockInfoService blockInfoService;
  39 +
  40 + @Resource
  41 + private AreaBlockIndicatorService areaBlockIndicatorService;
  42 +
  43 + @Transactional(readOnly = true)
  44 + public AreaScorecard getById(String id) {
  45 + Assert.hasLength(id, "id is empty!");
  46 +
  47 + Example example = new Example(entityClass);
  48 + CorpExample.criteria(example).andEqualTo(AreaScorecard.ID, id);
  49 + AreaScorecard areaScorecard = areaScorecardMapper.selectOneByExample(example);
  50 + if (null == areaScorecard) {
  51 + throw new BoException(BoErrorCode.DATA_ERROR);
  52 + }
  53 + return areaScorecard;
  54 + }
  55 +
  56 + @Transactional(readOnly = true)
  57 + public List<AreaScorecard> listByIds(Collection<String> ids) {
  58 + Assert.notEmpty(ids, "ids is empty!");
  59 +
  60 + Example example = new Example(entityClass);
  61 + CorpExample.criteria(example).andIn(AreaScorecard.ID, ids);
  62 + List<AreaScorecard> list = areaScorecardMapper.selectByExample(example);
  63 + if (CollectionUtils.isEmpty(list)) {
  64 + return new ArrayList<>(0);
  65 + }
  66 + return list;
  67 + }
  68 +
  69 + @Transactional(readOnly = true)
  70 + public Map<String, AreaScorecard> mapByIds(Collection<String> ids) {
  71 + Assert.notEmpty(ids, "ids is empty!");
  72 +
  73 + List<AreaScorecard> list = listByIds(ids);
  74 + if (CollectionUtils.isEmpty(list)) {
  75 + return new HashMap<>(0);
  76 + }
  77 +
  78 + return list.stream().collect(Collectors.toMap(AreaScorecard::getId, item -> item));
  79 + }
  80 +
  81 + @Transactional(readOnly = true)
  82 + public List<AreaScorecard> listAll() {
  83 +
  84 + Example example = CorpExample.ofCorp(entityClass);
  85 + return areaScorecardMapper.selectByExample(example);
  86 + }
  87 +
  88 + /**
  89 + * 按区域和月份查询记分卡列表(按板块序号排序,并填充关联信息)
  90 + *
  91 + * @param qyxx 区域信息,可为空
  92 + * @param yuefem 月份(格式:#1#-#12#)
  93 + * @return 记分卡列表
  94 + */
  95 + @Transactional(readOnly = true)
  96 + public List<AreaScorecard> listByQyxxAndYuefem(String qyxx, String yuefem) {
  97 + Example example = CorpExample.ofCorp(entityClass);
  98 + Example.Criteria criteria = example.createCriteria();
  99 +
  100 + // 添加月份条件
  101 + criteria.andEqualTo(AreaScorecard.YUEFEM, yuefem);
  102 +
  103 + // 如果区域信息不为空,添加区域条件
  104 + if (StringUtils.isNotBlank(qyxx)) {
  105 + criteria.andEqualTo(AreaScorecard.QYXX, qyxx);
  106 + }
  107 +
  108 + List<AreaScorecard> list = areaScorecardMapper.selectByExample(example);
  109 + if (CollectionUtils.isEmpty(list)) {
  110 + return new ArrayList<>(0);
  111 + }
  112 +
  113 + // 填充关联信息
  114 + fillRelatedInfo(list);
  115 +
  116 + // 按板块序号排序
  117 + list.sort(Comparator.comparing(AreaScorecard::getBkxh, Comparator.nullsLast(Comparator.naturalOrder())));
  118 +
  119 + return list;
  120 + }
  121 +
  122 + /**
  123 + * 填充关联信息(区域、板块、指标)
  124 + *
  125 + * @param list 记分卡列表
  126 + */
  127 + private void fillRelatedInfo(List<AreaScorecard> list) {
  128 + if (CollectionUtils.isEmpty(list)) {
  129 + return;
  130 + }
  131 +
  132 + // 收集关联 Id
  133 + Set<String> qyIds = list.stream()
  134 + .map(AreaScorecard::getQyxx)
  135 + .filter(StringUtils::isNotBlank)
  136 + .collect(Collectors.toSet());
  137 + Set<String> bkIds = list.stream()
  138 + .map(AreaScorecard::getBkxx)
  139 + .filter(StringUtils::isNotBlank)
  140 + .collect(Collectors.toSet());
  141 + Set<String> zhibIds = list.stream()
  142 + .map(AreaScorecard::getZhibxx)
  143 + .filter(StringUtils::isNotBlank)
  144 + .collect(Collectors.toSet());
  145 +
  146 + // 批量查询关联实体
  147 + Map<String, Area> qyMap = CollectionUtils.isEmpty(qyIds) ? new HashMap<>(0) : areaService.mapByIds(qyIds);
  148 + Map<String, BlockInfo> bkMap = CollectionUtils.isEmpty(bkIds) ? new HashMap<>(0) : blockInfoService.mapByIds(bkIds);
  149 + Map<String, AreaBlockIndicator> zhibMap = CollectionUtils.isEmpty(zhibIds) ? new HashMap<>(0) : areaBlockIndicatorService.mapByIds(zhibIds);
  150 +
  151 + // 填充非持久化字段
  152 + for (AreaScorecard record : list) {
  153 + // 填充区域信息
  154 + Area area = qyMap.get(record.getQyxx());
  155 + if (area != null) {
  156 + record.setQymc(area.getQymc());
  157 + record.setQybh(area.getQybh());
  158 + }
  159 +
  160 + // 填充板块信息
  161 + BlockInfo blockInfo = bkMap.get(record.getBkxx());
  162 + if (blockInfo != null) {
  163 + record.setBkmc(blockInfo.getMc());
  164 + record.setBkbm(blockInfo.getBm());
  165 + record.setBkxh(blockInfo.getXh());
  166 + }
  167 +
  168 + // 填充指标信息
  169 + AreaBlockIndicator indicator = zhibMap.get(record.getZhibxx());
  170 + if (indicator != null) {
  171 + record.setZhibmc(indicator.getZhib());
  172 + }
  173 + }
  174 + }
  175 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.FiveSMapMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.FiveSMap;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * FiveSMap 服务
  21 + */
  22 +@Service
  23 +public class FiveSMapService extends BaseServiceImpl<FiveSMap> {
  24 +
  25 + @Resource
  26 + private FiveSMapMapper fiveSMapMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public FiveSMap getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(FiveSMap.ID, id);
  34 + FiveSMap fiveSMap = fiveSMapMapper.selectOneByExample(example);
  35 + if (null == fiveSMap) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return fiveSMap;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<FiveSMap> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(FiveSMap.ID, ids);
  47 + List<FiveSMap> list = fiveSMapMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, FiveSMap> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<FiveSMap> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(FiveSMap::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<FiveSMap> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return fiveSMapMapper.selectByExample(example);
  71 + }
  72 +
  73 + /**
  74 + * 根据区域查询该区域下的 5S 责任图列表。
  75 + *
  76 + * @param qyxx 区域(Area)id,必传
  77 + * @return 指定区域下的 5S 责任图列表
  78 + */
  79 + @Transactional(readOnly = true)
  80 + public List<FiveSMap> listByArea(String qyxx) {
  81 + Assert.hasLength(qyxx, "qyxx is empty!");
  82 +
  83 + Example example = new Example(entityClass);
  84 + CorpExample.criteria(example).andEqualTo(FiveSMap.QYXX, qyxx);
  85 + List<FiveSMap> list = fiveSMapMapper.selectByExample(example);
  86 + if (CollectionUtils.isEmpty(list)) {
  87 + return new ArrayList<>(0);
  88 + }
  89 + return list;
  90 + }
  91 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cps.model.Area;
  7 +import com.qgutech.qgyun.apaas.sync.cps.model.RoomGroup;
  8 +import com.qgutech.qgyun.apaas.sync.cps.model.Team;
  9 +import com.qgutech.qgyun.apaas.sync.cps.model.Workshop;
  10 +import com.qgutech.qgyun.apaas.sync.cps.model.XtLine;
  11 +import com.qgutech.qgyun.apaas.sync.cps.service.AreaService;
  12 +import com.qgutech.qgyun.apaas.sync.cps.service.RoomGroupService;
  13 +import com.qgutech.qgyun.apaas.sync.cps.service.TeamService;
  14 +import com.qgutech.qgyun.apaas.sync.cps.service.WorkshopService;
  15 +import com.qgutech.qgyun.apaas.sync.cps.service.XtLineService;
  16 +import com.qgutech.qgyun.apaas.sync.cpsipo.dto.MultiSkilledEmployeeDTO;
  17 +import com.qgutech.qgyun.apaas.sync.cpsipo.dto.MultiSkilledWorkstationDTO;
  18 +import com.qgutech.qgyun.apaas.sync.cpsipo.dto.MultiSkilledWorkerSummaryDTO;
  19 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.MultiSkilledWorkerMapper;
  20 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.AreaEmployee;
  21 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.MultiSkilledWorker;
  22 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.StopWorkstation;
  23 +import com.qgutech.qgyun.apaas.sync.org.model.UcUser;
  24 +import com.qgutech.qgyun.apaas.sync.org.service.UcUserService;
  25 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  26 +import org.apache.commons.collections4.CollectionUtils;
  27 +import org.apache.commons.lang3.StringUtils;
  28 +import org.springframework.stereotype.Service;
  29 +import org.springframework.transaction.annotation.Transactional;
  30 +import org.springframework.util.Assert;
  31 +import tk.mybatis.mapper.entity.Example;
  32 +
  33 +import javax.annotation.Resource;
  34 +import java.util.*;
  35 +import java.util.stream.Collectors;
  36 +
  37 +/**
  38 + * MultiSkilledWorker 服务
  39 + */
  40 +@Service
  41 +public class MultiSkilledWorkerService extends BaseServiceImpl<MultiSkilledWorker> {
  42 +
  43 + @Resource
  44 + private MultiSkilledWorkerMapper multiSkilledWorkerMapper;
  45 +
  46 + @Resource
  47 + private XtLineService xtLineService;
  48 +
  49 + @Resource
  50 + private WorkshopService workshopService;
  51 +
  52 + @Resource
  53 + private RoomGroupService roomGroupService;
  54 +
  55 + @Resource
  56 + private AreaService areaService;
  57 +
  58 + @Resource
  59 + private TeamService teamService;
  60 +
  61 + @Resource
  62 + private UcUserService ucUserService;
  63 +
  64 + @Resource
  65 + private StopWorkstationService stopWorkstationService;
  66 +
  67 + @Resource
  68 + private AreaEmployeeService areaEmployeeService;
  69 +
  70 + @Transactional(readOnly = true)
  71 + public MultiSkilledWorker getById(String id) {
  72 + Assert.hasLength(id, "id is empty!");
  73 +
  74 + Example example = new Example(entityClass);
  75 + CorpExample.criteria(example).andEqualTo(MultiSkilledWorker.ID, id);
  76 + MultiSkilledWorker multiSkilledWorker = multiSkilledWorkerMapper.selectOneByExample(example);
  77 + if (null == multiSkilledWorker) {
  78 + throw new BoException(BoErrorCode.DATA_ERROR);
  79 + }
  80 + return multiSkilledWorker;
  81 + }
  82 +
  83 + @Transactional(readOnly = true)
  84 + public List<MultiSkilledWorker> listByIds(Collection<String> ids) {
  85 + Assert.notEmpty(ids, "ids is empty!");
  86 +
  87 + Example example = new Example(entityClass);
  88 + CorpExample.criteria(example).andIn(MultiSkilledWorker.ID, ids);
  89 + List<MultiSkilledWorker> list = multiSkilledWorkerMapper.selectByExample(example);
  90 + if (CollectionUtils.isEmpty(list)) {
  91 + return new ArrayList<>(0);
  92 + }
  93 + return list;
  94 + }
  95 +
  96 + @Transactional(readOnly = true)
  97 + public Map<String, MultiSkilledWorker> mapByIds(Collection<String> ids) {
  98 + Assert.notEmpty(ids, "ids is empty!");
  99 +
  100 + List<MultiSkilledWorker> list = listByIds(ids);
  101 + if (CollectionUtils.isEmpty(list)) {
  102 + return new HashMap<>(0);
  103 + }
  104 +
  105 + return list.stream().collect(Collectors.toMap(MultiSkilledWorker::getId, item -> item));
  106 + }
  107 +
  108 + @Transactional(readOnly = true)
  109 + public List<MultiSkilledWorker> listAll() {
  110 +
  111 + Example example = CorpExample.ofCorp(entityClass);
  112 + return multiSkilledWorkerMapper.selectByExample(example);
  113 + }
  114 +
  115 + /**
  116 + * 根据区域查询该区域下的多能工记录,并对员工、工位分别去重汇总。
  117 + * <p>
  118 + * 一个接口同时返回三部分:
  119 + * <ul>
  120 + * <li>员工列表(按 ygxx 去重);</li>
  121 + * <li>工位列表(按 gwxx 去重);</li>
  122 + * <li>员工工位等级信息列表(多能工明细,已补全线体/车间/室组/区域/班组/员工/工位/区域员工等关联名称与编号)。</li>
  123 + * </ul>
  124 + *
  125 + * @param qyxx 区域(Area)id,必传
  126 + * @return 多能工汇总结果
  127 + */
  128 + @Transactional(readOnly = true)
  129 + public MultiSkilledWorkerSummaryDTO summaryByArea(String qyxx) {
  130 + Assert.hasLength(qyxx, "qyxx is empty!");
  131 +
  132 + MultiSkilledWorkerSummaryDTO result = new MultiSkilledWorkerSummaryDTO();
  133 +
  134 + // 1. 查询当前企业下指定区域的多能工记录
  135 + Example example = new Example(entityClass);
  136 + CorpExample.criteria(example).andEqualTo(MultiSkilledWorker.QYXX, qyxx);
  137 + List<MultiSkilledWorker> records = multiSkilledWorkerMapper.selectByExample(example);
  138 + if (CollectionUtils.isEmpty(records)) {
  139 + result.setEmployeeList(new ArrayList<>(0));
  140 + result.setWorkstationList(new ArrayList<>(0));
  141 + result.setWorkerLevelList(new ArrayList<>(0));
  142 + return result;
  143 + }
  144 +
  145 + // 2. 补全线体/车间/室组/区域/班组/员工/工位/区域员工等关联信息
  146 + fillRelatedInfo(records);
  147 +
  148 + // 3. 分别汇总员工、工位,并组装返回结果
  149 + result.setEmployeeList(buildEmployeeList(records));
  150 + result.setWorkstationList(buildWorkstationList(records));
  151 + result.setWorkerLevelList(records);
  152 + return result;
  153 + }
  154 +
  155 + /**
  156 + * 按员工(ygxx)去重汇总,保留首次出现顺序。
  157 + */
  158 + private List<MultiSkilledEmployeeDTO> buildEmployeeList(List<MultiSkilledWorker> records) {
  159 + Map<String, MultiSkilledEmployeeDTO> employeeMap = new LinkedHashMap<>();
  160 + for (MultiSkilledWorker item : records) {
  161 + String ygxx = item.getYgxx();
  162 + if (StringUtils.isBlank(ygxx) || employeeMap.containsKey(ygxx)) {
  163 + continue;
  164 + }
  165 + MultiSkilledEmployeeDTO dto = new MultiSkilledEmployeeDTO();
  166 + dto.setYgxx(ygxx);
  167 + dto.setYgName(item.getYgName());
  168 + employeeMap.put(ygxx, dto);
  169 + }
  170 + return new ArrayList<>(employeeMap.values());
  171 + }
  172 +
  173 + /**
  174 + * 按工位(gwxx)去重汇总,保留首次出现顺序。
  175 + */
  176 + private List<MultiSkilledWorkstationDTO> buildWorkstationList(List<MultiSkilledWorker> records) {
  177 + Map<String, MultiSkilledWorkstationDTO> workstationMap = new LinkedHashMap<>();
  178 + for (MultiSkilledWorker item : records) {
  179 + String gwxx = item.getGwxx();
  180 + if (StringUtils.isBlank(gwxx) || workstationMap.containsKey(gwxx)) {
  181 + continue;
  182 + }
  183 + MultiSkilledWorkstationDTO dto = new MultiSkilledWorkstationDTO();
  184 + dto.setGwxx(gwxx);
  185 + dto.setGwmc(item.getGwmc());
  186 + dto.setGwbh(item.getGwbh());
  187 + workstationMap.put(gwxx, dto);
  188 + }
  189 + return new ArrayList<>(workstationMap.values());
  190 + }
  191 +
  192 + /**
  193 + * 批量补全多能工记录关联的线体/车间/室组/区域/班组/员工/工位/区域员工名称与编号。
  194 + */
  195 + private void fillRelatedInfo(List<MultiSkilledWorker> records) {
  196 + // 收集各维度关联 id
  197 + Set<String> xtIds = new HashSet<>();
  198 + Set<String> cjIds = new HashSet<>();
  199 + Set<String> szIds = new HashSet<>();
  200 + Set<String> qyIds = new HashSet<>();
  201 + Set<String> bzIds = new HashSet<>();
  202 + Set<String> ygIds = new HashSet<>();
  203 + Set<String> gwIds = new HashSet<>();
  204 + Set<String> qyygIds = new HashSet<>();
  205 + for (MultiSkilledWorker item : records) {
  206 + if (StringUtils.isNotBlank(item.getXtxx())) {
  207 + xtIds.add(item.getXtxx());
  208 + }
  209 + if (StringUtils.isNotBlank(item.getCjxx())) {
  210 + cjIds.add(item.getCjxx());
  211 + }
  212 + if (StringUtils.isNotBlank(item.getSzxx())) {
  213 + szIds.add(item.getSzxx());
  214 + }
  215 + if (StringUtils.isNotBlank(item.getQyxx())) {
  216 + qyIds.add(item.getQyxx());
  217 + }
  218 + if (StringUtils.isNotBlank(item.getBzxx())) {
  219 + bzIds.add(item.getBzxx());
  220 + }
  221 + if (StringUtils.isNotBlank(item.getYgxx())) {
  222 + ygIds.add(item.getYgxx());
  223 + }
  224 + if (StringUtils.isNotBlank(item.getGwxx())) {
  225 + gwIds.add(item.getGwxx());
  226 + }
  227 + if (StringUtils.isNotBlank(item.getQyygxx())) {
  228 + qyygIds.add(item.getQyygxx());
  229 + }
  230 + }
  231 +
  232 + // 批量查询关联实体(空集合时不调用,避免 mapByIds 断言报错)
  233 + Map<String, XtLine> xtMap = CollectionUtils.isEmpty(xtIds) ? new HashMap<>(0) : xtLineService.mapByIds(xtIds);
  234 + Map<String, Workshop> cjMap = CollectionUtils.isEmpty(cjIds) ? new HashMap<>(0) : workshopService.mapByIds(cjIds);
  235 + Map<String, RoomGroup> szMap = CollectionUtils.isEmpty(szIds) ? new HashMap<>(0) : roomGroupService.mapByIds(szIds);
  236 + Map<String, Area> qyMap = CollectionUtils.isEmpty(qyIds) ? new HashMap<>(0) : areaService.mapByIds(qyIds);
  237 + Map<String, Team> bzMap = CollectionUtils.isEmpty(bzIds) ? new HashMap<>(0) : teamService.mapByIds(bzIds);
  238 + Map<String, UcUser> ygMap = CollectionUtils.isEmpty(ygIds) ? new HashMap<>(0) : ucUserService.mapByIds(ygIds);
  239 + Map<String, StopWorkstation> gwMap = CollectionUtils.isEmpty(gwIds) ? new HashMap<>(0) : stopWorkstationService.mapByIds(gwIds);
  240 + Map<String, AreaEmployee> qyygMap = CollectionUtils.isEmpty(qyygIds) ? new HashMap<>(0) : areaEmployeeService.mapByIds(qyygIds);
  241 +
  242 + // 回填名称、编号
  243 + for (MultiSkilledWorker item : records) {
  244 + XtLine xtLine = xtMap.get(item.getXtxx());
  245 + if (null != xtLine) {
  246 + item.setXtmc(xtLine.getXtmc());
  247 + item.setXtbh(xtLine.getXtbh());
  248 + }
  249 + Workshop workshop = cjMap.get(item.getCjxx());
  250 + if (null != workshop) {
  251 + item.setDwmc(workshop.getDwmc());
  252 + item.setDwbh(workshop.getDwbh());
  253 + }
  254 + RoomGroup roomGroup = szMap.get(item.getSzxx());
  255 + if (null != roomGroup) {
  256 + item.setSzmc(roomGroup.getSzmc());
  257 + item.setSzbh(roomGroup.getSzbh());
  258 + }
  259 + Area area = qyMap.get(item.getQyxx());
  260 + if (null != area) {
  261 + item.setQymc(area.getQymc());
  262 + item.setQybh(area.getQybh());
  263 + }
  264 + Team team = bzMap.get(item.getBzxx());
  265 + if (null != team) {
  266 + item.setBzmc(team.getBzmc());
  267 + item.setBzbh(team.getBzbh());
  268 + }
  269 + UcUser ucUser = ygMap.get(item.getYgxx());
  270 + if (null != ucUser) {
  271 + item.setYgName(ucUser.getName());
  272 + }
  273 + StopWorkstation workstation = gwMap.get(item.getGwxx());
  274 + if (null != workstation) {
  275 + item.setGwmc(workstation.getGwmc());
  276 + item.setGwbh(workstation.getGwbh());
  277 + }
  278 + AreaEmployee areaEmployee = qyygMap.get(item.getQyygxx());
  279 + if (null != areaEmployee) {
  280 + item.setQyygxm(areaEmployee.getYgxm());
  281 + item.setQyygh(areaEmployee.getYgh());
  282 + }
  283 + }
  284 + }
  285 +}
... ...
  1 +package com.qgutech.qgyun.apaas.sync.cpsipo.service;
  2 +
  3 +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl;
  4 +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode;
  5 +import com.qgutech.qgyun.apaas.sync.base.BoException;
  6 +import com.qgutech.qgyun.apaas.sync.cpsipo.mapper.SafetyObservationMapper;
  7 +import com.qgutech.qgyun.apaas.sync.cpsipo.model.SafetyObservation;
  8 +import com.qgutech.qgyun.apaas.sync.utils.CorpExample;
  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 tk.mybatis.mapper.entity.Example;
  14 +
  15 +import javax.annotation.Resource;
  16 +import java.util.*;
  17 +import java.util.stream.Collectors;
  18 +
  19 +/**
  20 + * SafetyObservation 服务
  21 + */
  22 +@Service
  23 +public class SafetyObservationService extends BaseServiceImpl<SafetyObservation> {
  24 +
  25 + @Resource
  26 + private SafetyObservationMapper safetyObservationMapper;
  27 +
  28 + @Transactional(readOnly = true)
  29 + public SafetyObservation getById(String id) {
  30 + Assert.hasLength(id, "id is empty!");
  31 +
  32 + Example example = new Example(entityClass);
  33 + CorpExample.criteria(example).andEqualTo(SafetyObservation.ID, id);
  34 + SafetyObservation safetyObservation = safetyObservationMapper.selectOneByExample(example);
  35 + if (null == safetyObservation) {
  36 + throw new BoException(BoErrorCode.DATA_ERROR);
  37 + }
  38 + return safetyObservation;
  39 + }
  40 +
  41 + @Transactional(readOnly = true)
  42 + public List<SafetyObservation> listByIds(Collection<String> ids) {
  43 + Assert.notEmpty(ids, "ids is empty!");
  44 +
  45 + Example example = new Example(entityClass);
  46 + CorpExample.criteria(example).andIn(SafetyObservation.ID, ids);
  47 + List<SafetyObservation> list = safetyObservationMapper.selectByExample(example);
  48 + if (CollectionUtils.isEmpty(list)) {
  49 + return new ArrayList<>(0);
  50 + }
  51 + return list;
  52 + }
  53 +
  54 + @Transactional(readOnly = true)
  55 + public Map<String, SafetyObservation> mapByIds(Collection<String> ids) {
  56 + Assert.notEmpty(ids, "ids is empty!");
  57 +
  58 + List<SafetyObservation> list = listByIds(ids);
  59 + if (CollectionUtils.isEmpty(list)) {
  60 + return new HashMap<>(0);
  61 + }
  62 +
  63 + return list.stream().collect(Collectors.toMap(SafetyObservation::getId, item -> item));
  64 + }
  65 +
  66 + @Transactional(readOnly = true)
  67 + public List<SafetyObservation> listAll() {
  68 +
  69 + Example example = CorpExample.ofCorp(entityClass);
  70 + return safetyObservationMapper.selectByExample(example);
  71 + }
  72 +}
... ...
... ... @@ -31,10 +31,10 @@
31 31 - [6.1 获取所有枚举定义常量数组信息](#61-获取所有枚举定义常量数组信息)
32 32 - [7. 基础信息接口](#7-基础信息接口)
33 33 - [7.1 获取所有启用的线体列表](#71-获取所有启用的线体列表)
34   - - [7.2 获取所有启用的单位(车间)列表](#72-获取所有启用的单位车间列表)
35   - - [7.3 获取所有启用的室组列表](#73-获取所有启用的室组列表)
36   - - [7.4 获取所有启用的区域列表](#74-获取所有启用的区域列表)
37   - - [7.5 获取所有启用的班组列表](#75-获取所有启用的班组列表)
  34 + - [7.2 获取所有启用的单位(车间)列表 ✏️更新](#72-获取所有启用的单位车间列表)
  35 + - [7.3 获取所有启用的室组列表 ✏️更新](#73-获取所有启用的室组列表)
  36 + - [7.4 获取所有启用的区域列表 ✏️更新](#74-获取所有启用的区域列表)
  37 + - [7.5 获取所有启用的班组列表 ✏️更新](#75-获取所有启用的班组列表)
38 38 - [7.6 获取所有启用的班次列表](#76-获取所有启用的班次列表)
39 39 - [8. 停线记录接口](#8-停线记录接口)
40 40 - [8.1 获取所有停线记录列表 🆕新增](#81-获取所有停线记录列表)
... ... @@ -63,6 +63,10 @@
63 63 | ✏️ | [8.3](#83-按工位汇总停线时长按板块拆分) | `GET /stopRecord/summary/workstation/{logistics\|equipment\|quality\|other}` | 接口更新 | 原单一 `/summary/workstation` 按板块拆分为四个接口;去掉 txbkxx 入参改由接口固定板块;汇总结果新增板块信息 bkbm/bkmc(其他板块不返回) |
64 64 | ✏️ | [8.4](#84-查询停线记录明细列表按板块拆分) | `GET /stopRecord/list/detail/{logistics\|equipment\|quality\|other}` | 接口更新 | 原单一 `/list/detail` 按板块拆分为四个接口;去掉 txbkxx 入参改由接口固定板块,其余线体/班次/区域/工位/日期条件不变 |
65 65 | 🆕 | [9.1](#91-按区域查询当前周过程确认班组计划明细列表) | `GET /processConfirmTeamPlan/list/currentWeek` | 新增接口 | 按区域(qyxx,可选)查询当前时间所在周(周一~周日)的过程确认班组计划明细,关联计划走访班组、工位的编号与名称 |
  66 +| ✏️ | [7.2](#72-获取所有启用的单位车间列表) | `GET /workshop/list/enabled` | 接口更新 | 新增可选入参 `ssxt`(所属线体id),按所属线体筛选启用的单位(车间) |
  67 +| ✏️ | [7.3](#73-获取所有启用的室组列表) | `GET /roomGroup/list/enabled` | 接口更新 | 新增可选入参 `ssdw`(所属单位id),按所属单位筛选启用的室组 |
  68 +| ✏️ | [7.4](#74-获取所有启用的区域列表) | `GET /area/list/enabled` | 接口更新 | 新增可选入参 `sssz`(所属室组id),按所属室组筛选启用的区域 |
  69 +| ✏️ | [7.5](#75-获取所有启用的班组列表) | `GET /team/list/enabled` | 接口更新 | 新增可选入参 `ssqy`(所属区域id),按所属区域筛选启用的班组 |
66 70
67 71 > 编号调整说明:因 2.3 新增了「按单位车间查室组」接口,原「2.3 根据年份、季度、室组id查询C类改善记录详情」顺延为 **2.4**(接口路径与内容未变)。
68 72
... ... @@ -2121,10 +2125,13 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2121 2125 | 字段 | 类型 | 说明 |
2122 2126 |------|------|------|
2123 2127 | id | String | 记录ID |
  2128 +| corpCode | String | 企业编码 |
2124 2129 | xtmc | String | 线体名称 |
2125 2130 | xtbh | String | 线体编号 |
2126 2131 | xtfzr | String | 线体负责人 |
2127 2132 | amoigs | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) |
  2133 +| createdAt | String | 创建时间(yyyy-MM-dd HH:mm:ss) |
  2134 +| updatedAt | String | 更新时间(yyyy-MM-dd HH:mm:ss) |
2128 2135
2129 2136 **响应示例:**
2130 2137
... ... @@ -2148,13 +2155,19 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2148 2155 }
2149 2156 ```
2150 2157
2151   -### 7.2 获取所有启用的单位(车间)列表
  2158 +### 7.2 获取所有启用的单位(车间)列表 ✏️更新
  2159 +
  2160 +> ✏️ **接口更新**:新增可选入参 `ssxt`(所属线体id),用于按所属线体筛选启用的单位(车间);为空时返回全部启用记录。
2152 2161
2153 2162 **接口路径:** `GET /workshop/list/enabled`
2154 2163
2155   -**接口说明:** 获取所有启用状态(ieiblp = #2#)的单位(车间)信息列表。
  2164 +**接口说明:** 获取所有启用状态(ieiblp = #2#)的单位(车间)信息列表,可按所属线体筛选。
2156 2165
2157   -**请求参数:** 无
  2166 +**请求参数:**
  2167 +
  2168 +| 参数名 | 类型 | 必传 | 说明 |
  2169 +|--------|------|------|------|
  2170 +| ssxt | String | 否 | 所属线体(XtLine)id,为空则不限定线体 |
2158 2171
2159 2172 **响应数据:** `List<Workshop>`
2160 2173
... ... @@ -2163,6 +2176,7 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2163 2176 | 字段 | 类型 | 说明 |
2164 2177 |------|------|------|
2165 2178 | id | String | 记录ID |
  2179 +| corpCode | String | 企业编码 |
2166 2180 | dwmc | String | 单位名称 |
2167 2181 | dwbh | String | 单位编号 |
2168 2182 | ssxt | String | 所属线体id |
... ... @@ -2170,6 +2184,8 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2170 2184 | sszz | String | 所属组织 |
2171 2185 | ieiblp | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) |
2172 2186 | statusDesc | String | 状态中文描述(非数据库字段) |
  2187 +| createdAt | String | 创建时间(yyyy-MM-dd HH:mm:ss) |
  2188 +| updatedAt | String | 更新时间(yyyy-MM-dd HH:mm:ss) |
2173 2189
2174 2190 **响应示例:**
2175 2191
... ... @@ -2196,13 +2212,19 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2196 2212 }
2197 2213 ```
2198 2214
2199   -### 7.3 获取所有启用的室组列表
  2215 +### 7.3 获取所有启用的室组列表 ✏️更新
  2216 +
  2217 +> ✏️ **接口更新**:新增可选入参 `ssdw`(所属单位id),用于按所属单位筛选启用的室组;为空时返回全部启用记录。
2200 2218
2201 2219 **接口路径:** `GET /roomGroup/list/enabled`
2202 2220
2203   -**接口说明:** 获取所有启用状态(zt = #2#)的室组信息列表。
  2221 +**接口说明:** 获取所有启用状态(zt = #2#)的室组信息列表,可按所属单位筛选。
2204 2222
2205   -**请求参数:** 无
  2223 +**请求参数:**
  2224 +
  2225 +| 参数名 | 类型 | 必传 | 说明 |
  2226 +|--------|------|------|------|
  2227 +| ssdw | String | 否 | 所属单位(Workshop)id,为空则不限定单位 |
2206 2228
2207 2229 **响应数据:** `List<RoomGroup>`
2208 2230
... ... @@ -2211,12 +2233,15 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2211 2233 | 字段 | 类型 | 说明 |
2212 2234 |------|------|------|
2213 2235 | id | String | 记录ID |
  2236 +| corpCode | String | 企业编码 |
2214 2237 | szmc | String | 室组名称 |
2215 2238 | szbh | String | 室组编号 |
2216 2239 | szfzr | String | 室组负责人 |
2217 2240 | ssdw | String | 所属单位(车间)id |
2218 2241 | sszz | String | 所属组织 |
2219 2242 | zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) |
  2243 +| createdAt | String | 创建时间(yyyy-MM-dd HH:mm:ss) |
  2244 +| updatedAt | String | 更新时间(yyyy-MM-dd HH:mm:ss) |
2220 2245
2221 2246 **响应示例:**
2222 2247
... ... @@ -2242,13 +2267,19 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2242 2267 }
2243 2268 ```
2244 2269
2245   -### 7.4 获取所有启用的区域列表
  2270 +### 7.4 获取所有启用的区域列表 ✏️更新
  2271 +
  2272 +> ✏️ **接口更新**:新增可选入参 `sssz`(所属室组id),用于按所属室组筛选启用的区域;为空时返回全部启用记录。
2246 2273
2247 2274 **接口路径:** `GET /area/list/enabled`
2248 2275
2249   -**接口说明:** 获取所有启用状态(zt = #2#)的区域信息列表。
  2276 +**接口说明:** 获取所有启用状态(zt = #2#)的区域信息列表,可按所属室组筛选。
2250 2277
2251   -**请求参数:** 无
  2278 +**请求参数:**
  2279 +
  2280 +| 参数名 | 类型 | 必传 | 说明 |
  2281 +|--------|------|------|------|
  2282 +| sssz | String | 否 | 所属室组(RoomGroup)id,为空则不限定室组 |
2252 2283
2253 2284 **响应数据:** `List<Area>`
2254 2285
... ... @@ -2257,6 +2288,7 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2257 2288 | 字段 | 类型 | 说明 |
2258 2289 |------|------|------|
2259 2290 | id | String | 记录ID |
  2291 +| corpCode | String | 企业编码 |
2260 2292 | qymc | String | 区域名称 |
2261 2293 | qybh | String | 区域编号 |
2262 2294 | qyfzr | String | 区域负责人 |
... ... @@ -2264,6 +2296,8 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2264 2296 | sssz | String | 所属室组id |
2265 2297 | sszz | String | 所属组织 |
2266 2298 | zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) |
  2299 +| createdAt | String | 创建时间(yyyy-MM-dd HH:mm:ss) |
  2300 +| updatedAt | String | 更新时间(yyyy-MM-dd HH:mm:ss) |
2267 2301
2268 2302 **响应示例:**
2269 2303
... ... @@ -2290,13 +2324,19 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2290 2324 }
2291 2325 ```
2292 2326
2293   -### 7.5 获取所有启用的班组列表
  2327 +### 7.5 获取所有启用的班组列表 ✏️更新
  2328 +
  2329 +> ✏️ **接口更新**:新增可选入参 `ssqy`(所属区域id),用于按所属区域筛选启用的班组;为空时返回全部启用记录。
2294 2330
2295 2331 **接口路径:** `GET /team/list/enabled`
2296 2332
2297   -**接口说明:** 获取所有启用状态(zt = #2#)的班组信息列表。
  2333 +**接口说明:** 获取所有启用状态(zt = #2#)的班组信息列表,可按所属区域筛选。
2298 2334
2299   -**请求参数:** 无
  2335 +**请求参数:**
  2336 +
  2337 +| 参数名 | 类型 | 必传 | 说明 |
  2338 +|--------|------|------|------|
  2339 +| ssqy | String | 否 | 所属区域(Area)id,为空则不限定区域 |
2300 2340
2301 2341 **响应数据:** `List<Team>`
2302 2342
... ... @@ -2305,6 +2345,7 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2305 2345 | 字段 | 类型 | 说明 |
2306 2346 |------|------|------|
2307 2347 | id | String | 记录ID |
  2348 +| corpCode | String | 企业编码 |
2308 2349 | bzmc | String | 班组名称 |
2309 2350 | bzbh | String | 班组编号 |
2310 2351 | bzfzr | String | 班组负责人 |
... ... @@ -2314,6 +2355,8 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2314 2355 | bzcy | String | 班组成员 |
2315 2356 | sszz | String | 所属组织 |
2316 2357 | zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) |
  2358 +| createdAt | String | 创建时间(yyyy-MM-dd HH:mm:ss) |
  2359 +| updatedAt | String | 更新时间(yyyy-MM-dd HH:mm:ss) |
2317 2360
2318 2361 **响应示例:**
2319 2362
... ... @@ -2357,10 +2400,13 @@ uat3环境: https://uat3.qgutech.com/fkyycustom
2357 2400 | 字段 | 类型 | 说明 |
2358 2401 |------|------|------|
2359 2402 | id | String | 记录ID |
  2403 +| corpCode | String | 企业编码 |
2360 2404 | bcmc | String | 班次名称 |
2361 2405 | bcbh | String | 班次编号 |
2362 2406 | bclx | String | 班次类型 |
2363 2407 | zt | String | 状态编号(#1#-草稿;#2#-启用;#3#-停用) |
  2408 +| createdAt | String | 创建时间(yyyy-MM-dd HH:mm:ss) |
  2409 +| updatedAt | String | 更新时间(yyyy-MM-dd HH:mm:ss) |
2364 2410
2365 2411 **响应示例:**
2366 2412
... ...