Merge remote-tracking branch 'origin/fourthStage' into fourthStage
This commit is contained in:
+157
-151
@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @Description: 联络人管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-10-13
|
||||
* @Date: 2023-10-13
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@@ -37,8 +37,8 @@ import java.util.stream.Collectors;
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageMapper, LawsContactManage> implements ILawsContactManageService {
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -51,50 +51,50 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsContactManage> queryPage(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsContactManage> queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap());
|
||||
if (StringUtils.isNotBlank(lawsContactManage.getContact())){
|
||||
List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>()
|
||||
.like(SysUser::getRealname, lawsContactManage.getContact()));
|
||||
if (userList.isEmpty()){
|
||||
return new Page<>(pageNo, pageSize);
|
||||
}
|
||||
queryWrapper.in("contact_id", userList.stream().map(SysUser::getId).collect(Collectors.toList()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(lawsContactManage.getContact())) {
|
||||
List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>()
|
||||
.like(SysUser::getRealname, lawsContactManage.getContact()));
|
||||
if (userList.isEmpty()) {
|
||||
return new Page<>(pageNo, pageSize);
|
||||
}
|
||||
queryWrapper.in("contact_id", userList.stream().map(SysUser::getId).collect(Collectors.toList()));
|
||||
}
|
||||
Page<LawsContactManage> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsContactManage
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsContactManage> queryPageMerge(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsContactManage> queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap());
|
||||
queryWrapper.select("group_concat(id) as id, group_concat(create_by) as create_by, max(create_time) as create_time, " +
|
||||
"group_concat(update_by) as update_by, max(update_time) as update_time, group_concat(org_code) as org_code," +
|
||||
" 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 ");
|
||||
String contactId = "contact_id";
|
||||
if (StringUtils.isNotBlank(lawsContactManage.getContact())){
|
||||
List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>()
|
||||
.like(SysUser::getRealname, lawsContactManage.getContact()));
|
||||
if (userList.isEmpty()){
|
||||
return new Page<>(pageNo, pageSize);
|
||||
}
|
||||
queryWrapper.in(contactId, userList.stream().map(SysUser::getId).collect(Collectors.toList()));
|
||||
}
|
||||
queryWrapper.groupBy(contactId);
|
||||
Page<LawsContactManage> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsContactManage
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsContactManage> queryPageMerge(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsContactManage> queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap());
|
||||
queryWrapper.select("group_concat(id) as id, group_concat(create_by) as create_by, max(create_time) as create_time, " +
|
||||
"group_concat(update_by) as update_by, max(update_time) as update_time, group_concat(org_code) as org_code," +
|
||||
" 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 ");
|
||||
String contactId = "contact_id";
|
||||
if (StringUtils.isNotBlank(lawsContactManage.getContact())) {
|
||||
List<SysUser> userList = sysUserService.list(new LambdaQueryWrapper<SysUser>()
|
||||
.like(SysUser::getRealname, lawsContactManage.getContact()));
|
||||
if (userList.isEmpty()) {
|
||||
return new Page<>(pageNo, pageSize);
|
||||
}
|
||||
queryWrapper.in(contactId, userList.stream().map(SysUser::getId).collect(Collectors.toList()));
|
||||
}
|
||||
queryWrapper.groupBy(contactId);
|
||||
Page<LawsContactManage> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
@@ -108,24 +108,30 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
|
||||
return list(QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsContactManage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsContactManage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsContactManage lawsContactManage) {
|
||||
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
|
||||
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
|
||||
queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId());
|
||||
long l = count(queryLawsContactManage);
|
||||
if(l > 0){
|
||||
throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在");
|
||||
}
|
||||
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
|
||||
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
|
||||
queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
|
||||
long l = count(queryLawsContactManage);
|
||||
if (l > 0) {
|
||||
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();
|
||||
lawsContactManage.setCreateTime(now);
|
||||
@@ -133,114 +139,114 @@ public class LawsContactManageServiceImpl extends ServiceImpl<LawsContactManageM
|
||||
save(lawsContactManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsContactManage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsContactManage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsContactManage lawsContactManage) {
|
||||
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
|
||||
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
|
||||
queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId());
|
||||
queryLawsContactManage.ne(LawsContactManage::getId,lawsContactManage.getId());
|
||||
long l = count(queryLawsContactManage);
|
||||
if(l > 0){
|
||||
throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在");
|
||||
}
|
||||
Date now = new Date();
|
||||
// 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一
|
||||
LambdaQueryWrapper<LawsContactManage> queryLawsContactManage = new LambdaQueryWrapper<>();
|
||||
queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getEngineerId, lawsContactManage.getEngineerId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId());
|
||||
queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId());
|
||||
queryLawsContactManage.ne(LawsContactManage::getId, lawsContactManage.getId());
|
||||
long l = count(queryLawsContactManage);
|
||||
if (l > 0) {
|
||||
throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在");
|
||||
}
|
||||
Date now = new Date();
|
||||
lawsContactManage.setUpdateTime(now);
|
||||
saveOrUpdate(lawsContactManage);
|
||||
saveOrUpdate(lawsContactManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsContactManage queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findContactUserByDept(String deptId) {
|
||||
LambdaQueryWrapper<LawsContactManage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsContactManage::getDepartId, deptId);
|
||||
List<LawsContactManage> list = list(wrapper);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
String contactUserId = list.get(0).getContactId();
|
||||
SysUser user = sysUserService.getById(contactUserId);
|
||||
// 判断用户是否有效
|
||||
if (user == null) {
|
||||
log.info("部门{}的联络人{}已经被删除", deptId, contactUserId);
|
||||
return null;
|
||||
} else {
|
||||
return contactUserId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String findContactUserByDept(String deptId) {
|
||||
LambdaQueryWrapper<LawsContactManage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsContactManage::getDepartId, deptId);
|
||||
List<LawsContactManage> list = list(wrapper);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
String contactUserId = list.get(0).getContactId();
|
||||
SysUser user = sysUserService.getById(contactUserId);
|
||||
// 判断用户是否有效
|
||||
if (user == null) {
|
||||
log.info("部门{}的联络人{}已经被删除", deptId, contactUserId);
|
||||
return null;
|
||||
} else {
|
||||
return contactUserId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String findStandardEngineerByDept(String deptId) {
|
||||
LambdaQueryWrapper<LawsContactManage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsContactManage::getDepartId, deptId);
|
||||
List<LawsContactManage> list = list(wrapper);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
String engineerId = list.get(0).getEngineerId();
|
||||
SysUser user = sysUserService.getById(engineerId);
|
||||
// 判断用户是否有效
|
||||
if (user == null) {
|
||||
log.info("部门{}的联络人{}已经被删除", deptId, engineerId);
|
||||
return null;
|
||||
} else {
|
||||
return engineerId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String findStandardEngineerByDept(String deptId) {
|
||||
LambdaQueryWrapper<LawsContactManage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsContactManage::getDepartId, deptId);
|
||||
List<LawsContactManage> list = list(wrapper);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
String engineerId = list.get(0).getEngineerId();
|
||||
SysUser user = sysUserService.getById(engineerId);
|
||||
// 判断用户是否有效
|
||||
if (user == null) {
|
||||
log.info("部门{}的联络人{}已经被删除", deptId, engineerId);
|
||||
return null;
|
||||
} else {
|
||||
return engineerId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LawsContactManage> queryByDepartIds(String deptIds) {
|
||||
List<LawsContactManage> lawsContactManageList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(deptIds)){
|
||||
List<String> departIdList = Arrays.asList(deptIds.split(","));
|
||||
lawsContactManageList = list(new LambdaQueryWrapper<LawsContactManage>()
|
||||
.in(LawsContactManage::getDepartId, departIdList));
|
||||
for (LawsContactManage lawsContactManage : lawsContactManageList) {
|
||||
lawsContactManage.setContactIdDictText(sysUserService.dictByIdsOrUserNames(lawsContactManage.getContactId(), ""));
|
||||
}
|
||||
}
|
||||
return lawsContactManageList;
|
||||
}
|
||||
@Override
|
||||
public List<LawsContactManage> queryByDepartIds(String deptIds) {
|
||||
List<LawsContactManage> lawsContactManageList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(deptIds)) {
|
||||
List<String> departIdList = Arrays.asList(deptIds.split(","));
|
||||
lawsContactManageList = list(new LambdaQueryWrapper<LawsContactManage>()
|
||||
.in(LawsContactManage::getDepartId, departIdList));
|
||||
for (LawsContactManage lawsContactManage : lawsContactManageList) {
|
||||
lawsContactManage.setContactIdDictText(sysUserService.dictByIdsOrUserNames(lawsContactManage.getContactId(), ""));
|
||||
}
|
||||
}
|
||||
return lawsContactManageList;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -165,10 +165,12 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
|
||||
DateTime date = DateUtil.date();
|
||||
DateTime theDayBefore = DateUtil.offsetDay(date, 1);
|
||||
DateTime theDayAfter = DateUtil.offsetDay(date, -1);
|
||||
if (expectedTime.compareTo(theDayAfter)<0){
|
||||
if (expectedTime.compareTo(theDayAfter) < 0){
|
||||
lawsEvaluationNotMet.setState(AssessCommon.OVERDUE);
|
||||
}else if (expectedTime.compareTo(theDayBefore)<0){
|
||||
}else if (expectedTime.compareTo(theDayBefore) < 0){
|
||||
lawsEvaluationNotMet.setState(AssessCommon.WARNING);
|
||||
}else if (expectedTime.compareTo(theDayBefore) >= 0){
|
||||
lawsEvaluationNotMet.setState(AssessCommon.TO_BE_RECTIFIED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user