Commit 6d02b731 by 江和松

1.修改物料清单逻辑

2.增加批量新增逻辑
3.生产入库接口修改
parent 2aceb4f9
...@@ -91,7 +91,7 @@ public enum DdynamicEnum { ...@@ -91,7 +91,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框,带id名称等信息 * 用途:存货档案下拉框,带id名称等信息
* 编写: * 编写:
*/ */
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","HGPZ005.queryProductComboBox"), PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail","HGPZ005.queryProductComboBox"),
/** /**
* 模块:存货档案(ALL) * 模块:存货档案(ALL)
* 用途:存货档案下拉框 * 用途:存货档案下拉框
......
...@@ -74,7 +74,7 @@ public class DaoUtils { ...@@ -74,7 +74,7 @@ public class DaoUtils {
} }
/** /**
* update method. * updateBatch method.
* *
* @param sql * @param sql
* @param parameters * @param parameters
...@@ -91,6 +91,23 @@ public class DaoUtils { ...@@ -91,6 +91,23 @@ public class DaoUtils {
} }
/** /**
* insertBatch method.
*
* @param sql
* @param parameters
*/
public static int insertBatch(String sql, Collection parameters) {
parameters.forEach(obj->{
if (obj instanceof DaoEPBase) {
setRevisor((DaoEPBase) obj, true);
} else if (obj instanceof Map) {
setRevisor((Map) obj, true);
}
});
return DaoBase.getInstance().insertBatch(sql, parameters);
}
/**
* 创建人工号 创建人姓名 创建人岗号 创建时刻 * 创建人工号 创建人姓名 创建人岗号 创建时刻
* *
* @param bean * @param bean
......
...@@ -115,6 +115,7 @@ public class HGKC003 extends DaoEPBase { ...@@ -115,6 +115,7 @@ public class HGKC003 extends DaoEPBase {
public static final String UPDATE = "HGKC003.update"; public static final String UPDATE = "HGKC003.update";
public static final String DELETE = "HGKC003.delete"; public static final String DELETE = "HGKC003.delete";
public static final String UPDATE_SUBMIT_STATUS = "HGKC003.updateSubmitStatus"; public static final String UPDATE_SUBMIT_STATUS = "HGKC003.updateSubmitStatus";
public static final String MAX_ID = "HGKC003.maxId";
private Long id = new Long(0); private Long id = new Long(0);
private Long qualityId = new Long(0); /* 质检单id*/ private Long qualityId = new Long(0); /* 质检单id*/
......
...@@ -23,6 +23,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -23,6 +23,7 @@ public class HGKC003A extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; public static final String FIELD_ID = "id";
public static final String FIELD_QUALITY_DETAIL_ID = "qualityDetailId"; /* 质检单明细ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/ public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
...@@ -68,6 +69,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -68,6 +69,7 @@ public class HGKC003A extends DaoEPBase {
public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/ public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:0:入库 1:退回*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_QUALITY_DETAIL_ID = "QUALITY_DETAIL_ID"; /* 质检单明细ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/ public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
...@@ -120,6 +122,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -120,6 +122,7 @@ public class HGKC003A extends DaoEPBase {
public static final String BATCH_DELETE = "HGKC003A.batchDelete"; public static final String BATCH_DELETE = "HGKC003A.batchDelete";
private Long id = new Long(0); private Long id = new Long(0);
private Long qualityDetailId = new Long(0); /* 质检单明细ID*/
private String accountCode = " "; /* 企业编码*/ private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/ private String createdBy = " "; /* 记录创建者*/
...@@ -175,6 +178,10 @@ public class HGKC003A extends DaoEPBase { ...@@ -175,6 +178,10 @@ public class HGKC003A extends DaoEPBase {
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUALITY_DETAIL_ID);
eiColumn.setDescName("质检单明细ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE); eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码"); eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -1094,6 +1101,15 @@ public class HGKC003A extends DaoEPBase { ...@@ -1094,6 +1101,15 @@ public class HGKC003A extends DaoEPBase {
public void setStorageType(Boolean storageType) { public void setStorageType(Boolean storageType) {
this.storageType = storageType; this.storageType = storageType;
} }
public Long getQualityDetailId() {
return qualityDetailId;
}
public void setQualityDetailId(Long qualityDetailId) {
this.qualityDetailId = qualityDetailId;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1103,6 +1119,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -1103,6 +1119,7 @@ public class HGKC003A extends DaoEPBase {
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setQualityDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_QUALITY_DETAIL_ID)), qualityDetailId));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy)); setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
...@@ -1156,6 +1173,7 @@ public class HGKC003A extends DaoEPBase { ...@@ -1156,6 +1173,7 @@ public class HGKC003A extends DaoEPBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID))); map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_QUALITY_DETAIL_ID, StringUtils.toString(qualityDetailId, eiMetadata.getMeta(FIELD_QUALITY_DETAIL_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE))); map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY))); map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
......
...@@ -308,4 +308,8 @@ ...@@ -308,4 +308,8 @@
ID = #id# ID = #id#
</update> </update>
<select id="maxId" resultClass="long">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC003
</select>
</sqlMap> </sqlMap>
...@@ -135,12 +135,16 @@ ...@@ -135,12 +135,16 @@
<isNotEmpty prepend=" AND " property="storageType"> <isNotEmpty prepend=" AND " property="storageType">
STORAGE_TYPE = #storageType# STORAGE_TYPE = #storageType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="qualityDetailId">
QUALITY_DETAIL_ID = #qualityDetailId#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A"> resultClass="com.baosight.hggp.hg.kc.domain.HGKC003A">
SELECT SELECT
ID as "id", ID as "id",
QUALITY_DETAIL_ID as "qualityDetailId",<!-- 企业编码 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 --> CREATED_BY as "createdBy", <!-- 记录创建者 -->
...@@ -204,7 +208,8 @@ ...@@ -204,7 +208,8 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGKC003A (ID, INSERT INTO ${hggpSchema}.HGKC003A (
QUALITY_DETAIL_ID,<!-- 企业编码 -->
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
...@@ -249,7 +254,7 @@ ...@@ -249,7 +254,7 @@
AMOUNT, <!-- 金额 --> AMOUNT, <!-- 金额 -->
STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 --> STORAGE_TYPE <!-- 入库类型:0:入库 1:退回 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#) VALUES (#qualityDetailId#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#, #invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #primaryId#, #price#, #amount#, #storageType#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -265,6 +270,7 @@ ...@@ -265,6 +270,7 @@
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGKC003A UPDATE ${hggpSchema}.HGKC003A
SET SET
QUALITY_DETAIL_ID = #qualityDetailId#,<!-- 企业编码 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 --> ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 --> CREATED_BY = #createdBy#, <!-- 记录创建者 -->
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
...@@ -131,21 +132,39 @@ public class HGKCTools { ...@@ -131,21 +132,39 @@ public class HGKCTools {
public static class HgKc003 { public static class HgKc003 {
public static HGKC003 save(HGKC003 hgkc003){ public static HGKC003 save(HGKC003 hgkc003,List<HGKC003A> hgkc003aList){
checkSaveData(hgkc003); checkSaveData(hgkc003,hgkc003aList);
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO)); 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); DaoUtils.insert(HGKC003.INSERT,hgkc003);
hgkc003aList.forEach(o->{
o.setPrimaryId(setId);
});
DaoUtils.insertBatch(HGKC003A.INSERT,hgkc003aList);
return hgkc003; return hgkc003;
} }
private static void checkSaveData(HGKC003 hgkc003) { private static void checkSaveData(HGKC003 hgkc003,List<HGKC003A> hgkc003aList) {
AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgkc003.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgkc003.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003.getWhCode(), "仓库编码不能为空!"); AssertUtils.isEmpty(hgkc003.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(), "仓库名称不能为空!"); AssertUtils.isEmpty(hgkc003.getWhName(), "仓库名称不能为空!");
AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!"); AssertUtils.isEmpty(hgkc003.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!"); AssertUtils.isEmpty(hgkc003.getProjName(), "项目名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单idID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单ID不能为空!");
for(HGKC003A hgkc003a : hgkc003aList){
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.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!");
}
} }
/** /**
...@@ -207,8 +226,13 @@ public class HGKCTools { ...@@ -207,8 +226,13 @@ public class HGKCTools {
private static void checkSaveData(HGKC003A hgkc003a) { private static void checkSaveData(HGKC003A hgkc003a) {
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!"); AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "公司编码不能为空!");
AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!"); AssertUtils.isEmpty(hgkc003a.getCompanyName(), "公司名称不能为空!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "项目编号不能为空!");
// AssertUtils.isTrue(Objects.isNull(hgkc003.getQualityId())||hgkc003.getQualityId()<=0, "质检单idID不能为空!"); 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.getQualityDetailId())||hgkc003a.getQualityDetailId()<=0, "质检单明细ID不能为空!");
} }
} }
......
...@@ -345,10 +345,11 @@ ...@@ -345,10 +345,11 @@
a.INVENT_TYPE as "inventType", a.INVENT_TYPE as "inventType",
a.INVENT_CODE as "inventCode", a.INVENT_CODE as "inventCode",
a.INVENT_NAME as "inventName", a.INVENT_NAME as "inventName",
LENGTH as "length", <!-- 长 --> a.LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 --> a.WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 --> a.THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType" b.PAR_INVENT_TYPE as "parInventType",
b.INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGPZ005 a FROM ${hggpSchema}.HGPZ005 a
left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0 left join ${hggpSchema}.hgpz004 b on a.INVENT_TYPE = b.INVENT_TYPE and b.STATUS=1 and b.DELETE_FLAG = 0
WHERE a.DELETE_FLAG = 0 WHERE a.DELETE_FLAG = 0
......
...@@ -165,38 +165,31 @@ public class ServiceHGSC004 extends ServiceBase { ...@@ -165,38 +165,31 @@ public class ServiceHGSC004 extends ServiceBase {
* @param hgsc004 * @param hgsc004
*/ */
private void insertTree(HGSC004 hgsc004) { private void insertTree(HGSC004 hgsc004) {
//变更清单里面的公司、项目信息 //录入树结构,公司
Map<String,Object> map = new HashMap<>(); HGSC004A rootHgsc004A = new HGSC004A();
map.put("companyCode",hgsc004.getCompanyCode()); BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id");
map.put("projCode",hgsc004.getProjCode()); //因为获取不到id,所以根据公司编号+项目编号得到树结构
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,map, 0, -999999); rootHgsc004A.setMaterialId(hgsc004.getId());
if(CollectionUtils.isEmpty(hgsc004AList)){ rootHgsc004A.setParentProdCode("root");
//录入树结构,公司 rootHgsc004A.setParentProdName(hgsc004.getCompanyName());
HGSC004A rootHgsc004A = new HGSC004A(); rootHgsc004A.setLeaf(2);//有叶子节点
BeanUtil.copyProperties(hgsc004,rootHgsc004A,"id"); rootHgsc004A.setLv(1);
//因为获取不到id,所以根据公司编号+项目编号得到树结构 rootHgsc004A.setSort(1);
rootHgsc004A.setMaterialId(hgsc004.getId()); rootHgsc004A.setProductCode(hgsc004.getCompanyCode());
rootHgsc004A.setParentProdCode("root"); rootHgsc004A.setProductName(hgsc004.getCompanyName());
rootHgsc004A.setParentProdName(hgsc004.getCompanyName()); DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A);
rootHgsc004A.setLeaf(2);//有叶子节点 //录入2级目录,项目
rootHgsc004A.setLv(1); HGSC004A projectHgsc004A = new HGSC004A();
rootHgsc004A.setSort(1); BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id");
rootHgsc004A.setProductCode(hgsc004.getCompanyCode()); projectHgsc004A.setMaterialId(hgsc004.getId());
rootHgsc004A.setProductName(hgsc004.getCompanyName()); projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode());
DaoUtils.insert(HGSC004A.INSERT, rootHgsc004A); projectHgsc004A.setParentProdName(rootHgsc004A.getProductName());
//录入2级目录,项目 projectHgsc004A.setLeaf(2);//有叶子节点
HGSC004A projectHgsc004A = new HGSC004A(); projectHgsc004A.setLv(2);
BeanUtil.copyProperties(hgsc004,projectHgsc004A,"id"); projectHgsc004A.setSort(1);
projectHgsc004A.setMaterialId(hgsc004.getId()); projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setParentProdCode(rootHgsc004A.getProductCode()); projectHgsc004A.setProductName(hgsc004.getProjName());
projectHgsc004A.setParentProdName(rootHgsc004A.getProductName()); DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
projectHgsc004A.setLeaf(2);//有叶子节点
projectHgsc004A.setLv(2);
projectHgsc004A.setSort(1);
projectHgsc004A.setProductCode(hgsc004.getProjCode());
projectHgsc004A.setProductName(hgsc004.getProjName());
DaoUtils.insert(HGSC004A.INSERT, projectHgsc004A);
}
} }
......
...@@ -122,7 +122,7 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -122,7 +122,7 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setMaterialId(hgsc004.getId()); hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(hgsc004a.getLv() + 1); hgsc004a.setLv(hgsc004a.getLv() + 1);
//不为4级都有叶子节点 //不为4级都有叶子节点
if(hgsc004a.getLv().intValue() <= 4){ if(hgsc004a.getLv().intValue() < 4){
hgsc004a.setLeaf(2); hgsc004a.setLeaf(2);
}else{ }else{
hgsc004a.setLeaf(1); hgsc004a.setLeaf(1);
...@@ -177,9 +177,18 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -177,9 +177,18 @@ public class ServiceHGSC004A extends ServiceBase {
private void checkSaveData(HGSC004A hgsc004a,HGSC004 hgsc004) { private void checkSaveData(HGSC004A hgsc004a,HGSC004 hgsc004) {
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){ if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){
//蓝图信息,用于蓝图状态校验 //蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004.getBlueprintId()); HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC003.FIELD_id,hgsc004.getBlueprintId());
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!"); AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
} }
//为构件的需要验证是否已经存在了,不能重复添加
if(hgsc004a.getLv().intValue() == 3){
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productId",hgsc004a.getProductId());
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构建"+hgsc004a.getProductName());
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!"); AssertUtils.isEmpty(hgsc004a.getCompanyCode(), "请选择公司!");
......
...@@ -189,6 +189,7 @@ $(function () { ...@@ -189,6 +189,7 @@ $(function () {
item['length'] = productCodeBox[i]['param3Field']; item['length'] = productCodeBox[i]['param3Field'];
item['width'] = productCodeBox[i]['param4Field']; item['width'] = productCodeBox[i]['param4Field'];
item['thick'] = productCodeBox[i]['param5Field']; item['thick'] = productCodeBox[i]['param5Field'];
item['productType'] = productCodeBox[i]['param6Field'];
console.log(item) console.log(item)
template = productCodeBox[i]['valueField']; template = productCodeBox[i]['valueField'];
}else{ }else{
...@@ -261,17 +262,20 @@ $(function () { ...@@ -261,17 +262,20 @@ $(function () {
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field == "productCode") { if (e.field == "productCode") {
loadChange(grid,e,"productId"); loadChange(grid,e,"productId");
loadChange(grid,e,"inventType");
loadChange(grid,e,"productName"); loadChange(grid,e,"productName");
loadChange(grid,e,"quantity"); loadChange(grid,e,"inventType");
loadChange(grid,e,"length");
loadChange(grid,e,"width");
loadChange(grid,e,"thick");
loadChange(grid,e,"productType");
} }
if (e.field == "quantity") { if (e.field == "quantity") {
loadChange(grid,e,"singleWeight");
loadChange(grid,e,"totalWeight"); loadChange(grid,e,"totalWeight");
} }
if (e.field == "singleWeight") { if (e.field == "singleWeight") {
loadChange(grid,e,"totalWeight"); loadChange(grid,e,"totalWeight");
} }
loadChange(grid,e,"id");
}); });
}, },
onSuccess: function (e) { onSuccess: function (e) {
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/> <EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量"/> <EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)"/> <EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)"/>
<EF:EFColumn ename="totalWeight" cname="总重(kg)" required="true" format="{0:N3}"/> <EF:EFColumn ename="totalWeight" cname="总重(kg)" required="true" format="{0:N3}" enable="false"/>
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false" enable="false"> <EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" /> <EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn> </EF:EFComboColumn>
......
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