机构
This commit is contained in:
parent
f539d7628e
commit
ecc349d213
@ -21,6 +21,14 @@ public interface AgencyCategoryMapper {
|
|||||||
*/
|
*/
|
||||||
AgencyCategory selectAgencyCategoryById(Long id);
|
AgencyCategory selectAgencyCategoryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询机构类别
|
||||||
|
*
|
||||||
|
* @param parentCategoryId 机构类别主键
|
||||||
|
* @return 机构类别
|
||||||
|
*/
|
||||||
|
AgencyCategory selectAgencyCategoryByParentCategoryId(Long parentCategoryId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询机构类别列表
|
* 查询机构类别列表
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
package com.xinelu.manage.service.agencycategory.impl;
|
package com.xinelu.manage.service.agencycategory.impl;
|
||||||
|
|
||||||
import com.xinelu.common.utils.DateUtils;
|
|
||||||
import com.xinelu.common.utils.SecurityUtils;
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
import com.xinelu.common.utils.StringUtils;
|
import com.xinelu.common.utils.StringUtils;
|
||||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
|
||||||
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
|
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
|
||||||
import com.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper;
|
import com.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper;
|
||||||
import com.xinelu.manage.service.agencycategory.IAgencyCategoryService;
|
import com.xinelu.manage.service.agencycategory.IAgencyCategoryService;
|
||||||
@ -61,8 +59,9 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertAgencyCategory(AgencyCategory agencyCategory) {
|
public int insertAgencyCategory(AgencyCategory agencyCategory) {
|
||||||
if (Objects.isNull(agencyCategory.getCategoryLevel()) || agencyCategory.getCategoryLevel().equals(1)) {
|
if (Objects.nonNull(agencyCategory.getParentCategoryId())) {
|
||||||
agencyCategory.setParentCategoryId(null);
|
AgencyCategory parentAgencyCategory = agencyCategoryMapper.selectAgencyCategoryByParentCategoryId(agencyCategory.getParentCategoryId());
|
||||||
|
agencyCategory.setCategoryLevel((parentAgencyCategory.getCategoryLevel() == null ? 0 : parentAgencyCategory.getCategoryLevel()) + 1);
|
||||||
}
|
}
|
||||||
agencyCategory.setCreateTime(LocalDateTime.now());
|
agencyCategory.setCreateTime(LocalDateTime.now());
|
||||||
agencyCategory.setCreateBy(SecurityUtils.getUsername());
|
agencyCategory.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
|||||||
@ -87,9 +87,9 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
|||||||
return AjaxResult.error("新增专病路径信息失败,请联系管理员!");
|
return AjaxResult.error("新增专病路径信息失败,请联系管理员!");
|
||||||
}
|
}
|
||||||
List<SpecialDiseaseRoutePackage> specialDiseaseRoutePackages = new ArrayList<>();
|
List<SpecialDiseaseRoutePackage> specialDiseaseRoutePackages = new ArrayList<>();
|
||||||
SpecialDiseaseRoutePackage routePackage = new SpecialDiseaseRoutePackage();
|
|
||||||
if (CollectionUtils.isNotEmpty(specialDiseaseRoute.getRoutePackageList())) {
|
if (CollectionUtils.isNotEmpty(specialDiseaseRoute.getRoutePackageList())) {
|
||||||
for (SpecialDiseaseRoutePackage specialDiseaseRoutePackage : specialDiseaseRoute.getRoutePackageList()) {
|
for (SpecialDiseaseRoutePackage specialDiseaseRoutePackage : specialDiseaseRoute.getRoutePackageList()) {
|
||||||
|
SpecialDiseaseRoutePackage routePackage = new SpecialDiseaseRoutePackage();
|
||||||
specialDiseaseRoutePackage.setRouteId(specialDiseaseRoute.getId());
|
specialDiseaseRoutePackage.setRouteId(specialDiseaseRoute.getId());
|
||||||
specialDiseaseRoutePackage.setRouteName(specialDiseaseRoute.getRouteName());
|
specialDiseaseRoutePackage.setRouteName(specialDiseaseRoute.getRouteName());
|
||||||
specialDiseaseRoutePackage.setCreateTime(LocalDateTime.now());
|
specialDiseaseRoutePackage.setCreateTime(LocalDateTime.now());
|
||||||
@ -113,17 +113,22 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) {
|
public AjaxResult updateSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) {
|
||||||
|
int deleteRoutePackageCount = specialDiseaseRoutePackageMapper.deleteSpecialDiseaseRoutePackageByRouteId(specialDiseaseRoute.getId());
|
||||||
|
if (deleteRoutePackageCount < 0) {
|
||||||
|
return AjaxResult.error("修改专病路径信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
||||||
specialDiseaseRoute.setUpdateBy(SecurityUtils.getUsername());
|
specialDiseaseRoute.setUpdateBy(SecurityUtils.getUsername());
|
||||||
specialDiseaseRoute.setId(specialDiseaseRoute.getSpecialDiseaseRouteId());
|
|
||||||
int updateRouteCount = specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute);
|
int updateRouteCount = specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute);
|
||||||
if (updateRouteCount < 0) {
|
if (updateRouteCount < 0) {
|
||||||
return AjaxResult.error("修改专病路径信息失败,请联系管理员!");
|
return AjaxResult.error("修改专病路径信息失败,请联系管理员!");
|
||||||
}
|
}
|
||||||
List<SpecialDiseaseRoutePackage> specialDiseaseRoutePackages = new ArrayList<>();
|
List<SpecialDiseaseRoutePackage> specialDiseaseRoutePackages = new ArrayList<>();
|
||||||
SpecialDiseaseRoutePackage routePackage = new SpecialDiseaseRoutePackage();
|
|
||||||
if (CollectionUtils.isNotEmpty(specialDiseaseRoute.getRoutePackageList())) {
|
if (CollectionUtils.isNotEmpty(specialDiseaseRoute.getRoutePackageList())) {
|
||||||
for (SpecialDiseaseRoutePackageVO specialDiseaseRoutePackage : specialDiseaseRoute.getRoutePackageList()) {
|
for (SpecialDiseaseRoutePackageVO specialDiseaseRoutePackage : specialDiseaseRoute.getRoutePackageList()) {
|
||||||
|
SpecialDiseaseRoutePackage routePackage = new SpecialDiseaseRoutePackage();
|
||||||
|
specialDiseaseRoutePackage.setRouteId(specialDiseaseRoute.getId());
|
||||||
|
specialDiseaseRoutePackage.setRouteName(specialDiseaseRoute.getRouteName());
|
||||||
specialDiseaseRoutePackage.setUpdateTime(LocalDateTime.now());
|
specialDiseaseRoutePackage.setUpdateTime(LocalDateTime.now());
|
||||||
specialDiseaseRoutePackage.setUpdateBy(SecurityUtils.getUsername());
|
specialDiseaseRoutePackage.setUpdateBy(SecurityUtils.getUsername());
|
||||||
BeanUtils.copyBeanProp(routePackage, specialDiseaseRoutePackage);
|
BeanUtils.copyBeanProp(routePackage, specialDiseaseRoutePackage);
|
||||||
@ -134,10 +139,6 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
|||||||
return AjaxResult.error("修改专病路径信息失败,请联系管理员!");
|
return AjaxResult.error("修改专病路径信息失败,请联系管理员!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int deleteRoutePackageCount = specialDiseaseRoutePackageMapper.deleteSpecialDiseaseRoutePackageByRouteId(specialDiseaseRoute.getSpecialDiseaseRouteId());
|
|
||||||
if (deleteRoutePackageCount < 0) {
|
|
||||||
return AjaxResult.error("修改专病路径信息失败,请联系管理员!");
|
|
||||||
}
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,6 +67,12 @@
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAgencyCategoryByParentCategoryId"
|
||||||
|
resultType="com.xinelu.manage.domain.agencycategory.AgencyCategory">
|
||||||
|
<include refid="selectAgencyCategoryVo"/>
|
||||||
|
where parent_category_id = #{parentCategoryId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertAgencyCategory" parameterType="AgencyCategory" useGeneratedKeys="true"
|
<insert id="insertAgencyCategory" parameterType="AgencyCategory" useGeneratedKeys="true"
|
||||||
keyProperty="id">
|
keyProperty="id">
|
||||||
insert into agency_category
|
insert into agency_category
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user