| | |
| | | |
| | | //RPC接口--5、按照物资类型获取列表 |
| | | ResultVO<List<EmergencySuppliesTypeRPCResp>> emergencySuppliesList(ContextCacheUser currentUser); |
| | | |
| | | //RPC接口--6、根据ids获取库存数量 |
| | | ResultVO<List<EmergencySuppliesRPCResp>> listCountByIds(ContextCacheUser currentUser,List<Long> ids); |
| | | |
| | | } |
| | |
| | | } |
| | | return new ResultVO<>(ResultCodes.OK,typeRPCRespList); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<EmergencySuppliesRPCResp>> listCountByIds(ContextCacheUser currentUser,List<Long> ids) { |
| | | List<EmergencySuppliesRespDTO> list = (List<EmergencySuppliesRespDTO>)emergencySuppliesService.listCountByIds(currentUser,ids).getData(); |
| | | List<EmergencySuppliesRPCResp> emergencySuppliesRPCRespList = null; |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | emergencySuppliesRPCRespList = BeanCopyUtils.copyBeanList(list, EmergencySuppliesRPCResp.class); |
| | | } |
| | | |
| | | return new ResultVO<>(ResultCodes.OK,emergencySuppliesRPCRespList); |
| | | } |
| | | } |
| | |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesService.emergencySuppliesList(currentUser); |
| | | } |
| | | /** |
| | | * 应急物资-根据ids获取数据(为特殊作业提供数据) |
| | | */ |
| | | @RequestMapping(value = "/listCountByIds",method = RequestMethod.POST) |
| | | public ResultVO<List<EmergencySuppliesRespDTO>> listCountByIds(Authentication authentication,@RequestBody List<Long> ids){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesService.listCountByIds(currentUser,ids); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | SUPPLIES_MAINTAIN_NOT_EXIST("S1006" , "应急物资保养不存在"), |
| | | |
| | | SUPPLIES_PRAM_NULL("S1001" , "应急物资参数不可为空"), |
| | | |
| | | APPROVE_RELATE_ID_NULL("A1001","审批业务类型不可为空"), |
| | | |
| | | APPROVE_RELATE_TYPE_NULL("A1002","审批业务对象不可为空"), |
| | |
| | | List<EmergencySuppliesInfoDetailDO> countEmergencySupplies(Page<EmergencySuppliesInfoDetailDO> page, EmergencySuppliesCountQuery query); |
| | | |
| | | List<EmergencySuppliesInfo> listByNoConditions(@Param("delFlag") Byte delFlag,@Param("status") Byte status); |
| | | |
| | | |
| | | List<EmergencySuppliesInfo> listCountByIds(@Param("ids")List<Long> ids,@Param("delFlag") Byte delFlag,@Param("status") Byte status); |
| | | } |
| | |
| | | import com.gkhy.safePlatform.emergency.model.dto.req.EmergencySuppliesReqDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesDetailRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesPageRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesRespDTO; |
| | | import com.gkhy.safePlatform.emergency.model.dto.resp.EmergencySuppliesTypeRespDTO; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesQuery; |
| | | |
| | |
| | | ResultVO batchDeleteEmergencySupplies( Long[] ids); |
| | | |
| | | ResultVO<List<EmergencySuppliesTypeRespDTO>> emergencySuppliesList(ContextCacheUser currentUser); |
| | | |
| | | ResultVO<List<EmergencySuppliesRespDTO>> listCountByIds(ContextCacheUser currentUser, List<Long> ids); |
| | | } |
| | |
| | | List<EmergencySuppliesInfoDetailDO> countEmergencySupplies(Page<EmergencySuppliesInfoDetailDO> page,EmergencySuppliesCountQuery query); |
| | | |
| | | List<EmergencySuppliesInfo> listByNoConditions(); |
| | | |
| | | List<EmergencySuppliesInfo> listCountByIds(List<Long> ids); |
| | | } |
| | |
| | | package com.gkhy.safePlatform.emergency.service.baseService.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO; |
| | | import com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO; |
| | | import com.gkhy.safePlatform.emergency.enums.EmergencyResultCodes; |
| | | import com.gkhy.safePlatform.emergency.enums.EmergencySuppliesClassificationEnum; |
| | | import com.gkhy.safePlatform.emergency.enums.EmergencySuppliesStatusEnum; |
| | | import com.gkhy.safePlatform.emergency.excepiton.EmergencyException; |
| | | import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery; |
| | | import com.gkhy.safePlatform.emergency.query.db.EmergencySuppliesDBQuery; |
| | | import com.gkhy.safePlatform.emergency.repository.EmergencySuppliesInfoRepository; |
| | |
| | | return baseMapper.listByNoConditions((byte)0,EmergencySuppliesStatusEnum.STATUS_ONE.getCode()); |
| | | } |
| | | |
| | | @Override |
| | | public List<EmergencySuppliesInfo> listCountByIds(List<Long> ids) { |
| | | if(null == ids || ids.size() == 0){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PRAM_NULL); |
| | | } |
| | | return baseMapper.listCountByIds(ids, (byte) 0,EmergencySuppliesStatusEnum.STATUS_ONE.getCode()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return new ResultVO<>(ResultCodes.OK,typeRespDTOList); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<EmergencySuppliesRespDTO>> listCountByIds(ContextCacheUser currentUser, List<Long> ids) { |
| | | if(null == ids || ids.size() == 0 ){ |
| | | throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PRAM_NULL); |
| | | } |
| | | List<EmergencySuppliesInfo> emergencySuppliesInfos = emergencySuppliesInfoService.listCountByIds(ids); |
| | | List<EmergencySuppliesRespDTO> respDTOList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(emergencySuppliesInfos)){ |
| | | respDTOList = BeanCopyUtils.copyBeanList(emergencySuppliesInfos,EmergencySuppliesRespDTO.class); |
| | | } |
| | | return new ResultVO<>(ResultCodes.OK,respDTOList); |
| | | } |
| | | |
| | | private void deleteEmergencySupplies(Long id) { |
| | | //查询是否存在 |
| | | EmergencySuppliesInfoDetailDO emergencySuppliesInfoDetailDO = emergencySuppliesInfoService.selectEmergencySuppliesById(id); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证必填项 |
| | | * @return |
| | |
| | | from emergency_supplies |
| | | where del_flag = #{delFlag} and status = #{status} |
| | | </select> |
| | | <select id="listCountByIds" resultType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo"> |
| | | select id, |
| | | count |
| | | from emergency_supplies |
| | | where del_flag = #{delFlag} and status = #{status} and id in |
| | | <foreach collection="ids" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |