|
|
@@ -219,7 +219,6 @@ public class ApiController {
|
|
|
connection.setAutoCommit(false);
|
|
|
for (MDMDept model : mdmDeptList) {
|
|
|
SysDept dept = new SysDept();
|
|
|
- dept.setDeptId(Long.valueOf(model.get_ID()));
|
|
|
dept.setCode(model.getC_INTERNAL_UNIT_CODE());
|
|
|
dept.setName(model.getC_FULLNAME());
|
|
|
dept.setFirmAddress(model.getC_ADDRESS());
|
|
|
@@ -230,6 +229,8 @@ public class ApiController {
|
|
|
} else {
|
|
|
dept.setEnabled(false);
|
|
|
}
|
|
|
+ dept.setCreateTime(LocalDateUtil.localDateTimeFormatyMdHms(LocalDateTimeUtil.of(Long.valueOf(model.get_CREATE_TIME()))));
|
|
|
+ dept.setUpdateTime(dept.getCreateTime());
|
|
|
|
|
|
SysDept pDept = new SysDept();
|
|
|
pDept.setCode(model.getC_HR_MANAGEMENT_UNIT());
|
|
|
@@ -240,17 +241,17 @@ public class ApiController {
|
|
|
pDept.setSubCount(pDept.getSubCount() + 1);
|
|
|
jdbcClient.jdbcUpdateById(pDept, connection);
|
|
|
|
|
|
- dept.setCreateTime(LocalDateUtil.localDateTimeFormatyMdHms(LocalDateTimeUtil.of(Long.valueOf(model.get_CREATE_TIME()))));
|
|
|
- dept.setUpdateTime(dept.getCreateTime());
|
|
|
-
|
|
|
SysDept exist = new SysDept();
|
|
|
- exist.setDeptId(Long.valueOf(model.get_ID()));
|
|
|
- int count = jdbcClient.getJdbcCount(exist, connection);
|
|
|
- if (count == 0) {
|
|
|
+ exist.setCode(model.getC_INTERNAL_UNIT_CODE());
|
|
|
+ exist = jdbcClient.getJdbcModel(exist, connection);
|
|
|
+ if (StringUtil.isEmpty(exist.getDeptId())) {
|
|
|
+ dept.setDeptId((long) 0);
|
|
|
jdbcClient.jdbcInsert(dept, connection);
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
+ dept.setDeptId(exist.getDeptId());
|
|
|
jdbcClient.jdbcUpdateById(dept, connection);
|
|
|
}
|
|
|
+
|
|
|
connection.commit();
|
|
|
}
|
|
|
result.put("code", 200);
|
|
|
@@ -282,7 +283,6 @@ public class ApiController {
|
|
|
for (MDMUser model : mdmUserList) {
|
|
|
SysUser user = new SysUser();
|
|
|
user.setCode(model.getC_USER_CODE());
|
|
|
- user.setUserId(Long.valueOf(model.get_ID()));
|
|
|
user.setNickName(model.getC_USER_NAME());
|
|
|
user.setPhone(model.getC_MOBILEPHONE_NUMBER());
|
|
|
user.setCreateTime(LocalDateUtil
|
|
|
@@ -306,11 +306,13 @@ public class ApiController {
|
|
|
}
|
|
|
|
|
|
SysUser exist = new SysUser();
|
|
|
- exist.setUserId(Long.valueOf(model.get_ID()));
|
|
|
- int count = jdbcClient.getJdbcCount(exist, connection);
|
|
|
- if (count == 0) {
|
|
|
+ exist.setUsername(model.getC_USER_CODE());
|
|
|
+ jdbcClient.getJdbcModel(exist,connection);
|
|
|
+ if (StringUtil.isEmpty(exist.getUserId())) {
|
|
|
+ user.setUserId((long) 0);
|
|
|
jdbcClient.jdbcInsert(user, connection);
|
|
|
} else {
|
|
|
+ user.setUserId(exist.getUserId());
|
|
|
jdbcClient.jdbcUpdateById(user, connection);
|
|
|
}
|
|
|
}
|