|
|
@ -1,6 +1,8 @@
|
|
|
|
package com.docus.server.collect.web.service;
|
|
|
|
package com.docus.server.collect.web.service;
|
|
|
|
|
|
|
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
|
|
|
import com.docus.server.record.pojo.dto.TBasicDTO;
|
|
|
|
|
|
|
|
import com.docus.server.record.service.ITBasicService;
|
|
|
|
import com.docus.server.sys.common.pojo.dto.DeptDTO;
|
|
|
|
import com.docus.server.sys.common.pojo.dto.DeptDTO;
|
|
|
|
import com.docus.server.sys.common.pojo.dto.UserDTO;
|
|
|
|
import com.docus.server.sys.common.pojo.dto.UserDTO;
|
|
|
|
import com.docus.server.sys.service.IPowerDeptService;
|
|
|
|
import com.docus.server.sys.service.IPowerDeptService;
|
|
|
@ -17,13 +19,16 @@ public class CollectService {
|
|
|
|
private IPowerDeptService deptService;
|
|
|
|
private IPowerDeptService deptService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IPowerUserService userService;
|
|
|
|
private IPowerUserService userService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ITBasicService tBasicService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 默认3次重试
|
|
|
|
* 默认3次重试
|
|
|
|
|
|
|
|
* 科室数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
/*@Async("recordMessage")
|
|
|
|
/*@Async("recordMessage")
|
|
|
|
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 2000L, multiplier = 1.5))*/
|
|
|
|
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 2000L, multiplier = 1.5))*/
|
|
|
|
@Transactional
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public void insertOrUpdateDept(DeptDTO deptDTO) {
|
|
|
|
public void insertOrUpdateDept(DeptDTO deptDTO) {
|
|
|
|
//异步写入归档系统,失败自动重试。
|
|
|
|
//异步写入归档系统,失败自动重试。
|
|
|
|
if (checkType(deptDTO.getOperateType(), DEL_TYPE)) {
|
|
|
|
if (checkType(deptDTO.getOperateType(), DEL_TYPE)) {
|
|
|
@ -33,7 +38,12 @@ public class CollectService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 用户信息
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param userDTO
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public void insertOrUpdateUser(UserDTO userDTO) {
|
|
|
|
public void insertOrUpdateUser(UserDTO userDTO) {
|
|
|
|
// 判断操作类型
|
|
|
|
// 判断操作类型
|
|
|
|
if (checkType(userDTO.getOperateType(), DEL_TYPE)) {
|
|
|
|
if (checkType(userDTO.getOperateType(), DEL_TYPE)) {
|
|
|
@ -43,6 +53,21 @@ public class CollectService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 基础数据
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param tBasicDTO
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
public void insertOrUpdateBasic(TBasicDTO tBasicDTO) {
|
|
|
|
|
|
|
|
Integer num = tBasicService.findByJzh(tBasicDTO.getJzh());
|
|
|
|
|
|
|
|
if (num > 0) {
|
|
|
|
|
|
|
|
tBasicService.updateTBasic(tBasicDTO);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
tBasicService.insertTBasic(tBasicDTO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected boolean checkType(String operateType, String delType) {
|
|
|
|
protected boolean checkType(String operateType, String delType) {
|
|
|
|
return Func.isNotEmpty(operateType)
|
|
|
|
return Func.isNotEmpty(operateType)
|
|
|
|