Commit 177dff5274c429a634434d36a2c0a3b0b0b3cc5d

Authored by guzijian
1 parent 5d7106c9

fix: 修改导出记录

Bsth-admin/src/main/java/com/ruoyi/driver/domain/Driver.java
1 1 package com.ruoyi.driver.domain;
2 2  
  3 +import com.alibaba.excel.annotation.ExcelProperty;
3 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  5 +import com.ruoyi.pojo.converter.FaceSignInConverter;
4 6 import io.swagger.annotations.ApiModel;
5 7 import io.swagger.annotations.ApiModelProperty;
6 8 import lombok.Data;
... ... @@ -30,94 +32,94 @@ public class Driver extends BaseEntity implements Serializable {
30 32 /**
31 33 * 工号
32 34 */
33   - @Excel(name = "工号")
  35 + @ExcelProperty(value = "工号")
34 36 private String jobCode;
35 37  
36 38 /**
37 39 * 公司编码
38 40 */
39   - @Excel(name = "公司编码")
  41 +// @ExcelProperty(value = "公司编码")
40 42 private String companyCode;
41 43  
42 44 /**
43 45 * 分公司编码
44 46 */
45   - @Excel(name = "分公司编码")
  47 +// @ExcelProperty(value = "分公司编码")
46 48 private String brancheCompanyCode;
47 49  
48 50 /**
49 51 * 姓名
50 52 */
51   - @Excel(name = "姓名")
  53 + @ExcelProperty(value = "姓名")
52 54 private String personnelName;
53 55  
54 56 /**
55 57 * 运营服务证书号
56 58 */
57   - @Excel(name = "运营服务证书号")
  59 +// @ExcelProperty(value = "运营服务证书号")
58 60 private String papersCode;
59 61  
60 62 /**
61 63 * 一卡通工作卡号
62 64 */
63   - @Excel(name = "一卡通工作卡号")
  65 +// @ExcelProperty(value = "一卡通工作卡号")
64 66 private String icCardCode;
65 67  
66 68 /**
67 69 * 性别
68 70 */
69   - @Excel(name = "性别")
  71 + @ExcelProperty(value = "性别")
70 72 private String personnelType;
71 73  
72 74 /**
73 75 * 所属岗位/工种
74 76 */
75   - @Excel(name = "所属岗位/工种")
  77 + @ExcelProperty(value = "所属岗位/工种")
76 78 private String posts;
77 79  
78 80 /**
79 81 * 身份证
80 82 */
81   - @Excel(name = "身份证")
  83 +// @ExcelProperty(value = "身份证")
82 84 private String card;
83 85  
84 86 /**
85 87 * 联系电话
86 88 */
87   - @Excel(name = "联系电话")
  89 +// @ExcelProperty(value = "联系电话")
88 90 @JsonIgnoreProperties(ignoreUnknown = true)
89 91 private String telphone;
90 92  
91 93 /**
92 94 * RFID 人卡IC号
93 95 */
94   - @Excel(name = "RFID 人卡IC号")
  96 +// @ExcelProperty(value = "RFID 人卡IC号")
95 97 private String icRfid;
96 98  
97 99 /**
98 100 * RFID 人卡ID号(10进制)
99 101 */
100   - @Excel(name = "RFID 人卡ID号", readConverterExp = "1=0进制")
  102 +// @ExcelProperty(value = "RFID 人卡ID号", readConverterExp = "1=0进制")
101 103 private String idRfid;
102 104 /**
103 105 * RFID 标签号
104 106 */
105   - @Excel(name = "RFID 标签号")
  107 +// @ExcelProperty(value = "RFID 标签号")
106 108 private String tagRfid;
107 109 /**
108 110 * 线路名称
109 111 */
110   - @Excel(name = "线路名称")
  112 +// @ExcelProperty(value = "线路名称")
111 113 private String lineName;
112 114 /**
113 115 * 线路编码
114 116 */
115   - @Excel(name = "线路编码")
  117 +// @ExcelProperty(value = "线路编码")
116 118 private String lineCode;
117 119 /**
118 120 * 是否人脸注册
119 121 */
120   - @Excel(name = "是否人脸注册")
  122 + @ExcelProperty(value = "是否人脸注册",converter = FaceSignInConverter.class)
121 123 @ApiModelProperty("是否人脸注册 0 注册 1 未注册 2 注册过期更新")
122 124 private Integer faceSignIn;
123 125 /**
... ... @@ -133,7 +135,7 @@ public class Driver extends BaseEntity implements Serializable {
133 135 private String signInEquipment;
134 136  
135 137 @ApiModelProperty("车队名称")
136   - @Excel( name ="车队名称")
  138 + @ExcelProperty( value ="车队名称")
137 139 private String fleetName;
138 140  
139 141 }
... ...
Bsth-admin/src/main/java/com/ruoyi/job/DriverJob.java
... ... @@ -48,6 +48,8 @@ import java.util.stream.Collectors;
48 48  
49 49 import static com.ruoyi.common.ConstDriverProperties.*;
50 50 import static com.ruoyi.common.ConstEquipmentProperties.*;
  51 +import static com.ruoyi.common.ConstSignInConstSignInProperties.SIGN_FACE_ACTIVE;
  52 +import static com.ruoyi.common.ConstSignInConstSignInProperties.SIGN_FACE_TIMEOUT;
51 53 import static com.ruoyi.common.redispre.GlobalRedisPreName.*;
52 54  
53 55 /**
... ... @@ -152,17 +154,8 @@ public class DriverJob implements InitializingBean {
152 154 // 多线程插入数据
153 155 log.info("开始插入");
154 156 THREAD_JOB_SERVICE.asyncUploadDriverWithUpdateImageUrl(drivers);
155   -// String downloadImage = getDownloadImage(url, accessToken, "");
156   -
157 157 }
158 158  
159   -// public static void main(String[] args) {
160   -// String str = "[{\"previewUrl\":\"/ossFileHandle?appType=APP_HV8J7X8PFRXLJJW8JTZK&fileName=APP_HV8J7X8PFRXLJJW8JTZK_bWFuYWdlcjgxNF9QRTg2Nk1EMThYTUNaNkxVN002QTQ3N0hQV0E2MlNYMTMwQ0tMQTQ$.png&instId=&type=open&process=image/resize,m_fill,w_200,h_200,limit_0/quality,q_80\",\"size\":621992,\"name\":\"0332d25e3b9e80bca3d90daf0d5857d.png\",\"downloadUrl\":\"/ossFileHandle?appType=APP_HV8J7X8PFRXLJJW8JTZK&fileName=APP_HV8J7X8PFRXLJJW8JTZK_bWFuYWdlcjgxNF9QRTg2Nk1EMThYTUNaNkxVN002QTQ3N0hQV0E2MlNYMTMwQ0tMQTQ$.png&instId=&type=download\",\"fileUuid\":\"APP_HV8J7X8PFRXLJJW8JTZK_bWFuYWdlcjgxNF9QRTg2Nk1EMThYTUNaNkxVN002QTQ3N0hQV0E2MlNYMTMwQ0tMQTQ$.png\",\"url\":\"/ossFileHandle?appType=APP_HV8J7X8PFRXLJJW8JTZK&fileName=APP_HV8J7X8PFRXLJJW8JTZK_bWFuYWdlcjgxNF9QRTg2Nk1EMThYTUNaNkxVN002QTQ3N0hQV0E2MlNYMTMwQ0tMQTQ$.png&instId=&type=download\"}]";
161   -//// List<List> lists = JSONArray.parseArray(str, List.class);
162   -// List<ImageField_lk9mk228> lists = JSONArray.parseArray(str, ImageField_lk9mk228.class);
163   -// System.out.println(lists);
164   -// }
165   -
166 159 public static String getDownloadImageUrl(String accessToken, String preViewUrl) {
167 160 accessToken = REDIS_CACHE.getCacheObject(REDIS_PERSONNEL_TOKEN);
168 161 String url = "https://api.dingtalk.com/v1.0/yida/apps/temporaryUrls/APP_HV8J7X8PFRXLJJW8JTZK";
... ... @@ -197,6 +190,7 @@ public class DriverJob implements InitializingBean {
197 190 }
198 191  
199 192 // 弃用 无用方法
  193 + @Deprecated
200 194 public void clearExceptionYesterdayRecord() {
201 195 // 获取当前日期时间
202 196 Calendar calendar = Calendar.getInstance();
... ... @@ -398,8 +392,6 @@ public class DriverJob implements InitializingBean {
398 392  
399 393  
400 394 public static void handleDriverList() throws Exception {
401   -// Map<String, String> configMap = getStringStringMap(timestamp);
402   -// String sign = getSHA1(configMap);
403 395 Date date = new Date();
404 396 List<TJkEmployeeinfo> vo = getPersonInfo();
405 397 List<Driver> drivers = getDrivers(date, vo);
... ... @@ -410,14 +402,6 @@ public class DriverJob implements InitializingBean {
410 402 for (List<Driver> driverList : splitList) {
411 403 saveDrivers(driverList);
412 404 }
413   -// for (int i = 1; i <= countPage; ) {
414   -// if (++i <= countPage) {
415   -//// vo = getPersonInfo(accessToken, 100, i);
416   -//// drivers = getDrivers(date, vo);
417   -//// updateDrivers(drivers);
418   -// saveDrivers(drivers, accessToken);
419   -// }
420   -// }
421 405 }
422 406  
423 407 private static void handleNotEmptyJob(List<String> jobList) {
... ... @@ -441,6 +425,7 @@ public class DriverJob implements InitializingBean {
441 425 driver.setPosts(item.getPositname());
442 426 driver.setUpdateTime(date);
443 427 driver.setCard(item.getStatus());
  428 + driver.setFaceSignIn(SIGN_FACE_ACTIVE);
444 429 return driver;
445 430 }).collect(Collectors.toList());
446 431 return drivers;
... ...
Bsth-admin/src/main/java/com/ruoyi/pojo/converter/FaceSignInConverter.java 0 → 100644
  1 +package com.ruoyi.pojo.converter;
  2 +
  3 +import com.alibaba.excel.converters.Converter;
  4 +import com.alibaba.excel.enums.CellDataTypeEnum;
  5 +import com.alibaba.excel.metadata.CellData;
  6 +import com.alibaba.excel.metadata.GlobalConfiguration;
  7 +import com.alibaba.excel.metadata.property.ExcelContentProperty;
  8 +
  9 +import static com.ruoyi.common.ConstSignInConstSignInProperties.*;
  10 +import static com.ruoyi.common.ConstSignInConstSignInProperties.SIGN_IN_FAIL_STRING;
  11 +
  12 +public class FaceSignInConverter implements Converter<Integer> {
  13 + @Override
  14 + public Class supportJavaTypeKey() {
  15 + return Integer.class;
  16 + }
  17 +
  18 + @Override
  19 + public CellDataTypeEnum supportExcelTypeKey() {
  20 + return CellDataTypeEnum.STRING;
  21 + }
  22 +
  23 + @Override
  24 + public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
  25 + return null;
  26 + }
  27 +
  28 + @Override
  29 + public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
  30 + String str = "";
  31 + if (SIGN_FACE_SUCCESS.equals(value)){
  32 + str = "已完成人脸注册";
  33 + }else {
  34 + str = "未完成人脸注册";
  35 + }
  36 + return new CellData(str);
  37 + }
  38 +}
... ...