Commit 2ed4377063e89992074c40d6337ffcdc16c68ae5
1 parent
4183c71e
feat: 修改金高导入规则
Showing
11 changed files
with
344 additions
and
10 deletions
Bsth-admin/src/main/java/com/ruoyi/domain/TJkEmployeeinfo.java
0 → 100644
| 1 | +package com.ruoyi.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import java.io.Serializable; | |
| 8 | +import java.util.Date; | |
| 9 | +import lombok.Data; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 金蝶员工表 | |
| 13 | + * @TableName t_jk_employeeinfo | |
| 14 | + */ | |
| 15 | +@TableName(value ="t_jk_employeeinfo") | |
| 16 | +@Data | |
| 17 | +public class TJkEmployeeinfo implements Serializable { | |
| 18 | + /** | |
| 19 | + * 主键 | |
| 20 | + */ | |
| 21 | + private String emId; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 公司 | |
| 25 | + */ | |
| 26 | + private String companyname; | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 部门 | |
| 30 | + */ | |
| 31 | + private String departmentname; | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 职位名称 | |
| 35 | + */ | |
| 36 | + private String positname; | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 姓名 | |
| 40 | + */ | |
| 41 | + private String employeename; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 年龄 | |
| 45 | + */ | |
| 46 | + private Integer age; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 员工状态 | |
| 50 | + */ | |
| 51 | + private String status; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 所属组织单元全称 | |
| 55 | + */ | |
| 56 | + private String unitfullname; | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 职员代码,员工号 | |
| 60 | + */ | |
| 61 | + private String code; | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 入职类型 | |
| 65 | + */ | |
| 66 | + private String inposittype; | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 身份证号 | |
| 70 | + */ | |
| 71 | + private String idcardid; | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 性别 | |
| 75 | + */ | |
| 76 | + private String sextype; | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * 民族 | |
| 80 | + */ | |
| 81 | + private String nationname; | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 籍贯 | |
| 85 | + */ | |
| 86 | + private String nativeplace; | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 出生日期 | |
| 90 | + */ | |
| 91 | + private Date birthday; | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * 政治面貌 | |
| 95 | + */ | |
| 96 | + private String politicsstatus; | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 婚姻状况 | |
| 100 | + */ | |
| 101 | + private String marridstatus; | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 参加工作时间 | |
| 105 | + */ | |
| 106 | + private Date startwordtime; | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 联系电话 | |
| 110 | + */ | |
| 111 | + private String telphone; | |
| 112 | + | |
| 113 | + /** | |
| 114 | + * 手机号码 | |
| 115 | + */ | |
| 116 | + private String mobile; | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * 工作证号 | |
| 120 | + */ | |
| 121 | + @TableField("hrms_userfield_3") | |
| 122 | + private String hrmsUserfield3; | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * 户口性质 | |
| 126 | + */ | |
| 127 | + @TableField("hrms_userfield_47") | |
| 128 | + private String hrmsUserfield47; | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * l劳务派遣单位 | |
| 132 | + */ | |
| 133 | + @TableField("hrms_userfield_40") | |
| 134 | + private String hrmsUserfield40; | |
| 135 | + | |
| 136 | + /** | |
| 137 | + * 所属分公司 | |
| 138 | + */ | |
| 139 | + @TableField("hrms_userfield_45") | |
| 140 | + private String hrmsUserfield45; | |
| 141 | + | |
| 142 | + /** | |
| 143 | + * 最高学历 | |
| 144 | + */ | |
| 145 | + @TableField("hrms_userfield_41") | |
| 146 | + private String hrmsUserfield41; | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * 细分岗位 | |
| 150 | + */ | |
| 151 | + private String fname; | |
| 152 | + | |
| 153 | + /** | |
| 154 | + * 加入本部门日期 | |
| 155 | + */ | |
| 156 | + private Date enterdeptdate; | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * 加入集团日期 | |
| 160 | + */ | |
| 161 | + private Date entergroupdate; | |
| 162 | + | |
| 163 | + /** | |
| 164 | + * 担任本职位日期 | |
| 165 | + */ | |
| 166 | + private Date inpositiondate; | |
| 167 | + | |
| 168 | + /** | |
| 169 | + * 员工类别 | |
| 170 | + */ | |
| 171 | + private String emptypecls; | |
| 172 | + | |
| 173 | + /** | |
| 174 | + * 入司日期 | |
| 175 | + */ | |
| 176 | + private Date enterdate; | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * 合同到期日 | |
| 180 | + */ | |
| 181 | + private Date contractdate; | |
| 182 | + | |
| 183 | + @TableField(exist = false) | |
| 184 | + private static final long serialVersionUID = 1L; | |
| 185 | +} | |
| 0 | 186 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/driver/controller/DriverController.java
| ... | ... | @@ -130,6 +130,13 @@ public class DriverController extends BaseController { |
| 130 | 130 | return Result.OK(); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | + @GetMapping("/import/driver") | |
| 134 | + @ApiOperation("导入基础数据") | |
| 135 | + public Result<?> importDriver(){ | |
| 136 | + driverService.importDriver(); | |
| 137 | + return Result.OK(); | |
| 138 | + } | |
| 139 | + | |
| 133 | 140 | |
| 134 | 141 | /** |
| 135 | 142 | * 修改驾驶员信息 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/driver/mapper/DriverMapper.java
Bsth-admin/src/main/java/com/ruoyi/driver/service/IDriverService.java
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| ... | ... | @@ -24,6 +24,7 @@ import com.ruoyi.common.utils.DateUtils; |
| 24 | 24 | import com.ruoyi.common.utils.file.FileUploadUtils; |
| 25 | 25 | import com.ruoyi.common.utils.file.FileUtils; |
| 26 | 26 | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| 27 | +import com.ruoyi.domain.TJkEmployeeinfo; | |
| 27 | 28 | import com.ruoyi.equipment.mapper.EquipmentMapper; |
| 28 | 29 | import com.ruoyi.framework.config.ServerConfig; |
| 29 | 30 | import com.ruoyi.job.DriverJob; |
| ... | ... | @@ -36,6 +37,7 @@ import com.ruoyi.pojo.request.FaceUpdateReqVo; |
| 36 | 37 | import com.ruoyi.pojo.response.DriverResponseVo; |
| 37 | 38 | import com.ruoyi.pojo.response.ResponseSchedulingDto; |
| 38 | 39 | import com.ruoyi.service.SchedulingService; |
| 40 | +import com.ruoyi.service.TJkEmployeeinfoService; | |
| 39 | 41 | import com.ruoyi.service.ThreadJobService; |
| 40 | 42 | import com.ruoyi.system.domain.SysNotice; |
| 41 | 43 | import com.ruoyi.system.service.ISysNoticeService; |
| ... | ... | @@ -86,6 +88,9 @@ public class DriverServiceImpl implements IDriverService { |
| 86 | 88 | @Resource |
| 87 | 89 | private SchedulingCache schedulingCache; |
| 88 | 90 | |
| 91 | + @Autowired | |
| 92 | + private TJkEmployeeinfoService tJkEmployeeinfoService; | |
| 93 | + | |
| 89 | 94 | @Resource |
| 90 | 95 | private NowSchedulingCache nowSchedulingCache; |
| 91 | 96 | |
| ... | ... | @@ -502,7 +507,7 @@ public class DriverServiceImpl implements IDriverService { |
| 502 | 507 | |
| 503 | 508 | driver.setImage(fileName); |
| 504 | 509 | driver.setUpdateTime(new Date()); |
| 505 | - driverMapper.insertDriver(driver); | |
| 510 | +// driverMapper.insertDriver(driver); | |
| 506 | 511 | driverMapper.updateSignStatusDriversByJobCodes(new ArrayList<>(Arrays.asList(driver))); |
| 507 | 512 | driverMapper.deleteDeviceIdAssociatedJobCode(new ArrayList<>(Arrays.asList(driver.getJobCode()))); |
| 508 | 513 | log.info("进行人员数据更新完毕"); |
| ... | ... | @@ -512,7 +517,7 @@ public class DriverServiceImpl implements IDriverService { |
| 512 | 517 | } |
| 513 | 518 | |
| 514 | 519 | private static String handlerJobCode(DriverSignInRequestVo vo) { |
| 515 | - if (StringUtil.isEmpty(vo.getJobCode())){ | |
| 520 | + if (StringUtil.isEmpty(vo.getJobCode())) { | |
| 516 | 521 | return vo.getJobCode(); |
| 517 | 522 | } |
| 518 | 523 | String[] split = vo.getJobCode().split("-"); |
| ... | ... | @@ -557,6 +562,32 @@ public class DriverServiceImpl implements IDriverService { |
| 557 | 562 | sendNotice(nowTimerList); |
| 558 | 563 | } |
| 559 | 564 | |
| 565 | + @Override | |
| 566 | + public void importDriver() { | |
| 567 | + List<TJkEmployeeinfo> list = tJkEmployeeinfoService.list(); | |
| 568 | + Date date = DateUtils.getNowDate(); | |
| 569 | + List<Driver> drivers = list.stream() | |
| 570 | + .filter(item -> com.ruoyi.common.utils.StringUtils.contains(item.getUnitfullname(), "金高")) | |
| 571 | + .filter(item -> checkJingaoPosts(item)) | |
| 572 | + .map(item -> { | |
| 573 | + Driver driver = new Driver(); | |
| 574 | + driver.setJobCode(item.getCode()); | |
| 575 | + driver.setPersonnelName(item.getEmployeename()); | |
| 576 | + driver.setFleetName(item.getDepartmentname()); | |
| 577 | + driver.setPosts(item.getPositname()); | |
| 578 | + driver.setUpdateTime(date); | |
| 579 | + return driver; | |
| 580 | + }).collect(Collectors.toList()); | |
| 581 | + insertDrivers(drivers); | |
| 582 | + } | |
| 583 | + | |
| 584 | + private boolean checkJingaoPosts(TJkEmployeeinfo item) { | |
| 585 | + if (com.ruoyi.common.utils.StringUtils.contains(item.getPositname(), "驾驶员") || com.ruoyi.common.utils.StringUtils.contains(item.getPositname(), "乘务员")) { | |
| 586 | + return true; | |
| 587 | + } | |
| 588 | + return false; | |
| 589 | + } | |
| 590 | + | |
| 560 | 591 | private void sendNotice(List<DriverSignInRecommendation> nowTimerList) { |
| 561 | 592 | List<SysNotice> noticeList = new ArrayList<>(nowTimerList.size()); |
| 562 | 593 | for (DriverSignInRecommendation item : nowTimerList) { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/mapper/TJkEmployeeinfoMapper.java
0 → 100644
| 1 | +package com.ruoyi.mapper; | |
| 2 | + | |
| 3 | +import com.ruoyi.domain.TJkEmployeeinfo; | |
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【t_jk_employeeinfo(金蝶员工表)】的数据库操作Mapper | |
| 9 | +* @createDate 2023-09-26 11:39:31 | |
| 10 | +* @Entity .domain.TJkEmployeeinfo | |
| 11 | +*/ | |
| 12 | +public interface TJkEmployeeinfoMapper extends BaseMapper<TJkEmployeeinfo> { | |
| 13 | + | |
| 14 | +} | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/TJkEmployeeinfoService.java
0 → 100644
| 1 | +package com.ruoyi.service; | |
| 2 | + | |
| 3 | +import com.ruoyi.domain.TJkEmployeeinfo; | |
| 4 | +import com.baomidou.mybatisplus.extension.service.IService; | |
| 5 | + | |
| 6 | +/** | |
| 7 | +* @author 20412 | |
| 8 | +* @description 针对表【t_jk_employeeinfo(金蝶员工表)】的数据库操作Service | |
| 9 | +* @createDate 2023-09-26 11:39:31 | |
| 10 | +*/ | |
| 11 | +public interface TJkEmployeeinfoService extends IService<TJkEmployeeinfo> { | |
| 12 | + | |
| 13 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/TJkEmployeeinfoServiceImpl.java
0 → 100644
| 1 | +package com.ruoyi.service.impl; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 4 | +import com.ruoyi.domain.TJkEmployeeinfo; | |
| 5 | +import com.ruoyi.service.TJkEmployeeinfoService; | |
| 6 | +import com.ruoyi.mapper.TJkEmployeeinfoMapper; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +/** | |
| 10 | +* @author 20412 | |
| 11 | +* @description 针对表【t_jk_employeeinfo(金蝶员工表)】的数据库操作Service实现 | |
| 12 | +* @createDate 2023-09-26 11:39:31 | |
| 13 | +*/ | |
| 14 | +@Service | |
| 15 | +public class TJkEmployeeinfoServiceImpl extends ServiceImpl<TJkEmployeeinfoMapper, TJkEmployeeinfo> | |
| 16 | + implements TJkEmployeeinfoService{ | |
| 17 | + | |
| 18 | +} | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | ... | ... |
Bsth-admin/src/main/resources/application-druid-dev.yml
| ... | ... | @@ -154,12 +154,12 @@ swagger: |
| 154 | 154 | api: |
| 155 | 155 | url: |
| 156 | 156 | # all 为获取所有驾驶员信息 |
| 157 | - getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s | |
| 157 | + getDriverInfo: http://58.247.254.118:9089/webservice/rest/person/%s | |
| 158 | 158 | # 获取公司编码下的员工信息 暂时没用 |
| 159 | - getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s | |
| 159 | + getCompanyInfo: http://58.247.254.118:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s | |
| 160 | 160 | # 获取排班信息 |
| 161 | - getSchedulingInfo: http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 162 | - getSchedulingInfoNew: http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 161 | + getSchedulingInfo: http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 162 | + getSchedulingInfoNew: http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 163 | 163 | config: |
| 164 | 164 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 |
| 165 | 165 | # 随机字符串 | ... | ... |
Bsth-admin/src/main/resources/application-druid-uat.yml
| ... | ... | @@ -173,12 +173,12 @@ swagger: |
| 173 | 173 | api: |
| 174 | 174 | url: |
| 175 | 175 | # all 为获取所有驾驶员信息 |
| 176 | - getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s | |
| 176 | + getDriverInfo: http://58.247.254.118:9089/webservice/rest/person/%s | |
| 177 | 177 | # 获取公司编码下的员工信息 暂时没用 |
| 178 | - getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s | |
| 178 | + getCompanyInfo: http://58.247.254.118:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s | |
| 179 | 179 | # 获取排班信息 |
| 180 | - getSchedulingInfo: http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 181 | - getSchedulingInfoNew: http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 180 | + getSchedulingInfo: http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 181 | + getSchedulingInfoNew: http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s | |
| 182 | 182 | config: |
| 183 | 183 | # 固定密码 |
| 184 | 184 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 | ... | ... |
Bsth-admin/src/main/resources/mapper/TJkEmployeeinfoMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.ruoyi.mapper.TJkEmployeeinfoMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.ruoyi.domain.TJkEmployeeinfo"> | |
| 8 | + <result property="emId" column="em_id" jdbcType="VARCHAR"/> | |
| 9 | + <result property="companyname" column="companyname" jdbcType="VARCHAR"/> | |
| 10 | + <result property="departmentname" column="departmentname" jdbcType="VARCHAR"/> | |
| 11 | + <result property="positname" column="positname" jdbcType="VARCHAR"/> | |
| 12 | + <result property="employeename" column="employeename" jdbcType="VARCHAR"/> | |
| 13 | + <result property="age" column="age" jdbcType="INTEGER"/> | |
| 14 | + <result property="status" column="status" jdbcType="VARCHAR"/> | |
| 15 | + <result property="unitfullname" column="unitfullname" jdbcType="VARCHAR"/> | |
| 16 | + <result property="code" column="code" jdbcType="VARCHAR"/> | |
| 17 | + <result property="inposittype" column="inposittype" jdbcType="VARCHAR"/> | |
| 18 | + <result property="idcardid" column="idcardid" jdbcType="VARCHAR"/> | |
| 19 | + <result property="sextype" column="sextype" jdbcType="VARCHAR"/> | |
| 20 | + <result property="nationname" column="nationname" jdbcType="VARCHAR"/> | |
| 21 | + <result property="nativeplace" column="nativeplace" jdbcType="VARCHAR"/> | |
| 22 | + <result property="birthday" column="birthday" jdbcType="DATE"/> | |
| 23 | + <result property="politicsstatus" column="politicsstatus" jdbcType="VARCHAR"/> | |
| 24 | + <result property="marridstatus" column="marridstatus" jdbcType="VARCHAR"/> | |
| 25 | + <result property="startwordtime" column="startwordtime" jdbcType="DATE"/> | |
| 26 | + <result property="telphone" column="telphone" jdbcType="VARCHAR"/> | |
| 27 | + <result property="mobile" column="mobile" jdbcType="VARCHAR"/> | |
| 28 | + <result property="hrmsUserfield3" column="hrms_userfield_3" jdbcType="VARCHAR"/> | |
| 29 | + <result property="hrmsUserfield47" column="hrms_userfield_47" jdbcType="VARCHAR"/> | |
| 30 | + <result property="hrmsUserfield40" column="hrms_userfield_40" jdbcType="VARCHAR"/> | |
| 31 | + <result property="hrmsUserfield45" column="hrms_userfield_45" jdbcType="VARCHAR"/> | |
| 32 | + <result property="hrmsUserfield41" column="hrms_userfield_41" jdbcType="VARCHAR"/> | |
| 33 | + <result property="fname" column="fname" jdbcType="VARCHAR"/> | |
| 34 | + <result property="enterdeptdate" column="enterdeptdate" jdbcType="DATE"/> | |
| 35 | + <result property="entergroupdate" column="entergroupdate" jdbcType="DATE"/> | |
| 36 | + <result property="inpositiondate" column="inpositiondate" jdbcType="DATE"/> | |
| 37 | + <result property="emptypecls" column="emptypecls" jdbcType="VARCHAR"/> | |
| 38 | + <result property="enterdate" column="enterdate" jdbcType="DATE"/> | |
| 39 | + <result property="contractdate" column="contractdate" jdbcType="DATE"/> | |
| 40 | + </resultMap> | |
| 41 | + | |
| 42 | + <sql id="Base_Column_List"> | |
| 43 | + em_id,companyname,departmentname, | |
| 44 | + positname,employeename,age, | |
| 45 | + status,unitfullname,code, | |
| 46 | + inposittype,idcardid,sextype, | |
| 47 | + nationname,nativeplace,birthday, | |
| 48 | + politicsstatus,marridstatus,startwordtime, | |
| 49 | + telphone,mobile,hrms_userfield_3, | |
| 50 | + hrms_userfield_47,hrms_userfield_40,hrms_userfield_45, | |
| 51 | + hrms_userfield_41,fname,enterdeptdate, | |
| 52 | + entergroupdate,inpositiondate,emptypecls, | |
| 53 | + enterdate,contractdate | |
| 54 | + </sql> | |
| 55 | +</mapper> | ... | ... |