| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.enums.ClientTypeEnum; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.management.domain.InventoriesSupplies; |
| | | import com.ruoyi.management.domain.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.management.domain.SlGoodsShelf; |
| | | import com.ruoyi.management.domain.SlStoreManagement; |
| | | import com.ruoyi.management.domain.SlVolumeProductionRk; |
| | | import com.ruoyi.management.domain.dto.InventoriesSuppDTO; |
| | | import com.ruoyi.management.domain.dto.InventoriesSuppliesQuery; |
| | | import com.ruoyi.management.domain.dto.ScanCodesDTO; |
| | |
| | | import com.ruoyi.management.mapper.SlStoreManagementMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionRkMapper; |
| | | import com.ruoyi.management.service.InventoriesSuppliesService; |
| | | import com.ruoyi.management.service.SlGoodsMaterialsService; |
| | | import com.ruoyi.management.service.SlGoodsShelfService; |
| | | import com.ruoyi.management.service.SlVolumeProductionRkService; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.domain.WebsocketMessageDTO; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private SlVolumeProductionRkMapper slVolumeProductionRkMapper; |
| | | |
| | | @Autowired |
| | | private SlGoodsMaterialsService slGoodsMaterialsService; |
| | | @Autowired |
| | | private SlGoodsShelfService slGoodsShelfService; |
| | | @Autowired |
| | | private InventoriesSuppliesMapper inventoriesSuppliesMapper; |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | @Override |
| | | public PageDTO<InventoriesSuppliesVO> getInventoriesSuppliesList(InventoriesSuppliesQuery inventoriesSuppliesQuery) { |
| | | LambdaQueryWrapper<SlStoreManagement> wrapper= Wrappers.lambdaQuery(); |
| | | if (inventoriesSuppliesQuery.getStoreManagementName()!=null){ |
| | | if (inventoriesSuppliesQuery.getStoreManagementName()!=null&&inventoriesSuppliesQuery.getStoreManagementName()!=""){ |
| | | wrapper.eq(SlStoreManagement::getStoreManagementName,inventoriesSuppliesQuery.getStoreManagementName()); |
| | | } |
| | | if (inventoriesSuppliesQuery.getStoreManagementNo()!=null){ |
| | | if (inventoriesSuppliesQuery.getStoreManagementNo()!=null&&inventoriesSuppliesQuery.getStoreManagementNo()!=""){ |
| | | wrapper.eq(SlStoreManagement::getStoreManagementNo,inventoriesSuppliesQuery.getStoreManagementNo()); |
| | | } |
| | | List<SlStoreManagement> slStoreManagements = slStoreManagementMapper.selectList(wrapper); |
| | |
| | | |
| | | Page<InventoriesSupplies> page = new Page<>(inventoriesSuppliesQuery.getPageCurr(), inventoriesSuppliesQuery.getPageSize()); |
| | | LambdaQueryWrapper< InventoriesSupplies> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.like(InventoriesSupplies::getPdrName,inventoriesSuppliesQuery.getPdrName()); |
| | | if (inventoriesSuppliesQuery.getPdrName()!=null&&inventoriesSuppliesQuery.getPdrName()!=""){ |
| | | wrapper1.like(InventoriesSupplies::getPdrName,inventoriesSuppliesQuery.getPdrName()); |
| | | } |
| | | if (slStoreManagementIdList.size()>0){ |
| | | wrapper1.in(InventoriesSupplies::getMaterialsId,slStoreManagementIdList); |
| | | }else { |
| | |
| | | |
| | | wrapper1.gt(InventoriesSupplies::getPdTime, inventoriesSuppliesQuery.getStartpdTime()); |
| | | } |
| | | if (inventoriesSuppliesQuery.getEndpdTime()!=null){ |
| | | if (inventoriesSuppliesQuery.getEndpdTime()!=null&&inventoriesSuppliesQuery.getPdrName()!=""){ |
| | | wrapper1.le(InventoriesSupplies::getPdTime, inventoriesSuppliesQuery.getEndpdTime()); |
| | | } |
| | | |
| | |
| | | InventoriesSupplies inventoriesSupplies=new InventoriesSupplies(); |
| | | inventoriesSupplies.setMaterialsId(inventoriesSuppDTO.getMaterialsId()); |
| | | inventoriesSupplies.setPdTime(new Date()); |
| | | inventoriesSupplies.setCreateTime(new Date()); |
| | | inventoriesSupplies.setPdrId(inventoriesSuppDTO.getPdrId()); |
| | | R<SysUser> sysUser = sysUserClient.getSysUser(inventoriesSuppDTO.getPdrId()); |
| | | inventoriesSupplies.setPdrName(sysUser.getData().getNickName()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void scanCodes(ScanCodesDTO scanCodesDTO) { |
| | | public void scanCodes(String rkNumber) { |
| | | LambdaQueryWrapper< SlVolumeProductionRk> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.like(SlVolumeProductionRk::getRkNumber,scanCodesDTO.getRkNumber()); |
| | | wrapper1.eq( SlVolumeProductionRk::getDelFlag,0); |
| | | wrapper1.eq(SlVolumeProductionRk::getRkNumber,rkNumber); |
| | | wrapper1.eq(SlVolumeProductionRk::getDelFlag,"0"); |
| | | wrapper1.orderByDesc(SlVolumeProductionRk::getCreateTime); |
| | | SlVolumeProductionRk page2 = slVolumeProductionRkMapper.selectOne(wrapper1); |
| | | // if (page2.getSmerwmNum()<page2.getErwmNum()){ |
| | | // Integer i=page2.getSmerwmNum()+1; |
| | | // page2.setSmerwmNum(i); |
| | | // slVolumeProductionRkMapper.updateById(page2); |
| | | // } |
| | | SlGoodsMaterials byId = slGoodsMaterialsService.getById(page2.getMaterialsId()); |
| | | |
| | | page2.setGoodsMaterialsName(byId.getGoodsMaterialsName()); |
| | | page2.setIsConsume(byId.getIsConsume()); |
| | | page2.setManagementNumber(page2.getStoreManagementNumber()); |
| | | page2.setShelfName(slGoodsShelfService.getById(page2.getShelfId()).getGoodsShelfName()); |
| | | SlVolumeProductionRkVO slVolumeProductionRkVO = new SlVolumeProductionRkVO(); |
| | | BeanUtils.copyProperties(page2,slVolumeProductionRkVO); |
| | | slVolumeProductionRkVO.setId(page2.getId().toString()); |
| | | // slVolumeProductionRkVO.setVolumeProductionRkglId(page2.getVolumeProductionRkglId().toString()); |
| | | slVolumeProductionRkVO.setMaterialsId(page2.getMaterialsId().toString()); |
| | | slVolumeProductionRkVO.setManagementId(page2.getManagementId().toString()); |
| | | slVolumeProductionRkVO.setShelfId(page2.getShelfId().toString()); |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.SCANCODES); |
| | | map.put("SlVolumeProductionRk",page2); |
| | | map.put("SlVolumeProductionRk",slVolumeProductionRkVO); |
| | | String msg = null; |
| | | try { |
| | | msg = objectMapper.writeValueAsString(map); |
| | |
| | | } |
| | | |
| | | |
| | | public InventoriesSupplies getById1(Long suppliesId) { |
| | | return inventoriesSuppliesMapper.getById1(suppliesId); |
| | | } |
| | | } |