update code
parent
8bd551dce8
commit
18285da559
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,54 @@
|
|||
package com.yanzhu.jh.base.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
public class SysNative extends BaseEntity {
|
||||
|
||||
private Long id;
|
||||
private String address;
|
||||
private String provinces;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getProvinces() {
|
||||
return provinces;
|
||||
}
|
||||
|
||||
public void setProvinces(String provinces) {
|
||||
this.provinces = provinces;
|
||||
}
|
||||
|
||||
public String getCitiy() {
|
||||
return citiy;
|
||||
}
|
||||
|
||||
public void setCitiy(String citiy) {
|
||||
this.citiy = citiy;
|
||||
}
|
||||
|
||||
public String getAreas() {
|
||||
return areas;
|
||||
}
|
||||
|
||||
public void setAreas(String areas) {
|
||||
this.areas = areas;
|
||||
}
|
||||
|
||||
private String citiy;
|
||||
private String areas;
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.yanzhu.jh.base.mapper;
|
||||
|
||||
import com.yanzhu.jh.base.domain.SysNative;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysNativeMapper {
|
||||
|
||||
public List<SysNative> selectSysNativeListById(Long id);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.yanzhu.jh.base.service;
|
||||
|
||||
import com.yanzhu.jh.base.domain.SysNative;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISysNativeService {
|
||||
public List<SysNative> selectSysNativeListById(Long id);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.yanzhu.jh.base.service.impl;
|
||||
|
||||
import com.yanzhu.jh.base.domain.SysNative;
|
||||
import com.yanzhu.jh.base.mapper.SysNativeMapper;
|
||||
import com.yanzhu.jh.base.service.ISysNativeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class SysNativeServiceImpl implements ISysNativeService {
|
||||
|
||||
@Autowired
|
||||
SysNativeMapper sysNativeMapper;
|
||||
@Override
|
||||
public List<SysNative> selectSysNativeListById(Long id) {
|
||||
return sysNativeMapper.selectSysNativeListById(id);
|
||||
}
|
||||
}
|
|
@ -162,6 +162,11 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
|
|||
SurProjectAttendanceUser old=list.get(0);
|
||||
if(user.getVendorsCode().equals("jgw")){
|
||||
user.setCompanyId(old.getCompanyId());
|
||||
String oldNav=old.getNativePlace();
|
||||
String newNav=user.getNativePlace();
|
||||
if(oldNav==null || !oldNav.equals(newNav)){
|
||||
old.setNativePlace(newNav);
|
||||
}
|
||||
}
|
||||
user.setId(old.getId());
|
||||
updateSurProjectAttendanceUser(user);
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.yanzhu.jh.project.task;
|
|||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
|
@ -11,12 +11,11 @@ import com.alibaba.fastjson2.JSONArray;
|
|||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.sign.Md5Utils;
|
||||
import com.ruoyi.common.utils.uuid.UUID;
|
||||
import com.yanzhu.jh.base.domain.SysNative;
|
||||
import com.yanzhu.jh.base.service.ISysNativeService;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceGroup;
|
||||
|
@ -30,6 +29,7 @@ import org.apache.logging.log4j.util.Strings;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -49,6 +49,36 @@ public class AttendanceJgwTask {
|
|||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ISysNativeService sysNativeService;
|
||||
|
||||
private String getNative(long id){
|
||||
String ckey="attendance_jgw_native_"+id;
|
||||
Object obj=redisCache.getCacheObject(ckey);
|
||||
String tmp="";
|
||||
if(obj!=null){
|
||||
tmp=obj.toString();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
List<SysNative> list=sysNativeService.selectSysNativeListById(id);
|
||||
if(list.size()==0){
|
||||
id=id/100*100;
|
||||
list=sysNativeService.selectSysNativeListById(id);
|
||||
if(list.size()==0){
|
||||
id=id/10000*10000;
|
||||
list=sysNativeService.selectSysNativeListById(id);
|
||||
}
|
||||
}
|
||||
if(list.size()==0){
|
||||
tmp="";
|
||||
}else{
|
||||
tmp= list.get(0).getAddress();
|
||||
}
|
||||
redisCache.setCacheObject(ckey, tmp, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.DAYS);
|
||||
return tmp;
|
||||
}
|
||||
private String getWorkTypeName(String appid,String token,String type,String key){
|
||||
String ckey="attendance_jgw_work_type_"+type;
|
||||
Object obj=redisCache.getCacheObject(ckey);
|
||||
|
@ -56,7 +86,7 @@ public class AttendanceJgwTask {
|
|||
if(obj==null){
|
||||
map=getJobTypeData(appid,token,type);
|
||||
if(map!=null){
|
||||
redisCache.setCacheObject(key, ckey, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.DAYS);
|
||||
redisCache.setCacheObject(ckey, map, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.DAYS);
|
||||
}else{
|
||||
return "未知";
|
||||
}
|
||||
|
@ -540,6 +570,12 @@ public class AttendanceJgwTask {
|
|||
int cnt=0;
|
||||
for(int i=0;i<arr.size();i++){
|
||||
JSONObject json=arr.getJSONObject(i);
|
||||
String idNumber=json.getString("idNumber");
|
||||
if(StrUtil.isEmpty(idNumber)){
|
||||
String a="xx";
|
||||
}else{
|
||||
|
||||
}
|
||||
String workerStatus= json.getString("workerStatus");
|
||||
if("02".equals(workerStatus)){
|
||||
cnt++;
|
||||
|
@ -733,6 +769,18 @@ public class AttendanceJgwTask {
|
|||
user.setVendorsCode(it.getVendorsCode());
|
||||
user.setCfgid(it.getId());
|
||||
user.setAppId(appId);
|
||||
String idNumber=json.getString("idNumber");//身份证
|
||||
if(StrUtil.isNotEmpty(idNumber) && idNumber.length()>6){
|
||||
try {
|
||||
long idStr = Long.parseLong(idNumber.substring(0, 6));
|
||||
String natstr=getNative(idStr);
|
||||
if(StrUtil.isNotEmpty(natstr)){
|
||||
user.setNativePlace(natstr);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
|
||||
}
|
||||
}
|
||||
attendanceUserService.add(user);
|
||||
}
|
||||
doSyncWorker(jo,endId,it);
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.base.mapper.SysNativeMapper">
|
||||
|
||||
<resultMap type="SysNative" id="SysNativeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="address" column="address" />
|
||||
<result property="provinces" column="provinces" />
|
||||
<result property="citiy" column="citiy" />
|
||||
<result property="areas" column="areas" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectSysNativeListById" parameterType="Long" resultMap="SysNativeResult">
|
||||
SELECT * FROM sys_native WHERE id=#{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue