Commit 93a37664 authored by “xuhd”'s avatar “xuhd”

问题83、护理机构添加后默认加载48项配置,服务方案查询中服务方案配置默认显示48项选择

parent 415c5929
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvOrganProjectMapper extends BaseMapper<ChSrvOrganProject> {
}
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.disable.ChServiceTypeDetailed;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ServiceTypeDetailedMapper extends BaseMapper<ChServiceTypeDetailed> {
}
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.disable.ChServiceType;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ServiceTypeMapper extends BaseMapper<ChServiceType> {
}
package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
public interface ChSrvOrganProjectService extends IService<ChSrvOrganProject> {
}
package com.hungraim.ltc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.dao.ChSrvOrganProjectMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import com.hungraim.ltc.service.ChSrvOrganProjectService;
import org.springframework.stereotype.Service;
@Service
public class ChSrvOrganProjectServiceImpl extends ServiceImpl<ChSrvOrganProjectMapper, ChSrvOrganProject> implements ChSrvOrganProjectService {
}
......@@ -2,18 +2,24 @@ package com.hungraim.ltc.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvOrganType;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndSrvOrganLevel;
import com.hungraim.ltc.pojo.entity.disable.ChServiceType;
import com.hungraim.ltc.pojo.entity.disable.ChServiceTypeDetailed;
import com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan;
import com.hungraim.ltc.pojo.entity.riskLevel.ChSrvorganRiskLevel;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import com.hungraim.ltc.pojo.vo.disable.ChServiceTypeVo;
import com.hungraim.ltc.pojo.vo.disable.SrvModeVo;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganListVo;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.pojo.vo.system.SrvOrganVo;
import com.hungraim.ltc.service.ChSrvOrganProjectService;
import com.hungraim.ltc.service.OrganService;
import com.hungraim.ltc.service.SrvOrganService;
import com.hungraim.ltc.util.AttachType;
......@@ -22,6 +28,7 @@ import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -48,6 +55,12 @@ public class SrvOrganServiceImpl implements SrvOrganService {
private final ChSrvorganRiskLevelMapper chSrvorganRiskLevelMapper;
private final ServiceTypeMapper serviceTypeMapper;
private final ServiceTypeDetailedMapper serviceTypeDetailedMapper;
private final ChSrvOrganProjectMapper chSrvOrganProjectMapper;
private final ChSrvOrganProjectService chSrvOrganProjectService;
@Override
public Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName,Long srvOrganId) {
......@@ -129,6 +142,39 @@ public class SrvOrganServiceImpl implements SrvOrganService {
chSrvorganRiskLevel.setStatus(0);
chSrvorganRiskLevel.setFcd(new Date());
chSrvorganRiskLevelMapper.insert(chSrvorganRiskLevel);
//添加48项服务配置
//1、查询所有的服务配置
List<ChServiceType> list = serviceTypeMapper.selectList(new QueryWrapper<>());
List<ChServiceTypeVo> chServiceTypeVoList = new ArrayList<ChServiceTypeVo>();
for(ChServiceType chServiceType : list){
if(chServiceType.getParaId() == 0L){
ChServiceTypeVo chServiceTypeVo = new ChServiceTypeVo();
chServiceTypeVo.setServiceTypeId(chServiceType.getServiceTypeId());
chServiceTypeVo.setServiceTypeName(chServiceType.getServiceTypeName());
QueryWrapper<ChServiceTypeDetailed> wrapper = new QueryWrapper<ChServiceTypeDetailed>();
wrapper.eq("para_id", chServiceType.getServiceTypeId());
List<ChServiceTypeDetailed> detailedList = serviceTypeDetailedMapper.selectList(wrapper);
chServiceTypeVo.setList(detailedList);
chServiceTypeVoList.add(chServiceTypeVo);
}
}
Long srvOrganIdL = Long.valueOf(chSrvOrgan.getSrvOrganId());
List<ChSrvOrganProject> chSrvOrganProjectList = new ArrayList<>();
//进行服务处理
chServiceTypeVoList.stream().forEach(chServiceTypeVo->{
chServiceTypeVo.getList().stream().forEach(e->{
ChSrvOrganProject chSrvOrganProject = new ChSrvOrganProject();
chSrvOrganProject.setSrvOrganId(srvOrganIdL);
chSrvOrganProject.setItemName(e.getServiceTypeDetailedId()+"");
chSrvOrganProject.setCategoryType(chServiceTypeVo.getServiceTypeId().shortValue());
chSrvOrganProject.setIsConf(new Short("0"));
chSrvOrganProject.setStatus(new Short("0"));
chSrvOrganProjectList.add(chSrvOrganProject);
});
});
//批量添加内容
chSrvOrganProjectService.saveBatch(chSrvOrganProjectList);
}
}
......
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