From 8876b1b9cd27fad076ea9e5f3e04197b84ba02bd Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 01 八月 2024 14:26:56 +0800 Subject: [PATCH] 代码提交 bug解决 --- ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java | 79 ++++++++++++++++++++++++++++----------- 1 files changed, 56 insertions(+), 23 deletions(-) diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java index 43888ca..b8448b4 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java @@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.domain.getVolumeProductionRkQuery; +import com.ruoyi.system.api.feignClient.LogClient; import com.ruoyi.system.api.feignClient.SysUserClient; import org.springframework.stereotype.Service; @@ -57,6 +58,9 @@ @Resource private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; + @Resource + private LogClient logClient; + @Override public PageDTO<SupplierVolumeProductionRkglVO> getSupplierVolumeProductionRkglList(SupplierVolumeProductionRkglQuery supplierVolumeProductionRkglQuery) { Page<SlVolumeProductionRkgl> page = new Page<>(supplierVolumeProductionRkglQuery.getPageCurr(), supplierVolumeProductionRkglQuery.getPageSize()); @@ -79,17 +83,19 @@ } @Override - public VolumeProductionRkgInfoVO getVolumeProductionRkgInfo(Integer id) { + public VolumeProductionRkgInfoVO getVolumeProductionRkgInfo(Long id) { SlVolumeProductionRkgl byId = this.getById(id); VolumeProductionRkgInfoVO v=BeanUtils.copyBean(byId, VolumeProductionRkgInfoVO.class); SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(byId.getManagementId()); v.setStoreManagementName(slStoreManagement.getStoreManagementName()); SysUser data = sysUserClient.getSysUser(Long.valueOf(byId.getSupplierId())).getData(); + v.setSupplierId(byId.getSupplierId()); v.setSupplierName(data.getNickName()); v.setSupplierPhone(data.getPhonenumber()); SysUser data1 = sysUserClient.getSysUser(Long.valueOf(byId.getSysId())).getData(); v.setSysName(data1.getNickName()); v.setSysPhone(data1.getPhonenumber()); + v.setAuthorization(byId.getAuthorizationUrl()); return v; } @@ -103,9 +109,17 @@ .collect(Collectors.toSet()); LambdaQueryWrapper< SlVolumeProductionRkgl> wrapper1= Wrappers.lambdaQuery(); - wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState()); - wrapper1.eq(SlVolumeProductionRkgl::getAuditStatus,getVolumeProductionRkQuery.getAuditStatus()); + if (getVolumeProductionRkQuery.getPresentState()!=null && getVolumeProductionRkQuery.getPresentState()!=0){ + wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState()); + } + if (getVolumeProductionRkQuery.getAuditStatus()!=null && getVolumeProductionRkQuery.getAuditStatus()!=0) { + wrapper1.eq(SlVolumeProductionRkgl::getAuditStatus, getVolumeProductionRkQuery.getAuditStatus()); + } if (goodsSkuIdList.size()>0){ + wrapper1.in(SlVolumeProductionRkgl::getSysId,goodsSkuIdList); + }else{ + goodsSkuIdList=new HashSet<>(); + goodsSkuIdList.add(0l); wrapper1.in(SlVolumeProductionRkgl::getSysId,goodsSkuIdList); } wrapper1.eq( SlVolumeProductionRkgl::getDelFlag,0); @@ -115,22 +129,25 @@ PageDTO<SupplierVolumeProductionRkglVO> SlGoodsShelfDTO = PageDTO.of(page2, SupplierVolumeProductionRkglVO.class); List<SupplierVolumeProductionRkglVO> list2 = SlGoodsShelfDTO.getList(); for(SupplierVolumeProductionRkglVO list:list2){ - SysUser data = sysUserClient.getSysUser(list.getSupplierId()).getData(); + SysUser data = sysUserClient.getSysUser(list.getSysId()).getData(); list.setNickName(data.getNickName()); list.setPhonenumber(data.getPhonenumber()); SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(list.getManagementId()); - list.setStoreManagementName(slStoreManagement.getStoreManagementName()); + if (slStoreManagement!=null){ + list.setStoreManagementName(slStoreManagement.getStoreManagementName()); + } } return SlGoodsShelfDTO; } @Override - public void addVolumeProductionRkgl(VolumeProductionRkglDTO volumeProductionRkglDTO) { + public Long addVolumeProductionRkgl(VolumeProductionRkglDTO volumeProductionRkglDTO) { Long userid = SecurityUtils.getUserId(); - if (volumeProductionRkglDTO.getId()!=null){ - SlVolumeProductionRkgl slVolumeProductionRkgl=new SlVolumeProductionRkgl(); + SlVolumeProductionRkgl slVolumeProductionRkgl=null; + if (volumeProductionRkglDTO.getId()==null){ + new SlVolumeProductionRkgl(); slVolumeProductionRkgl.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl()); - slVolumeProductionRkgl.setAuthorization(volumeProductionRkglDTO.getAuthorization()); + slVolumeProductionRkgl.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization()); slVolumeProductionRkgl.setAuditStatus(1); slVolumeProductionRkgl.setManagementId(volumeProductionRkglDTO.getManagementId()); slVolumeProductionRkgl.setPresentState(1); @@ -141,31 +158,35 @@ slVolumeProductionRkgl.setRemark(volumeProductionRkglDTO.getRemark()); this.save(slVolumeProductionRkgl); }else{ - SlVolumeProductionRkgl byId = this.getById(volumeProductionRkglDTO.getId()); + slVolumeProductionRkgl = this.getById(volumeProductionRkglDTO.getId()); + slVolumeProductionRkgl.setPresentState(1); + slVolumeProductionRkgl.setAuditStatus(1); if (volumeProductionRkglDTO.getSource()!=null){ - byId.setSource(volumeProductionRkglDTO.getSource()); + slVolumeProductionRkgl.setSource(volumeProductionRkglDTO.getSource()); } if (volumeProductionRkglDTO.getRemark()!=null){ - byId.setRemark(volumeProductionRkglDTO.getRemark()); + slVolumeProductionRkgl.setRemark(volumeProductionRkglDTO.getRemark()); } if (volumeProductionRkglDTO.getSupplierId()!=null){ - byId.setSupplierId(volumeProductionRkglDTO.getSupplierId()); + slVolumeProductionRkgl.setSupplierId(volumeProductionRkglDTO.getSupplierId()); } if (volumeProductionRkglDTO.getAttachmentUrl()!=null){ - byId.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl()); + slVolumeProductionRkgl.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl()); } if (volumeProductionRkglDTO.getAuthorization()!=null){ - byId.setAuthorization(volumeProductionRkglDTO.getAuthorization()); + slVolumeProductionRkgl.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization()); } - this.updateById(byId); + this.updateById(slVolumeProductionRkgl); + } + return slVolumeProductionRkgl.getId(); } @Override - public VolumeProductionRkgInventoryVO getVolumeProductionRkgInventory(Integer id) { + public VolumeProductionRkgInventoryVO getVolumeProductionRkgInventory(Long id) { SlVolumeProductionRkgl byId = this.getById(id); VolumeProductionRkgInventoryVO vo = new VolumeProductionRkgInventoryVO(); - SysUser data = sysUserClient.getSysUser(byId.getId()).getData(); + SysUser data = sysUserClient.getSysUser(byId.getSysId()).getData(); vo.setSysPhone(data.getPhonenumber()); vo.setSysName(data.getNickName()); vo.setStartiTime(byId.getStartiTime()); @@ -173,7 +194,7 @@ vo.setStoreManagementName(slStoreManagement.getStoreManagementName()); String directorId = slStoreManagement.getDirectorId(); List<String> stri = Arrays.asList(directorId.split(",")); - String str1 = null; + String str1 =""; if (stri.size() > 0) { for (String str : stri) { SysUser data1 = sysUserClient.getSysUser(Long.valueOf(str)).getData(); @@ -184,7 +205,7 @@ String competentId = slStoreManagement.getCompetentId(); List<String> stri1 = Arrays.asList(competentId.split(",")); - String str11 = null; + String str11 = ""; if (stri1.size() > 0) { for (String str : stri1) { SysUser data1 = sysUserClient.getSysUser(Long.valueOf(str)).getData(); @@ -195,7 +216,7 @@ String administratorId = slStoreManagement.getAdministratorId(); List<String> stri11 = Arrays.asList(administratorId.split(",")); - String str111 = null; + String str111 = ""; if (stri11.size() > 0) { for (String str : stri11) { SysUser data1 = sysUserClient.getSysUser(Long.valueOf(str)).getData(); @@ -211,6 +232,7 @@ wrapper1.eq(SlVolumeProductionRk::getVolumeProductionRkglId, byId.getId()); wrapper1.eq(SlVolumeProductionRk::getDelFlag, 0); wrapper1.orderByDesc(SlVolumeProductionRk::getCreateTime); + SysUser data1 = sysUserClient.getSysUser(byId.getSupplierId()).getData(); List<SlVolumeProductionRk> page2 = slVolumeProductionRkMapper.selectList(wrapper1); for (SlVolumeProductionRk list : page2) { ManagementimgVolumeProductionRkVO rkVO = new ManagementimgVolumeProductionRkVO(); @@ -220,15 +242,18 @@ rkVO.setRkModel(list.getRkModel()); rkVO.setRkNum(list.getRkNum()); rkVO.setRkPice(list.getRkPice()); - rkVO.setStoreManagementNumber(rkVO.getStoreManagementNumber()); + rkVO.setStoreManagementNumber(list.getStoreManagementNumber()); SlGoodsShelf slGoodsShelf = slGoodsShelfMapper.selectById(list.getShelfId()); rkVO.setGoodsShelfName(slGoodsShelf.getGoodsShelfName()); + rkVO.setSupplierName(data1.getNickName()); + managementList.add(rkVO); } + vo.setManagementimgVolumeProductionRkVOList(managementList); return vo; } @Override - public void rk(Integer id) { + public void rk(Long id) { LambdaQueryWrapper<SlVolumeProductionRk> wrapper1 = Wrappers.lambdaQuery(); wrapper1.eq(SlVolumeProductionRk::getVolumeProductionRkglId, id); wrapper1.eq(SlVolumeProductionRk::getDelFlag, 0); @@ -240,6 +265,9 @@ wrapper2.eq(ManagementGoodsMaterials::getManagementId,list.getManagementId()); wrapper2.eq(ManagementGoodsMaterials::getDelFlag, 0); ManagementGoodsMaterials managementGoodsMaterials = managementGoodsMaterialsMapper.selectOne(wrapper2); + + SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(list.getMaterialsId()); + if (managementGoodsMaterials!=null){ Long repertorySum = managementGoodsMaterials.getRepertorySum(); Long repertoryZhai = managementGoodsMaterials.getRepertoryZhai(); @@ -247,6 +275,7 @@ Long re1=repertoryZhai+list.getRkNum(); managementGoodsMaterials.setRepertorySum(re); managementGoodsMaterials.setRepertoryZhai(re1); + managementGoodsMaterials.setRepertory(slGoodsMaterials.getRepertory()); managementGoodsMaterialsMapper.updateById(managementGoodsMaterials); }else{ ManagementGoodsMaterials managementGoodsMaterials1=new ManagementGoodsMaterials(); @@ -254,6 +283,8 @@ managementGoodsMaterials1.setGoodsMaterialsId(list.getMaterialsId()); managementGoodsMaterials1.setRepertoryZhai(list.getRkNum()); managementGoodsMaterials1.setRepertorySum(list.getRkNum()); + managementGoodsMaterials1.setCreateTime(new Date()); + managementGoodsMaterials1.setRepertory(slGoodsMaterials.getRepertory()); managementGoodsMaterialsMapper.insert(managementGoodsMaterials1); } } @@ -262,6 +293,8 @@ byId.setAuditStatus(6); byId.setEndTime(new Date()); this.updateById(byId); + + logClient.savelong(); } } -- Gitblit v1.7.1