Commit d39b079e by 江和松

将计划校验移除到物料清单模块

parent 692e391f
......@@ -7,6 +7,7 @@ import com.baosight.hggp.common.ProductTypeEnum;
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.sb.domain.HGSB002;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
......@@ -231,13 +232,12 @@ public class ServiceHGSC004A extends ServiceBase {
try {
HGSC004A hgsc004a = new HGSC004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
HGSC004 hgsc004 = new HGSC004();
String materialId = eiBlock.getCellStr(ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id);
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004.FIELD_id,materialId);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgsc004a.fromMap(map);
if(Objects.isNull(hgsc004.getId()) || hgsc004.getId() == 0){
hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004.FIELD_id,hgsc004a.getMaterialId());
}
if(Objects.nonNull(hgsc004)){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
//子表
......@@ -250,6 +250,8 @@ public class ServiceHGSC004A extends ServiceBase {
}else{
hgsc005a.setProductType(ProductTypeEnum.PART.getCode());
}
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
HGSCTools.THGSC005A.save(hgsc005a);
}else{
Map<String,Object> mapA = new HashMap<>();
......
......@@ -95,6 +95,12 @@ public class HGSCTools {
}
}
}
public static class THGSC004A{
public static void checkFatherSubmitStatus(Long matId) {
HGSC005 hgsc005 = THGSC005.queryByMatId(matId);
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==1, "生产计划已提交,不能操作!");
}
}
public static class THGSC005{
public static List<HGSC005> buildFinishRate(List<HGSC005> hgsc005List){
......@@ -191,7 +197,6 @@ public class HGSCTools {
}
private static List<HGSC005A> generatorNewPlanDetail(HGSC005A hgsc005a){
//通过存货档案编码查询存货档案工序
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(hgsc005a.getProductCode());
......@@ -226,7 +231,6 @@ public class HGSCTools {
public static HGSC005A save(HGSC005A hgsc005a){
checkUpdateData(hgsc005a);
checkFatherSubmitStatus(hgsc005a);
constructObj(hgsc005a);
List<HGSC005A> hgsc005AList = generatorNewPlanDetail(hgsc005a);
Map<Long,Optional<HGSC005A>> oldObjMap = queryOldPlanDetail(hgsc005a);
......@@ -289,7 +293,6 @@ public class HGSCTools {
public static void delete(HGSC005A hgsc005a){
checkUpdateData(hgsc005a);
checkFatherSubmitStatus(hgsc005a);
Map<Long,Optional<HGSC005A>> oldObjMap = queryOldPlanDetail(hgsc005a);
oldObjMap.forEach((k,v)->{
HGSC005A oldObj = v.get();
......@@ -303,11 +306,6 @@ public class HGSCTools {
});
}
private static void checkFatherSubmitStatus(HGSC005A hgsc005a) {
HGSC005 hgsc005 = THGSC005.queryByMatId(hgsc005a.getMatId());
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==1, "生产计划已提交,不能操作!");
}
/**
* 校验修改的数据
*
......
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