|
@@ -781,49 +781,42 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
|
|
public String weightReturn(WeighingManagement weighingManagement) {
|
|
public String weightReturn(WeighingManagement weighingManagement) {
|
|
//查询检斤信息表
|
|
//查询检斤信息表
|
|
WeighingManagement weighingManagement1 = this.selectById(weighingManagement.getId());
|
|
WeighingManagement weighingManagement1 = this.selectById(weighingManagement.getId());
|
|
|
|
+ //状态改为已称毛重
|
|
|
|
+ weighingManagement1.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
|
|
|
|
+ weighingManagement1.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
|
|
|
|
+ //更新检斤信息
|
|
|
|
+ this.updateById(weighingManagement1);
|
|
//查询出入库表
|
|
//查询出入库表
|
|
WarehouseInOutInfo warehouseInOutInfo = warehouseInOutInfoService.selectById(weighingManagement1.getWarehouseInOutId());
|
|
WarehouseInOutInfo warehouseInOutInfo = warehouseInOutInfoService.selectById(weighingManagement1.getWarehouseInOutId());
|
|
- //非收购类型更新库存量和任务完成量
|
|
|
|
- if(warehouseInOutInfo!= null && "3".equals(warehouseInOutInfo.getStatusFlag())){
|
|
|
|
- //状态改为已暂存
|
|
|
|
- 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("goods_name",warehouseInOutInfo.getGoodsName())
|
|
|
|
- .eq("delete_flag","0"));
|
|
|
|
- if(warehousePositionStorageInfo != null){
|
|
|
|
- //更新仓位库存信息
|
|
|
|
- warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() - weighingManagement1.getNetWeight()/1000);
|
|
|
|
- warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
|
|
|
|
- }
|
|
|
|
- //减去任务已完成量
|
|
|
|
- InOutWarehouseTask inOutWarehouseTask=inOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
|
|
|
|
- .eq("in_out_task_no",warehouseInOutInfo.getInOutTaskNo()));
|
|
|
|
- if (inOutWarehouseTask!=null){
|
|
|
|
- inOutWarehouseTask.setCompletedQuantity(inOutWarehouseTask.getCompletedQuantity()-warehouseInOutInfo.getNetWeight());
|
|
|
|
|
|
+ if (warehouseInOutInfo!=null) {
|
|
|
|
+ //更新任务已完成量
|
|
|
|
+ InOutWarehouseTask inOutWarehouseTask = inOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
|
|
|
|
+ .eq("in_out_task_no", warehouseInOutInfo.getInOutTaskNo()));
|
|
|
|
+ if (inOutWarehouseTask != null) {
|
|
|
|
+ inOutWarehouseTask.setCompletedQuantity(inOutWarehouseTask.getCompletedQuantity() - warehouseInOutInfo.getNetWeight());
|
|
inOutWarehouseTaskService.updateById(inOutWarehouseTask);
|
|
inOutWarehouseTaskService.updateById(inOutWarehouseTask);
|
|
}
|
|
}
|
|
|
|
+ //已经入库的更新库存量
|
|
|
|
+ if("3".equals(warehouseInOutInfo.getStatusFlag())){
|
|
|
|
+ //状态改为已暂存
|
|
|
|
+ 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("goods_name",warehouseInOutInfo.getGoodsName())
|
|
|
|
+ .eq("delete_flag","0"));
|
|
|
|
+ if(warehousePositionStorageInfo != null){
|
|
|
|
+ //更新仓位库存信息
|
|
|
|
+ warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() - weighingManagement1.getNetWeight()/1000);
|
|
|
|
+ warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//收购入库
|
|
//收购入库
|
|
if(weighingManagement1 != null && "3".equals(weighingManagement1.getServiceManagementType())){
|
|
if(weighingManagement1 != null && "3".equals(weighingManagement1.getServiceManagementType())){
|
|
- //状态改为已称毛重
|
|
|
|
- weighingManagement1.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
|
|
|
|
- weighingManagement1.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
|
|
|
|
- //更新检斤信息
|
|
|
|
- this.updateById(weighingManagement1);
|
|
|
|
- if (warehouseInOutInfo!=null) {
|
|
|
|
- //更新任务已完成量
|
|
|
|
- InOutWarehouseTask inOutWarehouseTask = inOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
|
|
|
|
- .eq("in_out_task_no", warehouseInOutInfo.getInOutTaskNo()));
|
|
|
|
- if (inOutWarehouseTask != null) {
|
|
|
|
- inOutWarehouseTask.setCompletedQuantity(inOutWarehouseTask.getCompletedQuantity() - warehouseInOutInfo.getNetWeight());
|
|
|
|
- inOutWarehouseTaskService.updateById(inOutWarehouseTask);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
//查询付款信息表
|
|
//查询付款信息表
|
|
PaymentManagement paymentManagement = paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
|
|
PaymentManagement paymentManagement = paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
|
|
.eq("relation_id", weighingManagement1.getRelationId())
|
|
.eq("relation_id", weighingManagement1.getRelationId())
|
|
@@ -833,13 +826,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
|
|
paymentManagement.setDeleteFlag("1");
|
|
paymentManagement.setDeleteFlag("1");
|
|
paymentManagementService.updateById(paymentManagement);
|
|
paymentManagementService.updateById(paymentManagement);
|
|
}
|
|
}
|
|
- //采购入库
|
|
|
|
|
|
+ //贸易入库
|
|
else if(weighingManagement1 != null && "1".equals(weighingManagement1.getServiceManagementType())){
|
|
else if(weighingManagement1 != null && "1".equals(weighingManagement1.getServiceManagementType())){
|
|
- //状态改为已称毛重
|
|
|
|
- weighingManagement1.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
|
|
|
|
- weighingManagement1.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
|
|
|
|
- //更新检斤信息
|
|
|
|
- this.updateById(weighingManagement1);
|
|
|
|
if(weighingManagement1.getWarehouseInOutId() != null){
|
|
if(weighingManagement1.getWarehouseInOutId() != null){
|
|
if(warehouseInOutInfo != null){
|
|
if(warehouseInOutInfo != null){
|
|
//入库日期
|
|
//入库日期
|