| | |
| | | import com.ld.igds.inout.dto.InoutParam; |
| | | import com.ld.igds.inout.dto.InoutRecordItemData; |
| | | import com.ld.igds.inout.dto.InoutRecordItemParam; |
| | | import com.ld.igds.inout.mapper.InoutRecordMapper; |
| | | import com.ld.igds.inout.service.InoutRecordItemService; |
| | | import com.ld.igds.inout.service.InoutService; |
| | | import com.ld.igds.m.dto.NoticeParam; |
| | |
| | | import com.ld.igds.util.DateUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private InoutCommonService inoutManagerService; |
| | | @Resource |
| | | private HInoutCarConfService carConfService; |
| | | @Autowired |
| | | private InoutRecordMapper inoutMapper; |
| | | |
| | | /** |
| | | * 出入库流程中的实时数据,直接从缓存中获取 |
| | |
| | | result.put("listProgress", listProgress); |
| | | result.put("listComplete", listComplete); |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行完成", result); |
| | | } |
| | | |
| | | public PageResponse<List<InoutData>> listOnlyProgress(InoutParam param) { |
| | | |
| | | String type = param.getType(); |
| | | //当前流程中 |
| | | List<InoutData> listProgress = inoutService.getListInoutCache(param.getDeptId()); |
| | | List<InoutData> result = new ArrayList<>(); |
| | | if (null == listProgress || listProgress.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行完成", result); |
| | | } |
| | | |
| | | if (null == type) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行完成", result); |
| | | } |
| | | |
| | | for (InoutData data : listProgress) { |
| | | if (data.getType().equals(type)) result.add(data); |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行完成", result); |
| | | } |
| | | |
| | |
| | | // 调用保存方法执行 |
| | | if (null == data.getIntelCard()) { |
| | | data.setIntelCard(data.getUserId()); |
| | | } |
| | | if (null == data.getRegisterTime()) { |
| | | data.setRegisterTime(new Date()); |
| | | } |
| | | msg = inoutService.insertData(data); |
| | | |
| | |
| | | if (InoutConstant.PROGRESS_RECORD.equals(data.getProgress())) { |
| | | //说明流程已结束,重新统计数量 |
| | | inoutRecordItemService.updateNumByInoutItem(data.getRecordId()); |
| | | InoutParam param = new InoutParam(); |
| | | param.setId(data.getRecordId()); |
| | | param.setType(data.getType()); |
| | | param.setCompanyId(data.getCompanyId()); |
| | | InoutData completeData = inoutMapper.inoutQueryById(param); |
| | | inoutService.updateInoutCache(completeData); |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), null, data); |
| | | |
| | | } else { |
| | |
| | | data.setDepotId(item.getDepotId()); |
| | | } |
| | | if (data.getDepotId().equals(item.getDepotId())) { |
| | | |
| | | inoutParam.setId(data.getRecordId()); |
| | | } else { |
| | | String newId = data.getRecordId() + temp; |
| | |
| | | map.put(inoutParam.getId(), inoutParam); |
| | | } |
| | | InoutParam par; |
| | | InoutData dat; |
| | | for (String key : map.keySet()) { |
| | | par = map.get(key); |
| | | if (par != null) { |
| | | dat = new InoutData(); |
| | | //更新流水数据(包含重量信息以及流程进度信息) |
| | | inoutService.toComplete(par); |
| | | BeanUtils.copyProperties(par, dat); |
| | | inoutService.updateData(dat); |
| | | |
| | | // //更新仓库库存 |
| | | // if (InoutConstant.TYPE_IN.equals(par.getType())) { |
| | |
| | | // } |
| | | } |
| | | } |
| | | |
| | | InoutData completeData = inoutMapper.inoutQueryById(inoutParam); |
| | | inoutService.updateInoutCache(completeData); |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), null, data); |
| | | } |
| | | |
| | |
| | | if (null == list || list.isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), "查询结果为空!"); |
| | | } |
| | | for (InoutNoticeIn inoutNoticeIn : list) { |
| | | Depot cacheDepot = coreCommonService.getCacheDepot(inoutNoticeIn.getCompanyId(), inoutNoticeIn.getDepotId()); |
| | | if (null == cacheDepot) { |
| | | continue; |
| | | } |
| | | inoutNoticeIn.setDepotName(cacheDepot.getName()); |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, list); |
| | | } |
| | | |