|
|
@@ -68,12 +68,14 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
return map;
|
|
|
}
|
|
|
if(materialClass.getPartType().equals("半成品")){
|
|
|
- map.put("msg", "500");
|
|
|
- map.put("errMsg", "此物料是" + materialClass.getPartType());
|
|
|
+ List<StorageLocation> listTwo = warehousingMapper.getRecommendTwo("1");
|
|
|
+ map.put("data", listTwo);
|
|
|
+ map.put("listString", new HashMap<>());//返回库位剩余数量
|
|
|
return map;
|
|
|
}
|
|
|
if (materialClass.getPartType().equals("产成品")) {
|
|
|
- map.put("data", new ArrayList<>());
|
|
|
+ List<StorageLocation> listTwo = warehousingMapper.getRecommendTwo("2");
|
|
|
+ map.put("data", listTwo);
|
|
|
map.put("listString", new HashMap<>());//返回库位剩余数量
|
|
|
return map;
|
|
|
}
|
|
|
@@ -176,6 +178,8 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
try {
|
|
|
//入库信息
|
|
|
List<WarehousingVirtual> list = new LinkedList<>();
|
|
|
+ //新入库逻辑
|
|
|
+ List<WarehousingVirtual> list1 = new LinkedList<>();
|
|
|
//返回采购单id
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
//查询入库所需要的信息
|
|
|
@@ -194,7 +198,7 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
warehousingVirtual.setMaterialId(warehousingVirtual1.getMaterialId());
|
|
|
warehousingVirtual.setPurchaseNum(receiveGoods1.getPurchaseNum());
|
|
|
list.add(warehousingVirtual);
|
|
|
-
|
|
|
+ list1.add(warehousingVirtual);
|
|
|
if(Double.parseDouble(warehousingVirtual.getNum()) <= 0){
|
|
|
break;
|
|
|
}
|
|
|
@@ -219,10 +223,32 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
if(!stringBuilder.toString().contains(receiveGoods1.getOrderNumber() + ",")){
|
|
|
stringBuilder.append(receiveGoods1.getOrderNumber() + ",");
|
|
|
}
|
|
|
+ //半成品扫码入库逻辑
|
|
|
+ //查询物料信息
|
|
|
+ MaterialClass material = warehousingMapper.getMaterial(new Notice().setMaterialCode(warehousingVirtual.getWllbCode()));
|
|
|
+ if(material.getPartType().equals("半成品")) {
|
|
|
+ Notice notice = new Notice()
|
|
|
+ .setMaterialId(receiveGoods1.getMaterialId())
|
|
|
+ .setCompanyNumber(warehousingVirtual.getAccountSleeve())
|
|
|
+ .setStorageLocationCode(warehousingVirtual.getStorageLocationCode())
|
|
|
+ .setWbs(receiveGoods1.getWbs())
|
|
|
+ .setWarehousingNum(warehousingVirtual.getNum())
|
|
|
+ .setProducBatch(warehousingVirtual.getProducDate())
|
|
|
+ .setWllbCode(material.getWllbCode())
|
|
|
+ .setWllbClass(material.getWllbClass());
|
|
|
+ if (warehousingMapper.getInventoryNotice(notice) != 0) {
|
|
|
+ warehousingMapper.updateInventoryNotice(notice);
|
|
|
+ } else {
|
|
|
+ warehousingMapper.addInventoryNotice(notice);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ warehousingMapper.addInventory(list1);//库存
|
|
|
+ list1.clear();
|
|
|
+ }
|
|
|
}
|
|
|
//入库
|
|
|
warehousingMapper.addStorage(list);//入库流水
|
|
|
- warehousingMapper.addInventory(list);//库存
|
|
|
+// warehousingMapper.addInventory(list);//库存
|
|
|
warehousingMapper.delVirtual(uniqueCode);//删除临时表数据
|
|
|
map.put("data", stringBuilder.toString());
|
|
|
map.put("msg", "200");
|
|
|
@@ -387,6 +413,32 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void exportNotice(Notice notice, HttpServletResponse response) {
|
|
|
+ try {
|
|
|
+ //导出数据汇总
|
|
|
+ List<List<Object>> sheetDataList = new ArrayList<>();
|
|
|
+ //表头数据
|
|
|
+ List<Object> head = Arrays.asList("生产订单号", "报工单号", "物料编号", "物料名称", "数量", "已入库数量", "报工时间", "分录号", "所属公司", "公司编号", "WBS", "移动类型", "来源类型", "状态");
|
|
|
+ //查询数据
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>(warehousingMapper.exportNotice(notice));
|
|
|
+ sheetDataList.add(head);
|
|
|
+ for (Map<String, Object> userMap : list) {
|
|
|
+ List<Object> listSheet = new ArrayList<>();
|
|
|
+ for (String key : userMap.keySet()) {
|
|
|
+ listSheet.add(userMap.get(key));
|
|
|
+ }
|
|
|
+ sheetDataList.add(listSheet);
|
|
|
+ }
|
|
|
+ //当前时间
|
|
|
+ Date time = new Date();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMddHHmmss");
|
|
|
+ ExcelUtils.export(response, "入库流水数据导出" + sdf.format(time), sheetDataList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map<String, Object> addInventoryNotice(Notice notice) {
|
|
|
@@ -1161,7 +1213,6 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 入库单生成
|
|
|
*
|