Commit a0d900a3 by 江和松

手动新增收货时直接生成入库单,并入默认仓库

parent 007cf0a8
......@@ -359,7 +359,7 @@ public class ServiceHGCG003 extends ServiceBase {
paramDetailMap.put(HGCG003B.FIELD_DEPOSIT_QTY, o.getReceiveQty());
DaoUtils.update(HGSqlConstant.HgCg003B.UPDATE_CONFIRM, paramDetailMap);
//采购入库
HGKCTools.HgKc001.putInStorageData(o.getId());
HGKCTools.HgKc001.putInStorageDataAndSubmit(o.getId());
});
}
......
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
......@@ -135,6 +136,45 @@ public class HGKCTools {
}
/**
* 生产入库(入库质检单)
* @param receiveId
*/
public static void putInStorageDataAndSubmit(Long receiveId) {
List<Long> receiveIDsList = new LinkedList<>();
receiveIDsList.add(receiveId);
// db数据
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetData(receiveIDsList);
HGCG003B dbCg003B = dbCg003BMap.get(receiveId);
HGKC001 newKc001 = new HGKC001();
BeanUtils.copyProperties(dbCg003B, newKc001,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime");
newKc001.setDepositDate(DateUtils.shortDate());
newKc001.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_DEPOSIT_NO));
newKc001.setDepositQty(dbCg003B.getDepositQty());
newKc001.setDepositUnitWeight(dbCg003B.getReceiveUnitWeight());
newKc001.setDepositWeight(dbCg003B.getDepositQty().multiply(dbCg003B.getReceiveUnitWeight()));
newKc001.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newKc001.setSubmitStatus(HGConstant.ProductStatus.YTJ);
newKc001.setStorageType(HGConstant.StorageType.RK);
newKc001.setIsReturn(CommonConstant.YesNo.NO_0);
newKc001.setReceiveDetailId(dbCg003B.getId());
List<HGPZ007> hgpz007List = HGPZTools.HgPz007.allList();
//获取仓库信息
HGPZ007 hgpz007 = hgpz007List.stream().filter(wh->wh.getInventTypeDetail() != null && wh.getInventTypeDetail().intValue() == newKc001.getInventTypeDetail()).findAny().orElse(null);
if(Objects.nonNull(hgpz007)){
newKc001.setWhCode(hgpz007.getWhCode());
newKc001.setWhName(hgpz007.getWhName());
}else{
AssertUtils.isNull(hgpz007.getId(), "仓库信息未获取到,请检查仓库档案是否维护存货大类!");
}
DaoUtils.insert(HGKC001.INSERT, newKc001);
// 更新库存数量
HGKCUtils.HgKc010.updateInv(newKc001.getCompanyCode(), newKc001.getWhCode(), newKc001.getInventCode(),
newKc001.getDepositQty(), newKc001.getDepositUnitWeight(), newKc001.getDepositWeight());
// 更新收货单状态
// HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_5);
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
......@@ -265,6 +305,7 @@ public class HGKCTools {
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
//可能全部不合格
if(!CollectionUtils.isEmpty(hgkc003List)){
//查看是否能获取到账期,获取不到就提示
List<String> inventCodes = hgkc003List.stream().map(HGKC003::getPrdtCode).collect(Collectors.toList());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes);
hgkc003List.forEach(hgkc003->{
......@@ -336,6 +377,8 @@ public class HGKCTools {
AssertUtils.isNull(hgpz007.getId(), "仓库信息未获取到,请检查仓库档案是否维护存货大类!");
}
hgkc003.setDepositDate(DateUtils.shortDate());
//检查是否能入库
// HGCWTools.HgCw001.getAccountPeriod(hgkc003.getCompanyCode(),hgkc003.getDepositDate());
hgkc003.setStorageType(HGConstant.StorageType.RK);
hgkc003.setIsReturn(CommonConstant.YesNo.NO_0);
hgkc003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
......
......@@ -29,6 +29,12 @@ $(function () {
}
}
],
beforeEdit: function (e) {
let item = e.model;
if(item.submitStatus != '0'){
e.preventDefault();
}
},
loadComplete: function (grid) {
// 确认
$("#CONFIRM").on("click", confirm);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment