|
@@ -87,7 +87,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
@Autowired
|
|
@Autowired
|
|
private IPaymentManagementService paymentManagementService;
|
|
private IPaymentManagementService paymentManagementService;
|
|
@Autowired
|
|
@Autowired
|
|
- private IWarehouseBaseInfoService warehouseBaseInfoService;
|
|
|
|
|
|
+ private IContractInventoryDistributionService contractInventoryDistributionService;
|
|
@Value("${file-root-path}")
|
|
@Value("${file-root-path}")
|
|
private String localPath;
|
|
private String localPath;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -129,6 +129,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
sourceRelationInfo.setCarNo(warehouseInOutInfo1.getCarNo());
|
|
sourceRelationInfo.setCarNo(warehouseInOutInfo1.getCarNo());
|
|
sourceRelationInfo.setEstimateOutWarehouseWeight(Float.valueOf(String.valueOf(warehouseInOutInfo1.getNetWeight())));
|
|
sourceRelationInfo.setEstimateOutWarehouseWeight(Float.valueOf(String.valueOf(warehouseInOutInfo1.getNetWeight())));
|
|
sourceRelationInfo.setIssuingTime(warehouseInOutInfo1.getInOutDate());
|
|
sourceRelationInfo.setIssuingTime(warehouseInOutInfo1.getInOutDate());
|
|
|
|
+ sourceRelationInfo.setIssuingTimeElse(warehouseInOutInfo1.getInOutDate());
|
|
sourceRelationInfo.setWarehouseName(warehouseInOutInfo1.getWarehouseName());
|
|
sourceRelationInfo.setWarehouseName(warehouseInOutInfo1.getWarehouseName());
|
|
sourceRelationInfo.setReturnTickFlag(warehouseInOutInfo1.getReturnTickFlag());
|
|
sourceRelationInfo.setReturnTickFlag(warehouseInOutInfo1.getReturnTickFlag());
|
|
String goodsSource="";
|
|
String goodsSource="";
|
|
@@ -237,17 +238,16 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
* 每天16.30点更新
|
|
* 每天16.30点更新
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- @Scheduled(cron = "0 03 11 * * ?")
|
|
|
|
|
|
+ @Scheduled(cron = "0 30 16 * * ?")
|
|
public String addInfo() {
|
|
public String addInfo() {
|
|
//当天零点
|
|
//当天零点
|
|
- SimpleDateFormat now = new SimpleDateFormat("yyyy-MM-dd 11:03:00");
|
|
|
|
|
|
+ SimpleDateFormat now = new SimpleDateFormat("yyyy-MM-dd 16:30:00");
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
c.setTime(new Date());
|
|
c.setTime(new Date());
|
|
c.add(Calendar.DATE, -1);
|
|
c.add(Calendar.DATE, -1);
|
|
String beforeDay=now.format(c.getTime());
|
|
String beforeDay=now.format(c.getTime());
|
|
Map<String, Object> pageView = new HashMap<>();
|
|
Map<String, Object> pageView = new HashMap<>();
|
|
pageView.put("beforeDay", beforeDay);
|
|
pageView.put("beforeDay", beforeDay);
|
|
- pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
|
//成本
|
|
//成本
|
|
List<WarehousingOrder> costList = baseMapper.getGoodCostListByCondition(pageView);
|
|
List<WarehousingOrder> costList = baseMapper.getGoodCostListByCondition(pageView);
|
|
//收购
|
|
//收购
|
|
@@ -293,6 +293,27 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
warehousingOrder.setIssuingTime(new Date());
|
|
warehousingOrder.setIssuingTime(new Date());
|
|
warehousingOrder.setGrainFund(money);
|
|
warehousingOrder.setGrainFund(money);
|
|
this.insert(warehousingOrder);
|
|
this.insert(warehousingOrder);
|
|
|
|
+ //更新收购库存
|
|
|
|
+ ContractInventoryDistribution contractInventoryDistribution=contractInventoryDistributionService.selectOne(new EntityWrapper<ContractInventoryDistribution>()
|
|
|
|
+ .eq("comp_id",warehousingOrder1.getCompId()).eq("inventory_type","3").eq("locus_warehouse",warehousingOrder1.getWarehouseName())
|
|
|
|
+ .eq("warehouseId",warehousingOrder1.getBaseId())
|
|
|
|
+ .eq("goods_name",warehousingOrder1.getGoodsName()));
|
|
|
|
+ if (contractInventoryDistribution!=null){
|
|
|
|
+ contractInventoryDistribution.setInventory(contractInventoryDistribution.getInventory()+warehousingOrder1.getInWarehouseWeight());
|
|
|
|
+ contractInventoryDistributionService.updateById(contractInventoryDistribution);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ ContractInventoryDistribution contractInventoryDistribution1=new ContractInventoryDistribution();
|
|
|
|
+ contractInventoryDistribution1.setId(IdGenerator.generateUUID());
|
|
|
|
+ contractInventoryDistribution1.setCompId(warehousingOrder1.getCompId());
|
|
|
|
+ contractInventoryDistribution1.setInventory(Double.valueOf(String.valueOf(warehousingOrder.getInWarehouseWeight())));
|
|
|
|
+ contractInventoryDistribution1.setLocusWarehouse(warehousingOrder1.getWarehouseName());
|
|
|
|
+ contractInventoryDistribution1.setGoodsName(warehousingOrder1.getGoodsName());
|
|
|
|
+ contractInventoryDistribution1.setInventoryType("3");
|
|
|
|
+ contractInventoryDistributionService.insert(contractInventoryDistribution1);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//采购入库
|
|
//采购入库
|
|
@@ -336,13 +357,31 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
money=money+warehouseInOutInfo.getCost()*warehouseInOutInfo.getNetWeight();
|
|
money=money+warehouseInOutInfo.getCost()*warehouseInOutInfo.getNetWeight();
|
|
}
|
|
}
|
|
warehousingOrder.setAmountNotPayable(money);
|
|
warehousingOrder.setAmountNotPayable(money);
|
|
- //平均成本 货值总和除以总重量
|
|
|
|
- warehousingOrder.setAvgCost(money/weight);
|
|
|
|
warehousingOrder.setAmountEdPayable(0d);
|
|
warehousingOrder.setAmountEdPayable(0d);
|
|
warehousingOrder.setSurplusWeight(Float.valueOf(String.valueOf(weight)));
|
|
warehousingOrder.setSurplusWeight(Float.valueOf(String.valueOf(weight)));
|
|
warehousingOrder.setIssuingTime(new Date());
|
|
warehousingOrder.setIssuingTime(new Date());
|
|
warehousingOrder.setGrainFund(money);
|
|
warehousingOrder.setGrainFund(money);
|
|
this.insert(warehousingOrder);
|
|
this.insert(warehousingOrder);
|
|
|
|
+ //更新采购库存
|
|
|
|
+ ContractInventoryDistribution contractInventoryDistribution=contractInventoryDistributionService.selectOne(new EntityWrapper<ContractInventoryDistribution>()
|
|
|
|
+ .eq("comp_id",warehousingOrder1.getCompId()).eq("inventory_type","1").eq("contract_no",warehousingOrder1.getContractNo())
|
|
|
|
+ .eq("warehouse",warehousingOrder1.getWarehouseName()));
|
|
|
|
+ if (contractInventoryDistribution!=null){
|
|
|
|
+ contractInventoryDistribution.setInStorage(contractInventoryDistribution.getInStorage()+warehousingOrder1.getInWarehouseWeight());
|
|
|
|
+ contractInventoryDistributionService.updateById(contractInventoryDistribution);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ ContractInventoryDistribution contractInventoryDistribution1=new ContractInventoryDistribution();
|
|
|
|
+ contractInventoryDistribution1.setId(IdGenerator.generateUUID());
|
|
|
|
+ contractInventoryDistribution1.setCompId(warehousingOrder1.getCompId());
|
|
|
|
+ contractInventoryDistribution1.setInStorage(Double.valueOf(String.valueOf(warehousingOrder.getInWarehouseWeight())));
|
|
|
|
+ contractInventoryDistribution1.setWarehouse(warehousingOrder1.getContractNo());
|
|
|
|
+ contractInventoryDistribution1.setContractNo(warehousingOrder1.getContractNo());
|
|
|
|
+ contractInventoryDistribution1.setGoodsName(warehousingOrder1.getGoodsName());
|
|
|
|
+ contractInventoryDistribution1.setInventoryType("1");
|
|
|
|
+ contractInventoryDistributionService.insert(contractInventoryDistribution1);
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//移库入库
|
|
//移库入库
|