Эх сурвалжийг харах

feat: 新建CSO初始化限制信息2

李学松 2 жил өмнө
parent
commit
af8ace56fc

+ 10 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmDaAgentServiceImpl.java

@@ -118,6 +118,8 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
 	 * sysDept.setTaxCode(wmDaAgent.getZjNumber());
 	*/
 	public boolean saveAgent(WmDaAgent wmDaAgent) {
+		Integer deptId = SecurityUtils.getUser().getDeptId();
+
 		wmDaAgent.setCreateTime(LocalDateTime.now());
 		boolean isSave = super.save(wmDaAgent);
 		List<SysDept> list = sysDeptMapper.selectByName(wmDaAgent.getGsmc());
@@ -136,6 +138,10 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
 					wmDaAgent.setDeptId(String.valueOf(list.get(0).getDeptId()));
 					wmDaAgentMapper.updateById(wmDaAgent);
 				}
+
+				// 初始化企业限制信息
+				taskSubmissionRuleService.initDeptTaskSubmissionRule(Collections.singleton(Integer.valueOf(wmDaAgent.getDeptId())), deptId);
+
 				List<SysDeptRelation> newList = new ArrayList<>();
 				SysDeptRelation sysDeptRelation = new SysDeptRelation();
 				sysDeptRelation.setAncestor(SecurityUtils.getUser().getDeptId());
@@ -160,6 +166,10 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
 					wmDaAgent.setDeptId(String.valueOf(list.get(0).getDeptId()));
 					wmDaAgentMapper.updateById(wmDaAgent);
 				}
+
+				// 初始化企业限制信息
+				taskSubmissionRuleService.initDeptTaskSubmissionRule(Collections.singleton(Integer.valueOf(wmDaAgent.getDeptId())), deptId);
+
 				List<SysDeptRelation> newList = new ArrayList<>();
 				SysDeptRelation sysDeptRelation = new SysDeptRelation();
 				sysDeptRelation.setAncestor(SecurityUtils.getUser().getDeptId());
@@ -172,8 +182,6 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
 				return sysDeptRelationService.saveBatch(newList);
 			}
 
-			// 初始化企业限制信息
-			taskSubmissionRuleService.initDeptTaskSubmissionRule(Collections.singleton(Integer.valueOf(wmDaAgent.getDeptId())), SecurityUtils.getUser().getDeptId());
 		}
 		return false;
 	}

+ 2 - 3
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmTaskSubmissionRuleServiceImpl.java

@@ -89,10 +89,9 @@ public class WmTaskSubmissionRuleServiceImpl extends ServiceImpl<WmTaskSubmissio
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public Boolean initDeptTaskSubmissionRule(Collection<Integer> deptIds, Integer sourceDeptId) {
-		// 查询平台的配置
+		// 查询源数据企业的配置
 		List<WmTaskSubmissionRule> platformRules = this.list(Wrappers.<WmTaskSubmissionRule>lambdaQuery()
-				.eq(WmTaskSubmissionRule::getDeptId, sourceDeptId)
-				.eq(WmTaskSubmissionRule::getSubCategory, UpmsType.TaskSubCategory.SCORE_LIMIT));
+				.eq(WmTaskSubmissionRule::getDeptId, sourceDeptId));
 
 
 		if (CollUtil.isEmpty(platformRules)) {