| | |
| | | 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 io.swagger.models.auth.In; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private SlGoodsShelfMapper slGoodsShelfMapper; |
| | | |
| | | @Resource |
| | | private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; |
| | | |
| | | @Resource |
| | | private LogClient logClient; |
| | | |
| | | @Override |
| | | public PageDTO<VolumeProductionCkglVO> getslVolumeProductionCkglList(getslVolumeProductionCkglQuery VolumeProductionCkglQuery) { |
| | | |
| | |
| | | PageDTO<VolumeProductionCkglVO> SlGoodsShelfDTO = PageDTO.of(page2, VolumeProductionCkglVO .class); |
| | | List<VolumeProductionCkglVO> list2 = SlGoodsShelfDTO.getList(); |
| | | for(VolumeProductionCkglVO 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()); |
| | |
| | | if (volumeProductionCkglDTO.getId()!=null){ |
| | | SlVolumeProductionCkgl slVolumeProductionRkgl=new SlVolumeProductionCkgl(); |
| | | slVolumeProductionRkgl.setAttachmentUrl(volumeProductionCkglDTO.getAttachmentUrl()); |
| | | slVolumeProductionRkgl.setAuthorization(volumeProductionCkglDTO.getAuthorization()); |
| | | slVolumeProductionRkgl.setAuthorizationUrl(volumeProductionCkglDTO.getAuthorization()); |
| | | slVolumeProductionRkgl.setSource(volumeProductionCkglDTO.getSource()); |
| | | slVolumeProductionRkgl.setAuditStatus(1); |
| | | slVolumeProductionRkgl.setManagementId(volumeProductionCkglDTO.getManagementId()); |
| | | slVolumeProductionRkgl.setPresentState(1); |
| | |
| | | byId.setAttachmentUrl(volumeProductionCkglDTO.getAttachmentUrl()); |
| | | } |
| | | if (volumeProductionCkglDTO.getAuthorization()!=null){ |
| | | byId.setAuthorization(volumeProductionCkglDTO.getAuthorization()); |
| | | byId.setAuthorizationUrl(volumeProductionCkglDTO.getAuthorization()); |
| | | } |
| | | this.updateById(byId); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public VolumeProductionCkglInfoVO getVolumeProductionCkglnfo(Integer id) { |
| | | public VolumeProductionCkglInfoVO getVolumeProductionCkglnfo(Long id) { |
| | | |
| | | SlVolumeProductionCkgl byId = this.getById(id); |
| | | VolumeProductionCkglInfoVO v= BeanUtils.copyBean(byId, VolumeProductionCkglInfoVO.class); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public VolumeProductionCkglInventoryVO getVolumeProductionCkglInventory(Integer id) { |
| | | public VolumeProductionCkglInventoryVO getVolumeProductionCkglInventory(Long id) { |
| | | SlVolumeProductionCkgl byId = this.getById(id); |
| | | VolumeProductionCkglInventoryVO vo = new VolumeProductionCkglInventoryVO(); |
| | | SysUser data = sysUserClient.getSysUser(byId.getId()).getData(); |
| | |
| | | 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(); |
| | |
| | | |
| | | 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(); |
| | |
| | | |
| | | 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(); |
| | |
| | | vo.setManagementimgVolumeProductionCkVOList(SlGoodsShelfDTO); |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public void ck(Long id) { |
| | | LambdaQueryWrapper<SlVolumeProductionCk> wrapper1 = Wrappers.lambdaQuery(); |
| | | wrapper1.eq(SlVolumeProductionCk::getCkglId, id); |
| | | wrapper1.eq(SlVolumeProductionCk::getDelFlag, 0); |
| | | wrapper1.orderByDesc(SlVolumeProductionCk::getCreateTime); |
| | | List<SlVolumeProductionCk> page2 = slVolumeProductionCkMapper.selectList(wrapper1); |
| | | for (SlVolumeProductionCk list : page2) { |
| | | SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(list.getRkId()); |
| | | Long num =slVolumeProductionRk.getRepertoryZhai()-Long.valueOf(list.getCkNum()); |
| | | slVolumeProductionRk.setRepertoryZhai(num); |
| | | slVolumeProductionRkMapper.updateById(slVolumeProductionRk); |
| | | |
| | | LambdaQueryWrapper<ManagementGoodsMaterials> wrapper2 = Wrappers.lambdaQuery(); |
| | | wrapper2.eq(ManagementGoodsMaterials::getGoodsMaterialsId,list.getMaterialsId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getManagementId,slVolumeProductionRk.getManagementId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getDelFlag, 0); |
| | | ManagementGoodsMaterials managementGoodsMaterials = managementGoodsMaterialsMapper.selectOne(wrapper2); |
| | | if (managementGoodsMaterials!=null){ |
| | | Long repertoryZhai = managementGoodsMaterials.getRepertoryZhai(); |
| | | Long re1=repertoryZhai-Long.valueOf(list.getCkNum()); |
| | | Integer num1= managementGoodsMaterials.getRepertoryChu()+list.getCkNum(); |
| | | managementGoodsMaterials.setRepertoryZhai(re1); |
| | | managementGoodsMaterials.setCheckNum(num1); |
| | | managementGoodsMaterialsMapper.updateById(managementGoodsMaterials); |
| | | } |
| | | } |
| | | SlVolumeProductionCkgl byId = this.getById(id); |
| | | byId.setAuditStatus(6); |
| | | this.updateById(byId); |
| | | logClient.savelong1(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void gh(Long id) { |
| | | LambdaQueryWrapper<SlVolumeProductionCk> wrapper1 = Wrappers.lambdaQuery(); |
| | | wrapper1.eq(SlVolumeProductionCk::getCkglId, id); |
| | | wrapper1.eq(SlVolumeProductionCk::getDelFlag, 0); |
| | | wrapper1.orderByDesc(SlVolumeProductionCk::getCreateTime); |
| | | List<SlVolumeProductionCk> page2 = slVolumeProductionCkMapper.selectList(wrapper1); |
| | | for (SlVolumeProductionCk list : page2) { |
| | | list.setIsGh(2); |
| | | slVolumeProductionCkMapper.updateById(list); |
| | | |
| | | SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(list.getRkId()); |
| | | Long num =slVolumeProductionRk.getRepertoryZhai()+Long.valueOf(list.getGuihNum()); |
| | | slVolumeProductionRk.setRepertoryZhai(num); |
| | | slVolumeProductionRkMapper.updateById(slVolumeProductionRk); |
| | | |
| | | LambdaQueryWrapper<ManagementGoodsMaterials> wrapper2 = Wrappers.lambdaQuery(); |
| | | wrapper2.eq(ManagementGoodsMaterials::getGoodsMaterialsId,list.getMaterialsId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getManagementId,slVolumeProductionRk.getManagementId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getDelFlag, 0); |
| | | ManagementGoodsMaterials managementGoodsMaterials = managementGoodsMaterialsMapper.selectOne(wrapper2); |
| | | if (managementGoodsMaterials!=null){ |
| | | Long repertoryZhai = managementGoodsMaterials.getRepertoryZhai(); |
| | | Long re1=repertoryZhai+Long.valueOf(list.getGuihNum()); |
| | | Integer m=managementGoodsMaterials.getCheckNum()-list.getCkNum(); |
| | | Integer m1=list.getCkNum()-list.getGuihNum(); |
| | | Integer m2=managementGoodsMaterials.getRepertoryYishi()+m1; |
| | | managementGoodsMaterials.setRepertoryChu(m); |
| | | managementGoodsMaterials.setRepertoryZhai(re1); |
| | | managementGoodsMaterials.setRepertoryYishi(m2); |
| | | managementGoodsMaterialsMapper.updateById(managementGoodsMaterials); |
| | | } |
| | | } |
| | | SlVolumeProductionCkgl byId = this.getById(id); |
| | | byId.setAuditStatus(7); |
| | | byId.setPresentState(4); |
| | | byId.setEndTime(new Date()); |
| | | this.updateById(byId); |
| | | } |
| | | } |