Commit 5ef38f66 by zhiwj

受审项

parent 06bfb93b
...@@ -35,20 +35,22 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel ...@@ -35,20 +35,22 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
@Override @Override
public void addOrUpdateRel(Integer enterpriseId, Integer auditorId, List<Integer> auditedGroupIdList) { public void addOrUpdateRel(Integer enterpriseId, Integer auditorId, List<Integer> auditedGroupIdList) {
// 把所有auditorId的关联status设置为0 if (CollectionUtils.isNotEmpty(auditedGroupIdList)) {
tabAuditorAuditedGroupRelMapper.delByAuditorId(auditorId); // 把所有auditorId的关联status设置为0
// 插入不存在的关联 tabAuditorAuditedGroupRelMapper.delByAuditorId(auditorId);
for (Integer auditedGroupId : auditedGroupIdList) { // 插入不存在的关联
TabAuditorAuditedGroupRel itemRel = new TabAuditorAuditedGroupRel(); for (Integer auditedGroupId : auditedGroupIdList) {
itemRel.setEnterpriseId(enterpriseId); TabAuditorAuditedGroupRel itemRel = new TabAuditorAuditedGroupRel();
itemRel.setAuditorId(auditorId); itemRel.setEnterpriseId(enterpriseId);
itemRel.setAuditedGroupId(auditedGroupId); itemRel.setAuditorId(auditorId);
itemRel.setStatus(GlobalInfo.DATA_STATUS_NORMAL); itemRel.setAuditedGroupId(auditedGroupId);
itemRel.setCreateTime(new Date()); itemRel.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
tabAuditorAuditedGroupRelMapper.insertSelectiveByNotExist(itemRel); itemRel.setCreateTime(new Date());
tabAuditorAuditedGroupRelMapper.insertSelectiveByNotExist(itemRel);
}
// 把所有auditedGroup关联status都设置为1
tabAuditorAuditedGroupRelMapper.updateStatusByAuditedGroupIds(enterpriseId, auditorId, auditedGroupIdList);
} }
// 把所有auditedGroup关联status都设置为1
tabAuditorAuditedGroupRelMapper.updateStatusByAuditedGroupIds(enterpriseId, auditorId, auditedGroupIdList);
} }
@Override @Override
......
...@@ -14,6 +14,7 @@ import com.gic.enterprise.dto.ProjectDTO; ...@@ -14,6 +14,7 @@ import com.gic.enterprise.dto.ProjectDTO;
import com.gic.enterprise.service.ProjectApiService; import com.gic.enterprise.service.ProjectApiService;
import com.gic.enterprise.utils.ResultControllerUtils; import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils; import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -47,8 +48,10 @@ public class AuditorController { ...@@ -47,8 +48,10 @@ public class AuditorController {
auditorDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId()); auditorDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
List<Integer> projectItemList = Stream.of(auditorQO.getProjectItems().split(GlobalInfo.FLAG_COMMA)).map(Integer::valueOf).collect(Collectors.toList()); List<Integer> projectItemList = Stream.of(auditorQO.getProjectItems().split(GlobalInfo.FLAG_COMMA)).map(Integer::valueOf).collect(Collectors.toList());
auditorDTO.setProjectItemList(projectItemList); auditorDTO.setProjectItemList(projectItemList);
List<Integer> auditedGroupIdList = Stream.of(auditorQO.getAuditedGroupIds().split(GlobalInfo.FLAG_COMMA)).map(Integer::valueOf).collect(Collectors.toList()); if (StringUtils.isNotBlank(auditorQO.getAuditedGroupIds())) {
auditorDTO.setAuditedGroupIdList(auditedGroupIdList); List<Integer> auditedGroupIdList = Stream.of(auditorQO.getAuditedGroupIds().split(GlobalInfo.FLAG_COMMA)).map(Integer::valueOf).collect(Collectors.toList());
auditorDTO.setAuditedGroupIdList(auditedGroupIdList);
}
ServiceResponse<String> response = auditorApiService.saveOrUpdateAuditor(auditorDTO); ServiceResponse<String> response = auditorApiService.saveOrUpdateAuditor(auditorDTO);
if (response.isSuccess()) { if (response.isSuccess()) {
LogUtils.createLog((auditorQO.getAuditorId() == null ? "新增" : "修改") + "审核员", auditorQO.getAuditorName()); LogUtils.createLog((auditorQO.getAuditorId() == null ? "新增" : "修改") + "审核员", auditorQO.getAuditorName());
......
...@@ -49,7 +49,7 @@ public class AuditorQO { ...@@ -49,7 +49,7 @@ public class AuditorQO {
/** /**
* 受审组id * 受审组id
*/ */
@NotBlank(message = "受审组不能为空", groups = SaveValid.class) // @NotBlank(message = "受审组不能为空", groups = SaveValid.class)
private String auditedGroupIds; private String auditedGroupIds;
public Integer getAuditorId() { public Integer getAuditorId() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment