diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java index 7abf194f4..44a6a9f2f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java @@ -172,6 +172,7 @@ public class SysUserServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("USER_ID", dto.getId().toString()); CustomerStaffEntity customerStaffEntity = customerStaffDao.selectOne(queryWrapper); - customerStaffEntity.setRealName(dto.getRealName()); - customerStaffEntity.setGender(dto.getGender()); - customerStaffEntity.setEmail(dto.getEmail()); - customerStaffEntity.setMobile(dto.getMobile()); - if (StringUtils.isNotEmpty(dto.getPassword())) { - customerStaffEntity.setPassword(PasswordUtils.encode(dto.getPassword())); + if (customerStaffEntity == null) { + CustomerStaffEntity staffEntity = ConvertUtils.sourceToTarget(entity, CustomerStaffEntity.class); + staffEntity.setId(entity.getId().toString()); + staffEntity.setCustomerId(sysDictEntity.getDictValue()); + staffEntity.setUserId(entity.getId().toString()); + staffEntity.setHeadPhoto(entity.getHeadUrl()); + staffEntity.setWorkType("fulltime"); + staffEntity.setActiveFlag("active"); + staffEntity.setActiveTime(new Date()); + staffEntity.setEnableFlag("enable"); + if(StringUtils.isEmpty(entity.getPassword())){ + staffEntity.setPassword(PasswordUtils.encode(sysUserEntity.getPassword())); + }else { + staffEntity.setPassword(PasswordUtils.encode(entity.getPassword())); + } + customerStaffDao.insert(staffEntity); + } else { + customerStaffEntity.setRealName(dto.getRealName()); + customerStaffEntity.setGender(dto.getGender()); + customerStaffEntity.setEmail(dto.getEmail()); + customerStaffEntity.setMobile(dto.getMobile()); + if (StringUtils.isNotEmpty(dto.getPassword())) { + customerStaffEntity.setPassword(PasswordUtils.encode(dto.getPassword())); + } + customerStaffEntity.setHeadPhoto(dto.getHeadUrl()); + customerStaffDao.updateById(customerStaffEntity); } - customerStaffEntity.setHeadPhoto(dto.getHeadUrl()); - customerStaffDao.updateById(customerStaffEntity); //同步更新staff_org_relation QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("STAFF_ID",dto.getId().toString()); + wrapper.eq("STAFF_ID", dto.getId().toString()); StaffOrgRelationEntity staffOrgRelationEntity = staffOrgRelationDao.selectOne(wrapper); String typeKey = deptEntity.getTypeKey(); - staffOrgRelationEntity.setPids(StringUtils.join(StringUtils.split(deptEntity.getPids(), ","), ":")); - staffOrgRelationEntity.setOrgId(deptEntity.getId().toString()); - if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(typeKey)) { - staffOrgRelationEntity.setOrgType("grid"); - } else if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(typeKey) || OrganizationTypeConstant.ORG_TYPE_STREET_DEPT.equals(typeKey)) { - staffOrgRelationEntity.setOrgType("dept"); - } else { - staffOrgRelationEntity.setOrgType("agency"); + if(staffOrgRelationEntity==null){ + StaffOrgRelationEntity orgRelationEntity = new StaffOrgRelationEntity(); + orgRelationEntity.setId(entity.getId().toString()); + orgRelationEntity.setCustomerId(sysDictEntity.getDictValue()); + orgRelationEntity.setStaffId(entity.getId().toString()); + orgRelationEntity.setPids(StringUtils.join(StringUtils.split(deptEntity.getPids(), ","), ":")); + orgRelationEntity.setOrgId(deptEntity.getId().toString()); + if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(typeKey)) { + orgRelationEntity.setOrgType("grid"); + } else if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(typeKey) || OrganizationTypeConstant.ORG_TYPE_STREET_DEPT.equals(typeKey)) { + orgRelationEntity.setOrgType("dept"); + } else { + orgRelationEntity.setOrgType("agency"); + } + staffOrgRelationDao.insert(orgRelationEntity); + }else { + staffOrgRelationEntity.setPids(StringUtils.join(StringUtils.split(deptEntity.getPids(), ","), ":")); + staffOrgRelationEntity.setOrgId(deptEntity.getId().toString()); + if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(typeKey)) { + staffOrgRelationEntity.setOrgType("grid"); + } else if (OrganizationTypeConstant.ORG_TYPE_DISTRICT_DEPT.equals(typeKey) || OrganizationTypeConstant.ORG_TYPE_STREET_DEPT.equals(typeKey)) { + staffOrgRelationEntity.setOrgType("dept"); + } else { + staffOrgRelationEntity.setOrgType("agency"); + } + staffOrgRelationDao.updateById(staffOrgRelationEntity); } - staffOrgRelationDao.updateById(staffOrgRelationEntity); } if (!sysUserEntity.getDeptId().equals(entity.getDeptId())) { diff --git a/esua-epdc/kettle-Code/dcp_job/epmet_gov_issue/issue.ktr b/esua-epdc/kettle-Code/dcp_job/epmet_gov_issue/issue.ktr index 832d07e13..4ad69422f 100644 --- a/esua-epdc/kettle-Code/dcp_job/epmet_gov_issue/issue.ktr +++ b/esua-epdc/kettle-Code/dcp_job/epmet_gov_issue/issue.ktr @@ -760,7 +760,7 @@ issue.GRID_ID , REPLACE(issue.PARENT_DEPT_IDS,',',':') ORG_ID_PATH, SUBSTRING_INDEX(issue.PARENT_DEPT_IDS,',',-1) ORG_ID, issue.CREATED_TIME DECIDED_TIME, -(case when issue.ISSUE_STATE = 4 then item.CREATED_TIME else '' end) SHIFTED_TIME, +(case when issue.ISSUE_STATE = 4 then item.CREATED_TIME else null end) SHIFTED_TIME, hdl.CREATED_TIME CLOSED_TIME, issue.DEL_FLAG, issue.REVISION, diff --git a/esua-epdc/kettle-Code/dcp_job/user/volunteer_info.ktr b/esua-epdc/kettle-Code/dcp_job/user/volunteer_info.ktr index 1e81b58a0..680df0a37 100644 --- a/esua-epdc/kettle-Code/dcp_job/user/volunteer_info.ktr +++ b/esua-epdc/kettle-Code/dcp_job/user/volunteer_info.ktr @@ -577,77 +577,6 @@ - - target-user - ${db.mysql.epdc.target.host} - MYSQL - Native - ${epmet.user.database} - ${db.mysql.epdc.target.port} - ${db.mysql.epdc.target.username} - ${db.mysql.epdc.target.password} - - - - - - EXTRA_OPTION_MYSQL.allowMultiQueries - true - - - EXTRA_OPTION_MYSQL.characterEncoding - UTF-8 - - - EXTRA_OPTION_MYSQL.useSSL - false - - - EXTRA_OPTION_MYSQL.useUnicode - true - - - FORCE_IDENTIFIERS_TO_LOWERCASE - N - - - FORCE_IDENTIFIERS_TO_UPPERCASE - N - - - IS_CLUSTERED - N - - - PORT_NUMBER - ${db.mysql.epdc.target.port} - - - PRESERVE_RESERVED_WORD_CASE - Y - - - QUOTE_ALL_FIELDS - N - - - STREAM_RESULTS - Y - - - SUPPORTS_BOOLEAN_DATA_TYPE - Y - - - SUPPORTS_TIMESTAMP_DATA_TYPE - Y - - - USE_POOLING - N - - - 数据库连接 2 @@ -843,16 +772,14 @@ AND DATE_FORMAT(info.UPDATED_TIME, '%Y-%m-%d %H:%i:%s') >?; none - target-user + target-hert SELECT IFNULL( ( SELECT u.UPDATED_TIME FROM - `user` u - WHERE - u.FROM_APP = 'resi' + `volunteer_info` u ORDER BY u.UPDATED_TIME DESC LIMIT 1