equipment/equipment-rpc-provider/src/main/java/com/gkhy/safePlatform/equipment/rpc/provider/EquipmentRpcProvider.java
@@ -88,7 +88,7 @@ resultVO.setMsg(e.getMessage()); }catch (Exception e){ resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; @@ -108,7 +108,7 @@ resultVO.setMsg(e.getMessage()); }catch (Exception e){ resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; @@ -131,7 +131,7 @@ resultVO.setMsg(e.getMessage()); }catch (Exception e){ resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; @@ -154,7 +154,7 @@ resultVO.setMsg(e.getMessage()); }catch (Exception e){ resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; @@ -183,7 +183,7 @@ resultVO.setMsg(e.getMessage()); }catch (Exception e){ resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; } @@ -202,7 +202,7 @@ resultVO.setMsg(e.getMessage()); }catch (Exception e){ resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; @@ -227,11 +227,13 @@ resultVO.setData(materialReceiveRecordsRPCRespDtos); } }catch (EquipmentException e){ e.printStackTrace(); resultVO.setCode(e.getCode()); resultVO.setMsg(e.getMessage()); }catch (Exception e){ e.printStackTrace(); resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc()); resultVO.setMsg(ResultCodes.SERVER_ERROR.getDesc()); } return resultVO; equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/common/RocketMQTemplateHelper.java
文件已删除 equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java
@@ -1,13 +1,13 @@ package com.gkhy.safePlatform.equipment.controller; import com.alibaba.fastjson.JSONObject; import com.gkhy.safePlatform.commons.co.ContextCacheUser; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.query.PageQuery; import com.gkhy.safePlatform.commons.utils.PageUtils; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.commons.vo.SearchResultVO; import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO; import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsBaseReq; import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery; import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialReceiveRecordsBaseDto; @@ -43,4 +43,14 @@ materialReceiveRecordsService.revertMaterial(currentUser,req); return new ResultVO(ResultCodes.OK); } /** * 获取单条记录 */ @RequestMapping("queryById") public ResultVO queryById(Authentication authentication, @RequestBody JSONObject jsonObject){ ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); Long id = jsonObject.getLong("id"); MaterialReceiveRecordsBaseDto materialReceiveRecordsBaseDto = materialReceiveRecordsService.queryById(currentUser,id); return new ResultVO(ResultCodes.OK,materialReceiveRecordsBaseDto); } } equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/mq/consumer/SafeMaterialConsumer.java
文件已删除 equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/mq/msg/SafeMaterialMsg.java
文件已删除 equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/MaterialReceiveRecordsService.java
@@ -16,4 +16,6 @@ void revertMaterial(ContextCacheUser currentUser, MaterialReceiveRecordsBaseReq req); List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo); MaterialReceiveRecordsBaseDto queryById(ContextCacheUser currentUser, Long id); } equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/MaterialReceiveRecordsInfoService.java
@@ -19,4 +19,6 @@ List<MaterialReceiveRecordsInfo> listByReceiveBaseIds(List<Long> idList); List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo); List<MaterialReceiveRecordsInfo> listByReceiveBaseId(Long id); } equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/MaterialReceiveRecordsInfoServiceImpl.java
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import java.util.List; @@ -66,4 +67,14 @@ } return repository.getReceiveRecordsByReceiveUids(bo); } @Override public List<MaterialReceiveRecordsInfo> listByReceiveBaseId(Long id) { if (ObjectUtils.isEmpty(id)) { throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); } List<MaterialReceiveRecordsInfo> receiveRecordsInfoList = repository.selectList(new LambdaQueryWrapper<MaterialReceiveRecordsInfo>() .eq(MaterialReceiveRecordsInfo::getReceiveBaseId, id)); return receiveRecordsInfoList; } } equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/MaterialReceiveRecordsServiceImpl.java
@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import java.time.LocalDateTime; import java.util.ArrayList; @@ -216,4 +217,29 @@ return list; } @Override public MaterialReceiveRecordsBaseDto queryById(ContextCacheUser currentUser, Long id) { if(ObjectUtils.isEmpty(id)){ throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"领取总记录主键不可为空!"); } MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = recordsBaseInfoService.queryById(id); List<MaterialReceiveRecordsInfo> receiveRecordsInfoList = receiveRecordsInfoService.listByReceiveBaseId(id); MaterialReceiveRecordsBaseDto materialReceiveRecordsBaseDto = new MaterialReceiveRecordsBaseDto(); if(!ObjectUtils.isEmpty(receiveRecordsBaseInfo)){ BeanUtils.copyProperties(receiveRecordsBaseInfo,materialReceiveRecordsBaseDto); List<MaterialReceiveRecordsDto> receiveRecordsDtoList = new ArrayList<>(); for(MaterialReceiveRecordsInfo receiveRecordsInfo:receiveRecordsInfoList){ MaterialReceiveRecordsDto receiveRecordsDto = new MaterialReceiveRecordsDto(); BeanUtils.copyProperties(receiveRecordsInfo,receiveRecordsDto); receiveRecordsDto.setMaterialStatusName(MaterialStatusEnum.getByCode(receiveRecordsInfo.getMaterialStatus()).getValue()); receiveRecordsDto.setRevertStatusName(MaterialRevertStatusEnum.getByCode(receiveRecordsInfo.getRevertStatus()).getValue()); receiveRecordsDtoList.add(receiveRecordsDto); } materialReceiveRecordsBaseDto.setMaterialList(receiveRecordsDtoList); return materialReceiveRecordsBaseDto; } return null; } } equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialDetailInfoMapper.xml
@@ -320,7 +320,8 @@ delivery_time, sm_id, receive_uid, receive_uname receive_uname, status from safe_material_detail where del_flag = 0 and valid_status = #{validStatus} pom.xml
@@ -147,6 +147,18 @@ <version>${redission.version}</version> </dependency> <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-spring-boot</artifactId> <version>${rocketmq.starter.version}</version> </dependency> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.8.5</version> </dependency> </dependencies> </dependencyManagement> @@ -265,6 +277,19 @@ <artifactId>account-rpc-api</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-spring-boot</artifactId> </dependency> <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> </dependency> </dependencies> <build>