Merge remote-tracking branch 'origin/fourthStage' into fourthStage

This commit is contained in:
梁琦涛
2024-02-01 17:49:24 +08:00
2 changed files with 161 additions and 153 deletions
@@ -53,10 +53,10 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
public IPage<LawsContactManage> queryPage(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize, public IPage<LawsContactManage> queryPage(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<LawsContactManage> queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap()); QueryWrapper<LawsContactManage> queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap());
if (StringUtils.isNotBlank(lawsContactManage.getContact())){ if (StringUtils.isNotBlank(lawsContactManage.getContact())) {
List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>() List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>()
.like(SysUser::getRealname, lawsContactManage.getContact())); .like(SysUser::getRealname, lawsContactManage.getContact()));
if (userList.isEmpty()){ if (userList.isEmpty()) {
return new Page<>(pageNo, pageSize); return new Page<>(pageNo, pageSize);
} }
queryWrapper.in("contact_id", userList.stream().map(SysUser::getId).collect(Collectors.toList())); queryWrapper.in("contact_id", userList.stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -83,10 +83,10 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
" group_concat(depart_name) as depart_name, group_concat(depart_id) as depart_id, " + " group_concat(depart_name) as depart_name, group_concat(depart_id) as depart_id, " +
"group_concat(engineer_id) as engineer_id, group_concat(leader_id) as leader_id,contact_id "); "group_concat(engineer_id) as engineer_id, group_concat(leader_id) as leader_id,contact_id ");
String contactId = "contact_id"; String contactId = "contact_id";
if (StringUtils.isNotBlank(lawsContactManage.getContact())){ if (StringUtils.isNotBlank(lawsContactManage.getContact())) {
List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>() List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>()
.like(SysUser::getRealname, lawsContactManage.getContact())); .like(SysUser::getRealname, lawsContactManage.getContact()));
if (userList.isEmpty()){ if (userList.isEmpty()) {
return new Page<>(pageNo, pageSize); return new Page<>(pageNo, pageSize);
} }
queryWrapper.in(contactId, userList.stream().map(SysUser::getId).collect(Collectors.toList())); queryWrapper.in(contactId, userList.stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -118,13 +118,19 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
public void add(LawsContactManage lawsContactManage) { public void add(LawsContactManage lawsContactManage) {
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一 // 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>(); LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId()); queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId()); queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId()); queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId());
long l = count(queryLawsContactManage); long l = count(queryLawsContactManage);
if(l > 0){ if (l > 0) {
throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); throw new JeroBootException("部门和联络人匹配关系已存在,请重新选择");
}
queryLawsContactManage.clear();
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
long n = count(queryLawsContactManage);
if (n > 0) {
throw new JeroBootException("已存在相同的联络人");
} }
Date now = new Date(); Date now = new Date();
@@ -143,13 +149,13 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
public void editById(LawsContactManage lawsContactManage) { public void editById(LawsContactManage lawsContactManage) {
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一 // 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>(); LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId()); queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId()); queryLawsContactManage.eq(LawsContactManage::getEngineerId, lawsContactManage.getEngineerId());
queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId()); queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId()); queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
queryLawsContactManage.ne(LawsContactManage::getId,lawsContactManage.getId()); queryLawsContactManage.ne(LawsContactManage::getId, lawsContactManage.getId());
long l = count(queryLawsContactManage); long l = count(queryLawsContactManage);
if(l > 0){ if (l > 0) {
throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在");
} }
Date now = new Date(); Date now = new Date();
@@ -233,7 +239,7 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
@Override @Override
public List<LawsContactManage> queryByDepartIds(String deptIds) { public List<LawsContactManage> queryByDepartIds(String deptIds) {
List<LawsContactManage> lawsContactManageList = new ArrayList<>(); List<LawsContactManage> lawsContactManageList = new ArrayList<>();
if (StringUtils.isNotBlank(deptIds)){ if (StringUtils.isNotBlank(deptIds)) {
List<String> departIdList = Arrays.asList(deptIds.split(",")); List<String> departIdList = Arrays.asList(deptIds.split(","));
lawsContactManageList = list(new LambdaQueryWrapper<LawsContactManage>() lawsContactManageList = list(new LambdaQueryWrapper<LawsContactManage>()
.in(LawsContactManage::getDepartId, departIdList)); .in(LawsContactManage::getDepartId, departIdList));
@@ -165,10 +165,12 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
DateTime date = DateUtil.date(); DateTime date = DateUtil.date();
DateTime theDayBefore = DateUtil.offsetDay(date, 1); DateTime theDayBefore = DateUtil.offsetDay(date, 1);
DateTime theDayAfter = DateUtil.offsetDay(date, -1); DateTime theDayAfter = DateUtil.offsetDay(date, -1);
if (expectedTime.compareTo(theDayAfter)<0){ if (expectedTime.compareTo(theDayAfter) < 0){
lawsEvaluationNotMet.setState(AssessCommon.OVERDUE); lawsEvaluationNotMet.setState(AssessCommon.OVERDUE);
}else if (expectedTime.compareTo(theDayBefore)<0){ }else if (expectedTime.compareTo(theDayBefore) < 0){
lawsEvaluationNotMet.setState(AssessCommon.WARNING); lawsEvaluationNotMet.setState(AssessCommon.WARNING);
}else if (expectedTime.compareTo(theDayBefore) >= 0){
lawsEvaluationNotMet.setState(AssessCommon.TO_BE_RECTIFIED);
} }
} }