Merge branch 'dev' into 0418_小程序开发

This commit is contained in:
zhangheng 2024-05-08 09:11:14 +08:00
commit b27ecd75f7
4 changed files with 10 additions and 5 deletions

View File

@ -195,7 +195,7 @@ public class Constants {
public static final String TASK_STATUS_CODE = "TSC";
/**
* 任务状态编码
* 机构代码编码
*/
public static final String AGENCY_CODE = "AYC";

View File

@ -27,10 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;

View File

@ -1,7 +1,9 @@
package com.xinelu.manage.service.agencycategory.impl;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
import com.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper;
import com.xinelu.manage.service.agencycategory.IAgencyCategoryService;
@ -28,6 +30,8 @@ import java.util.stream.Collectors;
public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
@Resource
private AgencyCategoryMapper agencyCategoryMapper;
@Resource
private GenerateSystemCodeUtil generateSystemCodeUtil;
/**
* 查询机构类别
@ -65,6 +69,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
}
agencyCategory.setCreateTime(LocalDateTime.now());
agencyCategory.setCreateBy(SecurityUtils.getUsername());
agencyCategory.setCategoryCode(Constants.CATEGORY_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CATEGORY_CODE));
return agencyCategoryMapper.insertAgencyCategory(agencyCategory);
}

View File

@ -124,6 +124,9 @@ public class DepartmentServiceImpl implements IDepartmentService {
*/
@Override
public int updateDepartment(Department department) {
if (Objects.nonNull(department) && Objects.nonNull(department.getId()) && Objects.nonNull(department.getParentDepartmentId()) && department.getId().equals(department.getParentDepartmentId())) {
department.setParentDepartmentId(null);
}
department.setUpdateBy(SecurityUtils.getUsername());
department.setUpdateTime(LocalDateTime.now());
return departmentMapper.updateDepartmentById(department);