耗材字典院内分类功能代码提交
							parent
							
								
									b814e811f5
								
							
						
					
					
						commit
						d74a95f05f
					
				| @ -0,0 +1,165 @@ | |||||||
|  | package com.glxp.api.controller.basic; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.stream.StreamUtil; | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import com.github.pagehelper.PageInfo; | ||||||
|  | import com.glxp.api.common.enums.ResultEnum; | ||||||
|  | import com.glxp.api.common.res.BaseResponse; | ||||||
|  | import com.glxp.api.common.util.ResultVOUtils; | ||||||
|  | import com.glxp.api.dao.basic.BasicHospTypeRelDao; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeEntity; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeRelEntity; | ||||||
|  | import com.glxp.api.entity.basic.UdiEntity; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeFilterRequest; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeRequest; | ||||||
|  | import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||||
|  | import com.glxp.api.res.PageSimpleResponse; | ||||||
|  | import com.glxp.api.res.basic.BasicHospTypeResponse; | ||||||
|  | import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||||
|  | import com.glxp.api.service.basic.BasicHospTypeRelService; | ||||||
|  | import com.glxp.api.service.basic.BasicHospTypeService; | ||||||
|  | import com.glxp.api.util.StreamUtils; | ||||||
|  | import com.glxp.api.util.StringUtils; | ||||||
|  | import com.glxp.api.util.udi.FilterUdiUtils; | ||||||
|  | import org.springframework.validation.BindingResult; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | import org.springframework.web.bind.annotation.PostMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RequestBody; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @RestController | ||||||
|  | public class BasicHospTypeController { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     BasicHospTypeService basicHospTypeService; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     BasicHospTypeRelService basicHospTypeRelService; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/udiwms/basic/hosp/type/filter") | ||||||
|  |     public BaseResponse filterBasicUnitMaintain(BasicHospTypeFilterRequest basicHospTypeFilterRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  |         List<BasicHospTypeEntity> basicHospTypeEntities=basicHospTypeService.filterHospTypeList(basicHospTypeFilterRequest); | ||||||
|  |         PageInfo<BasicHospTypeEntity> pageInfo = new PageInfo<>(basicHospTypeEntities); | ||||||
|  |         PageSimpleResponse<BasicHospTypeEntity> pageSimpleResponse = new PageSimpleResponse<>(); | ||||||
|  |         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         pageSimpleResponse.setList(basicHospTypeEntities); | ||||||
|  | 
 | ||||||
|  |         return ResultVOUtils.success(pageSimpleResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/udiwms/basic/hosp/type/menuList") | ||||||
|  |     public BaseResponse menuList(BasicHospTypeFilterRequest basicHospTypeFilterRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  |         List<BasicHospTypeEntity> basicHospTypeEntities=basicHospTypeService.getMenuList(basicHospTypeFilterRequest); | ||||||
|  | 
 | ||||||
|  |         return ResultVOUtils.success(basicHospTypeEntities); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/basic/hosp/type/save") | ||||||
|  |     public BaseResponse save(@RequestBody  BasicHospTypeRequest basicHospTypeRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         Boolean falg=basicHospTypeService.saveBasicHospType(basicHospTypeRequest); | ||||||
|  |         if(!falg){ | ||||||
|  |             return ResultVOUtils.error(999,"插入失败!"); | ||||||
|  |         } | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/basic/hosp/type/update") | ||||||
|  |     public BaseResponse update(@RequestBody  BasicHospTypeRequest basicHospTypeRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         Boolean falg=basicHospTypeService.updateBasicHospType(basicHospTypeRequest); | ||||||
|  |         if(!falg){ | ||||||
|  |             return ResultVOUtils.error(999,"更新失败!"); | ||||||
|  |         } | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/udiwms/basic/hosp/type/delect") | ||||||
|  |     public BaseResponse delect(BasicHospTypeRequest basicHospTypeRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  |        String msg=basicHospTypeService.delectBasicHospType(basicHospTypeRequest); | ||||||
|  | 
 | ||||||
|  |         if (StringUtils.isNotBlank(msg)){ | ||||||
|  |             return  ResultVOUtils.error(999,msg); | ||||||
|  |         } | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/udiwms/basic/hosp/type/getTree") | ||||||
|  |     public BaseResponse getTree() { | ||||||
|  |         List<BasicHospTypeResponse> basicHospTypeEntities=basicHospTypeService.getTreeList(); | ||||||
|  |         return ResultVOUtils.success(basicHospTypeEntities); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/basic/hosp/type/bindRel") | ||||||
|  |     public BaseResponse saveRel(@RequestBody  BasicHospTypeRequest basicHospTypeRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         Boolean falg=basicHospTypeService.bindHospProduct(basicHospTypeRequest); | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/udiwms/basic/hosp/type/bindList") | ||||||
|  |     public BaseResponse bindList(FilterUdiRelRequest filterUdiRelRequest) { | ||||||
|  | 
 | ||||||
|  |         filterUdiRelRequest.setDiType(1); | ||||||
|  |         List<UdiRelevanceResponse> udiRelevanceResponses = basicHospTypeService.filterUdiGp(filterUdiRelRequest); | ||||||
|  |         //查询分类关联表,存在的制灰
 | ||||||
|  |         List<BasicHospTypeRelEntity> basicHospTypeRelEntityList=basicHospTypeRelService.getBasicHospTypeRelList(filterUdiRelRequest.getBindId()); | ||||||
|  |         for (UdiRelevanceResponse obj:udiRelevanceResponses){ | ||||||
|  |             for (BasicHospTypeRelEntity obj2:basicHospTypeRelEntityList){ | ||||||
|  |                 if(obj2.getRelId().equals(String.valueOf(obj.getId()))){ | ||||||
|  |                     obj.setBindCheck(true); | ||||||
|  |                     break; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         PageInfo<UdiRelevanceResponse> pageInfo = new PageInfo<>(udiRelevanceResponses); | ||||||
|  |         PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>(); | ||||||
|  |         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         pageSimpleResponse.setList(udiRelevanceResponses); | ||||||
|  |         return ResultVOUtils.success(pageSimpleResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @PostMapping("/udiwms/basic/hosp/type/unbindRel") | ||||||
|  |     public BaseResponse unbindRel(@RequestBody  BasicHospTypeRequest basicHospTypeRequest, BindingResult bindingResult) { | ||||||
|  | 
 | ||||||
|  |         if (bindingResult.hasErrors()) { | ||||||
|  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         Boolean falg=basicHospTypeService.unbindHospProduct(basicHospTypeRequest); | ||||||
|  |         return ResultVOUtils.success(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -1,19 +0,0 @@ | |||||||
| package com.glxp.api.dao.basic; |  | ||||||
| 
 |  | ||||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; |  | ||||||
| import com.glxp.api.entity.basic.BasicUdirelTypeEntity; |  | ||||||
| import org.apache.ibatis.annotations.Param; |  | ||||||
| 
 |  | ||||||
| import java.util.List; |  | ||||||
| 
 |  | ||||||
| public interface BasicUdirelTypeDao extends BaseMapper<BasicUdirelTypeEntity> { |  | ||||||
|     int updateBatch(List<BasicUdirelTypeEntity> list); |  | ||||||
| 
 |  | ||||||
|     int updateBatchSelective(List<BasicUdirelTypeEntity> list); |  | ||||||
| 
 |  | ||||||
|     int batchInsert(@Param("list") List<BasicUdirelTypeEntity> list); |  | ||||||
| 
 |  | ||||||
|     int insertOrUpdate(BasicUdirelTypeEntity record); |  | ||||||
| 
 |  | ||||||
|     int insertOrUpdateSelective(BasicUdirelTypeEntity record); |  | ||||||
| } |  | ||||||
| @ -0,0 +1,13 @@ | |||||||
|  | package com.glxp.api.req.basic; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.res.basic.BasicErpUnitsResponse; | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class BasicHospTypeFilterRequest extends ListPageRequest { | ||||||
|  | 
 | ||||||
|  |   private  String name; | ||||||
|  | } | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | package com.glxp.api.req.basic; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.basic.UdiProductEntity; | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class BasicHospTypeRequest{ | ||||||
|  | 
 | ||||||
|  |   private  Integer id; | ||||||
|  |   private  String code; | ||||||
|  |   private  String parentCode; | ||||||
|  |   private  String name; | ||||||
|  |   private String remark; | ||||||
|  |   List<String> ids; | ||||||
|  | } | ||||||
| @ -0,0 +1,26 @@ | |||||||
|  | package com.glxp.api.res.basic; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | public class BasicHospTypeResponse { | ||||||
|  | 
 | ||||||
|  |     private Integer id; | ||||||
|  |     private String code; | ||||||
|  |     private String parentCode; | ||||||
|  |     private String name; | ||||||
|  |     private String remark; | ||||||
|  |     private Date createTime; | ||||||
|  |     private Date updateTime; | ||||||
|  |     private String createUser; | ||||||
|  |     private String updateUser; | ||||||
|  |     private String label; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,17 @@ | |||||||
|  | package com.glxp.api.service.basic; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeEntity; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeRelEntity; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeFilterRequest; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeRequest; | ||||||
|  | import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||||
|  | import com.glxp.api.res.basic.BasicHospTypeResponse; | ||||||
|  | import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | public interface BasicHospTypeRelService { | ||||||
|  | 
 | ||||||
|  |    List<BasicHospTypeRelEntity> getBasicHospTypeRelList(String code); | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | package com.glxp.api.service.basic; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeEntity; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeFilterRequest; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeRequest; | ||||||
|  | import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||||
|  | import com.glxp.api.res.basic.BasicHospTypeResponse; | ||||||
|  | import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | public interface BasicHospTypeService { | ||||||
|  | 
 | ||||||
|  |     List<BasicHospTypeEntity> filterHospTypeList(BasicHospTypeFilterRequest basicHospTypeFilterRequest); | ||||||
|  | 
 | ||||||
|  |     List<BasicHospTypeEntity> getMenuList(BasicHospTypeFilterRequest basicHospTypeFilterRequest); | ||||||
|  | 
 | ||||||
|  |     Boolean saveBasicHospType(BasicHospTypeRequest basicHospTypeRequest); | ||||||
|  | 
 | ||||||
|  |     boolean updateBasicHospType(BasicHospTypeRequest basicHospTypeRequest); | ||||||
|  | 
 | ||||||
|  |     String delectBasicHospType(BasicHospTypeRequest basicHospTypeRequest); | ||||||
|  | 
 | ||||||
|  |     List<BasicHospTypeResponse> getTreeList(); | ||||||
|  | 
 | ||||||
|  |     boolean bindHospProduct(BasicHospTypeRequest basicHospTypeRequest); | ||||||
|  | 
 | ||||||
|  |     boolean unbindHospProduct(BasicHospTypeRequest basicHospTypeRequest); | ||||||
|  | 
 | ||||||
|  |     List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,46 @@ | |||||||
|  | package com.glxp.api.service.basic.impl; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.dao.basic.BasicHospTypeDao; | ||||||
|  | import com.glxp.api.dao.basic.BasicHospTypeRelDao; | ||||||
|  | import com.glxp.api.dao.basic.UdiRelevanceDao; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeEntity; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeRelEntity; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeFilterRequest; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeRequest; | ||||||
|  | import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||||
|  | import com.glxp.api.res.basic.BasicHospTypeResponse; | ||||||
|  | import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||||
|  | import com.glxp.api.service.auth.CustomerService; | ||||||
|  | import com.glxp.api.service.basic.BasicHospTypeRelService; | ||||||
|  | import com.glxp.api.service.basic.BasicHospTypeService; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Service | ||||||
|  | public class BasicHospTypeRelServiceImpl implements BasicHospTypeRelService { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     BasicHospTypeRelDao basicHospTypeRelDao; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<BasicHospTypeRelEntity> getBasicHospTypeRelList(String code) { | ||||||
|  |         List<BasicHospTypeRelEntity> basicHospTypeRelEntityList=new ArrayList<>(); | ||||||
|  |         QueryWrapper<BasicHospTypeRelEntity> ew=new QueryWrapper<>(); | ||||||
|  |         if(StrUtil.isNotEmpty(code)){ | ||||||
|  |             ew.eq("code",code); | ||||||
|  |             basicHospTypeRelEntityList =basicHospTypeRelDao.selectList(ew); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         return basicHospTypeRelEntityList; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,178 @@ | |||||||
|  | package com.glxp.api.service.basic.impl; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.dao.basic.BasicHospTypeDao; | ||||||
|  | import com.glxp.api.dao.basic.BasicHospTypeRelDao; | ||||||
|  | import com.glxp.api.dao.basic.UdiRelevanceDao; | ||||||
|  | import com.glxp.api.entity.basic.BasicCorpEntity; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeEntity; | ||||||
|  | import com.glxp.api.entity.basic.BasicHospTypeRelEntity; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeFilterRequest; | ||||||
|  | import com.glxp.api.req.basic.BasicHospTypeRequest; | ||||||
|  | import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||||
|  | import com.glxp.api.res.basic.BasicHospTypeResponse; | ||||||
|  | import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||||
|  | import com.glxp.api.service.auth.CustomerService; | ||||||
|  | import com.glxp.api.service.basic.BasicHospTypeService; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Service | ||||||
|  | public class BasicHospTypeServiceImpl implements BasicHospTypeService { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     BasicHospTypeDao basicHospTypeDao; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     CustomerService customerService; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     BasicHospTypeRelDao basicHospTypeRelDao; | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     UdiRelevanceDao udiRelevanceDao; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<BasicHospTypeEntity> filterHospTypeList(BasicHospTypeFilterRequest basicHospTypeFilterRequest) { | ||||||
|  |         if (basicHospTypeFilterRequest == null) { | ||||||
|  |             return Collections.emptyList(); | ||||||
|  |         } | ||||||
|  |         if (basicHospTypeFilterRequest.getPage() != null) { | ||||||
|  |             int offset = (basicHospTypeFilterRequest.getPage() - 1) * basicHospTypeFilterRequest.getLimit(); | ||||||
|  |             PageHelper.offsetPage(offset, basicHospTypeFilterRequest.getLimit()); | ||||||
|  |         } | ||||||
|  |         QueryWrapper<BasicHospTypeEntity> ew=new QueryWrapper<>(); | ||||||
|  |         if (StrUtil.isNotEmpty(basicHospTypeFilterRequest.getName())){ | ||||||
|  |             ew.like("name",basicHospTypeFilterRequest.getName()); | ||||||
|  |         } | ||||||
|  |         List<BasicHospTypeEntity> data = basicHospTypeDao.selectList(ew); | ||||||
|  |         return data; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<BasicHospTypeEntity> getMenuList(BasicHospTypeFilterRequest basicHospTypeFilterRequest) { | ||||||
|  |         QueryWrapper<BasicHospTypeEntity> ew=new QueryWrapper<>(); | ||||||
|  |         List<BasicHospTypeEntity> data = basicHospTypeDao.selectList(ew); | ||||||
|  |         return data; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public Boolean saveBasicHospType(BasicHospTypeRequest basicHospTypeRequest) { | ||||||
|  |         boolean falg=true; | ||||||
|  |         BasicHospTypeEntity basicHospTypeEntity=new BasicHospTypeEntity(); | ||||||
|  |         basicHospTypeEntity.setCreateTime(new Date()); | ||||||
|  |         basicHospTypeEntity.setUpdateTime(new Date()); | ||||||
|  |         basicHospTypeEntity.setName(basicHospTypeRequest.getName()); | ||||||
|  |         basicHospTypeEntity.setParentCode(basicHospTypeRequest.getParentCode()); | ||||||
|  |         basicHospTypeEntity.setRemark(basicHospTypeRequest.getRemark()); | ||||||
|  |         Long userId=customerService.getUserId(); | ||||||
|  |         basicHospTypeEntity.setCreateUser(userId+""); | ||||||
|  |         basicHospTypeEntity.setUpdateUser(userId+""); | ||||||
|  |         //获取数据库最大的code
 | ||||||
|  |         QueryWrapper<BasicHospTypeEntity> ew=new QueryWrapper<>(); | ||||||
|  |         ew.select("max(code) as code"); | ||||||
|  |         BasicHospTypeEntity code=basicHospTypeDao.selectOne(ew); | ||||||
|  |         basicHospTypeEntity.setCode(Integer.valueOf(code.getCode())+1+""); | ||||||
|  |         int count=basicHospTypeDao.insert(basicHospTypeEntity); | ||||||
|  |         if(count==0){ | ||||||
|  |             falg=false; | ||||||
|  |         } | ||||||
|  |         return falg; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean updateBasicHospType(BasicHospTypeRequest basicHospTypeRequest) { | ||||||
|  |         boolean falg=true; | ||||||
|  |         BasicHospTypeEntity basicHospTypeEntity=new BasicHospTypeEntity(); | ||||||
|  |         basicHospTypeEntity.setId(basicHospTypeRequest.getId()); | ||||||
|  |         basicHospTypeEntity.setCreateTime(new Date()); | ||||||
|  |         basicHospTypeEntity.setUpdateTime(new Date()); | ||||||
|  |         basicHospTypeEntity.setName(basicHospTypeRequest.getName()); | ||||||
|  |         basicHospTypeEntity.setParentCode(basicHospTypeRequest.getParentCode()); | ||||||
|  |         basicHospTypeEntity.setRemark(basicHospTypeRequest.getRemark()); | ||||||
|  |         Long userId=customerService.getUserId(); | ||||||
|  |         basicHospTypeEntity.setCreateUser(userId+""); | ||||||
|  |         basicHospTypeEntity.setUpdateUser(userId+""); | ||||||
|  |         int count=basicHospTypeDao.updateById(basicHospTypeEntity); | ||||||
|  |         if(count==0){ | ||||||
|  |             falg=false; | ||||||
|  |         } | ||||||
|  |         return falg; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public String delectBasicHospType(BasicHospTypeRequest basicHospTypeRequest) { | ||||||
|  | 
 | ||||||
|  |         //查询有没有自己的子集
 | ||||||
|  |         QueryWrapper<BasicHospTypeEntity> ew=new QueryWrapper<>(); | ||||||
|  |         ew.eq("parentCode",basicHospTypeRequest.getCode()); | ||||||
|  |         Long count=basicHospTypeDao.selectCount(ew); | ||||||
|  |         if(count>0){ | ||||||
|  |             return "请先删除该节点底下的数据!"; | ||||||
|  |         } | ||||||
|  |         //查询有没有产品绑定
 | ||||||
|  |         QueryWrapper<BasicHospTypeRelEntity> ew2=new QueryWrapper<>(); | ||||||
|  |         ew2.eq("code",basicHospTypeRequest.getCode()); | ||||||
|  |         count=basicHospTypeRelDao.selectCount(ew2); | ||||||
|  |         if(count>0){ | ||||||
|  |             return "该节点还存在产品,请先删除!"; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         basicHospTypeDao.deleteById(basicHospTypeRequest.getId()); | ||||||
|  | 
 | ||||||
|  |         return ""; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<BasicHospTypeResponse> getTreeList() { | ||||||
|  |         return basicHospTypeDao.getTreeList(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean bindHospProduct(BasicHospTypeRequest basicHospTypeRequest) { | ||||||
|  | 
 | ||||||
|  |         List<BasicHospTypeRelEntity> basicHospTypeRelEntityList=new ArrayList<>(); | ||||||
|  |         for (String obj:basicHospTypeRequest.getIds()){ | ||||||
|  |             BasicHospTypeRelEntity basicHospTypeRelEntity=new BasicHospTypeRelEntity(); | ||||||
|  |             basicHospTypeRelEntity.setCode(basicHospTypeRequest.getCode()); | ||||||
|  |             basicHospTypeRelEntity.setRelId(obj); | ||||||
|  |             basicHospTypeRelEntityList.add(basicHospTypeRelEntity); | ||||||
|  |         } | ||||||
|  |        basicHospTypeRelDao.batchInsert(basicHospTypeRelEntityList); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean unbindHospProduct(BasicHospTypeRequest basicHospTypeRequest) { | ||||||
|  | 
 | ||||||
|  |         QueryWrapper<BasicHospTypeRelEntity> ew=new QueryWrapper<>(); | ||||||
|  |         ew.eq("code",basicHospTypeRequest.getCode()); | ||||||
|  |         ew.in("relId",basicHospTypeRequest.getIds()); | ||||||
|  |         basicHospTypeRelDao.delete(ew); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest) { | ||||||
|  |         if (filterUdiRelRequest == null) { | ||||||
|  |             return Collections.emptyList(); | ||||||
|  |         } | ||||||
|  |         if (filterUdiRelRequest.getPage() != null) { | ||||||
|  |             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||||
|  |             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiGp(filterUdiRelRequest); | ||||||
|  |         return data; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -1,261 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |  | ||||||
| <mapper namespace="com.glxp.api.dao.basic.BasicUdirelTypeDao"> |  | ||||||
|   <resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicUdirelTypeEntity"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     <!--@Table basic_udirel_type--> |  | ||||||
|     <id column="id" jdbcType="INTEGER" property="id" /> |  | ||||||
|     <result column="pId" jdbcType="INTEGER" property="pId" /> |  | ||||||
|     <result column="name" jdbcType="VARCHAR" property="name" /> |  | ||||||
|     <result column="remark" jdbcType="VARCHAR" property="remark" /> |  | ||||||
|     <result column="createTime" jdbcType="TIMESTAMP" property="createTime" /> |  | ||||||
|     <result column="updateTime" jdbcType="VARCHAR" property="updateTime" /> |  | ||||||
|     <result column="createUser" jdbcType="VARCHAR" property="createUser" /> |  | ||||||
|     <result column="updateUser" jdbcType="VARCHAR" property="updateUser" /> |  | ||||||
|   </resultMap> |  | ||||||
|   <sql id="Base_Column_List"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     id, pId, `name`, remark, createTime, updateTime, `createUser`, updateUser |  | ||||||
|   </sql> |  | ||||||
|   <update id="updateBatch" parameterType="java.util.List"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     update basic_udirel_type |  | ||||||
|     <trim prefix="set" suffixOverrides=","> |  | ||||||
|       <trim prefix="pId = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.pId,jdbcType=INTEGER} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="`name` = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.name,jdbcType=VARCHAR} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="remark = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="createTime = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="updateTime = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=VARCHAR} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="`createUser` = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.createUser,jdbcType=VARCHAR} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="updateUser = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           when id = #{item.id,jdbcType=INTEGER} then #{item.updateUser,jdbcType=VARCHAR} |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|     </trim> |  | ||||||
|     where id in |  | ||||||
|     <foreach close=")" collection="list" item="item" open="(" separator=", "> |  | ||||||
|       #{item.id,jdbcType=INTEGER} |  | ||||||
|     </foreach> |  | ||||||
|   </update> |  | ||||||
|   <update id="updateBatchSelective" parameterType="java.util.List"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     update basic_udirel_type |  | ||||||
|     <trim prefix="set" suffixOverrides=","> |  | ||||||
|       <trim prefix="pId = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.pId != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.pId,jdbcType=INTEGER} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="`name` = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.name != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.name,jdbcType=VARCHAR} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="remark = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.remark != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="createTime = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.createTime != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="updateTime = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.updateTime != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=VARCHAR} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="`createUser` = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.createUser != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.createUser,jdbcType=VARCHAR} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|       <trim prefix="updateUser = case" suffix="end,"> |  | ||||||
|         <foreach collection="list" index="index" item="item"> |  | ||||||
|           <if test="item.updateUser != null"> |  | ||||||
|             when id = #{item.id,jdbcType=INTEGER} then #{item.updateUser,jdbcType=VARCHAR} |  | ||||||
|           </if> |  | ||||||
|         </foreach> |  | ||||||
|       </trim> |  | ||||||
|     </trim> |  | ||||||
|     where id in |  | ||||||
|     <foreach close=")" collection="list" item="item" open="(" separator=", "> |  | ||||||
|       #{item.id,jdbcType=INTEGER} |  | ||||||
|     </foreach> |  | ||||||
|   </update> |  | ||||||
|   <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     insert into basic_udirel_type |  | ||||||
|     (pId, `name`, remark, createTime, updateTime, `createUser`, updateUser) |  | ||||||
|     values |  | ||||||
|     <foreach collection="list" item="item" separator=","> |  | ||||||
|       (#{item.pId,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR},  |  | ||||||
|         #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},  |  | ||||||
|         #{item.updateUser,jdbcType=VARCHAR}) |  | ||||||
|     </foreach> |  | ||||||
|   </insert> |  | ||||||
|   <insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.basic.BasicUdirelTypeEntity" useGeneratedKeys="true"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     insert into basic_udirel_type |  | ||||||
|     <trim prefix="(" suffix=")" suffixOverrides=","> |  | ||||||
|       <if test="id != null"> |  | ||||||
|         id, |  | ||||||
|       </if> |  | ||||||
|       pId, |  | ||||||
|       `name`, |  | ||||||
|       remark, |  | ||||||
|       createTime, |  | ||||||
|       updateTime, |  | ||||||
|       `createUser`, |  | ||||||
|       updateUser, |  | ||||||
|     </trim> |  | ||||||
|     values |  | ||||||
|     <trim prefix="(" suffix=")" suffixOverrides=","> |  | ||||||
|       <if test="id != null"> |  | ||||||
|         #{id,jdbcType=INTEGER}, |  | ||||||
|       </if> |  | ||||||
|       #{pId,jdbcType=INTEGER}, |  | ||||||
|       #{name,jdbcType=VARCHAR}, |  | ||||||
|       #{remark,jdbcType=VARCHAR}, |  | ||||||
|       #{createTime,jdbcType=TIMESTAMP}, |  | ||||||
|       #{updateTime,jdbcType=VARCHAR}, |  | ||||||
|       #{createUser,jdbcType=VARCHAR}, |  | ||||||
|       #{updateUser,jdbcType=VARCHAR}, |  | ||||||
|     </trim> |  | ||||||
|     on duplicate key update  |  | ||||||
|     <trim suffixOverrides=","> |  | ||||||
|       <if test="id != null"> |  | ||||||
|         id = #{id,jdbcType=INTEGER}, |  | ||||||
|       </if> |  | ||||||
|       pId = #{pId,jdbcType=INTEGER}, |  | ||||||
|       `name` = #{name,jdbcType=VARCHAR}, |  | ||||||
|       remark = #{remark,jdbcType=VARCHAR}, |  | ||||||
|       createTime = #{createTime,jdbcType=TIMESTAMP}, |  | ||||||
|       updateTime = #{updateTime,jdbcType=VARCHAR}, |  | ||||||
|       `createUser` = #{createUser,jdbcType=VARCHAR}, |  | ||||||
|       updateUser = #{updateUser,jdbcType=VARCHAR}, |  | ||||||
|     </trim> |  | ||||||
|   </insert> |  | ||||||
|   <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.basic.BasicUdirelTypeEntity" useGeneratedKeys="true"> |  | ||||||
|     <!--@mbg.generated--> |  | ||||||
|     insert into basic_udirel_type |  | ||||||
|     <trim prefix="(" suffix=")" suffixOverrides=","> |  | ||||||
|       <if test="id != null"> |  | ||||||
|         id, |  | ||||||
|       </if> |  | ||||||
|       <if test="pId != null"> |  | ||||||
|         pId, |  | ||||||
|       </if> |  | ||||||
|       <if test="name != null"> |  | ||||||
|         `name`, |  | ||||||
|       </if> |  | ||||||
|       <if test="remark != null"> |  | ||||||
|         remark, |  | ||||||
|       </if> |  | ||||||
|       <if test="createTime != null"> |  | ||||||
|         createTime, |  | ||||||
|       </if> |  | ||||||
|       <if test="updateTime != null"> |  | ||||||
|         updateTime, |  | ||||||
|       </if> |  | ||||||
|       <if test="createUser != null"> |  | ||||||
|         `createUser`, |  | ||||||
|       </if> |  | ||||||
|       <if test="updateUser != null"> |  | ||||||
|         updateUser, |  | ||||||
|       </if> |  | ||||||
|     </trim> |  | ||||||
|     values |  | ||||||
|     <trim prefix="(" suffix=")" suffixOverrides=","> |  | ||||||
|       <if test="id != null"> |  | ||||||
|         #{id,jdbcType=INTEGER}, |  | ||||||
|       </if> |  | ||||||
|       <if test="pId != null"> |  | ||||||
|         #{pId,jdbcType=INTEGER}, |  | ||||||
|       </if> |  | ||||||
|       <if test="name != null"> |  | ||||||
|         #{name,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="remark != null"> |  | ||||||
|         #{remark,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="createTime != null"> |  | ||||||
|         #{createTime,jdbcType=TIMESTAMP}, |  | ||||||
|       </if> |  | ||||||
|       <if test="updateTime != null"> |  | ||||||
|         #{updateTime,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="createUser != null"> |  | ||||||
|         #{createUser,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="updateUser != null"> |  | ||||||
|         #{updateUser,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|     </trim> |  | ||||||
|     on duplicate key update  |  | ||||||
|     <trim suffixOverrides=","> |  | ||||||
|       <if test="id != null"> |  | ||||||
|         id = #{id,jdbcType=INTEGER}, |  | ||||||
|       </if> |  | ||||||
|       <if test="pId != null"> |  | ||||||
|         pId = #{pId,jdbcType=INTEGER}, |  | ||||||
|       </if> |  | ||||||
|       <if test="name != null"> |  | ||||||
|         `name` = #{name,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="remark != null"> |  | ||||||
|         remark = #{remark,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="createTime != null"> |  | ||||||
|         createTime = #{createTime,jdbcType=TIMESTAMP}, |  | ||||||
|       </if> |  | ||||||
|       <if test="updateTime != null"> |  | ||||||
|         updateTime = #{updateTime,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="createUser != null"> |  | ||||||
|         `createUser` = #{createUser,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|       <if test="updateUser != null"> |  | ||||||
|         updateUser = #{updateUser,jdbcType=VARCHAR}, |  | ||||||
|       </if> |  | ||||||
|     </trim> |  | ||||||
|   </insert> |  | ||||||
| </mapper> |  | ||||||
					Loading…
					
					
				
		Reference in New Issue