add:原材料、半成品、成品插入库存变动记录
This commit is contained in:
@@ -45,12 +45,7 @@ public class StIvtStructivtflow implements Serializable {
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
private String material_spec;
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
@@ -79,7 +74,7 @@ public class StIvtStructivtflow implements Serializable {
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String bill_type;
|
||||
private String bill_type_scode;
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
@@ -104,17 +99,17 @@ public class StIvtStructivtflow implements Serializable {
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private Date create_time;
|
||||
private String change_time;
|
||||
|
||||
/**
|
||||
* 变动人
|
||||
*/
|
||||
private String create_id;
|
||||
private String change_person_id;
|
||||
|
||||
/**
|
||||
* 变动人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
private String change_person_name;
|
||||
|
||||
/**
|
||||
* 变动数
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.record.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dao.StIvtStructivtflow;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
||||
@@ -15,4 +16,6 @@ import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowD
|
||||
public interface IStIvtStructivtflowService extends IService<StIvtStructivtflow> {
|
||||
|
||||
void recordStructivtFlow(StIvtStructivtflowDto flowDto);
|
||||
|
||||
void insetIvtChange(JSONObject json);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.record.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -13,6 +15,7 @@ import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivt
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtflowCp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -34,6 +37,8 @@ public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflo
|
||||
private IStIvtStructattrService structattrService;
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService;
|
||||
@Autowired
|
||||
protected IStIvtStructattrService iStIvtStructattrService; // 仓位属性服务
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -43,8 +48,6 @@ public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflo
|
||||
flow.setChange_id(IdUtil.getStringId());
|
||||
物料信息: {
|
||||
MdMeMaterialbase material = materialbaseService.getOne(new QueryWrapper<MdMeMaterialbase>().eq("material_id", flowDto.getMaterial_id()));
|
||||
flow.setMaterial_code(material.getMaterial_code());
|
||||
flow.setMaterial_spec(material.getMaterial_spec());
|
||||
flow.setPcsn(flowDto.getPcsn());
|
||||
}
|
||||
仓库信息:{
|
||||
@@ -58,9 +61,6 @@ public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflo
|
||||
flow.setBill_table(flowDto.getBill_table());
|
||||
flow.setChange_qty(flowDto.getChange_qty());
|
||||
flow.setResult_qty(flowDto.getResult_qty());
|
||||
flow.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
flow.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
flow.setCreate_time(new Date());
|
||||
this.save(flow);
|
||||
|
||||
struct_attr.setStoragevehicle_code(flowDto.getStoragevehicle_code());
|
||||
@@ -78,4 +78,35 @@ public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflo
|
||||
}
|
||||
structattrService.updateById(struct_attr);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void insetIvtChange(JSONObject json) {
|
||||
|
||||
StIvtStructattr ivtDao = iStIvtStructattrService.getById(json.getString("struct_id"));
|
||||
|
||||
StIvtStructivtflow dao = new StIvtStructivtflow();
|
||||
dao.setChange_id(IdUtil.getStringId());
|
||||
dao.setStruct_id(json.getString("struct_id"));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setStruct_name(json.getString("struct_name"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setQuality_scode(json.getString("quality_scode"));
|
||||
dao.setIvt_level(json.getString("ivt_level"));
|
||||
dao.setIs_active(json.getBoolean("is_active"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setStor_id(ivtDao.getStor_id());
|
||||
dao.setChange_type_scode(json.getString("change_type_scode"));
|
||||
dao.setChange_time(DateUtil.now());
|
||||
dao.setChange_person_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setChange_person_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setChange_qty(json.getBigDecimal("change_qty"));
|
||||
dao.setResult_qty(json.getBigDecimal("result_qty"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setProduct_area(json.getString("workshop_id"));
|
||||
dao.setBill_code(json.getString("bill_code"));
|
||||
dao.setBill_type_scode(json.getString("bill_type_scode"));
|
||||
dao.setInv_id(json.getString("inv_id"));
|
||||
this.save(dao);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +487,12 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
StIvtIostorinvdtlCp dtlDao = dtlDaoList.stream()
|
||||
.filter(row -> row.getIostorinvdtl_id().equals(dao.getIostorinvdtl_id()))
|
||||
.findAny().get();
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(dao,ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY,dtlDao.getBase_billdtl_id()));
|
||||
|
||||
JSONObject param = ivtDataParam(dao, ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY, dtlDao.getBase_billdtl_id());
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
|
||||
// 3)解锁起点 / 将此托盘上的库存全部出掉
|
||||
unLockNext(dao.getStruct_id());
|
||||
@@ -826,6 +831,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
param.put("change_qty", ivtDao.getCanuse_qty());
|
||||
param.put("sale_id", ivtDao.getSale_id());
|
||||
param.put("change_type", ChangeIvtUtil.ADDFROZEN_SUBIVT_QTY);
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
|
||||
// 2.锁定仓位
|
||||
@@ -848,6 +856,8 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
*/
|
||||
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getById(dao.getIostorinvdtl_id());
|
||||
|
||||
StIvtIostorinvCp mstDao = this.getById(dtlDao.getIostorinv_id());
|
||||
|
||||
// 更新库存
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("struct_id", dao.getStruct_id());
|
||||
@@ -858,6 +868,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
param.put("change_qty", dao.getReal_qty());
|
||||
param.put("sale_id", dtlDao.getBase_billdtl_id());
|
||||
param.put("change_type", type);
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
|
||||
// 解锁仓位
|
||||
|
||||
@@ -480,6 +480,9 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
JSONObject param = ivtDataParam(disDao_1, ChangeIvtUtil.ADDWAREHOUSING_QTY, dtlDao.getBase_billdtl_id());
|
||||
param.put("product_area", mstDao.getProduct_area());
|
||||
param.put("stor_id", mstDao.getStor_id());
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
}
|
||||
}
|
||||
@@ -562,6 +565,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(StIvtIostorinvdisCp::getIostorinvdtl_id));
|
||||
|
||||
StIvtIostorinvCp mstDao = this.getById(disDao.getIostorinv_id());
|
||||
for (List<StIvtIostorinvdisCp> list : collect.values()) {
|
||||
|
||||
BigDecimal qty = list
|
||||
@@ -574,7 +578,11 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
|
||||
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getById(disDao_1.getIostorinvdtl_id());
|
||||
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(disDao_1,ChangeIvtUtil.SUBWAREHOUSING_QTY,dtlDao.getBase_billdtl_id()));
|
||||
JSONObject param = ivtDataParam(disDao_1, ChangeIvtUtil.SUBWAREHOUSING_QTY, dtlDao.getBase_billdtl_id());
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
|
||||
}
|
||||
|
||||
@@ -751,7 +759,11 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
// 2)更新库存
|
||||
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getById(dao.getIostorinvdtl_id());
|
||||
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(dao,ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY,dtlDao.getBase_billdtl_id()));
|
||||
JSONObject param = ivtDataParam(dao, ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY, dtlDao.getBase_billdtl_id());
|
||||
param.put("bill_code",mstDao.getBill_code());
|
||||
param.put("inv_id",mstDao.getIostorinv_id());
|
||||
param.put("bill_type_scode",mstDao.getBill_type());
|
||||
iStIvtStructivtCpService.UpdateIvt(param);
|
||||
|
||||
// 3)解锁终点
|
||||
unLockNext(dao.getStruct_id(),dao.getStoragevehicle_code());
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -11,6 +12,7 @@ import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
@@ -19,7 +21,9 @@ import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbBucketrecord;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtflowCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtflowCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper.StIvtStructivtCpMapper;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
@@ -54,6 +58,9 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
@Autowired
|
||||
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
|
||||
|
||||
@Autowired
|
||||
protected IStIvtStructivtflowCpService iStIvtStructivtflowCpService; // 库存变动记录服务
|
||||
|
||||
@Override
|
||||
public Object packageQuery(CpIvtQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
@@ -177,10 +184,30 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
dao.setUnit_weight(materDao.getNet_weight());
|
||||
this.save(dao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(dao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.ADDWAREHOUSING_QTY);
|
||||
param.put("change_qty", json.getBigDecimal("change_qty"));
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("result_qty", 0);
|
||||
insetIvtChange(param);
|
||||
|
||||
} else {
|
||||
// 更新待入数
|
||||
ivtDao.setWarehousing_qty(NumberUtil.add(ivtDao.getWarehousing_qty(),json.getDoubleValue("change_qty")));
|
||||
this.updateById(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.ADDWAREHOUSING_QTY);
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("change_qty", json.getBigDecimal("change_qty"));
|
||||
param.put("result_qty", ivtDao.getIvt_qty());
|
||||
insetIvtChange(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +241,16 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
ivtDao.setWarehousing_qty(BigDecimal.valueOf(change_qty));
|
||||
this.updateById(ivtDao);
|
||||
}
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.SUBWAREHOUSING_QTY);
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("change_qty", json.getDoubleValue("change_qty"));
|
||||
param.put("result_qty", ivtDao.getIvt_qty());
|
||||
insetIvtChange(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,6 +284,16 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
ivtDao.setIvt_qty(ivt_qty);
|
||||
ivtDao.setInstorage_time(DateUtil.now());
|
||||
this.updateById(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("change_qty", json.getDoubleValue("change_qty"));
|
||||
param.put("result_qty", ivt_qty);
|
||||
insetIvtChange(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,6 +331,16 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
ivtDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
|
||||
ivtDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
this.updateById(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.ADDFROZEN_SUBIVT_QTY);
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("change_qty", json.getBigDecimal("change_qty"));
|
||||
param.put("result_qty", ivtDao.getIvt_qty());
|
||||
insetIvtChange(param);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -321,6 +378,15 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
ivtDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
this.updateById(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.SUBFROZEN_ADDIVT_QTY);
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("change_qty", json.getBigDecimal("change_qty"));
|
||||
param.put("result_qty", ivtDao.getIvt_qty());
|
||||
insetIvtChange(param);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -362,6 +428,16 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
ivtDao.setIvt_qty(BigDecimal.valueOf(ivt_qty));
|
||||
this.updateById(ivtDao);
|
||||
}
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type_scode", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
|
||||
param.put("inv_id", json.getString("inv_id"));
|
||||
param.put("bill_type_scode", json.getString("bill_type_scode"));
|
||||
param.put("bill_code", json.getString("bill_code"));
|
||||
param.put("change_qty", json.getBigDecimal("change_qty"));
|
||||
param.put("result_qty", ivt_qty);
|
||||
insetIvtChange(param);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -389,5 +465,46 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
|
||||
if (ObjectUtil.isEmpty(json.getString("change_type")))
|
||||
throw new BadRequestException("更新库存失败:变动类型不能为空!");
|
||||
|
||||
if (ObjectUtil.isEmpty(json.getString("bill_code")))
|
||||
throw new BadRequestException("更新库存失败:单据号不能为空!");
|
||||
|
||||
if (ObjectUtil.isEmpty(json.getString("bill_type_scode")))
|
||||
throw new BadRequestException("更新库存失败:单据类型不能为空!");
|
||||
|
||||
if (ObjectUtil.isEmpty(json.getString("inv_id")))
|
||||
throw new BadRequestException("更新库存失败:单据标识不能为空!");
|
||||
}
|
||||
|
||||
/*
|
||||
插入库存变动记录
|
||||
*/
|
||||
private void insetIvtChange(JSONObject json) {
|
||||
|
||||
StIvtStructattr ivtDao = iStIvtStructattrService.getById(json.getString("struct_id"));
|
||||
|
||||
StIvtStructivtflowCp dao = new StIvtStructivtflowCp();
|
||||
dao.setChange_id(IdUtil.getStringId());
|
||||
dao.setStruct_id(json.getString("struct_id"));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setStruct_name(json.getString("struct_name"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setQuality_scode(json.getString("quality_scode"));
|
||||
dao.setIvt_level(json.getString("ivt_level"));
|
||||
dao.setIs_active(json.getBoolean("is_active"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setStor_id(ivtDao.getStor_id());
|
||||
dao.setChange_type_scode(json.getString("change_type_scode"));
|
||||
dao.setChange_time(DateUtil.now());
|
||||
dao.setChange_person_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setChange_person_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setChange_qty(json.getBigDecimal("change_qty"));
|
||||
dao.setResult_qty(json.getBigDecimal("result_qty"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setProduct_area(json.getString("product_area"));
|
||||
dao.setBill_code(json.getString("bill_code"));
|
||||
dao.setBill_type_scode(json.getString("bill_type_scode"));
|
||||
dao.setInv_id(json.getString("inv_id"));
|
||||
iStIvtStructivtflowCpService.save(dao);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstora
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvOutYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvdisYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvdtlYlService;
|
||||
@@ -36,6 +37,7 @@ import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.mapper.StIvtIos
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.mapper.StIvtIostorinvYlMapper;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dto.YlIostorInvQuery;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.IStIvtStructivtYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.IStIvtStructivtflowYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtYl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -74,6 +76,9 @@ public class StIvtIostorinvOutYlServiceImpl extends ServiceImpl<StIvtIostorinvOu
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowYlService iStIvtStructivtflowYlService;
|
||||
|
||||
|
||||
@Override
|
||||
public Object pageQuery(YlIostorInvQuery query, PageQuery pageQuery) {
|
||||
@@ -187,12 +192,32 @@ public class StIvtIostorinvOutYlServiceImpl extends ServiceImpl<StIvtIostorinvOu
|
||||
ivt.setIvt_qty(BigDecimal.valueOf(sub));
|
||||
structivtYlService.updateById(ivt);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivt));
|
||||
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
|
||||
param.put("change_qty",need_qty);
|
||||
param.put("result_qty", sub);
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
iStIvtStructivtflowYlService.insetIvtChange(param);
|
||||
|
||||
need_qty = 0;
|
||||
} else {
|
||||
dis.put("plan_qty", canuse_qty);
|
||||
dis.put("real_qty", canuse_qty);
|
||||
structivtYlService.remove(new QueryWrapper<StIvtStructivtYl>().eq("stockrecord_id", ivt.getStockrecord_id()));
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivt));
|
||||
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
|
||||
param.put("change_qty",need_qty);
|
||||
param.put("result_qty", 0);
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
iStIvtStructivtflowYlService.insetIvtChange(param);
|
||||
|
||||
need_qty = NumberUtil.sub(need_qty - canuse_qty).doubleValue();
|
||||
}
|
||||
JSONObject mst_jo = new JSONObject();
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.rawmanage.service.iostorInv.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -22,6 +23,7 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstora
|
||||
import org.nl.wms.pcs_manage.service.purchase.IPcsIfPurchaseorderService;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvdisYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvdtlYlService;
|
||||
@@ -31,6 +33,7 @@ import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.StIvtIostorinvd
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.mapper.StIvtIostorinvYlMapper;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dto.YlIostorInvQuery;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.IStIvtStructivtYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.IStIvtStructivtflowYlService;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtYl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -65,6 +68,9 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
@Autowired
|
||||
private IPcsIfPurchaseorderService purchaseorderService;
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowYlService iStIvtStructivtflowYlService;
|
||||
|
||||
|
||||
@Override
|
||||
public Object pageQuery(YlIostorInvQuery query, PageQuery pageQuery) {
|
||||
@@ -155,8 +161,18 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
structivtYl.setCanuse_qty(NumberUtil.add(structivtYl.getCanuse_qty(), dis.getPlan_qty()));
|
||||
structivtYl.setIvt_qty(structivtYl.getCanuse_qty());
|
||||
structivtYlService.updateById(structivtYl);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(structivtYl));
|
||||
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
|
||||
param.put("change_qty",dis.getPlan_qty());
|
||||
param.put("result_qty", structivtYl.getCanuse_qty());
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
iStIvtStructivtflowYlService.insetIvtChange(param);
|
||||
} else {
|
||||
structivtYlService.save(StIvtStructivtYl.builder()
|
||||
StIvtStructivtYl ivtDao = StIvtStructivtYl.builder()
|
||||
.stockrecord_id(IdUtil.getStringId())
|
||||
.struct_id(dis.getStruct_id())
|
||||
.struct_code(dis.getStruct_code())
|
||||
@@ -172,8 +188,18 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.workshop_id(mst.getWorkshop_id())
|
||||
.build()
|
||||
);
|
||||
.build();
|
||||
structivtYlService.save(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
|
||||
param.put("change_qty",dis.getPlan_qty());
|
||||
param.put("result_qty", dis.getPlan_qty());
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
iStIvtStructivtflowYlService.insetIvtChange(param);
|
||||
}
|
||||
|
||||
/*//修改库存和插入库存变动记录表
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.rawmanage.service.structIvt;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtflowYl;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IStIvtStructivtflowYlService extends IService<StIvtStructivtflowYl> {
|
||||
|
||||
void insetIvtChange(JSONObject json);
|
||||
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class StIvtStructivtflowYl implements Serializable {
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private Date change_time;
|
||||
private String change_time;
|
||||
|
||||
/**
|
||||
* 变动人
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package org.nl.wms.storage_manage.rawmanage.service.structIvt.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtflowYl;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.mapper.StIvtStructivtflowYlMapper;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.IStIvtStructivtflowYlService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -17,4 +25,36 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class StIvtStructivtflowYlServiceImpl extends ServiceImpl<StIvtStructivtflowYlMapper, StIvtStructivtflowYl> implements IStIvtStructivtflowYlService {
|
||||
|
||||
@Autowired
|
||||
protected IStIvtStructattrService iStIvtStructattrService; // 仓位属性服务
|
||||
|
||||
@Override
|
||||
public void insetIvtChange(JSONObject json) {
|
||||
|
||||
StIvtStructattr ivtDao = iStIvtStructattrService.getById(json.getString("struct_id"));
|
||||
|
||||
StIvtStructivtflowYl dao = new StIvtStructivtflowYl();
|
||||
dao.setChange_id(IdUtil.getStringId());
|
||||
dao.setStruct_id(json.getString("struct_id"));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setStruct_name(json.getString("struct_name"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setQuality_scode(json.getString("quality_scode"));
|
||||
dao.setIvt_level(json.getString("ivt_level"));
|
||||
dao.setIs_active(json.getBoolean("is_active"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setStor_id(ivtDao.getStor_id());
|
||||
dao.setChange_type_scode(json.getString("change_type_scode"));
|
||||
dao.setChange_time(DateUtil.now());
|
||||
dao.setChange_person_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setChange_person_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setChange_qty(json.getBigDecimal("change_qty"));
|
||||
dao.setResult_qty(json.getBigDecimal("result_qty"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setProduct_area(json.getString("workshop_id"));
|
||||
dao.setBill_code(json.getString("bill_code"));
|
||||
dao.setBill_type_scode(json.getString("bill_type_scode"));
|
||||
dao.setInv_id(json.getString("inv_id"));
|
||||
this.save(dao);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.nl.wms.storage_manage.productmanage.util.DivRuleCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.util.RuleUtil;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpOutService;
|
||||
@@ -83,6 +84,8 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
private ISchBaseTaskService iSchBaseTaskService; // 任务表服务
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService;
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService iStIvtStructivtflowService; // 库存变动服务
|
||||
|
||||
|
||||
@Override
|
||||
@@ -181,9 +184,20 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(mst);
|
||||
|
||||
StIvtStructivtBcp ivtDao = structivtBcpService.getById(mst.getStruct_id());
|
||||
//删除库存
|
||||
structivtBcpService.remove(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", mst.getStruct_id()));
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
|
||||
param.put("change_qty", ivtDao.getCanuse_qty());
|
||||
param.put("result_qty", 0);
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
iStIvtStructivtflowService.insetIvtChange(param);
|
||||
|
||||
/*structivtflowService.recordStructivtFlow(
|
||||
StIvtStructivtflowDto.builder()
|
||||
.bill_code(mst.getBill_code()).change_type_scode(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_CONFIRM).bill_table("st_ivt_iostorinv_bcp")
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivt
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.nl.wms.storage_manage.productmanage.util.DivRuleCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.util.RuleUtil;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtYl;
|
||||
@@ -83,6 +84,8 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
private IStIvtSectattrService sectattrService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService; // 任务表服务
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService iStIvtStructivtflowService; // 库存变动服务
|
||||
|
||||
|
||||
@Override
|
||||
@@ -158,7 +161,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
this.updateById(mst);
|
||||
|
||||
//新增库存
|
||||
structivtBcpService.save(StIvtStructivtBcp.builder()
|
||||
StIvtStructivtBcp ivtDao = StIvtStructivtBcp.builder()
|
||||
.struct_id(mst.getStruct_id())
|
||||
.struct_code(mst.getStruct_code())
|
||||
.struct_name(mst.getStruct_name())
|
||||
@@ -173,8 +176,18 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
.canuse_qty(mst.getPlan_qty())
|
||||
.workshop_id(mst.getWorkshop_id())
|
||||
.unit_weight(mst.getUnit_weight())
|
||||
.build()
|
||||
);
|
||||
.build();
|
||||
structivtBcpService.save(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
|
||||
param.put("change_qty", ivtDao.getCanuse_qty());
|
||||
param.put("result_qty", ivtDao.getCanuse_qty());
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
iStIvtStructivtflowService.insetIvtChange(param);
|
||||
|
||||
//维护载具
|
||||
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
|
||||
|
||||
@@ -417,7 +417,7 @@ export default {
|
||||
}
|
||||
|
||||
this.loadingAlldiv = true
|
||||
productOut.allDivIvt({ 'iostorinvdtl_id': this.currentRow.iostorinvdtl_id, 'sect_id': this.mstrow.sect_id, 'stor_id': this.mstrow.stor_id, 'type': false }).then(res => {
|
||||
productOut.allDivIvt({ 'iostorinvdtl_id': this.currentRow.iostorinvdtl_id, 'iostorinv_id': this.currentRow.iostorinv_id, 'sect_id': this.mstrow.sect_id, 'stor_id': this.mstrow.stor_id, 'type': false }).then(res => {
|
||||
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.queryTableDtl()
|
||||
this.loadingAlldiv = false
|
||||
|
||||
Reference in New Issue
Block a user