已修改38个文件
已添加14个文件
已删除1个文件
| | |
| | | </parent>--> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.gkhy.safePlatfrom</groupId> |
| | | <artifactId>commons</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | <groupId>com.gkhy.safePlatfrom</groupId> |
| | | <artifactId>equipment-rpc-api</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api; |
| | | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialSpwRPCReq; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeMaterialBsClassifyRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeMaterialClassifyRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeMaterialClassifyStockRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeRfidMaterialDetailRPCRespDto; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface EquipmentRpcAPi { |
| | | /** |
| | | * 物资类型分类 |
| | | */ |
| | | ResultVO<List<SafeMaterialClassifyRPCRespDto>> getMaterialClassifyList(); |
| | | |
| | | /** |
| | | * 根据小类溯源到父类信息 |
| | | * @param smallClassifyIds |
| | | * @return |
| | | */ |
| | | |
| | | ResultVO<List<SafeMaterialBsClassifyRPCRespDto>> getTraceabilityClassifyList(List<Long> smallClassifyIds); |
| | | /** |
| | | * 根据小类溯源到父类信息 列表 |
| | | * @param smallClassifyId |
| | | * @return |
| | | */ |
| | | |
| | | ResultVO<SafeMaterialBsClassifyRPCRespDto> getBigAndSmallClassifyInfo(Long smallClassifyId); |
| | | |
| | | /** |
| | | * 根据小类ids查询物资种类 |
| | | */ |
| | | ResultVO<List<SafeMaterialClassifyRPCRespDto>> getClassifyListByIds(List<Long> ids); |
| | | /** |
| | | * 根据物资种类(小类)获取其库存 |
| | | */ |
| | | ResultVO<List<SafeMaterialClassifyStockRPCRespDto>> getSmallClassifyStockByIds(List<Long> smallClassifyIds); |
| | | |
| | | /** |
| | | * 特殊作业批量出库 |
| | | */ |
| | | ResultVO deliveryBatchSpw(MaterialSpwRPCReq req); |
| | | |
| | | /** |
| | | * 根据rfids获取物资 |
| | | */ |
| | | ResultVO<List<SafeRfidMaterialDetailRPCRespDto>> getListByRfid(List<String> rfids); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api.model.dto.req; |
| | | |
| | | |
| | | public class MaterialSpwDeliveryRPCReq { |
| | | private Integer count; |
| | | |
| | | private Long smallClassifyId; |
| | | |
| | | private Long depId; |
| | | |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api.model.dto.req; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | public class MaterialSpwRPCReq { |
| | | |
| | | private Long claimantId; |
| | | |
| | | private List<MaterialSpwDeliveryRPCReq> deliveryReqList; |
| | | |
| | | public Long getClaimantId() { |
| | | return claimantId; |
| | | } |
| | | |
| | | public void setClaimantId(Long claimantId) { |
| | | this.claimantId = claimantId; |
| | | } |
| | | |
| | | public List<MaterialSpwDeliveryRPCReq> getDeliveryReqList() { |
| | | return deliveryReqList; |
| | | } |
| | | |
| | | public void setDeliveryReqList(List<MaterialSpwDeliveryRPCReq> deliveryReqList) { |
| | | this.deliveryReqList = deliveryReqList; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp; |
| | | |
| | | public class SafeMaterialBsClassifyRPCRespDto { |
| | | private Long smallClassifyId; |
| | | private String smallClassifyName; |
| | | private Long bigClassifyId; |
| | | private String bigClassifyName; |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public String getSmallClassifyName() { |
| | | return smallClassifyName; |
| | | } |
| | | |
| | | public void setSmallClassifyName(String smallClassifyName) { |
| | | this.smallClassifyName = smallClassifyName; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public String getBigClassifyName() { |
| | | return bigClassifyName; |
| | | } |
| | | |
| | | public void setBigClassifyName(String bigClassifyName) { |
| | | this.bigClassifyName = bigClassifyName; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class SafeMaterialClassifyRPCRespDto { |
| | | private Long id; |
| | | private String materialClassifyName; |
| | | |
| | | private Long parentId; |
| | | |
| | | private List<SafeMaterialClassifyRPCRespDto> childList; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getMaterialClassifyName() { |
| | | return materialClassifyName; |
| | | } |
| | | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public List<SafeMaterialClassifyRPCRespDto> getChildList() { |
| | | return childList; |
| | | } |
| | | |
| | | public void setChildList(List<SafeMaterialClassifyRPCRespDto> childList) { |
| | | this.childList = childList; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp; |
| | | |
| | | public class SafeMaterialClassifyStockRPCRespDto { |
| | | private Long smallClassifyId; |
| | | private Long depId; |
| | | private String depName; |
| | | private Integer stockCount; |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public Integer getStockCount() { |
| | | return stockCount; |
| | | } |
| | | |
| | | public void setStockCount(Integer stockCount) { |
| | | this.stockCount = stockCount; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp; |
| | | |
| | | public class SafeRfidMaterialDetailRPCRespDto { |
| | | private Long id; |
| | | private String name; |
| | | |
| | | private Long bigClassifyId; |
| | | |
| | | private Long smallClassifyId; |
| | | |
| | | private Long depId; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.rpc.provider; |
| | | |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.MaterialSpwDeliveryReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.MaterialSpwReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeRfidMaterialDetailDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.EquipmentRpcAPi; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialSpwDeliveryRPCReq; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialSpwRPCReq; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeMaterialBsClassifyRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeMaterialClassifyRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeMaterialClassifyStockRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeRfidMaterialDetailRPCRespDto; |
| | | import com.gkhy.safePlatform.equipment.service.MaterialClassifyService; |
| | | import com.gkhy.safePlatform.equipment.service.SafeMaterialDetailService; |
| | | import org.apache.dubbo.config.annotation.DubboService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @DubboService |
| | | public class EquipmentRpcProvider implements EquipmentRpcAPi { |
| | | @Autowired |
| | | private MaterialClassifyService materialClassifyService; |
| | | @Autowired |
| | | private SafeMaterialDetailService safeMaterialDetailService; |
| | | |
| | | |
| | | public ResultVO<List<SafeMaterialClassifyRPCRespDto>> getMaterialClassifyList(){ |
| | | ResultVO<List<SafeMaterialClassifyRPCRespDto>> resultVO = new ResultVO(ResultCodes.OK); |
| | | List<SafeMaterialClassifyDto> list = materialClassifyService.list(); |
| | | List<SafeMaterialClassifyRPCRespDto> rpcRespList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyDto classifyDto:list) { |
| | | SafeMaterialClassifyRPCRespDto classifyRPCRespDto = new SafeMaterialClassifyRPCRespDto(); |
| | | classifyRPCRespDto.setId(classifyDto.getId()); |
| | | classifyRPCRespDto.setParentId(classifyDto.getParentId()); |
| | | classifyRPCRespDto.setMaterialClassifyName(classifyDto.getMaterialClassifyName()); |
| | | List<SafeMaterialClassifyDto> childList = classifyDto.getChildList(); |
| | | List<SafeMaterialClassifyRPCRespDto> childRPCList = new ArrayList<>(); |
| | | for(SafeMaterialClassifyDto child:childList){ |
| | | SafeMaterialClassifyRPCRespDto childRPCRespDto = new SafeMaterialClassifyRPCRespDto(); |
| | | childRPCRespDto.setId(child.getId()); |
| | | childRPCRespDto.setParentId(child.getParentId()); |
| | | childRPCRespDto.setMaterialClassifyName(child.getMaterialClassifyName()); |
| | | childRPCList.add(childRPCRespDto); |
| | | } |
| | | classifyRPCRespDto.setChildList(childRPCList); |
| | | rpcRespList.add(classifyRPCRespDto); |
| | | |
| | | } |
| | | resultVO.setData(rpcRespList); |
| | | return resultVO; |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<SafeMaterialBsClassifyRPCRespDto>> getTraceabilityClassifyList(List<Long> smallClassifyIds) { |
| | | ResultVO<List<SafeMaterialBsClassifyRPCRespDto>> resultVO = new ResultVO<>(ResultCodes.OK); |
| | | try { |
| | | List<SafeMaterialClassifyDO> list = materialClassifyService.getTraceabilityClassifyList(smallClassifyIds); |
| | | List<SafeMaterialBsClassifyRPCRespDto> classifyRPCRespDtoList= new ArrayList<>(); |
| | | for(SafeMaterialClassifyDO classifyDO:list){ |
| | | SafeMaterialBsClassifyRPCRespDto bsClassifyRPCRespDto = new SafeMaterialBsClassifyRPCRespDto(); |
| | | BeanUtils.copyProperties(classifyDO,bsClassifyRPCRespDto); |
| | | classifyRPCRespDtoList.add(bsClassifyRPCRespDto); |
| | | } |
| | | resultVO.setData(classifyRPCRespDtoList); |
| | | }catch (EquipmentException e){ |
| | | resultVO.setCode(e.getCode()); |
| | | resultVO.setMsg(e.getMessage()); |
| | | }catch (Exception e){ |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); |
| | | |
| | | } |
| | | return resultVO; |
| | | } |
| | | |
| | | public ResultVO<SafeMaterialBsClassifyRPCRespDto> getBigAndSmallClassifyInfo(Long smallClassifyId){ |
| | | ResultVO<SafeMaterialBsClassifyRPCRespDto> resultVO = new ResultVO<>(ResultCodes.OK); |
| | | try { |
| | | SafeMaterialClassifyDO safeMaterialClassifyDO = materialClassifyService.getBigAndSmallClassifyInfo(smallClassifyId); |
| | | SafeMaterialBsClassifyRPCRespDto bsClassifyRPCRespDto = new SafeMaterialBsClassifyRPCRespDto(); |
| | | if(null != safeMaterialClassifyDO){ |
| | | BeanUtils.copyProperties(safeMaterialClassifyDO,bsClassifyRPCRespDto); |
| | | } |
| | | resultVO.setData(bsClassifyRPCRespDto); |
| | | }catch (EquipmentException e){ |
| | | resultVO.setCode(e.getCode()); |
| | | resultVO.setMsg(e.getMessage()); |
| | | }catch (Exception e){ |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); |
| | | |
| | | } |
| | | return resultVO; |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<SafeMaterialClassifyRPCRespDto>> getClassifyListByIds(List<Long> ids) { |
| | | ResultVO<List<SafeMaterialClassifyRPCRespDto>> resultVO = new ResultVO<>(ResultCodes.OK); |
| | | try { |
| | | List<SafeMaterialClassifyDto> listBySmallClassify = materialClassifyService.getClassifyListByIds(ids); |
| | | List<SafeMaterialClassifyRPCRespDto> classifyRPCRespDtoList = new ArrayList<>(); |
| | | for(SafeMaterialClassifyDto classifyDto:listBySmallClassify){ |
| | | SafeMaterialClassifyRPCRespDto classifyRPCRespDto = new SafeMaterialClassifyRPCRespDto(); |
| | | BeanUtils.copyProperties(classifyDto,classifyRPCRespDto); |
| | | classifyRPCRespDtoList.add(classifyRPCRespDto); |
| | | } |
| | | resultVO.setData(classifyRPCRespDtoList); |
| | | }catch (EquipmentException e){ |
| | | resultVO.setCode(e.getCode()); |
| | | resultVO.setMsg(e.getMessage()); |
| | | }catch (Exception e){ |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); |
| | | |
| | | } |
| | | return resultVO; |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<SafeMaterialClassifyStockRPCRespDto>> getSmallClassifyStockByIds(List<Long> smallClassifyIds) { |
| | | ResultVO<List<SafeMaterialClassifyStockRPCRespDto>> resultVO = new ResultVO<>(ResultCodes.OK); |
| | | try { |
| | | List<SafeMaterialClassifyStockDto> smallClassifyStockList = safeMaterialDetailService.getSmallClassifyStockByIds(smallClassifyIds); |
| | | List<SafeMaterialClassifyStockRPCRespDto> classifyRPCRespDtoList = new ArrayList<>(); |
| | | for(SafeMaterialClassifyStockDto classifyStockDto:smallClassifyStockList){ |
| | | SafeMaterialClassifyStockRPCRespDto classifyRPCRespDto = new SafeMaterialClassifyStockRPCRespDto(); |
| | | BeanUtils.copyProperties(classifyStockDto,classifyRPCRespDto); |
| | | classifyRPCRespDtoList.add(classifyRPCRespDto); |
| | | } |
| | | resultVO.setData(classifyRPCRespDtoList); |
| | | }catch (EquipmentException e){ |
| | | resultVO.setCode(e.getCode()); |
| | | resultVO.setMsg(e.getMessage()); |
| | | }catch (Exception e){ |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); |
| | | |
| | | } |
| | | return resultVO; |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO deliveryBatchSpw(MaterialSpwRPCReq req) { |
| | | ResultVO resultVO = new ResultVO<>(ResultCodes.OK); |
| | | MaterialSpwReq materialSpwReq = new MaterialSpwReq(); |
| | | List<MaterialSpwDeliveryReq> list = new ArrayList<>(); |
| | | List<MaterialSpwDeliveryRPCReq> deliveryRPCReqList = req.getDeliveryReqList(); |
| | | if(!CollectionUtils.isEmpty(deliveryRPCReqList)){ |
| | | for (MaterialSpwDeliveryRPCReq deliveryRPCReq:deliveryRPCReqList) { |
| | | MaterialSpwDeliveryReq deliveryReq = new MaterialSpwDeliveryReq(); |
| | | BeanUtils.copyProperties(deliveryRPCReq,deliveryReq); |
| | | list.add(deliveryReq); |
| | | } |
| | | } |
| | | materialSpwReq.setClaimantId(req.getClaimantId()); |
| | | materialSpwReq.setDeliveryReqList(list); |
| | | |
| | | try { |
| | | safeMaterialDetailService.deliveryBatchSpw(materialSpwReq); |
| | | }catch (EquipmentException e){ |
| | | resultVO.setCode(e.getCode()); |
| | | resultVO.setMsg(e.getMessage()); |
| | | }catch (Exception e){ |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); |
| | | } |
| | | return resultVO; |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<List<SafeRfidMaterialDetailRPCRespDto>> getListByRfid(List<String> rfids) { |
| | | ResultVO resultVO = new ResultVO<>(ResultCodes.OK); |
| | | try { |
| | | List<SafeRfidMaterialDetailDto> listByRfids = safeMaterialDetailService.getListByRfids(rfids); |
| | | if(listByRfids.size()>0){ |
| | | List<SafeRfidMaterialDetailRPCRespDto> safeRfidMaterialDetailRPCRespDtos = BeanCopyUtils.copyBeanList(listByRfids, SafeRfidMaterialDetailRPCRespDto.class); |
| | | resultVO.setData(safeRfidMaterialDetailRPCRespDtos); |
| | | } |
| | | }catch (EquipmentException e){ |
| | | resultVO.setCode(e.getCode()); |
| | | resultVO.setMsg(e.getMessage()); |
| | | }catch (Exception e){ |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); |
| | | resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); |
| | | |
| | | } |
| | | return resultVO; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyAddReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyModReq; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/list") |
| | | public ResultVO<List<SafeMaterialClassifyDto>> list(Authentication authentication, @RequestBody SafeMaterialClassifyQuery query){ |
| | | public ResultVO<List<SafeMaterialClassifyDto>> list(Authentication authentication){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return materialClassifyService.list(query); |
| | | return new ResultVO<>(ResultCodes.OK,materialClassifyService.list()); |
| | | |
| | | } |
| | | |
| | |
| | | @PostMapping(value = "queryById") |
| | | public ResultVO<SafeMaterialClassifyDto> queryById(Authentication authentication, @RequestBody JSONObject jsonObject){ |
| | | Long id = jsonObject.getLong("id"); |
| | | return materialClassifyService.queryById(id); |
| | | return new ResultVO<>(ResultCodes.OK,materialClassifyService.queryById(id)); |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | |
| | | Long id = jsonObject.getLong("id"); |
| | | return safeMaterialDetailService.queryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 特殊作业批量出库接口 |
| | | * @param authentication |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/deliveryBatchSpw") |
| | | public ResultVO deliveryBatchSpw(Authentication authentication, @Validated @RequestBody MaterialSpwReq req){ |
| | | safeMaterialDetailService.deliveryBatchSpw(req); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | /* *//** |
| | | * 根据rfid获去数据 |
| | | * @param authentication |
| | | * @return |
| | | *//* |
| | | @PostMapping(value = "/rfid/list") |
| | | public ResultVO getListByRfid(Authentication authentication, @RequestBody String[] rfids){ |
| | | return new ResultVO(ResultCodes.OK,safeMaterialDetailService.getListByRfids(rfids)); |
| | | }*/ |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | public class SafeMaterialClassifyDO { |
| | | private Long id; |
| | | private String materialClassifyName; |
| | | private Long smallClassifyId; |
| | | private String smallClassifyName; |
| | | private Long bigClassifyId; |
| | | private String bigClassifyName; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public String getMaterialClassifyName() { |
| | | return materialClassifyName; |
| | | public String getSmallClassifyName() { |
| | | return smallClassifyName; |
| | | } |
| | | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | public void setSmallClassifyName(String smallClassifyName) { |
| | | this.smallClassifyName = smallClassifyName; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public String getBigClassifyName() { |
| | | return bigClassifyName; |
| | | } |
| | | |
| | | public void setBigClassifyName(String bigClassifyName) { |
| | | this.bigClassifyName = bigClassifyName; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String materialClassifyName; |
| | | /** |
| | | * 父级id |
| | | */ |
| | | private Long parentId; |
| | | /** |
| | | * 删除标识 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) //自动填充的注解 |
| | |
| | | public void setUpdateUname(String updateUname) { |
| | | this.updateUname = updateUname; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | public class SafeMaterialClassifyStockDO { |
| | | |
| | | private Long smallClassifyId; |
| | | |
| | | private Long depId; |
| | | |
| | | private String depName; |
| | | |
| | | private Integer stockCount; |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public Integer getStockCount() { |
| | | return stockCount; |
| | | } |
| | | |
| | | public void setStockCount(Integer stockCount) { |
| | | this.stockCount = stockCount; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 物资类型id |
| | | */ |
| | | private Long materialClassifyId; |
| | | private Long bigClassifyId; |
| | | |
| | | private String materialClassifyName; |
| | | private String bigClassifyName; |
| | | |
| | | private Long smallClassifyId; |
| | | /** |
| | | * 部门id |
| | | */ |
| | |
| | | this.serialNum = serialNum; |
| | | } |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getMaterialClassifyName() { |
| | | return materialClassifyName; |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public String getBigClassifyName() { |
| | | return bigClassifyName; |
| | | } |
| | | |
| | | public void setBigClassifyName(String bigClassifyName) { |
| | | this.bigClassifyName = bigClassifyName; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | } |
| | |
| | | private Long smId; |
| | | private Integer count; |
| | | |
| | | private Long smallClassifyId; |
| | | |
| | | public Long getSmId() { |
| | | return smId; |
| | | } |
| | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.entity; |
| | | |
| | | public class SafeMaterialDetailDO { |
| | | private Long id; |
| | | private String rfid; |
| | | private Long depId; |
| | | private Long smallClassifyId; |
| | | private Long bigClassifyId; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getRfid() { |
| | | return rfid; |
| | | } |
| | | |
| | | public void setRfid(String rfid) { |
| | | this.rfid = rfid; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String materialNo; |
| | | /** |
| | | * 物资类型id |
| | | * 物资类型id 大类 |
| | | */ |
| | | private Long materialClassifyId; |
| | | private Long bigClassifyId; |
| | | /** |
| | | * 物资类型id 小类 |
| | | */ |
| | | private Long smallClassifyId; |
| | | /** |
| | | * RFID |
| | | */ |
| | |
| | | this.materialNo = materialNo; |
| | | } |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public String getRfid() { |
| | |
| | | * 物资编号 |
| | | */ |
| | | private String materialNo; |
| | | private Long smallClassifyId; |
| | | /** |
| | | * 物资类型id |
| | | */ |
| | | private Long materialClassifyId; |
| | | private Long bigClassifyId; |
| | | /** |
| | | * 物资类型名称 |
| | | */ |
| | | private String materialClassifyName; |
| | | private String bigClassifyName; |
| | | /** |
| | | * RFID |
| | | */ |
| | |
| | | this.materialNo = materialNo; |
| | | } |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public String getMaterialClassifyName() { |
| | | return materialClassifyName; |
| | | public String getBigClassifyName() { |
| | | return bigClassifyName; |
| | | } |
| | | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | public void setBigClassifyName(String bigClassifyName) { |
| | | this.bigClassifyName = bigClassifyName; |
| | | } |
| | | |
| | | public String getRfid() { |
| | |
| | | public void setClaimantName(String claimantName) { |
| | | this.claimantName = claimantName; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String serialNum; |
| | | /** |
| | | * 物资类型id |
| | | * 物资类型id 大类 |
| | | */ |
| | | private Long materialClassifyId; |
| | | private Long bigClassifyId; |
| | | /** |
| | | * 物资类型 小类 |
| | | */ |
| | | private Long smallClassifyId; |
| | | /** |
| | | * 部门id |
| | | */ |
| | |
| | | this.serialNum = serialNum; |
| | | } |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | |
| | | DATA_NOT_EXIST("E1005","数据不存在"), |
| | | MATERIAL_INVALID("E1006","物资无效"), |
| | | MATERIAL_OUT_OF_LIBRARY("E1007","物资已出库,不可再次出库"), |
| | | MATERIAL_IN_THE_LIBRARY("E1007","物资已入库,不可再次入库"), |
| | | MATERIAL_IN_THE_LIBRARY("E1008","物资已入库,不可再次入库"), |
| | | MATERIAL_CONSUMABLE("E1009","耗材物资不可重新入库"), |
| | | DATA_EXIST("E1010","数据已存在"), |
| | | |
| | | ERROR("A3000", "未知错误"); |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.req; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | public class MaterialSpwDeliveryReq { |
| | | @NotNull(message = "主键不可为空!") |
| | | private Integer count; |
| | | |
| | | @NotNull(message = "物资主键不可为空!") |
| | | private Long smallClassifyId; |
| | | |
| | | @NotNull(message = "部门或者仓库不可为空!") |
| | | private Long depId; |
| | | |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.req; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | public class MaterialSpwReq { |
| | | |
| | | @NotNull(message = "认领人不可为空!") |
| | | private Long claimantId; |
| | | |
| | | @NotNull(message = "出库物资不可为空!") |
| | | private List<MaterialSpwDeliveryReq> deliveryReqList; |
| | | |
| | | public Long getClaimantId() { |
| | | return claimantId; |
| | | } |
| | | |
| | | public void setClaimantId(Long claimantId) { |
| | | this.claimantId = claimantId; |
| | | } |
| | | |
| | | public List<MaterialSpwDeliveryReq> getDeliveryReqList() { |
| | | return deliveryReqList; |
| | | } |
| | | |
| | | public void setDeliveryReqList(List<MaterialSpwDeliveryReq> deliveryReqList) { |
| | | this.deliveryReqList = deliveryReqList; |
| | | } |
| | | } |
| | |
| | | @NotNull(message = "认领人不可为空!") |
| | | private Long claimantId; |
| | | |
| | | @NotNull(message = "物资主键不可为空!") |
| | | @NotNull(message = "物资管理id不可为空!") |
| | | private Long smId; |
| | | |
| | | private String rfid; |
| | | |
| | | public Long getSmId() { |
| | | return smId; |
| | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public String getRfid() { |
| | | return rfid; |
| | | } |
| | | |
| | | public void setRfid(String rfid) { |
| | | this.rfid = rfid; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 物资类型id |
| | | */ |
| | | @NotNull(message = "物资类型不可为空!") |
| | | private Long materialClassifyId; |
| | | @NotNull(message = "物资类型(小类)不可为空!") |
| | | private Long smallClassifyId; |
| | | /** |
| | | * 大类id |
| | | */ |
| | | @NotNull(message = "物资类型(大类)不可为空!") |
| | | private Long bigClassifyId; |
| | | /** |
| | | * 部门id |
| | | */ |
| | | @NotNull(message = "所属部门不可为空!") |
| | | private Long depId; |
| | | /** |
| | | * 物资名称 |
| | | */ |
| | | @NotBlank(message = "安全物资名称不可为空!") |
| | | private String materialName; |
| | | |
| | | /** |
| | | * 是否是耗材(0是, 1否) |
| | | */ |
| | | @NotNull(message = "是否是耗材不可为空!") |
| | | private Byte consumable; |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | |
| | | this.depId = depId; |
| | | } |
| | | |
| | | |
| | | public String getMaterialName() { |
| | | return materialName; |
| | | } |
| | | |
| | | public void setMaterialName(String materialName) { |
| | | this.materialName = materialName; |
| | | } |
| | | |
| | | public Byte getConsumable() { |
| | | return consumable; |
| | | } |
| | |
| | | public void setConsumable(Byte consumable) { |
| | | this.consumable = consumable; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.req; |
| | | |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | import org.jetbrains.annotations.NotNull; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | public class SafeMaterialClassifyAddReq { |
| | |
| | | */ |
| | | @NotBlank(message = "物资名称不可为空") |
| | | private String materialClassifyName; |
| | | /** |
| | | * 父级id |
| | | */ |
| | | private Long ParentId; |
| | | |
| | | public String getMaterialClassifyName() { |
| | | return materialClassifyName; |
| | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return ParentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | ParentId = parentId; |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.req; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | public class SafeMaterialModReq { |
| | |
| | | * 物资类型id |
| | | */ |
| | | @NotNull(message = "物资类型不可为空!") |
| | | private Long materialClassifyId; |
| | | private Long smallClassifyId; |
| | | /** |
| | | * 大类id |
| | | */ |
| | | @NotNull(message = "物资类型(大类)不可为空!") |
| | | private Long bigClassifyId; |
| | | /** |
| | | * 部门id |
| | | */ |
| | |
| | | /** |
| | | * 物资名称 |
| | | */ |
| | | @NotBlank(message = "安全物资名称不可为空!") |
| | | private String materialName; |
| | | /** |
| | | * 是否是耗材(0是, 1否) |
| | | */ |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | |
| | | this.depId = depId; |
| | | } |
| | | |
| | | public String getMaterialName() { |
| | | return materialName; |
| | | } |
| | | |
| | | public void setMaterialName(String materialName) { |
| | | this.materialName = materialName; |
| | | } |
| | | |
| | | public Byte getConsumable() { |
| | | return consumable; |
| | | } |
| | |
| | | public void setConsumable(Byte consumable) { |
| | | this.consumable = consumable; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 物资类型id |
| | | */ |
| | | private Long materialClassifyId; |
| | | private Long bigClassifyId; |
| | | /** |
| | | * 物资名称 |
| | | */ |
| | | private String materialName; |
| | | private String materialName; |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public String getMaterialName() { |
| | |
| | | private Long materialClassifyId; |
| | | //物资类型名称 |
| | | private String materialClassifyName; |
| | | private List<MaterialDepartmentDto> departmentList; |
| | | |
| | | private List<BaseMaterialDto> baseMaterialList; |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | } |
| | |
| | | this.materialClassifyName = materialClassifyName; |
| | | } |
| | | |
| | | public List<MaterialDepartmentDto> getDepartmentList() { |
| | | return departmentList; |
| | | public List<BaseMaterialDto> getBaseMaterialList() { |
| | | return baseMaterialList; |
| | | } |
| | | |
| | | public void setDepartmentList(List<MaterialDepartmentDto> departmentList) { |
| | | this.departmentList = departmentList; |
| | | public void setBaseMaterialList(List<BaseMaterialDto> baseMaterialList) { |
| | | this.baseMaterialList = baseMaterialList; |
| | | } |
| | | } |
| | |
| | | //部门名称 |
| | | private String depName; |
| | | //基础物资设备 |
| | | private List<BaseMaterialDto> baseMaterialList; |
| | | private List<MaterialClassificationDto> classificationList; |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public List<BaseMaterialDto> getBaseMaterialList() { |
| | | return baseMaterialList; |
| | | public List<MaterialClassificationDto> getClassificationList() { |
| | | return classificationList; |
| | | } |
| | | |
| | | public void setBaseMaterialList(List<BaseMaterialDto> baseMaterialList) { |
| | | this.baseMaterialList = baseMaterialList; |
| | | public void setClassificationList(List<MaterialClassificationDto> classificationList) { |
| | | this.classificationList = classificationList; |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.resp; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class SafeMaterialClassifyDto { |
| | | private Long id; |
| | | private String materialClassifyName; |
| | | |
| | | private Long parentId; |
| | | |
| | | private List<SafeMaterialClassifyDto> childList; |
| | | |
| | | public Long getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | } |
| | | |
| | | public List<SafeMaterialClassifyDto> getChildList() { |
| | | return childList; |
| | | } |
| | | |
| | | public void setChildList(List<SafeMaterialClassifyDto> childList) { |
| | | this.childList = childList; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.resp; |
| | | |
| | | public class SafeMaterialClassifyStockDto { |
| | | private Long smallClassifyId; |
| | | private Long depId; |
| | | private String depName; |
| | | private Integer stockCount; |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public Integer getStockCount() { |
| | | return stockCount; |
| | | } |
| | | |
| | | public void setStockCount(Integer stockCount) { |
| | | this.stockCount = stockCount; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String claimantName; |
| | | |
| | | /** |
| | | * 安全物资管理id |
| | | * @return |
| | | */ |
| | | private Long smId; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | public void setValidTypeName(String validTypeName) { |
| | | this.validTypeName = validTypeName; |
| | | } |
| | | |
| | | public Long getSmId() { |
| | | return smId; |
| | | } |
| | | |
| | | public void setSmId(Long smId) { |
| | | this.smId = smId; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 物资类型id |
| | | */ |
| | | private Long materialClassifyId; |
| | | private Long bigClassifyId; |
| | | |
| | | private String materialClassifyName; |
| | | private String bigClassifyName; |
| | | |
| | | private Long smallClassifyId; |
| | | /** |
| | | * 部门id |
| | | */ |
| | |
| | | this.serialNum = serialNum; |
| | | } |
| | | |
| | | public Long getMaterialClassifyId() { |
| | | return materialClassifyId; |
| | | } |
| | | |
| | | public void setMaterialClassifyId(Long materialClassifyId) { |
| | | this.materialClassifyId = materialClassifyId; |
| | | } |
| | | |
| | | public String getMaterialClassifyName() { |
| | | return materialClassifyName; |
| | | } |
| | | |
| | | public void setMaterialClassifyName(String materialClassifyName) { |
| | | this.materialClassifyName = materialClassifyName; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | |
| | | this.validStockCount = validStockCount; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public String getBigClassifyName() { |
| | | return bigClassifyName; |
| | | } |
| | | |
| | | public void setBigClassifyName(String bigClassifyName) { |
| | | this.bigClassifyName = bigClassifyName; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.safePlatform.equipment.model.dto.resp; |
| | | |
| | | public class SafeRfidMaterialDetailDto { |
| | | private Long id; |
| | | private String name; |
| | | |
| | | private Long bigClassifyId; |
| | | |
| | | private Long smallClassifyId; |
| | | |
| | | private Long depId; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Long getBigClassifyId() { |
| | | return bigClassifyId; |
| | | } |
| | | |
| | | public void setBigClassifyId(Long bigClassifyId) { |
| | | this.bigClassifyId = bigClassifyId; |
| | | } |
| | | |
| | | public Long getSmallClassifyId() { |
| | | return smallClassifyId; |
| | | } |
| | | |
| | | public void setSmallClassifyId(Long smallClassifyId) { |
| | | this.smallClassifyId = smallClassifyId; |
| | | } |
| | | |
| | | public Long getDepId() { |
| | | return depId; |
| | | } |
| | | |
| | | public void setDepId(Long depId) { |
| | | this.depId = depId; |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.repository; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface SafeMaterialClassifyInfoRepository extends BaseMapper<SafeMaterialClassifyInfo> { |
| | |
| | | |
| | | SafeMaterialClassifyInfo queryById(@Param("id") Long id); |
| | | |
| | | List<SafeMaterialClassifyInfo> getListByParentId(Long parentId); |
| | | |
| | | SafeMaterialClassifyDO getBigAndSmallClassify(Long smallClassifyId); |
| | | |
| | | List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailBO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailCountDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMatetrialDetailQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | int getCountBySmId(Long smId); |
| | | |
| | | void updateValidStatus(@Param("id") Long id, @Param("validStatus")Byte validStatus); |
| | | |
| | | List<Long> getRfidNotNullList(@Param("count") Integer count,@Param("smId")Long smId); |
| | | |
| | | List<Long> getRfidNullList(@Param("count") Integer count,@Param("smId") Long smId); |
| | | |
| | | List<Long> getIdListByRfid(Integer count, Long smId, String rfid); |
| | | |
| | | List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(@Param("smallClassifyIds") List<Long> smallClassifyIds); |
| | | |
| | | List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,@Param("depIds") List<Long> depIds); |
| | | |
| | | List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfids); |
| | | } |
| | |
| | | int deleteBatch(List<Long> ids); |
| | | |
| | | List<SafeMaterialDO> listByConditions(Page<SafeMaterialDO> page, @Param("query") SafeMaterialQuery query); |
| | | int getCountBySmallClassifyId(Long smallClassifyId); |
| | | |
| | | |
| | | Integer checkMatrial(@Param("smallClassifyId") Long smallClassifyId, @Param("depId") Long depId,@Param("id") Long id); |
| | | } |
| | |
| | | |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyAddReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyModReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyQuery; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MaterialClassifyService { |
| | | ResultVO<List<SafeMaterialClassifyDto>> list(SafeMaterialClassifyQuery query); |
| | | List<SafeMaterialClassifyDto> list(); |
| | | |
| | | ResultVO save(ContextCacheUser currentUser, SafeMaterialClassifyAddReq req); |
| | | |
| | |
| | | |
| | | ResultVO delete(Long id); |
| | | |
| | | ResultVO<SafeMaterialClassifyDto> queryById(Long id); |
| | | SafeMaterialClassifyDto queryById(Long id); |
| | | |
| | | SafeMaterialClassifyDO getBigAndSmallClassifyInfo(Long smallClassifyId); |
| | | List<SafeMaterialClassifyDto> getClassifyListByIds(List<Long> ids); |
| | | |
| | | List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds); |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDetailDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeRfidMaterialDetailDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | SearchResultVO<List<SafeMaterialDetailDto>> listByPage(PageQuery<SafeMatetrialDetailQuery> pageQuery); |
| | | |
| | | ResultVO queryById(Long id); |
| | | List<SafeMaterialClassifyStockDto> getSmallClassifyStockByIds(List<Long> smallClassifyIds); |
| | | void deliveryBatchSpw(MaterialSpwReq req); |
| | | |
| | | List<SafeRfidMaterialDetailDto> getListByRfids(List<String> rfids); |
| | | |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.service.baseService; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyStockDO; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyQuery; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto; |
| | | |
| | |
| | | |
| | | int update(SafeMaterialClassifyInfo classifyInfo); |
| | | |
| | | List<SafeMaterialClassifyInfo> listByCondition(SafeMaterialClassifyQuery query); |
| | | List<SafeMaterialClassifyInfo> list(); |
| | | |
| | | List<SafeMaterialClassifyInfo> getList(); |
| | | |
| | | List<SafeMaterialClassifyInfo> getListByParentId(Long parentId); |
| | | |
| | | SafeMaterialClassifyDO getBigAndSmallClassify(Long smallClassifyId); |
| | | |
| | | List<SafeMaterialClassifyInfo> getClassifyListByIds(List<Long> smallClassifyIds); |
| | | |
| | | List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailBO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailCountDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMatetrialDetailQuery; |
| | | |
| | | import java.util.List; |
| | |
| | | int getCountBySmId(Long smId); |
| | | |
| | | void updateValidStatus(Long id); |
| | | |
| | | List<Long> getRfidNotNullList(Integer count, Long smId); |
| | | |
| | | |
| | | List<Long> getRfidNullList(Integer count, Long smId); |
| | | |
| | | List<Long> getIdListByRfid(Integer count, Long smId, String rfid); |
| | | |
| | | List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(List<Long> smallClassifyIds); |
| | | |
| | | List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,List<Long> depIds); |
| | | |
| | | List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfid); |
| | | |
| | | } |
| | |
| | | |
| | | SafeMaterialInfo queryById(Long id); |
| | | |
| | | int getCountByClassify(Long classifyId); |
| | | |
| | | |
| | | int deleteBatch(List<Long> ids); |
| | | |
| | |
| | | List<SafeMaterialDO> listByPage(Page<SafeMaterialDO> page, SafeMaterialQuery query); |
| | | |
| | | |
| | | int getCountBySmallClassifyId(Long smallClassifyId); |
| | | |
| | | boolean checkMaterial(Long smallClassifyId, Long depId, Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.utils.StringUtils; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.enums.IssueReceiptEnum; |
| | | import com.gkhy.safePlatform.equipment.enums.ValidStatusEnum; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyQuery; |
| | | import com.gkhy.safePlatform.equipment.repository.SafeMaterialClassifyInfoRepository; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialClassifyInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | @Service("SafeMaterialClassifyInfoService") |
| | |
| | | return repository.queryById(id); |
| | | } |
| | | @Override |
| | | public List<SafeMaterialClassifyInfo> listByCondition(SafeMaterialClassifyQuery query){ |
| | | public List<SafeMaterialClassifyInfo> list(){ |
| | | List<SafeMaterialClassifyInfo> list = repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>() |
| | | .eq(SafeMaterialClassifyInfo::getDelFlag, 0) |
| | | .like(StringUtils.isNotBlank(query.getMaterialClassifyName()), SafeMaterialClassifyInfo::getMaterialClassifyName, query.getMaterialClassifyName()) |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyInfo> getList(){ |
| | | List<SafeMaterialClassifyInfo> list = repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>()); |
| | | List<SafeMaterialClassifyInfo> list = repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>() |
| | | .eq(SafeMaterialClassifyInfo::getDelFlag,0) |
| | | .eq(SafeMaterialClassifyInfo::getParentId,0l)); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyInfo> getListByParentId(Long parentId) { |
| | | if(null == parentId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getListByParentId(parentId); |
| | | } |
| | | |
| | | @Override |
| | | public SafeMaterialClassifyDO getBigAndSmallClassify(Long smallClassifyId) { |
| | | if(null == smallClassifyId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getBigAndSmallClassify(smallClassifyId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyInfo> getClassifyListByIds(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>() |
| | | .eq(SafeMaterialClassifyInfo::getDelFlag,0) |
| | | .in(SafeMaterialClassifyInfo::getId,ids) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getTraceabilityClassifyList(smallClassifyIds); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.service.baseService.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailBO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailCountDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO; |
| | | import com.gkhy.safePlatform.commons.utils.StringUtils; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.enums.IssueReceiptEnum; |
| | | import com.gkhy.safePlatform.equipment.enums.ValidStatusEnum; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | |
| | | import com.gkhy.safePlatform.equipment.repository.SafeMaterialDetailInfoRepository; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialDetailInfoService; |
| | | import jodd.util.StringUtil; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | repository.updateValidStatus(id,ValidStatusEnum.NO.getCode()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getRfidNotNullList(Integer count,Long smId) { |
| | | if(null == count || null == smId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getRfidNotNullList(count,smId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getRfidNullList(Integer count,Long smId) { |
| | | if(null == count || null == smId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getRfidNullList(count,smId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getIdListByRfid(Integer count, Long smId, String rfid) { |
| | | return repository.getIdListByRfid(count,smId,rfid); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(List<Long> smallClassifyIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds) ){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getSmallClassifyStockByIds(smallClassifyIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,List<Long> depIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds) || CollectionUtils.isEmpty(depIds)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getListBySmallClassifyIds(smallClassifyIds,depIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfids) { |
| | | if(CollectionUtils.isEmpty(rfids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getListByRfids(rfids); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return safeMaterialInfo; |
| | | } |
| | | |
| | | /** |
| | | * 根据类型统计数据 |
| | | */ |
| | | @Override |
| | | public int getCountByClassify(Long classifyId){ |
| | | if(null == classifyId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getCountByClassify(classifyId); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteBatch(List<Long> ids) { |
| | | if(null == ids || ids.size() == 0){ |
| | |
| | | return materialInfoList; |
| | | } |
| | | |
| | | @Override |
| | | public int getCountBySmallClassifyId(Long smallClassifyId) { |
| | | if(null == smallClassifyId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getCountBySmallClassifyId(smallClassifyId); |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkMaterial(Long smallClassifyId, Long depId, Long id) { |
| | | if(null == depId || null == smallClassifyId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | boolean flag = false; |
| | | int i = repository.checkMatrial(smallClassifyId,depId,id); |
| | | if (i>0){ |
| | | flag = true; |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.gkhy.safePlatform.equipment.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.utils.StringUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo; |
| | | import com.gkhy.safePlatform.equipment.enums.EquipmentResultCodes; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyAddReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyModReq; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyQuery; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto; |
| | | import com.gkhy.safePlatform.equipment.service.MaterialClassifyService; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialClassifyInfoService; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("MaterialClassifyService") |
| | | public class MaterialClassifyServiceImpl implements MaterialClassifyService { |
| | |
| | | private SafeMaterialInfoService safeMaterialInfoService; |
| | | |
| | | @Override |
| | | public ResultVO<List<SafeMaterialClassifyDto>> list(SafeMaterialClassifyQuery query) { |
| | | List<SafeMaterialClassifyInfo> list = safeMaterialClassifyInfoService.listByCondition(query); |
| | | List<SafeMaterialClassifyDto> respList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | for(SafeMaterialClassifyInfo classifyInfo : list){ |
| | | SafeMaterialClassifyDto respDTO = new SafeMaterialClassifyDto(); |
| | | respDTO.setId(classifyInfo.getId()); |
| | | respDTO.setMaterialClassifyName(classifyInfo.getMaterialClassifyName()); |
| | | respList.add(respDTO); |
| | | public List<SafeMaterialClassifyDto> list() { |
| | | List<SafeMaterialClassifyInfo> list = safeMaterialClassifyInfoService.list(); |
| | | //过滤出父级 |
| | | List<SafeMaterialClassifyInfo> parentList = list |
| | | .stream() |
| | | .filter(item -> item.getParentId().equals(0l)) |
| | | .collect(Collectors.toList()); |
| | | List<SafeMaterialClassifyDto> respDTOList = new ArrayList<>(); |
| | | //只有二级不采用递归 |
| | | for (SafeMaterialClassifyInfo classifyInfo:parentList) { |
| | | SafeMaterialClassifyDto respDTO = new SafeMaterialClassifyDto(); |
| | | respDTO.setId(classifyInfo.getId()); |
| | | respDTO.setMaterialClassifyName(classifyInfo.getMaterialClassifyName()); |
| | | respDTO.setParentId(classifyInfo.getParentId()); |
| | | List<SafeMaterialClassifyInfo> childList = list |
| | | .stream() |
| | | .filter(item -> item.getParentId().equals(classifyInfo.getId())) |
| | | .collect(Collectors.toList()); |
| | | List<SafeMaterialClassifyDto> childDTOList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyInfo child:childList){ |
| | | SafeMaterialClassifyDto childDTO = new SafeMaterialClassifyDto(); |
| | | childDTO.setId(child.getId()); |
| | | childDTO.setMaterialClassifyName(child.getMaterialClassifyName()); |
| | | childDTO.setParentId(child.getParentId()); |
| | | childDTOList.add(childDTO); |
| | | } |
| | | respDTO.setChildList(childDTOList); |
| | | respDTOList.add(respDTO); |
| | | } |
| | | return new ResultVO<>(ResultCodes.OK,respList); |
| | | |
| | | return respDTOList; |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO save(ContextCacheUser currentUser, SafeMaterialClassifyAddReq req) { |
| | | ResultVO resultVO = null; |
| | | |
| | | SafeMaterialClassifyInfo classifyInfo = new SafeMaterialClassifyInfo(); |
| | | classifyInfo.setMaterialClassifyName(req.getMaterialClassifyName()); |
| | | if(null != req.getParentId()){ |
| | | classifyInfo.setParentId(req.getParentId()); |
| | | }else{ |
| | | classifyInfo.setParentId(0l); |
| | | } |
| | | boolean flag = safeMaterialClassifyInfoService.save(classifyInfo); |
| | | if (flag){ |
| | | resultVO = new ResultVO(ResultCodes.OK); |
| | |
| | | if(id == null){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | ResultVO resultVO = null; |
| | | //判断是否被绑定 |
| | | int count = safeMaterialInfoService.getCountByClassify(id); |
| | | if(count > 0){ |
| | | throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"该类型已被绑定,不可删除!"); |
| | | }else{ |
| | | //如果没有被绑定,逻辑删除 |
| | | SafeMaterialClassifyInfo classifyInfo = new SafeMaterialClassifyInfo(); |
| | | classifyInfo.setId(id); |
| | | classifyInfo.setDelFlag(1); |
| | | boolean flag = safeMaterialClassifyInfoService.updateById(classifyInfo); |
| | | if (flag){ |
| | | resultVO = new ResultVO(ResultCodes.OK); |
| | | }else { |
| | | resultVO = new ResultVO(ResultCodes.SERVER_DEL_ERROR); |
| | | SafeMaterialClassifyInfo classify = safeMaterialClassifyInfoService.queryById(id); |
| | | if(null == classify){ |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST); |
| | | } |
| | | if(0 == classify.getParentId()){//一级 |
| | | List<SafeMaterialClassifyInfo> childrenList = safeMaterialClassifyInfoService.getListByParentId(id); |
| | | if (childrenList.size()>0){ |
| | | throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"改类型存在小类,不可删除!"); |
| | | } |
| | | }else {//二级 |
| | | //判断是否被绑定 |
| | | int count = safeMaterialInfoService.getCountBySmallClassifyId(id); |
| | | if(count > 0){ |
| | | throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"该类型已被绑定,不可删除!"); |
| | | } |
| | | } |
| | | return resultVO; |
| | | //如果没有被绑定,逻辑删除 |
| | | SafeMaterialClassifyInfo classifyInfo = new SafeMaterialClassifyInfo(); |
| | | classifyInfo.setId(id); |
| | | classifyInfo.setDelFlag(1); |
| | | safeMaterialClassifyInfoService.updateById(classifyInfo); |
| | | |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | |
| | | @Override |
| | | public ResultVO<SafeMaterialClassifyDto> queryById(Long id) { |
| | | public SafeMaterialClassifyDto queryById(Long id) { |
| | | if(id == null){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(id); |
| | | if(null == classifyInfo){ |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST); |
| | | } |
| | | List<SafeMaterialClassifyInfo> childList = new ArrayList<>(); |
| | | if(0l == classifyInfo.getParentId()){ |
| | | childList = safeMaterialClassifyInfoService.getListByParentId(id); |
| | | } |
| | | SafeMaterialClassifyDto respDTO = new SafeMaterialClassifyDto(); |
| | | respDTO.setId(classifyInfo.getId()); |
| | | respDTO.setMaterialClassifyName(classifyInfo.getMaterialClassifyName()); |
| | | return new ResultVO<>(ResultCodes.OK,respDTO); |
| | | respDTO.setParentId(classifyInfo.getParentId()); |
| | | List<SafeMaterialClassifyDto> childDtoList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyInfo child:childList){ |
| | | SafeMaterialClassifyDto childDto = new SafeMaterialClassifyDto(); |
| | | childDto.setId(child.getId()); |
| | | childDto.setMaterialClassifyName(child.getMaterialClassifyName()); |
| | | childDto.setParentId(child.getParentId()); |
| | | childDtoList.add(childDto); |
| | | } |
| | | respDTO.setChildList(childDtoList); |
| | | return respDTO; |
| | | } |
| | | |
| | | /** |
| | | * 根据小类id获取大小类相关信息 |
| | | * @param smallClassifyId |
| | | * @return |
| | | */ |
| | | public SafeMaterialClassifyDO getBigAndSmallClassifyInfo(Long smallClassifyId){ |
| | | if(null == smallClassifyId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | SafeMaterialClassifyDO classifyDO = safeMaterialClassifyInfoService.getBigAndSmallClassify(smallClassifyId); |
| | | return classifyDO; |
| | | } |
| | | /** |
| | | * 根据小类ids获取小类相关信息 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public List<SafeMaterialClassifyDto> getClassifyListByIds(List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | List<SafeMaterialClassifyInfo> list = safeMaterialClassifyInfoService.getClassifyListByIds(ids); |
| | | List<SafeMaterialClassifyDto> classifyDtoList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyInfo classifyInfo:list){ |
| | | SafeMaterialClassifyDto classifyDto = new SafeMaterialClassifyDto(); |
| | | BeanUtils.copyProperties(classifyInfo,classifyDto); |
| | | classifyDtoList.add(classifyDto); |
| | | } |
| | | return classifyDtoList; |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return safeMaterialClassifyInfoService.getTraceabilityClassifyList(smallClassifyIds); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.equipment.enums.*; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDetailDto; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.SafeRfidMaterialDetailDto; |
| | | import com.gkhy.safePlatform.equipment.mq.msg.SafeMaterialMsg; |
| | | import com.gkhy.safePlatform.equipment.service.SafeMaterialDetailService; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialClassifyInfoService; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("SafeMaterialDetailService") |
| | |
| | | String rfid = "0000000".substring(0,(8 - countStr.length()))+countStr; |
| | | SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo(); |
| | | materialDetailInfo.setId(IdUtil.getSnowflake(0,0).nextId()); |
| | | materialDetailInfo.setMaterialClassifyId(materialInfo.getMaterialClassifyId()); |
| | | materialDetailInfo.setName(materialInfo.getMaterialName()+"(ID"+materialInfo.getId()+")"); |
| | | materialDetailInfo.setBigClassifyId(materialInfo.getBigClassifyId()); |
| | | materialDetailInfo.setSmallClassifyId(materialInfo.getSmallClassifyId()); |
| | | materialDetailInfo.setName(materialInfo.getMaterialName()); |
| | | materialDetailInfo.setSmId(req.getSmId()); |
| | | materialDetailInfo.setConsumable(materialInfo.getConsumable()); |
| | | materialDetailInfo.setValidType(req.getValidType()); |
| | |
| | | for(int i = 0;i < req.getWareHousingCount();i++){ |
| | | SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo(); |
| | | materialDetailInfo.setId(IdUtil.getSnowflake(0,0).nextId()); |
| | | materialDetailInfo.setMaterialClassifyId(materialInfo.getMaterialClassifyId()); |
| | | materialDetailInfo.setName(materialInfo.getMaterialName()+"(ID"+materialInfo.getId()+")"); |
| | | materialDetailInfo.setBigClassifyId(materialInfo.getBigClassifyId()); |
| | | materialDetailInfo.setSmallClassifyId(materialInfo.getSmallClassifyId()); |
| | | materialDetailInfo.setName(materialInfo.getMaterialName()); |
| | | materialDetailInfo.setSmId(req.getSmId()); |
| | | materialDetailInfo.setConsumable(materialInfo.getConsumable()); |
| | | materialDetailInfo.setValidType(req.getValidType()); |
| | |
| | | for(int i = 0;i < req.getWareHousingCount();i++){ |
| | | SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo(); |
| | | materialDetailInfo.setId(IdUtil.getSnowflake(0,0).nextId()); |
| | | materialDetailInfo.setMaterialClassifyId(materialInfo.getMaterialClassifyId()); |
| | | materialDetailInfo.setName(materialInfo.getMaterialName()+"(ID"+materialInfo.getId()+")"); |
| | | materialDetailInfo.setBigClassifyId(materialInfo.getBigClassifyId()); |
| | | materialDetailInfo.setSmallClassifyId(materialInfo.getSmallClassifyId()); |
| | | materialDetailInfo.setName(materialInfo.getMaterialName()); |
| | | materialDetailInfo.setSmId(req.getSmId()); |
| | | materialDetailInfo.setConsumable(materialInfo.getConsumable()); |
| | | materialDetailInfo.setValidType(req.getValidType()); |
| | |
| | | List<SafeMaterialDetailInfo> list = safeMaterialDetailInfoService.getListByIds(idList); |
| | | List<SafeMaterialDetailInfo> selectList = list |
| | | .stream() |
| | | .filter(item -> item.getIrStatus().equals(IssueReceiptEnum.OUT_OF_LIBRARY.getCode())) |
| | | .filter(item -> item.getIrStatus().equals(IssueReceiptEnum.OUT_OF_LIBRARY.getCode()) && item.getConsumable().equals(ConsumableEnum.YES.getCode())) |
| | | .collect(Collectors.toList()); |
| | | if(selectList.size() != ids.length){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"已入库物资不可重复入库!"); |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"已入库或耗材物资不可重复入库!"); |
| | | } |
| | | //修改为入库状态 |
| | | safeMaterialDetailInfoService.updateReceiptStatusByIds(idList,IssueReceiptEnum.IN_THE_LIBRARY.getCode()); |
| | |
| | | @Override |
| | | public ResultVO deliveryBatchRandom(MterialRandomDeliveryReq req) { |
| | | UserInfoRPCRespDTO userInfo = getUserInfo(req.getClaimantId()); |
| | | List<Long> idList = new ArrayList<>(); |
| | | if(StringUtils.isNotBlank(req.getRfid())){ |
| | | idList = safeMaterialDetailInfoService.getIdListByRfid(req.getCount(),req.getSmId(),req.getRfid()); |
| | | |
| | | }else{ |
| | | idList = safeMaterialDetailInfoService.getRfidNullList(req.getCount(), req.getSmId()); |
| | | |
| | | } |
| | | if(idList.size()< req.getCount()){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"有效库存数量不足!"); |
| | | } |
| | | //获取有效数量 |
| | | Integer validStockCount = safeMaterialDetailInfoService.getValidStockCount(req.getSmId()); |
| | | if(req.getCount() > validStockCount){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"出库数量不可大于有效库存数量!"); |
| | | } |
| | | |
| | | SafeMaterialDetailBO detailBO = new SafeMaterialDetailBO(); |
| | | detailBO.setCount(req.getCount()); |
| | | detailBO.setClaimantName(userInfo.getUsername()); |
| | | detailBO.setClaimantId(req.getClaimantId()); |
| | | safeMaterialDetailInfoService.deliveryBatchRandom(detailBO); |
| | | detailBO.setIds(idList); |
| | | safeMaterialDetailInfoService.updateDeliveryStatusByIds(detailBO); |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | |
| | | /** |
| | | * 特殊作业物资出库 |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void deliveryBatchSpw(MaterialSpwReq req) { |
| | | //验证 |
| | | if(null == req.getClaimantId()){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"认领人不可为空!"); |
| | | } |
| | | List<MaterialSpwDeliveryReq> deliveryReqList = req.getDeliveryReqList(); |
| | | if(CollectionUtils.isEmpty(deliveryReqList)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"出库物资不可为空!"); |
| | | } |
| | | //获取小类物资 |
| | | List<Long> smallClassifyIds = deliveryReqList |
| | | .stream() |
| | | .map(MaterialSpwDeliveryReq::getSmallClassifyId) |
| | | .collect(Collectors.toList()); |
| | | List<Long> depIds = deliveryReqList |
| | | .stream() |
| | | .map(MaterialSpwDeliveryReq::getDepId) |
| | | .collect(Collectors.toList()); |
| | | if(smallClassifyIds.size() == 0 || depIds.size() == 0){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"部门/仓库或者物资类型(小类)不可为空!"); |
| | | } |
| | | |
| | | List<SafeMaterialClassifyStockDO> classifyStockList= safeMaterialDetailInfoService.getSmallClassifyStockByIds(smallClassifyIds); |
| | | //根据物资种类获取有效在库物资 |
| | | List<SafeMaterialDetailDO> listBySmallClassifyIds = safeMaterialDetailInfoService.getListBySmallClassifyIds(smallClassifyIds,depIds); |
| | | |
| | | for(MaterialSpwDeliveryReq deliveryReq:deliveryReqList){ |
| | | if(null == deliveryReq.getDepId()){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"部门或仓库不可为空!"); |
| | | } |
| | | if(null == deliveryReq.getCount()){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"出库数量不可为空!"); |
| | | } |
| | | if(null == deliveryReq.getSmallClassifyId()){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"物资类型(小类)不可为空!"); |
| | | } |
| | | List<SafeMaterialClassifyStockDO> collect = classifyStockList |
| | | .stream() |
| | | .filter(cs -> cs.getSmallClassifyId().equals(deliveryReq.getSmallClassifyId()) && cs.getDepId().equals(deliveryReq.getDepId()) && cs.getStockCount() >= deliveryReq.getCount()) |
| | | .collect(Collectors.toList()); |
| | | if(collect.size() == 0){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"库存不足!"); |
| | | } |
| | | } |
| | | UserInfoRPCRespDTO userInfo = getUserInfo(req.getClaimantId()); |
| | | List<Long> ids = new ArrayList<>(); |
| | | //循环数据 |
| | | for(MaterialSpwDeliveryReq deliveryReq:deliveryReqList){ |
| | | //过滤出rfid存在的数据 |
| | | List<SafeMaterialDetailDO> selectRfidNotNull = listBySmallClassifyIds |
| | | .stream() |
| | | .filter(item -> null != item.getRfid() && item.getSmallClassifyId().equals(deliveryReq.getSmallClassifyId()) && item.getDepId().equals(deliveryReq.getDepId())) |
| | | .collect(Collectors.toList()); |
| | | List<Long> selectIds = new ArrayList<>(); |
| | | if(selectRfidNotNull.size()>0){ |
| | | selectIds = selectRfidNotNull |
| | | .stream() |
| | | .map(SafeMaterialDetailDO::getId) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if(selectRfidNotNull.size() >= deliveryReq.getCount()){ |
| | | ids.addAll(selectIds.subList(0,deliveryReq.getCount())); |
| | | }else{ |
| | | ids.addAll(selectIds); |
| | | List<SafeMaterialDetailDO> selectRfidIsNull = listBySmallClassifyIds |
| | | .stream() |
| | | .filter(item -> null == item.getRfid() && item.getSmallClassifyId().equals(deliveryReq.getSmallClassifyId()) && item.getDepId().equals(deliveryReq.getDepId())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<Long> collect = selectRfidIsNull.subList(0,deliveryReq.getCount()-selectRfidNotNull.size()).stream().map(SafeMaterialDetailDO::getId) |
| | | .collect(Collectors.toList()); |
| | | ids.addAll(collect); |
| | | } |
| | | } |
| | | SafeMaterialDetailBO detailBO = new SafeMaterialDetailBO(); |
| | | detailBO.setClaimantName(userInfo.getUsername()); |
| | | detailBO.setClaimantId(req.getClaimantId()); |
| | | detailBO.setIds(ids); |
| | | safeMaterialDetailInfoService.updateDeliveryStatusByIds(detailBO); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据rfid获取数据信息 |
| | | * @param rfids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SafeRfidMaterialDetailDto> getListByRfids(List<String> rfids) { |
| | | if(CollectionUtils.isEmpty(rfids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | List<SafeMaterialDetailInfoDO> listByRfid = safeMaterialDetailInfoService.getListByRfids(rfids); |
| | | List<SafeRfidMaterialDetailDto> rfidMaterialDetailDtoList = new ArrayList<>(); |
| | | for (SafeMaterialDetailInfoDO detailInfoDO:listByRfid){ |
| | | SafeRfidMaterialDetailDto detailDto = new SafeRfidMaterialDetailDto(); |
| | | detailDto.setId(detailInfoDO.getId()); |
| | | detailDto.setName(detailInfoDO.getName()); |
| | | detailDto.setBigClassifyId(detailInfoDO.getBigClassifyId()); |
| | | detailDto.setSmallClassifyId(detailInfoDO.getSmallClassifyId()); |
| | | detailDto.setDepId(detailInfoDO.getDepId()); |
| | | rfidMaterialDetailDtoList.add(detailDto); |
| | | } |
| | | return rfidMaterialDetailDtoList; |
| | | } |
| | | |
| | | @Override |
| | |
| | | materialDetailDto.setValidStatusName(ValidStatusEnum.getByCode(materialDetailInfoDO.getValidStatus()).getValue()); |
| | | materialDetailDto.setValidTypeName(ValidTypeEnum.getByCode(materialDetailInfoDO.getValidType()).getValue()); |
| | | materialDetailDto.setIrStatusName(IssueReceiptEnum.getByCode(materialDetailInfoDO.getIrStatus()).getValue()); |
| | | |
| | | detailDtoList.add(materialDetailDto); |
| | | } |
| | | return new SearchResultVO<>(true, page.getCurrent(),page.getSize(), page.getPages(),page.getTotal(),detailDtoList,ResultCodes.OK); |
| | |
| | | SafeMaterialDetailDto detailDto = new SafeMaterialDetailDto(); |
| | | if(materialDetailInfo != null){ |
| | | SafeMaterialInfo materialInfo = safeMaterialInfoService.queryById(materialDetailInfo.getSmId()); |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(materialDetailInfo.getMaterialClassifyId()); |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(materialDetailInfo.getBigClassifyId()); |
| | | BeanUtils.copyProperties(materialDetailInfo,detailDto); |
| | | detailDto.setConsumableName(ConsumableEnum.getByCode(materialDetailInfo.getConsumable()).getValue()); |
| | | detailDto.setValidStatusName(ValidStatusEnum.getByCode(materialDetailInfo.getValidStatus()).getValue()); |
| | |
| | | if(null == vo){ |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST); |
| | | } |
| | | //如果是耗材不可重新入库 |
| | | if(vo.getConsumable().equals(ConsumableEnum.YES.getCode())){ |
| | | throw new EquipmentException(EquipmentResultCodes.MATERIAL_CONSUMABLE); |
| | | } |
| | | if(vo.getIrStatus().equals(IssueReceiptEnum.IN_THE_LIBRARY.getCode())){ |
| | | throw new EquipmentException(EquipmentResultCodes.MATERIAL_IN_THE_LIBRARY); |
| | | } |
| | |
| | | } |
| | | |
| | | if(IssueReceiptEnum.IN_THE_LIBRARY.getCode().equals(req.getIrStatus())){ |
| | | //如果是耗材不可重新入库 |
| | | if(vo.getConsumable().equals(ConsumableEnum.YES.getCode())){ |
| | | throw new EquipmentException(EquipmentResultCodes.MATERIAL_CONSUMABLE); |
| | | } |
| | | //重新入库 |
| | | if(vo.getIrStatus().equals(req.getIrStatus())){ |
| | | throw new EquipmentException(EquipmentResultCodes.MATERIAL_IN_THE_LIBRARY); |
| | |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据小类id(物资种类)获取库存数量 |
| | | * @param smallClassifyIds |
| | | * @return |
| | | */ |
| | | public List<SafeMaterialClassifyStockDto> getSmallClassifyStockByIds(List<Long> smallClassifyIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | List<SafeMaterialClassifyStockDO> classifyStockList= safeMaterialDetailInfoService.getSmallClassifyStockByIds(smallClassifyIds); |
| | | List<SafeMaterialClassifyStockDto> classifyStockDtoList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyStockDO classifyStockDO:classifyStockList){ |
| | | SafeMaterialClassifyStockDto classifyStockDto = new SafeMaterialClassifyStockDto(); |
| | | BeanUtils.copyProperties(classifyStockDO,classifyStockDto); |
| | | classifyStockDtoList.add(classifyStockDto); |
| | | } |
| | | return classifyStockDtoList; |
| | | } |
| | | |
| | | |
| | | private UserInfoRPCRespDTO getUserInfo(Long uid) { |
| | |
| | | Date date = Date.from(zdt.toInstant()); |
| | | return date; |
| | | } |
| | | |
| | | } |
| | |
| | | ResultVO resultVO = null; |
| | | //获取部门信息 |
| | | DepInfoRPCRespDTO depInfo = getDepInfoByDepId(req.getDepId()); |
| | | |
| | | if(null == ConsumableEnum.getByCode(req.getConsumable())){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"耗材类型不合法!"); |
| | | } |
| | | //获取物资类型 |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(req.getMaterialClassifyId()); |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(req.getSmallClassifyId()); |
| | | if(null == classifyInfo){ |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"物资类型不存在!"); |
| | | } |
| | | //判断该部门是否已经创建物资 |
| | | boolean flag = safeMaterialInfoService.checkMaterial(req.getSmallClassifyId(), req.getDepId(), null); |
| | | if(flag){ |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_EXIST,"该种物资已存在不可重复创建"); |
| | | } |
| | | |
| | | //获取数量 |
| | | int safeMaterialTotalCount = safeMaterialInfoService.getTotalCount(); |
| | | SafeMaterialInfo safeMaterialInfo = new SafeMaterialInfo(); |
| | | BeanUtils.copyProperties(req,safeMaterialInfo); |
| | | safeMaterialInfo.setConsumable(req.getConsumable()); |
| | | safeMaterialInfo.setDepId(req.getDepId()); |
| | | safeMaterialInfo.setSmallClassifyId(req.getSmallClassifyId()); |
| | | safeMaterialInfo.setMaterialName(classifyInfo.getMaterialClassifyName()); |
| | | safeMaterialInfo.setDepName(depInfo.getDepName()); |
| | | safeMaterialInfo.setSerialNum(this.generateSerialNum(safeMaterialTotalCount)); |
| | | safeMaterialInfo.setBigClassifyId(req.getBigClassifyId()); |
| | | //插入 |
| | | boolean flag = safeMaterialInfoService.save(safeMaterialInfo); |
| | | if(flag){ |
| | | resultVO = new ResultVO(ResultCodes.OK); |
| | | }else { |
| | | resultVO = new ResultVO(ResultCodes.SERVER_ADD_ERROR); |
| | | } |
| | | safeMaterialInfoService.save(safeMaterialInfo); |
| | | |
| | | return resultVO; |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | |
| | | @Override |
| | |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"耗材类型不合法!"); |
| | | } |
| | | //获取物资类型 |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(req.getMaterialClassifyId()); |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(req.getSmallClassifyId()); |
| | | if(null == classifyInfo){ |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"物资类型不存在!"); |
| | | } |
| | | SafeMaterialInfo safeMaterialInfo = new SafeMaterialInfo(); |
| | | BeanUtils.copyProperties(req,safeMaterialInfo); |
| | | safeMaterialInfo.setDepName(depInfo.getDepName()); |
| | | //跟新 |
| | | boolean flag = safeMaterialInfoService.updateById(safeMaterialInfo); |
| | | boolean flag = safeMaterialInfoService.checkMaterial(req.getSmallClassifyId(), req.getDepId(), req.getDepId()); |
| | | if(flag){ |
| | | resultVO = new ResultVO(ResultCodes.OK); |
| | | }else { |
| | | resultVO = new ResultVO(ResultCodes.SERVER_UPDATE_ERROR); |
| | | throw new EquipmentException(EquipmentResultCodes.DATA_EXIST,"该种物资已存在不可重复创建"); |
| | | } |
| | | SafeMaterialInfo safeMaterialInfo = new SafeMaterialInfo(); |
| | | safeMaterialInfo.setConsumable(req.getConsumable()); |
| | | safeMaterialInfo.setDepId(req.getDepId()); |
| | | safeMaterialInfo.setSmallClassifyId(req.getSmallClassifyId()); |
| | | safeMaterialInfo.setMaterialName(classifyInfo.getMaterialClassifyName()); |
| | | safeMaterialInfo.setDepName(depInfo.getDepName()); |
| | | safeMaterialInfo.setBigClassifyId(req.getBigClassifyId()); |
| | | //跟新 |
| | | safeMaterialInfoService.updateById(safeMaterialInfo); |
| | | |
| | | return resultVO; |
| | | return new ResultVO(ResultCodes.OK); |
| | | } |
| | | |
| | | @Override |
| | |
| | | SafeMaterialInfo safeMaterialInfo = safeMaterialInfoService.queryById(id); |
| | | SafeMaterialDto safeMaterialDto = new SafeMaterialDto(); |
| | | if(null != safeMaterialInfo){ |
| | | SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(safeMaterialInfo.getMaterialClassifyId()); |
| | | SafeMaterialClassifyDO classifyDO = safeMaterialClassifyInfoService.getBigAndSmallClassify(safeMaterialInfo.getSmallClassifyId()); |
| | | Integer validStockCount = safeMaterialDetailInfoService.getValidStockCount(safeMaterialInfo.getId()); |
| | | BeanUtils.copyProperties(safeMaterialInfo,safeMaterialDto); |
| | | safeMaterialDto.setConsumable(ConsumableEnum.getByCode(safeMaterialInfo.getConsumable()).getCode()); |
| | | if(null != classifyInfo){ |
| | | safeMaterialDto.setMaterialClassifyName(classifyInfo.getMaterialClassifyName()); |
| | | safeMaterialDto.setConsumableName(ConsumableEnum.getByCode(safeMaterialInfo.getConsumable()).getValue()); |
| | | if(null != classifyDO){ |
| | | safeMaterialDto.setBigClassifyName(classifyDO.getBigClassifyName()); |
| | | } |
| | | safeMaterialDto.setValidStockCount(validStockCount); |
| | | |
| | |
| | | List<DepRPCRespDTO> depInfoList = getDepInfoList(); |
| | | //获取所有物资类型 |
| | | List<SafeMaterialClassifyInfo> classifyInfoList = safeMaterialClassifyInfoService.getList(); |
| | | //循环物资分类 |
| | | List<MaterialClassificationDto> classificationDtoList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyInfo classifyInfo:classifyInfoList){ |
| | | MaterialClassificationDto classificationDto = new MaterialClassificationDto(); |
| | | classificationDto.setMaterialClassifyId(classifyInfo.getId()); |
| | | classificationDto.setMaterialClassifyName(classifyInfo.getMaterialClassifyName()); |
| | | //循环部门 |
| | | List<MaterialDepartmentDto> departmentDtoList = new ArrayList<>(); |
| | | for (DepRPCRespDTO dep:depInfoList){ |
| | | //循环部门 |
| | | List<MaterialDepartmentDto> departmentDtoList = new ArrayList<>(); |
| | | recursiveDep(depInfoList,departmentDtoList,materialInfoList,classifyInfoList); |
| | | |
| | | return new ResultVO(ResultCodes.OK,departmentDtoList); |
| | | } |
| | | private void recursiveDep(List<DepRPCRespDTO> depInfoList,List<MaterialDepartmentDto> departmentDtoList,List<SafeMaterialInfo> materialInfoList,List<SafeMaterialClassifyInfo> classifyInfoList){ |
| | | for (DepRPCRespDTO dep:depInfoList){ |
| | | MaterialDepartmentDto materialDepartmentDto = new MaterialDepartmentDto(); |
| | | materialDepartmentDto.setDepId(dep.getDepId()); |
| | | materialDepartmentDto.setDepName(dep.getDepName()); |
| | | List<MaterialClassificationDto> classificationDtoList = new ArrayList<>(); |
| | | for (SafeMaterialClassifyInfo classifyInfo:classifyInfoList) { |
| | | MaterialClassificationDto classificationDto = new MaterialClassificationDto(); |
| | | classificationDto.setMaterialClassifyName(classifyInfo.getMaterialClassifyName()); |
| | | classificationDto.setMaterialClassifyId(classifyInfo.getId()); |
| | | //过滤出物资数据 |
| | | List<SafeMaterialInfo> selectMaterialList = materialInfoList |
| | | .stream() |
| | | .filter(item -> classifyInfo.getId().equals(item.getMaterialClassifyId()) && dep.getDepId().equals(item.getDepId())) |
| | | .filter(item -> classifyInfo.getId().equals(item.getBigClassifyId()) && dep.getDepId().equals(item.getDepId())) |
| | | .collect(Collectors.toList()); |
| | | List<BaseMaterialDto> baseMaterialDtoList = new ArrayList<>(); |
| | | if(selectMaterialList.size()>0){ |
| | | //填充部门数据 |
| | | MaterialDepartmentDto departmentDto = new MaterialDepartmentDto(); |
| | | departmentDto.setDepId(dep.getDepId()); |
| | | departmentDto.setDepName(dep.getDepName()); |
| | | |
| | | List<BaseMaterialDto> baseMaterialDtoList = new ArrayList<>(); |
| | | //循环物资 |
| | | for (SafeMaterialInfo materialInfo:selectMaterialList){ |
| | | //填充基础物资数据 |
| | |
| | | baseMaterialDto.setSmId(materialInfo.getId()); |
| | | baseMaterialDtoList.add(baseMaterialDto); |
| | | } |
| | | departmentDto.setBaseMaterialList(baseMaterialDtoList); |
| | | departmentDtoList.add(departmentDto); |
| | | } |
| | | //子集部门 |
| | | if(!CollectionUtils.isEmpty(dep.getChildren())){ |
| | | this.recursiveDep(dep.getChildren(),departmentDtoList,materialInfoList,classifyInfo.getId()); |
| | | classificationDto.setBaseMaterialList(baseMaterialDtoList); |
| | | classificationDtoList.add(classificationDto); |
| | | } |
| | | } |
| | | classificationDto.setDepartmentList(departmentDtoList); |
| | | classificationDtoList.add(classificationDto); |
| | | } |
| | | |
| | | return new ResultVO(ResultCodes.OK,classificationDtoList); |
| | | } |
| | | private void recursiveDep(List<DepRPCRespDTO> depList,List<MaterialDepartmentDto> departmentDtoList,List<SafeMaterialInfo> materialInfoList,Long classifyId){ |
| | | for(DepRPCRespDTO dep:depList){ |
| | | //过滤出物资数据 |
| | | List<SafeMaterialInfo> selectMaterialList = materialInfoList |
| | | .stream() |
| | | .filter(item -> classifyId.equals(item.getMaterialClassifyId()) && dep.getDepId().equals(item.getDepId())) |
| | | .collect(Collectors.toList()); |
| | | if(selectMaterialList.size()>0){ |
| | | //填充部门数据 |
| | | MaterialDepartmentDto departmentDto = new MaterialDepartmentDto(); |
| | | departmentDto.setDepId(dep.getDepId()); |
| | | departmentDto.setDepName(dep.getDepName()); |
| | | |
| | | List<BaseMaterialDto> baseMaterialDtoList = new ArrayList<>(); |
| | | //循环物资 |
| | | for (SafeMaterialInfo materialInfo:selectMaterialList){ |
| | | //填充基础物资数据 |
| | | BaseMaterialDto baseMaterialDto = new BaseMaterialDto(); |
| | | baseMaterialDto.setMaterialName(materialInfo.getMaterialName()); |
| | | baseMaterialDto.setSmId(materialInfo.getId()); |
| | | baseMaterialDtoList.add(baseMaterialDto); |
| | | } |
| | | departmentDto.setBaseMaterialList(baseMaterialDtoList); |
| | | departmentDtoList.add(departmentDto); |
| | | if(classificationDtoList.size()>0){ |
| | | materialDepartmentDto.setClassificationList(classificationDtoList); |
| | | departmentDtoList.add(materialDepartmentDto); |
| | | } |
| | | //子集 |
| | | //子集部门 |
| | | if(!CollectionUtils.isEmpty(dep.getChildren())){ |
| | | this.recursiveDep(dep.getChildren(),departmentDtoList,materialInfoList,classifyId); |
| | | this.recursiveDep(dep.getChildren(),departmentDtoList,materialInfoList,classifyInfoList); |
| | | } |
| | | } |
| | | } |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.gkhy.safePlatform.equipment.repository.SafeMaterialClassifyInfoRepository"> |
| | | |
| | | <resultMap type="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO" id="materialClassifyResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="material_classify_name" property="materialClassifyName"/> |
| | | </resultMap> |
| | | <!--新增--> |
| | | <insert id="save" parameterType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo"> |
| | | insert into safe_material_classify (id,material_classify_name,del_flag,create_time,create_uid,create_uname,update_time,update_uid,update_uname) values (#{id},#{materialClassifyName},#{delFlag},#{createTime},#{createUid},#{createUname},#{updateTime},#{updateUid},#{updateUname}) |
| | | insert into safe_material_classify (id,material_classify_name,parent_id,del_flag,create_time,create_uid,create_uname,update_time,update_uid,update_uname) values (#{id},#{materialClassifyName},#{parentId},#{delFlag},#{createTime},#{createUid},#{createUname},#{updateTime},#{updateUid},#{updateUname}) |
| | | </insert> |
| | | <!--更新--> |
| | | <update id="update" parameterType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo"> |
| | |
| | | </update> |
| | | <!--查询单条数据--> |
| | | <select id="queryById" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo"> |
| | | select id,material_classify_name,create_time,create_uid,create_uname,update_time,update_uid,update_uname from safe_material_classify where id = #{id} and del_flag = 0; |
| | | select id,material_classify_name,parent_id,create_time,create_uid,create_uname,update_time,update_uid,update_uname from safe_material_classify where id = #{id} and del_flag = 0; |
| | | </select> |
| | | <select id="listByContion" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo"> |
| | | select id, |
| | |
| | | and instr(material_classify_name,#{materialClassifyName}) > 0 |
| | | </if> |
| | | </select> |
| | | <select id="getListByParentId" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo"> |
| | | select id,material_classify_name,parent_id from safe_material_classify where parent_id = #{parentId} and del_flag = 0; |
| | | </select> |
| | | <select id="getBigAndSmallClassify" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO"> |
| | | SELECT |
| | | c1.id as smallClassifyId, |
| | | c1.material_classify_name as smallClassifyName, |
| | | c2.id as bigClassifyId, |
| | | c2.material_classify_name as bigClassifyName |
| | | FROM |
| | | safe_material_classify c1 |
| | | INNER JOIN safe_material_classify c2 ON c1.parent_id = c2.id |
| | | WHERE |
| | | c1.del_flag = 0 |
| | | AND c1.id = #{smallClassifyId} |
| | | </select> |
| | | <select id="getTraceabilityClassifyList" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO"> |
| | | SELECT |
| | | c1.id as smallClassifyId, |
| | | c1.material_classify_name as smallClassifyName, |
| | | c2.id as bigClassifyId, |
| | | c2.material_classify_name as bigClassifyName |
| | | FROM |
| | | safe_material_classify c1 |
| | | INNER JOIN safe_material_classify c2 ON c1.parent_id = c2.id |
| | | WHERE |
| | | c1.del_flag = 0 |
| | | AND c1.id in |
| | | <foreach collection="smallClassifyIds" item="id" close=")" open="(" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="material_no" property="materialNo" jdbcType="VARCHAR"/> |
| | | <result column="material_classify_id" property="materialClassifyId" jdbcType="BIGINT"/> |
| | | <result column="big_classify_id" property="bigClassifyId" jdbcType="BIGINT"/> |
| | | <result column="small_classify_id" property="smallClassifyId" jdbcType="BIGINT"/> |
| | | <result column="rfid" property="rfid" jdbcType="VARCHAR"/> |
| | | <result column="consumable" property="consumable" jdbcType="TINYINT"/> |
| | | <result column="valid_type" property="validType" jdbcType="TINYINT"/> |
| | |
| | | </select> |
| | | <select id="queryById" resultMap="materialDetailResult"> |
| | | select id, |
| | | name, |
| | | CONCAT(name,'(ID',sm_id,')') as name, |
| | | material_no, |
| | | material_classify_id, |
| | | big_classify_id, |
| | | rfid, |
| | | consumable, |
| | | valid_type, |
| | |
| | | where id = #{id} |
| | | </update> |
| | | <select id="getListByIds" resultMap="materialDetailResult"> |
| | | select id,name,material_no,material_classify_id,rfid,consumable,valid_type,valid_time,valid_status,ir_status,ware_housing_time,ware_housing_time,delivery_time,sm_id,claimant_id,claimant_name |
| | | select id,name,material_no,big_classify_id,rfid,consumable,valid_type,valid_time,valid_status,ir_status,ware_housing_time,ware_housing_time,delivery_time,sm_id,claimant_id,claimant_name |
| | | from safe_material_detail |
| | | where del_flag = 0 |
| | | and id in |
| | |
| | | claimant_name = #{detailBO.claimantName}, |
| | | delivery_time = #{detailBO.deliveryTime} |
| | | where id in |
| | | (select t.id from (select id from safe_material_detail where ir_status = 0 and valid_status = 0 and del_flag = 0 ORDER BY ware_housing_time asc LIMIT #{detailBO.count}) t |
| | | ) |
| | | <foreach collection="detailBO.ids" item="id" separator="," open="(" close=")" > |
| | | #{id} |
| | | </foreach> |
| | | |
| | | </update> |
| | | |
| | | <select id="getValidStockCount" resultType="java.lang.Integer"> |
| | |
| | | </select> |
| | | <select id="listByCondition" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO"> |
| | | select sd.id, |
| | | sd.name, |
| | | CONCAT(sd.name,'(ID',sd.sm_id,')') as name, |
| | | sd.material_no, |
| | | sd.material_classify_id, |
| | | sd.big_classify_id, |
| | | sd.rfid, |
| | | sd.consumable, |
| | | sd.valid_type, |
| | |
| | | sd.delivery_time, |
| | | sm.dep_id, |
| | | sm.dep_name, |
| | | sc.material_classify_name |
| | | sd.sm_id, |
| | | sc.material_classify_name as bigClassifyName |
| | | from safe_material_detail sd |
| | | INNER JOIN safe_material_classify sc on sd.material_classify_id = sc.id |
| | | INNER JOIN safe_material_classify sc on sd.big_classify_id = sc.id |
| | | INNER JOIN safe_material sm on sd.sm_id = sm.id |
| | | where sd.del_flag = 0 |
| | | <if test="query.rfid != null and query.rfid != '' "> |
| | |
| | | <update id="updateValidStatus" > |
| | | update safe_material_detail set valid_status = #{validStatus} where id = #{id} |
| | | </update> |
| | | <select id="getRfidNotNullList" resultType="java.lang.Long"> |
| | | select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid is not null ORDER BY ware_housing_time asc LIMIT #{count} |
| | | </select> |
| | | |
| | | <select id="getRfidNullList" resultType="java.lang.Long"> |
| | | select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid is null ORDER BY ware_housing_time asc LIMIT #{count} |
| | | </select> |
| | | <select id="getIdListByRfid" resultType="java.lang.Long"> |
| | | select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid = #{rfid} ORDER BY ware_housing_time asc LIMIT #{count} |
| | | </select> |
| | | <select id="getSmallClassifyStockByIds" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyStockDO"> |
| | | select d.small_classify_id, |
| | | m.dep_id, |
| | | m.dep_name, |
| | | count(1) as stockCount |
| | | from safe_material_detail d |
| | | INNER JOIN safe_material m |
| | | ON d.sm_id = m.id |
| | | where d.del_flag = 0 |
| | | and d.ir_status = 0 |
| | | and d.valid_status = 0 |
| | | and d.small_classify_id in |
| | | <foreach collection="smallClassifyIds" item="smallClassifyId" separator="," open="(" close=")"> |
| | | #{smallClassifyId} |
| | | </foreach> |
| | | group By d.small_classify_id,m.dep_id,m.dep_name |
| | | </select> |
| | | <select id="getListBySmallClassifyIds" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailDO"> |
| | | SELECT |
| | | sd.id, |
| | | sd.rfid, |
| | | sm.dep_id, |
| | | sd.small_classify_id, |
| | | sd.big_classify_id |
| | | FROM |
| | | safe_material_detail sd |
| | | INNER JOIN safe_material sm ON sd.sm_id = sm.id |
| | | WHERE |
| | | sd.del_flag = 0 |
| | | AND sd.ir_status = 0 |
| | | AND sd.valid_status = 0 |
| | | AND sd.small_classify_id IN |
| | | <foreach collection="smallClassifyIds" item="smallClassifyId" open="(" close=")" separator=","> |
| | | #{smallClassifyId} |
| | | </foreach> |
| | | AND sm.dep_id IN |
| | | <foreach collection="depIds" item="depId" open="(" close=")" separator=","> |
| | | #{depId} |
| | | </foreach> |
| | | ORDER BY |
| | | sd.create_time ASC |
| | | </select> |
| | | <select id="getListByRfids" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO"> |
| | | SELECT |
| | | sd.id, |
| | | CONCAT( sd.NAME, '(NO', sd.material_no, ')' ) as name, |
| | | sd.big_classify_id, |
| | | sd.small_classify_id, |
| | | sm.dep_id |
| | | FROM |
| | | safe_material_detail sd |
| | | inner join safe_material sm on sd.sm_id = sm.id |
| | | WHERE |
| | | sd.del_flag = 0 |
| | | AND sd.ir_status = 1 |
| | | AND sd.rfid in |
| | | <foreach collection="rfids" item="rfid" open="(" close=")" separator=","> |
| | | #{rfid} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | <resultMap type="com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo" id="materialResult"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="serial_num" property="serialNum" jdbcType="VARCHAR"/> |
| | | <result column="material_classify_id" property="materialClassifyId" jdbcType="BIGINT"/> |
| | | <result column="big_classify_id" property="bigClassifyId" jdbcType="BIGINT"/> |
| | | <result column="small_classify_id" property="smallClassifyId" jdbcType="BIGINT"/> |
| | | <result column="dep_id" property="depId" jdbcType="BIGINT"/> |
| | | <result column="dep_name" property="depName" jdbcType="VARCHAR"/> |
| | | <result column="material_name" property="materilaName" jdbcType="VARCHAR"/> |
| | |
| | | </resultMap> |
| | | <!--查询单条数据--> |
| | | <select id="queryById" resultMap="materialResult"> |
| | | select id,serial_num,material_classify_id,dep_id,dep_name,material_name,consumable,del_flag,create_time,create_uid,create_uname,update_time,update_uid,update_uname from safe_material where id = #{id} and del_flag = 0; |
| | | select id,serial_num,small_classify_id,big_classify_id,dep_id,dep_name,material_name,consumable,del_flag,create_time,create_uid,create_uname,update_time,update_uid,update_uname from safe_material where id = #{id} and del_flag = 0; |
| | | </select> |
| | | <!--查询所有数量--> |
| | | <select id="getTotalCount" resultType="java.lang.Integer"> |
| | | select count(1) from safe_material; |
| | | </select> |
| | | <!--根据类型统计数量--> |
| | | <select id="getCountByClassify" resultType="java.lang.Integer"> |
| | | select count(1) from safe_material where del_flag = 0 and material_classify_id = #{classifyId} |
| | | <!--根据小类型统计数量--> |
| | | <select id="getCountBySmallClassifyId" resultType="java.lang.Integer"> |
| | | select count(1) from safe_material where del_flag = 0 and small_classify_id = #{smallClassifyId} |
| | | </select> |
| | | <update id="deleteBatch"> |
| | | update safe_material set del_flag = 1 where id in |
| | |
| | | <select id="listByConditions" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDO"> |
| | | select m.id, |
| | | m.serial_num, |
| | | m.material_classify_id, |
| | | m.big_classify_id as bigClassifyId, |
| | | m.small_classify_id as smallClassifyId, |
| | | m.dep_id, |
| | | m.dep_name, |
| | | m.material_name, |
| | | m.consumable, |
| | | c.material_classify_name |
| | | c.material_classify_name as bigClassifyName |
| | | from safe_material m |
| | | inner join safe_material_classify c |
| | | on m.material_classify_id = c.id |
| | | on m.big_classify_id = c.id |
| | | where m.del_flag = 0 |
| | | <if test="query.materialName != null and query.materialName != '' "> |
| | | and instr(m.material_name,#{query.materialName})>0 |
| | | </if> |
| | | <if test="query.materialClassifyId != null"> |
| | | and m.material_classify_id = #{query.materialClassifyId} |
| | | <if test="query.bigClassifyId != null"> |
| | | and m.big_classify_id = #{query.bigClassifyId} |
| | | </if> |
| | | order by m.create_time desc |
| | | </select> |
| | | |
| | | <select id="checkMatrial" resultType="java.lang.Integer"> |
| | | select count(1) |
| | | from safe_material |
| | | where del_flag = 0 |
| | | and small_classify_id = #{smallClassifyId} |
| | | and dep_id = #{depId} |
| | | <if test="id != null"> |
| | | and id != #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |