| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.management.domain.SlStoreManagement; |
| | | import com.ruoyi.management.domain.SlVolumeProductionRkgl; |
| | | import com.ruoyi.management.domain.*; |
| | | import com.ruoyi.management.domain.dto.SupplierVolumeProductionRkglQuery; |
| | | import com.ruoyi.management.domain.dto.VolumeProductionRkglDTO; |
| | | import com.ruoyi.management.domain.vo.ManagementimgVolumeProductionRkVO; |
| | | import com.ruoyi.management.domain.vo.SupplierVolumeProductionRkglVO; |
| | | import com.ruoyi.management.domain.vo.VolumeProductionRkgInfoVO; |
| | | import com.ruoyi.management.mapper.SlStoreManagementMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionRkglMapper; |
| | | import com.ruoyi.management.domain.vo.VolumeProductionRkgInventoryVO; |
| | | import com.ruoyi.management.mapper.*; |
| | | import com.ruoyi.management.service.SlVolumeProductionRkglService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.xml.crypto.Data; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private SlStoreManagementMapper slStoreManagementMapper; |
| | | |
| | | @Resource |
| | | private SlVolumeProductionRkMapper slVolumeProductionRkMapper; |
| | | |
| | | @Resource |
| | | private SlGoodsMaterialsMapper slGoodsMaterialsMapper; |
| | | |
| | | @Resource |
| | | private SlGoodsShelfMapper slGoodsShelfMapper; |
| | | |
| | | @Resource |
| | | private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; |
| | | |
| | | @Override |
| | | public PageDTO<SupplierVolumeProductionRkglVO> getSupplierVolumeProductionRkglList(SupplierVolumeProductionRkglQuery supplierVolumeProductionRkglQuery) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public VolumeProductionRkgInventoryVO getVolumeProductionRkgInventory(Integer id) { |
| | | SlVolumeProductionRkgl byId = this.getById(id); |
| | | VolumeProductionRkgInventoryVO vo = new VolumeProductionRkgInventoryVO(); |
| | | SysUser data = sysUserClient.getSysUser(byId.getId()).getData(); |
| | | vo.setSysPhone(data.getPhonenumber()); |
| | | vo.setSysName(data.getNickName()); |
| | | vo.setStartiTime(byId.getStartiTime()); |
| | | SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(byId.getManagementId()); |
| | | vo.setStoreManagementName(slStoreManagement.getStoreManagementName()); |
| | | String directorId = slStoreManagement.getDirectorId(); |
| | | List<String> stri = Arrays.asList(directorId.split(",")); |
| | | String str1 = null; |
| | | if (stri.size() > 0) { |
| | | for (String str : stri) { |
| | | SysUser data1 = sysUserClient.getSysUser(Long.valueOf(str)).getData(); |
| | | str1 += data1.getNickName() + ","; |
| | | } |
| | | } |
| | | vo.setDirectorName(str1.substring(0, str1.length() - 1)); |
| | | |
| | | String competentId = slStoreManagement.getCompetentId(); |
| | | List<String> stri1 = Arrays.asList(competentId.split(",")); |
| | | String str11 = null; |
| | | if (stri1.size() > 0) { |
| | | for (String str : stri1) { |
| | | SysUser data1 = sysUserClient.getSysUser(Long.valueOf(str)).getData(); |
| | | str11 += data1.getNickName() + ","; |
| | | } |
| | | } |
| | | vo.setCompetentName(str11.substring(0, str11.length() - 1)); |
| | | |
| | | String administratorId = slStoreManagement.getAdministratorId(); |
| | | List<String> stri11 = Arrays.asList(administratorId.split(",")); |
| | | String str111 = null; |
| | | if (stri11.size() > 0) { |
| | | for (String str : stri11) { |
| | | SysUser data1 = sysUserClient.getSysUser(Long.valueOf(str)).getData(); |
| | | str111 += data1.getNickName() + ","; |
| | | } |
| | | } |
| | | vo.setAdministratorName(str111.substring(0, str111.length() - 1)); |
| | | |
| | | List<ManagementimgVolumeProductionRkVO> managementList = new ArrayList<>(); |
| | | |
| | | |
| | | LambdaQueryWrapper<SlVolumeProductionRk> wrapper1 = Wrappers.lambdaQuery(); |
| | | wrapper1.eq(SlVolumeProductionRk::getVolumeProductionRkglId, byId.getId()); |
| | | wrapper1.eq(SlVolumeProductionRk::getDelFlag, 0); |
| | | wrapper1.orderByDesc(SlVolumeProductionRk::getCreateTime); |
| | | List<SlVolumeProductionRk> page2 = slVolumeProductionRkMapper.selectList(wrapper1); |
| | | for (SlVolumeProductionRk list : page2) { |
| | | ManagementimgVolumeProductionRkVO rkVO = new ManagementimgVolumeProductionRkVO(); |
| | | SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(list.getMaterialsId()); |
| | | rkVO.setGoodsMaterialsName(slGoodsMaterials.getGoodsMaterialsName()); |
| | | rkVO.setIsConsume(slGoodsMaterials.getIsConsume()); |
| | | rkVO.setRkModel(list.getRkModel()); |
| | | rkVO.setRkNum(list.getRkNum()); |
| | | rkVO.setRkPice(list.getRkPice()); |
| | | rkVO.setStoreManagementNumber(rkVO.getStoreManagementNumber()); |
| | | SlGoodsShelf slGoodsShelf = slGoodsShelfMapper.selectById(list.getShelfId()); |
| | | rkVO.setGoodsShelfName(slGoodsShelf.getGoodsShelfName()); |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public void rk(Integer id) { |
| | | LambdaQueryWrapper<SlVolumeProductionRk> wrapper1 = Wrappers.lambdaQuery(); |
| | | wrapper1.eq(SlVolumeProductionRk::getVolumeProductionRkglId, id); |
| | | wrapper1.eq(SlVolumeProductionRk::getDelFlag, 0); |
| | | wrapper1.orderByDesc(SlVolumeProductionRk::getCreateTime); |
| | | List<SlVolumeProductionRk> page2 = slVolumeProductionRkMapper.selectList(wrapper1); |
| | | for (SlVolumeProductionRk list : page2) { |
| | | LambdaQueryWrapper<ManagementGoodsMaterials> wrapper2 = Wrappers.lambdaQuery(); |
| | | wrapper2.eq(ManagementGoodsMaterials::getGoodsMaterialsId,list.getMaterialsId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getManagementId,list.getManagementId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getDelFlag, 0); |
| | | ManagementGoodsMaterials managementGoodsMaterials = managementGoodsMaterialsMapper.selectOne(wrapper2); |
| | | if (managementGoodsMaterials!=null){ |
| | | Long repertorySum = managementGoodsMaterials.getRepertorySum(); |
| | | Long repertoryZhai = managementGoodsMaterials.getRepertoryZhai(); |
| | | Long re=repertorySum+list.getRkNum(); |
| | | Long re1=repertoryZhai+list.getRkNum(); |
| | | managementGoodsMaterials.setRepertoryZhai(re); |
| | | managementGoodsMaterials.setRepertorySum(re1); |
| | | managementGoodsMaterialsMapper.updateById(managementGoodsMaterials); |
| | | }else{ |
| | | ManagementGoodsMaterials managementGoodsMaterials1=new ManagementGoodsMaterials(); |
| | | managementGoodsMaterials1.setManagementId(list.getManagementId()); |
| | | managementGoodsMaterials1.setGoodsMaterialsId(list.getMaterialsId()); |
| | | managementGoodsMaterials1.setRepertoryZhai(list.getRkNum()); |
| | | managementGoodsMaterials1.setRepertorySum(list.getRkNum()); |
| | | managementGoodsMaterialsMapper.insert(managementGoodsMaterials1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |