Commit 43c680d9 by 江和松

仓库增加物料类别

parent 53543b26
......@@ -12,7 +12,10 @@ 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.kc.domain.*;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
......@@ -260,6 +263,24 @@ public class HGKCTools {
putInStorageCheckData(hgzl002List);
setHgkc003Data(hgzl002List,hgkc003List, null, null);
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->{
//修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId(),HGConstant.StorageType.RK);
//查询当前工序
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o -> o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null);
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List<HGPZ005A> nextHgpz005AList = hgpz005AList.stream().filter(o->o.getProcessOrder().compareTo(hgpz005A.getProcessOrder()) == 1).collect(Collectors.toList());
if(CollectionUtils.isEmpty(nextHgpz005AList)){
// 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight());
}
});
}
}
/**
* 对象赋值(工序质检单)
......@@ -270,7 +291,7 @@ public class HGKCTools {
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code, List<HGZL004> hgzl004List) {
List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
List<HGPZ007> hgpz007List = HGPZTools.HgPz007.allList();
hgzl002List.forEach(o->{
HGPZ005 hgpz005 = hgpz005List.stream().filter(h->h.getInventCode().equals(o.getProductCode())).findAny().orElse(null);
HGSC008 hgsc008 = HGSCTools.THGSC008.getById(o.getWorkId());
......@@ -279,7 +300,6 @@ public class HGKCTools {
BeanUtil.copyProperties(o,hgkc003,"id");
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
hgkc003.setQualityId(o.getId());
hgkc003.setSubmitStatus(HGConstant.ProductStatus.WTJ);
if(Objects.nonNull(code)){
HGZL004 hgzl004 = hgzl004List.stream().filter(h->h.getCheckId().equals(o.getId())).findAny().orElse(null);
//整改通知单
......@@ -307,10 +327,20 @@ public class HGKCTools {
hgkc003.setPrdtWidth(hgpz005.getWidth());
hgkc003.setPrdtThick(hgpz005.getThick());
hgkc003.setInventTypeDetail(hgpz005.getInventTypeDetail());
//获取仓库信息
HGPZ007 hgpz007 = hgpz007List.stream().filter(wh->wh.getInventTypeDetail() != null && wh.getInventTypeDetail().intValue() == hgpz005.getInventTypeDetail()).findAny().orElse(null);
if(Objects.nonNull(hgpz007)){
hgkc003.setWhCode(hgpz007.getWhCode());
hgkc003.setWhName(hgpz007.getWhName());
}else{
AssertUtils.isNull(hgpz007.getId(), "仓库信息未获取到,请检查仓库档案是否维护存货大类!");
}
hgkc003.setDepositDate(DateUtils.shortDate());
hgkc003.setStorageType(HGConstant.StorageType.RK);
hgkc003.setIsReturn(CommonConstant.YesNo.NO_0);
hgkc003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
//默认已提交
hgkc003.setSubmitStatus(HGConstant.ProductStatus.YTJ);
hgkc003List.add(hgkc003);
}
});
......@@ -335,6 +365,22 @@ public class HGKCTools {
//赋值
setHgkc003Data(hgzl002List,hgkc003List,CheckTypeEnum.PROCESS_CHECK.getCode(),hgzl004List);
DaoUtils.insertBatch(HGKC003.INSERT,hgkc003List);
//查看是否为最后工序,如果最后工序则不需要再进行提交
List<String> inventCodes = hgkc003List.stream().map(HGKC003::getPrdtCode).collect(Collectors.toList());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes);
hgkc003List.forEach(hgkc003->{
//修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId(),HGConstant.StorageType.RK);
//查询当前工序
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o -> o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null);
//查询比当前工序靠后的工序是否存在,不存在说明是最后工序,修改实时库存
List<HGPZ005A> nextHgpz005AList = hgpz005AList.stream().filter(o->o.getProcessOrder().compareTo(hgpz005A.getProcessOrder()) == 1).collect(Collectors.toList());
if(CollectionUtils.isEmpty(nextHgpz005AList)){
// 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight());
}
});
}
}
......
......@@ -178,6 +178,15 @@ public class HGPZTools {
/**
* 查询仓库信息
*
* @return
*/
public static List<HGPZ007> allList() {
Map queryMap = new HashMap();
return DaoBase.getInstance().query("HGPZ007.query", queryMap);
}
/**
* 查询仓库信息
*
* @param whCodes
* @return
*/
......
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