Commit 5ef38f66 by zhiwj

受审项

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