|
|
@@ -15,25 +15,31 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.goafanti.common.bo.Error;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
+import com.goafanti.common.dao.AdminMapper;
|
|
|
import com.goafanti.common.dao.OrderExamineMapper;
|
|
|
import com.goafanti.common.dao.OrganizationContactBookMapper;
|
|
|
import com.goafanti.common.dao.PatentNewMapper;
|
|
|
import com.goafanti.common.dao.RoleMapper;
|
|
|
import com.goafanti.common.dao.RolePermissionMapper;
|
|
|
import com.goafanti.common.dao.RoleResourcesMapper;
|
|
|
+import com.goafanti.common.dao.TOrderLogMapper;
|
|
|
import com.goafanti.common.dao.TOrderMidMapper;
|
|
|
import com.goafanti.common.dao.TOrderNewMapper;
|
|
|
import com.goafanti.common.dao.TOrderTaskMapper;
|
|
|
import com.goafanti.common.dao.TTaskLogMapper;
|
|
|
+import com.goafanti.common.dao.TaskAttributionLogMapper;
|
|
|
import com.goafanti.common.dao.UserBusinessMapper;
|
|
|
import com.goafanti.common.dao.UserMapper;
|
|
|
import com.goafanti.common.dao.UserRoleMapper;
|
|
|
+import com.goafanti.common.dao.UserTransferLogMapper;
|
|
|
import com.goafanti.common.enums.roleResources;
|
|
|
import com.goafanti.common.error.BusinessException;
|
|
|
+import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.Role;
|
|
|
import com.goafanti.common.model.RolePermission;
|
|
|
import com.goafanti.common.model.RoleResources;
|
|
|
import com.goafanti.common.model.UserRole;
|
|
|
+import com.goafanti.common.model.UserTransferLog;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
@@ -69,6 +75,16 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
|
|
|
private TOrderMidMapper tOrderMidMapper;
|
|
|
@Autowired
|
|
|
private OrderExamineMapper orderExamineMapper;
|
|
|
+ @Autowired
|
|
|
+ private UserTransferLogMapper userTransferLogMapper;
|
|
|
+ @Autowired
|
|
|
+ private AdminMapper adminMapper;
|
|
|
+ @Autowired
|
|
|
+ private TaskAttributionLogMapper taskAttributionLogMapper;
|
|
|
+ @Autowired
|
|
|
+ private TOrderLogMapper tOrderLogMapper;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public Pagination<RoleBo> findRoles(RoleBo role, Integer pageNo, Integer pageSize) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
@@ -196,8 +212,10 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
|
|
|
if (list.size()<1||list.get(0)==null) {
|
|
|
throw new BusinessException(new Error("","用户角色资源不存在"));
|
|
|
}
|
|
|
+ Date date=new Date();
|
|
|
for (Integer s : list) {
|
|
|
if (s==roleResources.YXKH.getCode()) {
|
|
|
+ userTransferLogMapper.insertUserLog(aid,transferId,date);
|
|
|
roleResourcesMapper.updateLockRelease("0",aid,transferId);//将用户锁转给指定人
|
|
|
userBusinessMapper.updateDimissionTransfer(aid,transferId);
|
|
|
organizationContactBookMapper.updateDimissionTransfer(aid,transferId);
|
|
|
@@ -205,22 +223,29 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
|
|
|
userMapper.updateDimissionTransfer(aid,transferId);
|
|
|
}
|
|
|
if (s==roleResources.QDYW.getCode()) {
|
|
|
- tOrderNewMapper.updateSalesmanId(aid, transferId);
|
|
|
- tOrderMidMapper.updateSalesmanId(aid, transferId);
|
|
|
+ userTransferLogMapper.insertUserLockLog(aid,transferId,date);
|
|
|
patentNewMapper.updateAdmin(aid,transferId);
|
|
|
roleResourcesMapper.updateLockRelease("1",aid,transferId);//将业务锁转给指定人
|
|
|
}
|
|
|
- if (s==roleResources.XMRW.getCode()) {
|
|
|
-// contractTaskLogMapper.updateDimissionTransfer(aid,transferId);
|
|
|
- //获取被转角色判断修改对应任务角色
|
|
|
- Integer type=-1;
|
|
|
- if (TokenManager.hasRole(AFTConstants.TECH)) type=0;
|
|
|
- else if (TokenManager.hasRole(AFTConstants.TECH_MANAGER))type=1;
|
|
|
- if (type!=-1) {
|
|
|
- tOrderTaskMapper.updateDimissionTransfer(aid,transferId,type);
|
|
|
- tTaskLogMapper.updateDimissionTransfer(aid,transferId);
|
|
|
- orderExamineMapper.updateDimissionTransfer(aid,transferId);
|
|
|
+ if (s == roleResources.YQDD.getCode()) {
|
|
|
+ tOrderLogMapper.insertOrderLog(aid,TokenManager.getAdminId(),date);
|
|
|
+ tOrderNewMapper.updateSalesmanId(aid, transferId);
|
|
|
+ tOrderMidMapper.updateSalesmanId(aid, transferId);
|
|
|
+ }
|
|
|
+ if (s == roleResources.XMRW.getCode()) {
|
|
|
+ // 获取被转角色判断修改对应任务角色
|
|
|
+ int type=0;
|
|
|
+ List<String> l=adminMapper.getAdminRoleListByAid(transferId);
|
|
|
+ for (String str : l) {
|
|
|
+ if (str.equals(AFTConstants.TECH_MANAGER)) {
|
|
|
+ type=1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ taskAttributionLogMapper.insertList(aid, transferId, date);
|
|
|
+ tOrderTaskMapper.updateDimissionTransfer(aid, transferId, type);
|
|
|
+ tTaskLogMapper.updateDimissionTransfer(aid, transferId);
|
|
|
+ orderExamineMapper.updateDimissionTransfer(aid, transferId);
|
|
|
}
|
|
|
if (s!=roleResources.QDYW.getCode()) {
|
|
|
roleResourcesMapper.updateDimissionTransfer(s,aid,transferId);
|