Commit cd55601a by 江和松

修改生产入库单的字段信息,增加质检单的部分信息

parent 682fc1de
......@@ -160,7 +160,7 @@ public class ServiceHGKC003 extends ServiceBase {
//修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId(),HGConstant.StorageType.RK);
// 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPartCode(),
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......@@ -181,15 +181,15 @@ public class ServiceHGKC003 extends ServiceBase {
AssertUtils.isEmpty(hgkc003.getWhName(),"仓库名称不能为空!");
AssertUtils.isNull(hgkc003.getPrice(),"单价不能为空!");
//判断是不是最前工序,如果不是得提示
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(hgkc003.getPartCode());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(hgkc003.getPrdtCode());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.getByQualityId(hgkc003.getQualityId());
//当前提交的工序信息
HGPZ005A hgpz005AFilter = hgpz005AList.stream().filter(o->o.getInventCode().equals(hgkc003.getPartCode())).findAny().orElse(null);
HGPZ005A hgpz005AFilter = hgpz005AList.stream().filter(o->o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null);
AssertUtils.isNull(hgpz005AFilter,"此物料没有配置工序!");
for(HGKC003 entity : hgkc003List){
if(entity.getId().intValue() != hgkc003.getId().intValue()){
//遍历相同质检单的工序
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o->o.getInventCode().equals(entity.getPartCode())).findAny().orElse(null);
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o->o.getInventCode().equals(entity.getPrdtCode())).findAny().orElse(null);
//如果未提交的生产单有比当前更靠前的工序,则需要提示
AssertUtils.isTrue(hgpz005A.getProcessOrder().compareTo(hgpz005AFilter.getProcessOrder()) < 0,hgpz005A.getInventCode()+"的工序“"+hgpz005A.getProcessName()+"“未提交,生产入库号为:"+entity.getDepositNo());
}
......@@ -246,7 +246,7 @@ public class ServiceHGKC003 extends ServiceBase {
//修改计划生产任务完工数量
HGSCTools.complete(fKc003.getQualityId(),newKc003.getInvQty().intValue(),fKc003.getRectificationId(), HGConstant.StorageType.TH);
// 修改库存
HGKCUtils.HgKc010.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getPartCode(),
HGKCUtils.HgKc010.updateInv(newKc003.getCompanyCode(), newKc003.getWhCode(), newKc003.getPrdtCode(),
newKc003.getInvQty(), newKc003.getInvWeight());
}
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC003A;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.*;
/**
* 生产入库明细
*
* @author:jhs
* @date:2024/5/24,11:08
*/
public class ServiceHGKC003B extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC003A.QUERY, new HGKC003A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC003A.QUERY, new HGKC003A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC003A.FIELD_ID);
DaoUtils.update(HGKC003A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGKC003A hgkc003a = new HGKC003A();
hgkc003a.fromMap(resultMap);
//查询蓝图
HGKC003 hgkc003 = (HGKC003) super.dao.get(HGKC003.QUERY,HGKC003.FIELD_ID,hgkc003a.getPrimaryId());
//复制蓝图基本信息
hgkc003a.setCompanyCode(hgkc003.getCompanyCode());
hgkc003a.setCompanyName(hgkc003.getCompanyName());
hgkc003a.setDepCode(hgkc003.getDepCode());
// hgkc003a.setDepName(hgkc003.getDepName());
hgkc003a.setProjCode(hgkc003.getProjCode());
hgkc003a.setProjName(hgkc003.getProjName());
this.checkSaveData(hgkc003a,hgkc003);
if(Objects.nonNull(hgkc003a.getId())&&hgkc003a.getId()!=0){
DaoUtils.update(HGKC003A.UPDATE, hgkc003a);
}else {
DaoUtils.insert(HGKC003A.INSERT, hgkc003a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgkc003a
*/
private void checkSaveData(HGKC003A hgkc003a, HGKC003 hgkc003) {
if(Objects.nonNull(hgkc003a.getId())&&hgkc003a.getId()>0){
AssertUtils.isTrue(hgkc003.getSubmitStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0,"入库单已提交,不能修改!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgkc003a.getProjName(), "请填写项目名称!");
}
}
......@@ -232,29 +232,6 @@ public class HGKCTools {
return CollectionUtils.isEmpty(list) ? null : list;
}
public static HGKC003 save(HGKC003 hgkc003,List<HGKC003A> hgkc003aList){
checkSaveData(hgkc003,hgkc003aList);
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
Long maxId = (Long)DaoBase.getInstance().get(HGKC003.MAX_ID,null,null);
Long setId = maxId+1;
hgkc003.setId(setId);
DaoUtils.insert(HGKC003.INSERT,hgkc003);
hgkc003aList.forEach(o->{
o.setPrimaryId(setId);
});
DaoUtils.insertBatch(HGKC003A.INSERT,hgkc003aList);
return hgkc003;
}
private static void checkSaveData(HGKC003 hgkc003,List<HGKC003A> hgkc003aList) {
AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单ID不能为空!");
}
/**
* 校验生产入库信息,整改单就不用校验了
* @param hgzl002List
......@@ -323,15 +300,14 @@ public class HGKCTools {
hgkc003.setInvWeight(hgsc008.getTotalWeight());
hgkc003.setProjCode(o.getProjCode());
hgkc003.setProjName(o.getProjName());
hgkc003.setPartCode(o.getProductCode());
hgkc003.setPartName(o.getProductName());
hgkc003.setPartType(hgpz005.getInventType());
hgkc003.setPartSpecId(hgpz005.getId());
hgkc003.setPartSpec(hgpz005.getSpec());
hgkc003.setPartCoefficient(hgpz005.getCoefficient());
hgkc003.setPartLength(hgpz005.getLength());
hgkc003.setPartWidth(hgpz005.getWidth());
hgkc003.setPartThick(hgpz005.getThick());
hgkc003.setPrdtCode(o.getProductCode());
hgkc003.setPrdtName(o.getProductName());
hgkc003.setPrdtType(hgpz005.getInventType());
hgkc003.setPrdtSpec(hgpz005.getSpec());
hgkc003.setPrdtCoefficient(hgpz005.getCoefficient());
hgkc003.setPrdtLength(hgpz005.getLength());
hgkc003.setPrdtWidth(hgpz005.getWidth());
hgkc003.setPrdtThick(hgpz005.getThick());
hgkc003.setDepositDate(DateUtils.shortDate());
hgkc003.setStorageType(HGConstant.StorageType.RK);
hgkc003.setIsReturn(CommonConstant.YesNo.NO_0);
......@@ -415,36 +391,6 @@ public class HGKCTools {
}
/**
* HGKC003A 工具类
*
* @author:songx
* @date:2024/5/15,9:49
*/
public static class Hgkc003a {
public static HGKC003A save(HGKC003A hgkc003a){
checkSaveData(hgkc003a);
hgkc003a.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
DaoUtils.insert(HGKC003A.INSERT,hgkc003a);
return hgkc003a;
}
private static void checkSaveData(HGKC003A hgkc003a) {
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtCode(), "存货编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getPrdtName(), "存货名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getPartSpecId())||hgkc003a.getPartSpecId()<=0, "存货id不能为空");
AssertUtils.isTrue(Objects.isNull(hgkc003a.getQualityId())||hgkc003a.getQualityId()<=0, "质检单明细ID不能为空!");
}
}
/**
* HPKC004 公共方法定义
*
* @author:songx
......
......@@ -25,8 +25,6 @@
<EF:EFColumn ename="operator" cname="操作" locked="true" width="140" enable="false" readonly="false"/>
<EF:EFColumn ename="qualityId" cname="质检单id" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="rectificationId" cname="整改通知单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="partSpecId" cname="零件规格ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFComboColumn cname="入库类型" ename="storageType" width="90" align="center" required="false" enable="false" readonly="false" >
<EF:EFCodeOption codeName="hggp.kc.storageType" />
</EF:EFComboColumn>
......@@ -39,18 +37,18 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="depositNo" cname="生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositNoOld" cname="历史生产入库单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="partType" cname="存货类型" width="120" align="center" required="false"
<EF:EFComboColumn ename="prdtType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains" enable="false">
</EF:EFComboColumn>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partCoefficient" cname="系数" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtCode" cname="物料编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prdtName" cname="物料名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prdtSpec" cname="物料规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="prdtLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtCoefficient" cname="系数" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
......
......@@ -9,8 +9,7 @@
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput cname="物料名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="4"/>
</div>
<div class="row">
<EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="4"
......@@ -30,9 +29,8 @@
<EF:EFColumn ename="id" cname="生产订单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="childId" cname="生产任务ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="prdtName" cname="物料名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prdtSpec" cname="物料规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="applyNum" cname="入库数量" width="120" align="right" format="{0:N0}" required="true"/>
<EF:EFColumn ename="remark1" cname="入库说明" width="150"/>
......@@ -43,8 +41,7 @@
<EF:EFColumn ename="totalWt" cname="任务重量(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" width="150" align="center"/>
<EF:EFColumn ename="orgName" cname="生产组名称" enable="false" width="150" align="center"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="prdtCode" cname="物料编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="factoryCode" cname="厂区编码" enable="false" width="150" hidden="true"/>
<EF:EFColumn ename="orgNo" cname="生产组编码" enable="false" width="150" hidden="true"/>
</EF:EFGrid>
......
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