|
@@ -499,7 +499,7 @@ public class UserController {
|
|
|
* 定时同步白马项目用户信息
|
|
|
*/
|
|
|
@Scheduled(cron = "0 0 4 * * ?")
|
|
|
- //@Scheduled(cron = "0 */3 * * * ?")
|
|
|
+ //@Scheduled(cron = "0 */2 * * * ?")
|
|
|
public void syncProjectUserInfo() throws ParseException, IOException {
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("fn", "all");
|
|
@@ -522,6 +522,7 @@ public class UserController {
|
|
|
//String password = jsonObject.getString("password"); //MD5加密后的密码
|
|
|
String name = jsonObject.getString("name"); //人员姓名
|
|
|
String idCard = jsonObject.getString("idcard"); //身份证号
|
|
|
+ String phone = jsonObject.getString("phone"); //电话号码
|
|
|
|
|
|
/*这里实际接口返回的数据都是companyName对应的公司名称*/
|
|
|
String companyName = jsonObject.getString("companyName"); //公司名称
|
|
@@ -569,9 +570,22 @@ public class UserController {
|
|
|
|| companyName.contains("重庆市交通工程监理咨询有限责任公司")
|
|
|
|| companyName.contains("中铁长江交通设计集团有限公司")
|
|
|
|| companyName.contains("中铁八局集团有限公司")) {
|
|
|
- Long sysUser = userService.getBaseMapper().selectCount(Wrappers.<User>lambdaQuery().eq(User::getSysId, id).eq(User::getSysType, 2));
|
|
|
+ List<User> sysUser = userService.getBaseMapper().selectList(Wrappers.<User>lambdaQuery().eq(User::getSysId, id).eq(User::getSysType, 2));
|
|
|
+
|
|
|
+ /*修改电话号码*/
|
|
|
+ if (sysUser.size() > 0 && ObjectUtil.isNotEmpty(phone) && phone.length() == 11) {
|
|
|
+ for (User user : sysUser) {
|
|
|
+ if (ObjectUtil.isEmpty(user.getPhone())) {
|
|
|
+ userService.lambdaUpdate()
|
|
|
+ .set(User::getPhone, phone)
|
|
|
+ .eq(User::getId, user.getId())
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/*只有本系统不存在时才去新增*/
|
|
|
- if (sysUser == 0L) {
|
|
|
+ if (sysUser.size() == 0L) {
|
|
|
User newUser = new User();
|
|
|
newUser.setId(SnowFlakeUtil.getId());
|
|
|
newUser.setDeptId("1588069957940674562"); //白马部门
|
|
@@ -593,6 +607,7 @@ public class UserController {
|
|
|
newUser.setStatus(Integer.parseInt(status));
|
|
|
newUser.setIdNumber(idCard);
|
|
|
newUser.setCompanyName(companyName);
|
|
|
+ newUser.setPhone(ObjectUtil.isNotEmpty(phone) && phone.length() == 11 ? phone : null);
|
|
|
|
|
|
//所有合同段(白马)
|
|
|
if (companyName.contains("重庆白马航运发展有限公司")) {
|