Selaa lähdekoodia

用户画像修改

wangxx 1 kuukausi sitten
vanhempi
commit
e73d1b8ed5

+ 57 - 3
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/vo/EmployeePortraitVO.java

@@ -29,6 +29,8 @@ public class EmployeePortraitVO {
29 29
     private String phonenumber;
30 30
     private String birthday;       // 出生日期,从身份证计算
31 31
     private String major;          // 专业(新增字段)
32
+    private String nativePlace;    // 籍贯(新增字段)
33
+    private String nation;         // 民族(新增字段)
32 34
     private String roleNames;      // 职务(来自 sys_role)
33 35
     private String postNames;      // 岗位(来自 sys_post)
34 36
 
@@ -38,8 +40,16 @@ public class EmployeePortraitVO {
38 40
     @JsonFormat(pattern = "yyyy-MM-dd")
39 41
     private Date securityCheckStartDate;
40 42
 
41
-    private Integer workYears;
42
-    private Integer securityCheckYears;
43
+    @JsonFormat(pattern = "yyyy-MM-dd")
44
+    private Date entryDate;              // 入职时间(新增字段)
45
+
46
+    @JsonFormat(pattern = "yyyy-MM-dd")
47
+    private Date xrayOperatorStarttime;  // X射线操作员开始时间(新增字段)
48
+
49
+    private Integer workYears;           // 工龄
50
+    private Integer securityCheckYears;  // 安检年限
51
+    private Integer xrayOperatorYears;   // 开机年限(新增字段)
52
+    private Integer companyYears;        // 司龄(新增字段)
43 53
     private String securityInspectionPosition;
44 54
 
45 55
     // ── 综合得分 ──────────────────────────────────────────────────────────────
@@ -67,6 +77,9 @@ public class EmployeePortraitVO {
67 77
     // ── 质控情况 ──────────────────────────────────────────────────────────────
68 78
 
69 79
     private Integer qualityControlCount;   // 查获违规品次数
80
+    private Integer qualityControlEventCount; // 监察问题记录次数
81
+    private Integer realtimeInterceptionCount; // 实时质控拦截次数
82
+    private Integer level3QualityControlCount; // 三级质控巡查次数
70 83
 
71 84
     // ── 配分明细(加分+扣分全量) ──────────────────────────────────────────────
72 85
 
@@ -122,6 +135,12 @@ public class EmployeePortraitVO {
122 135
     public String getMajor() { return major; }
123 136
     public void setMajor(String major) { this.major = major; }
124 137
 
138
+    public String getNativePlace() { return nativePlace; }
139
+    public void setNativePlace(String nativePlace) { this.nativePlace = nativePlace; }
140
+
141
+    public String getNation() { return nation; }
142
+    public void setNation(String nation) { this.nation = nation; }
143
+
125 144
     public String getRoleNames() { return roleNames; }
126 145
     public void setRoleNames(String roleNames) { this.roleNames = roleNames; }
127 146
 
@@ -134,12 +153,24 @@ public class EmployeePortraitVO {
134 153
     public Date getSecurityCheckStartDate() { return securityCheckStartDate; }
135 154
     public void setSecurityCheckStartDate(Date securityCheckStartDate) { this.securityCheckStartDate = securityCheckStartDate; }
136 155
 
156
+    public Date getEntryDate() { return entryDate; }
157
+    public void setEntryDate(Date entryDate) { this.entryDate = entryDate; }
158
+
159
+    public Date getXrayOperatorStarttime() { return xrayOperatorStarttime; }
160
+    public void setXrayOperatorStarttime(Date xrayOperatorStarttime) { this.xrayOperatorStarttime = xrayOperatorStarttime; }
161
+
137 162
     public Integer getWorkYears() { return workYears; }
138 163
     public void setWorkYears(Integer workYears) { this.workYears = workYears; }
139 164
 
140 165
     public Integer getSecurityCheckYears() { return securityCheckYears; }
141 166
     public void setSecurityCheckYears(Integer securityCheckYears) { this.securityCheckYears = securityCheckYears; }
142 167
 
168
+    public Integer getXrayOperatorYears() { return xrayOperatorYears; }
169
+    public void setXrayOperatorYears(Integer xrayOperatorYears) { this.xrayOperatorYears = xrayOperatorYears; }
170
+
171
+    public Integer getCompanyYears() { return companyYears; }
172
+    public void setCompanyYears(Integer companyYears) { this.companyYears = companyYears; }
173
+
143 174
     public String getSecurityInspectionPosition() { return securityInspectionPosition; }
144 175
     public void setSecurityInspectionPosition(String securityInspectionPosition) { this.securityInspectionPosition = securityInspectionPosition; }
145 176
 
@@ -167,7 +198,30 @@ public class EmployeePortraitVO {
167 198
     public List<AwardRecord> getAwards() { return awards; }
168 199
     public void setAwards(List<AwardRecord> awards) { this.awards = awards; }
169 200
 
170
-    // ── 内部类 ────────────────────────────────────────────────────────────────
201
+    public Integer getQualityControlEventCount() {
202
+        return qualityControlEventCount;
203
+    }
204
+
205
+    public void setQualityControlEventCount(Integer qualityControlEventCount) {
206
+        this.qualityControlEventCount = qualityControlEventCount;
207
+    }
208
+
209
+    public Integer getRealtimeInterceptionCount() {
210
+        return realtimeInterceptionCount;
211
+    }
212
+
213
+    public void setRealtimeInterceptionCount(Integer realtimeInterceptionCount) {
214
+        this.realtimeInterceptionCount = realtimeInterceptionCount;
215
+    }
216
+
217
+    public Integer getLevel3QualityControlCount() {
218
+        return level3QualityControlCount;
219
+    }
220
+
221
+    public void setLevel3QualityControlCount(Integer level3QualityControlCount) {
222
+        this.level3QualityControlCount = level3QualityControlCount;
223
+    }
224
+// ── 内部类 ────────────────────────────────────────────────────────────────
171 225
 
172 226
     public static class DimScoreItem {
173 227
         private String name;

+ 9 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/mapper/LedgerPatrolInspectionMapper.java

@@ -9,4 +9,13 @@ import com.sundot.airport.ledger.domain.LedgerPatrolInspection;
9 9
  */
10 10
 public interface LedgerPatrolInspectionMapper extends BaseMapper<LedgerPatrolInspection> {
11 11
     List<LedgerPatrolInspection> selectList(LedgerPatrolInspection query);
12
+    
13
+    /**
14
+     * 根据被查人姓名和时间范围统计三级质控巡查次数
15
+     * @param inspectedName 被查人姓名
16
+     * @param beginTime 开始时间
17
+     * @param endTime 结束时间
18
+     * @return 巡查次数
19
+     */
20
+    int countByInspectedNameAndDateRange(String inspectedName, String beginTime, String endTime);
12 21
 }

+ 48 - 3
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/EmployeePortraitServiceImpl.java

@@ -7,6 +7,7 @@ import com.sundot.airport.ledger.domain.ScoreDimension;
7 7
 import com.sundot.airport.ledger.domain.ScoreEvent;
8 8
 import com.sundot.airport.ledger.domain.vo.EmployeePortraitVO;
9 9
 import com.sundot.airport.ledger.mapper.LedgerExamScoreMapper;
10
+import com.sundot.airport.ledger.mapper.LedgerPatrolInspectionMapper;
10 11
 import com.sundot.airport.ledger.mapper.LedgerSeizureStatsMapper;
11 12
 import com.sundot.airport.ledger.mapper.ScoreDimensionMapper;
12 13
 import com.sundot.airport.ledger.mapper.ScoreEventMapper;
@@ -52,6 +53,9 @@ public class EmployeePortraitServiceImpl implements IEmployeePortraitService {
52 53
     @Autowired
53 54
     private LedgerSeizureStatsMapper ledgerSeizureStatsMapper;
54 55
 
56
+    @Autowired
57
+    private LedgerPatrolInspectionMapper ledgerPatrolInspectionMapper;
58
+
55 59
     // ── 搜索员工 ─────────────────────────────────────────────────────────────
56 60
 
57 61
     @Override
@@ -96,12 +100,42 @@ public class EmployeePortraitServiceImpl implements IEmployeePortraitService {
96 100
         fillScoreDetails(vo, personName, beginTime, endTime);
97 101
 
98 102
         // 6. 质控情况
99
-        int qcCount = ledgerSeizureStatsMapper.countByInspectorAndDateRange(personName, beginTime, endTime);
100
-        vo.setQualityControlCount(qcCount);
103
+        fillQualityControl(vo, personName, beginTime, endTime);
104
+
105
+
101 106
 
102 107
         return vo;
103 108
     }
104 109
 
110
+    /**
111
+     * 质控情况
112
+     * @param vo 输出对象
113
+     * @param personName 员工姓名
114
+     * @param beginTime 查询开始时间
115
+     * @param endTime 查询结束时间
116
+     */
117
+    private void fillQualityControl(EmployeePortraitVO vo, String personName, String beginTime, String endTime) {
118
+        ScoreEvent eq = new ScoreEvent();
119
+        eq.setPersonName(personName);
120
+        if (beginTime != null && !beginTime.isEmpty()) eq.getParams().put("beginTime", beginTime);
121
+        if (endTime   != null && !endTime.isEmpty())   eq.getParams().put("endTime",   endTime);
122
+        // 查获违规品次数
123
+        int qcCount = ledgerSeizureStatsMapper.countByInspectorAndDateRange(personName, beginTime, endTime);
124
+        vo.setQualityControlCount(qcCount);
125
+        // 监察问题记录次数
126
+        eq.setDimensionId(1L);
127
+        eq.setLevel2Name("员工规范化操作");
128
+        List<ScoreEvent> events = scoreEventMapper.selectList(eq);
129
+        vo.setQualityControlEventCount(events.size());
130
+        //实时质控拦截次数
131
+        eq.setLevel2Name("后台实时质控拦截");
132
+        List<ScoreEvent>  qcEvents = scoreEventMapper.selectList(eq);
133
+        vo.setRealtimeInterceptionCount(qcEvents.size());
134
+        //三级质控巡查次数
135
+        int patrolCount = ledgerPatrolInspectionMapper.countByInspectedNameAndDateRange(personName, beginTime, endTime);
136
+        vo.setLevel3QualityControlCount(patrolCount);
137
+    }
138
+
105 139
     // ── 用户基本信息 ─────────────────────────────────────────────────────────
106 140
 
107 141
     private void fillUserInfo(EmployeePortraitVO vo, String personName) {
@@ -121,15 +155,20 @@ public class EmployeePortraitServiceImpl implements IEmployeePortraitService {
121 155
         vo.setSex(user.getSex());
122 156
         vo.setSexText("0".equals(user.getSex()) ? "男" : "1".equals(user.getSex()) ? "女" : "");
123 157
         vo.setSchooling(user.getSchooling());
158
+        vo.setMajor(user.getProfessional());
159
+        vo.setNativePlace(user.getNativePlace());
160
+        vo.setNation(user.getNation());
124 161
         vo.setQualificationLevelText(decodeQualLevel(user.getQualificationLevel()));
125 162
         vo.setPoliticalStatusText(decodePolitical(user.getPoliticalStatus()));
126 163
         vo.setCharacterCharacteristics(decodeChar(user.getCharacterCharacteristics()));
127 164
         vo.setWorkingStyle(decodeWorkStyle(user.getWorkingStyle()));
128 165
         vo.setStartWorkingDate(user.getStartWorkingDate());
129 166
         vo.setSecurityCheckStartDate(user.getSecurityCheckStartDate());
167
+        vo.setEntryDate(user.getEntryDate());
168
+        vo.setXrayOperatorStarttime(user.getXrayOperatorStarttime());
130 169
         vo.setSecurityInspectionPosition(user.getSecurityInspectionPosition());
131 170
 
132
-        // 司龄、开机年限
171
+        // 司龄、工龄、开机年限
133 172
         long nowMs = System.currentTimeMillis();
134 173
         if (user.getStartWorkingDate() != null) {
135 174
             vo.setWorkYears((int) ((nowMs - user.getStartWorkingDate().getTime()) / (365L * 24 * 3600 * 1000)));
@@ -137,6 +176,12 @@ public class EmployeePortraitServiceImpl implements IEmployeePortraitService {
137 176
         if (user.getSecurityCheckStartDate() != null) {
138 177
             vo.setSecurityCheckYears((int) ((nowMs - user.getSecurityCheckStartDate().getTime()) / (365L * 24 * 3600 * 1000)));
139 178
         }
179
+        if (user.getEntryDate() != null) {
180
+            vo.setCompanyYears((int) ((nowMs - user.getEntryDate().getTime()) / (365L * 24 * 3600 * 1000)));
181
+        }
182
+        if (user.getXrayOperatorStarttime() != null) {
183
+            vo.setXrayOperatorYears((int) ((nowMs - user.getXrayOperatorStarttime().getTime()) / (365L * 24 * 3600 * 1000)));
184
+        }
140 185
 
141 186
         // 出生日期(从18位身份证第7~14位提取)
142 187
         String card = user.getCardNumber();

+ 14 - 0
airport-ledger/src/main/resources/mapper/ledger/LedgerPatrolInspectionMapper.xml

@@ -37,6 +37,7 @@
37 37
 
38 38
     <select id="selectList" parameterType="com.sundot.airport.ledger.domain.LedgerPatrolInspection" resultMap="BaseResultMap">
39 39
         <include refid="selectVo"/>
40
+        WHERE del_flag = '0'
40 41
         <if test="deptName != null and deptName != ''">AND dept_name LIKE CONCAT('%', #{deptName}, '%')</if>
41 42
         <if test="teamName != null and teamName != ''">AND team_name LIKE CONCAT('%', #{teamName}, '%')</if>
42 43
         <if test="inspectorName != null and inspectorName != ''">AND inspector_name LIKE CONCAT('%', #{inspectorName}, '%')</if>
@@ -49,4 +50,17 @@
49 50
         ORDER BY record_date DESC, id DESC
50 51
     </select>
51 52
 
53
+    <select id="countByInspectedNameAndDateRange" resultType="int">
54
+        SELECT COUNT(*)
55
+        FROM ledger_patrol_inspection
56
+        WHERE del_flag = '0'
57
+          AND inspected_name = #{inspectedName}
58
+          <if test="beginTime != null and beginTime != ''">
59
+              AND record_date &gt;= STR_TO_DATE(#{beginTime}, '%Y-%m-%d')
60
+          </if>
61
+          <if test="endTime != null and endTime != ''">
62
+              AND record_date &lt;= STR_TO_DATE(#{endTime}, '%Y-%m-%d')
63
+          </if>
64
+    </select>
65
+
52 66
 </mapper>

+ 1 - 0
airport-ledger/src/main/resources/mapper/ledger/ScoreEventMapper.xml

@@ -50,6 +50,7 @@
50 50
         <if test="deptName != null and deptName != ''">AND dept_name LIKE CONCAT('%', #{deptName}, '%')</if>
51 51
         <if test="teamName != null and teamName != ''">AND team_name LIKE CONCAT('%', #{teamName}, '%')</if>
52 52
         <if test="sourceType != null and sourceType != ''">AND source_type = #{sourceType}</if>
53
+        <if test="level2Name != null and level2Name != ''">AND level2_name LIKE CONCAT('%', #{level2Name}, '%')</if>
53 54
         <if test="params != null and params.beginTime != null and params.beginTime != ''">
54 55
             AND event_time &gt;= #{params.beginTime}
55 56
         </if>