金筑工实名制同步数据

This commit is contained in:
guo 2023-10-08 09:23:12 +08:00
parent ee0f0377ce
commit d78537bd28
3 changed files with 39 additions and 1 deletions

View File

@ -72,6 +72,7 @@ public class QualityInspectionRecordController {
@ApiImplicitParam(name = "operatorId", value = "操作人整改、复查、核验changeId、reviewId、verifyManId", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "inspectStartTime", value = "检查开始时间", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "inspectEndTime", value = "检查结束时间", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "search", value = "搜索(检查部位、问题分类、问题描述、补充说明、整改要求)", paramType = "query", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
})

View File

@ -126,6 +126,14 @@
<if test="param.recordStatus == '7'.toString()">
and a.status = 4
</if>
<if test="param.search != null and param.search != ''">
and (
a.region_name like concat('%',#{param.search},'%')
or a.danger_item_content like concat('%',#{param.search},'%')
or a.danger_desc like concat('%',#{param.search},'%')
or a.remark like concat('%',#{param.search},'%')
)
</if>
order by a.inspect_time desc
</select>
<select id="selectQualityInspectionRecordPageTotal"
@ -204,6 +212,14 @@
<if test="regionId != null and regionId != ''">
and a.region_id = #{regionId}
</if>
<if test="search != null and search != ''">
and (
a.region_name like concat('%',#{search},'%')
or a.danger_item_content like concat('%',#{search},'%')
or a.danger_desc like concat('%',#{search},'%')
or a.remark like concat('%',#{search},'%')
)
</if>
) tp
</select>
<select id="selectQualityInspectionRecordCountByDay" resultType="java.util.Map" parameterType="java.util.Map">

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.task;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
@ -30,6 +31,7 @@ import net.javacrumbs.shedlock.core.SchedulerLock;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
@ -38,6 +40,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.crypto.Mac;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
@ -55,6 +58,8 @@ import static com.zhgd.xmgl.util.EncryptUtils.decryptAes;
@RequestMapping("/xmgl/jzg")
@RestController
public class JzgTask {
@Value("${basePath}")
private String path;
@Autowired
private ProjectEnterpriseMapper projectEnterpriseMapper;
@Autowired
@ -98,7 +103,7 @@ public class JzgTask {
* 实名制同步
*/
@SchedulerLock(name = "realNameSystem", lockAtMostFor = 1000 * 60 * 60, lockAtLeastFor = 1000 * 60 * 5)
@Scheduled(cron = "0 0 0/12 * * ?")
@Scheduled(cron = "0 0 0/1 * * ?")
@RequestMapping("/sync")
public void realNameSystem() {
List<Project> projects = projectMapper.selectList(null);
@ -270,15 +275,31 @@ public class JzgTask {
wi.setSex(Integer.valueOf(jzg.getGender()));
wi.setNation(getNation(jzg.getNation()));
if (StrUtil.isNotBlank(jzg.getIssueCardPicUrl())) {
String file = owi.getFieldAcquisitionUrl();
if (StrUtil.isNotBlank(file)) {
FileUtil.del(new File(path, file));
}
wi.setFieldAcquisitionUrl(uploadFileService.uploadUrlResourceRtName(jzg.getIssueCardPicUrl()));
}
if (StrUtil.isNotBlank(jzg.getHeadImageUrl())) {
String file = owi.getIdCardBigPhotoUrl();
if (StrUtil.isNotBlank(file)) {
FileUtil.del(new File(path, file));
}
wi.setIdCardBigPhotoUrl(uploadFileService.uploadUrlResourceRtName(jzg.getHeadImageUrl()));
}
if (StrUtil.isNotBlank(jzg.getPositiveIdCardImageUrl())) {
String file = owi.getIdCardUpPhotoUrl();
if (StrUtil.isNotBlank(file)) {
FileUtil.del(new File(path, file));
}
wi.setIdCardUpPhotoUrl(uploadFileService.uploadUrlResourceRtName(jzg.getPositiveIdCardImageUrl()));
}
if (StrUtil.isNotBlank(jzg.getNegativeIdCardImageUrl())) {
String file = owi.getIdCardDownPhotoUrl();
if (StrUtil.isNotBlank(file)) {
FileUtil.del(new File(path, file));
}
wi.setIdCardDownPhotoUrl(uploadFileService.uploadUrlResourceRtName(jzg.getNegativeIdCardImageUrl()));
}
wi.setPhoneNumber(jzg.getCellPhone());