|
@@ -65,6 +65,10 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
|
|
private ICommonStaffService staffService;
|
|
private ICommonStaffService staffService;
|
|
@Autowired
|
|
@Autowired
|
|
private QRCodeUtil qrCodeUtil;
|
|
private QRCodeUtil qrCodeUtil;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IStockSaleReceiptReportService stockSaleReceiptReportService;
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 检斤管理列表
|
|
* 检斤管理列表
|
|
* @param weighingManagement
|
|
* @param weighingManagement
|
|
@@ -630,7 +634,7 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
|
|
.eq("car_no",warehouseInOutInfo.getCarNo())
|
|
.eq("car_no",warehouseInOutInfo.getCarNo())
|
|
.eq("delete_flag","0"));
|
|
.eq("delete_flag","0"));
|
|
if(tranCarInfo != null){
|
|
if(tranCarInfo != null){
|
|
- tranCarInfo.setSubmit("1");
|
|
|
|
|
|
+ tranCarInfo.setSubmit("2");
|
|
//汽运状态改为已装车
|
|
//汽运状态改为已装车
|
|
tranCarInfo.setStatus(StatusEnum.LOADED.getName());
|
|
tranCarInfo.setStatus(StatusEnum.LOADED.getName());
|
|
tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
|
|
tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
|
|
@@ -652,6 +656,93 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
|
|
return "OK";
|
|
return "OK";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 出库管理检斤退回
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String outWeightReturn(WeighingManagement weighingManagement) {
|
|
|
|
+ //查询检斤信息表
|
|
|
|
+ WeighingManagement weighingManagement1 = this.selectById(weighingManagement.getId());
|
|
|
|
+ //状态改为已称皮重
|
|
|
|
+ weighingManagement1.setStatus(StatusEnum.TARED.getName());
|
|
|
|
+ weighingManagement1.setStatusFlag(StatusEnum.TARED.getFlag());
|
|
|
|
+ //更新检斤信息
|
|
|
|
+ this.updateById(weighingManagement1);
|
|
|
|
+ //查询出入库表
|
|
|
|
+ WarehouseInOutInfo warehouseInOutInfo = warehouseInOutInfoService.selectById(weighingManagement1.getWarehouseInOutId());
|
|
|
|
+ if(weighingManagement1.getWarehouseInOutId() != null){
|
|
|
|
+ if(warehouseInOutInfo!= null){
|
|
|
|
+ //状态改为已暂存
|
|
|
|
+ warehouseInOutInfo.setStatusFlag(StatusEnum.TEMPORARILY_STORED.getFlag());
|
|
|
|
+ warehouseInOutInfo.setStatus(StatusEnum.TEMPORARILY_STORED.getName());
|
|
|
|
+ //更新出入库表信息
|
|
|
|
+ warehouseInOutInfoService.updateById(warehouseInOutInfo);
|
|
|
|
+ //查询仓位库存信息
|
|
|
|
+ WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
|
|
|
|
+ .eq("position_id",warehouseInOutInfo.getPositionId())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(warehousePositionStorageInfo != null){
|
|
|
|
+ //更新仓位库存信息
|
|
|
|
+ warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() + weighingManagement1.getNetWeight()/1000);
|
|
|
|
+ warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //移库出库
|
|
|
|
+ if(weighingManagement1 != null && "2".equals(weighingManagement1.getServiceManagementType()) && "移库出库".equals(weighingManagement1.getInOutType())){
|
|
|
|
+
|
|
|
|
+ if(warehouseInOutInfo.getCarId() != null ){
|
|
|
|
+ //查询派车信息表
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("car_no",warehouseInOutInfo.getCarNo())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(tranCarInfo != null){
|
|
|
|
+ tranCarInfo.setSubmit("1");
|
|
|
|
+ //汽运状态改为已装车
|
|
|
|
+ tranCarInfo.setStatus(StatusEnum.LOADED.getName());
|
|
|
|
+ tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
|
|
|
|
+ //更新派车信息表
|
|
|
|
+ tranCarInfoService.updateById(tranCarInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //销售出库
|
|
|
|
+ else if(weighingManagement1 != null && "2".equals(weighingManagement1.getServiceManagementType()) && "销售出库".equals(weighingManagement1.getInOutType())){
|
|
|
|
+
|
|
|
|
+ if(weighingManagement1.getWarehouseInOutId() != null){
|
|
|
|
+ if(warehouseInOutInfo != null){
|
|
|
|
+ if(warehouseInOutInfo.getCarId() != null ){
|
|
|
|
+ //查询派车信息表
|
|
|
|
+ TranCarInfo tranCarInfo = tranCarInfoService.selectOne(new EntityWrapper<TranCarInfo>()
|
|
|
|
+ .eq("car_no",warehouseInOutInfo.getCarNo())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(tranCarInfo != null){
|
|
|
|
+ tranCarInfo.setSubmit("1");
|
|
|
|
+ //汽运状态改为已装车
|
|
|
|
+ tranCarInfo.setStatus(StatusEnum.LOADED.getName());
|
|
|
|
+ tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
|
|
|
|
+ //更新派车信息表
|
|
|
|
+ tranCarInfoService.updateById(tranCarInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //查询销售出库报表
|
|
|
|
+ StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
|
|
|
|
+ .eq("warehouse_record_id",warehouseInOutInfo.getId())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(stockSaleReceiptReport != null){
|
|
|
|
+ stockSaleReceiptReport.setDeleteFlag("1");
|
|
|
|
+ stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return "OK";
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 换仓
|
|
* 换仓
|
|
* @param
|
|
* @param
|