Commit c57953ee by 江和松

在存货档案(物料数据库成品)增加产品来源字段,内容包括加工和外购,在产品清单容增加加工、外购,当为外购时生产计划不生成

parent 012cbb98
......@@ -122,7 +122,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框,带id名称等信息
* 编写:
*/
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail", "spec","HGPZ005.queryProductComboBox"),
PRODUCT_BLOCK_ID("product_block_id","inventCode","inventName","id","inventType","length","width","thick","inventTypeDetail", "spec","inventSource","HGPZ005.queryProductComboBox"),
/**
* 模块:存货档案(ALL)
* 用途:存货档案下拉框
......
......@@ -344,6 +344,19 @@ public class HGConstant {
/**
*
* 产品来源
* @author:jhs
* @date:2024/10/25,15:18
*/
public static class InventSource {
// 加工
public static final Integer JG = 1;
// 外购
public static final Integer WG = 2;
}
/**
*
* 出库单数据来源
* @author:songx
* @date:2024/5/15,15:18
......
......@@ -48,6 +48,7 @@ public class HGPZ005 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_FLOW_ID = "flowId";
public static final String FIELD_INVENT_SOURCE = "inventSource"; /* 物料来源 1加工 2外购*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/
......@@ -111,6 +112,7 @@ public class HGPZ005 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private Long flowId = new Long(0); /*工艺流程ID*/
private Integer inventSource; /* 物料来源 1加工 2外购*/
/**
* initialize the metadata.
......@@ -223,6 +225,10 @@ public class HGPZ005 extends DaoEPBase {
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_SOURCE);
eiColumn.setDescName("物料来源 1加工 2外购");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -585,6 +591,14 @@ public class HGPZ005 extends DaoEPBase {
this.inventTypeDetail = inventTypeDetail;
}
public Integer getInventSource() {
return inventSource;
}
public void setInventSource(Integer inventSource) {
this.inventSource = inventSource;
}
/**
* 用于材料计划对比物料数据库是否存在不同,存在时就新录入一条
* @param o
......@@ -653,6 +667,7 @@ public class HGPZ005 extends DaoEPBase {
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFlowId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_FLOW_ID)), flowId));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setInventSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_SOURCE)), inventSource));
}
/**
......@@ -685,6 +700,7 @@ public class HGPZ005 extends DaoEPBase {
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_FLOW_ID, StringUtils.toString(flowId, eiMetadata.getMeta(FIELD_FLOW_ID)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_INVENT_SOURCE, StringUtils.toString(inventSource, eiMetadata.getMeta(FIELD_INVENT_SOURCE)));
return map;
}
......
......@@ -27,7 +27,8 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
FLOW_ID as "flowId"
FLOW_ID as "flowId",
INVENT_SOURCE as "inventSource" <!-- 物料来源 1加工 2外购 -->
</sql>
<sql id="condition">
<!-- 存货档案去除权限限制
......@@ -131,6 +132,9 @@
<isNotEmpty prepend=" AND " property="processCode">
INVENT_CODE IN (SELECT INVENT_CODE FROM ${hggpSchema}.HGPZ005A WHERE PROCESS_CODE = #processCode#)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventSource">
INVENT_SOURCE = #inventSource#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGPZ005">
......@@ -178,9 +182,10 @@
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
FLOW_ID
FLOW_ID,
INVENT_SOURCE
)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventTypeDetail#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,#flowId#)
VALUES (#id#, #accountCode#, #depCode#, #inventType#, #inventTypeDetail#, #inventCode#, #inventName#, #spec#, #length#, #width#, #thick#, #material#, #coefficient#, #unit#, #status#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,#flowId#,#inventSource#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) FROM ${hggpSchema}.HGPZ005
</selectKey>
......@@ -214,7 +219,8 @@
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
FLOW_ID = #flowId#
FLOW_ID = #flowId#,
INVENT_SOURCE = #inventSource#
WHERE
ID = #id#
</update>
......@@ -266,7 +272,8 @@
ifnull(THICK,0) as "thick", <!-- 厚 -->
STATUS as "status",
ifnull(COEFFICIENT,0) as "coefficient", <!-- 系数 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
INVENT_TYPE_DETAIL as "inventTypeDetail",
INVENT_SOURCE as "inventSource" <!-- 物料来源 1加工 2外购 -->
FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -284,7 +291,7 @@
ORDER BY INVENT_CODE
</select>
<select id="queryProductComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
<select id="queryProductComboBox" parameterClass="java.util.HashMap" resultClass="HGPZ005">
SELECT DISTINCT
a.ID as "id",
a.INVENT_TYPE as "inventType",
......@@ -295,7 +302,8 @@
a.THICK as "thick", <!-- 厚 -->
b.PAR_INVENT_TYPE as "parInventType",
b.INVENT_TYPE_DETAIL as "inventTypeDetail",
a.SPEC as "spec" <!-- 规格 -->
a.SPEC as "spec", <!-- 规格 -->
a.INVENT_SOURCE as "inventSource" <!-- 物料来源 1加工 2外购 -->
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
WHERE a.DELETE_FLAG = 0
......@@ -346,7 +354,8 @@
THICK AS "thick" , <!-- 厚 -->
COEFFICIENT AS "coefficient", <!-- 系数 -->
ID AS "id",
INVENT_TYPE_DETAIL as "inventTypeDetail"
INVENT_TYPE_DETAIL as "inventTypeDetail",
INVENT_SOURCE as "inventSource" <!-- 物料来源 1加工 2外购 -->
FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0
AND STATUS = 1
......
......@@ -63,6 +63,8 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String FIELD_proj_code_prefix = "projCodePrefix"; /* 项目编码前缀*/
public static final String FIELD_proj_name_prefix = "projNamePrefix"; /* 项目名称前缀*/
public static final String FIELD_invent_source = "inventSource"; /* 物料来源 1加工 2外购*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_company_code = "company_code"; /* 公司编码(预留)*/
......@@ -160,6 +162,7 @@ public class HGSC004A extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer inventSource; /* 物料来源 1加工 2外购*/
@ExcelAnno(index = 4)
private String material = " "; /* 材质*/
@ExcelAnno(index = 11)
......@@ -400,6 +403,10 @@ public class HGSC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_proj_name_prefix);
eiColumn.setDescName("项目名称缩写");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_invent_source);
eiColumn.setDescName("物料来源 1加工 2外购");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -959,6 +966,14 @@ public class HGSC004A extends DaoEPBase {
this.projNamePrefix = projNamePrefix;
}
public Integer getInventSource() {
return inventSource;
}
public void setInventSource(Integer inventSource) {
this.inventSource = inventSource;
}
/**
* get the value from Map.
*
......@@ -1007,6 +1022,7 @@ public class HGSC004A extends DaoEPBase {
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setProjCodePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code_prefix)), projCodePrefix));
setProjNamePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name_prefix)), projNamePrefix));
setInventSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_invent_source)), inventSource));
}
/**
......@@ -1056,6 +1072,7 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
map.put(FIELD_proj_code_prefix, StringUtils.toString(projCodePrefix, eiMetadata.getMeta(FIELD_proj_code_prefix)));
map.put(FIELD_proj_name_prefix, StringUtils.toString(projNamePrefix, eiMetadata.getMeta(FIELD_proj_name_prefix)));
map.put(FIELD_invent_source, StringUtils.toString(inventSource, eiMetadata.getMeta(FIELD_invent_source)));
return map;
}
}
......@@ -54,6 +54,7 @@ public class HGSC004B extends DaoEPBase {
public static final String FIELD_updated_by = "updatedBy"; /* 更新人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String FIELD_invent_source = "inventSource"; /* 物料来源 1加工 2外购*/
public static final String COL_id = "id"; /* 主键*/
public static final String COL_material_detail_id = "material_detail_id"; /* 物料明细id*/
......@@ -126,6 +127,7 @@ public class HGSC004B extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer inventSource; /* 物料来源 1加工 2外购*/
/**
* initialize the metadata.
......@@ -319,7 +321,9 @@ public class HGSC004B extends DaoEPBase {
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_invent_source);
eiColumn.setDescName("物料来源 1加工 2外购");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -793,7 +797,13 @@ public class HGSC004B extends DaoEPBase {
public void setThick(BigDecimal thick) {
this.thick = thick;
}
public Integer getInventSource() {
return inventSource;
}
public void setInventSource(Integer inventSource) {
this.inventSource = inventSource;
}
/**
* get the value from Map.
*
......@@ -834,6 +844,7 @@ public class HGSC004B extends DaoEPBase {
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_length)), length));
setWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_width)), width));
setThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_thick)), thick));
setInventSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_invent_source)), inventSource));
}
/**
......@@ -873,6 +884,7 @@ public class HGSC004B extends DaoEPBase {
map.put(FIELD_length, StringUtils.toString(length, eiMetadata.getMeta(FIELD_length)));
map.put(FIELD_width, StringUtils.toString(width, eiMetadata.getMeta(FIELD_width)));
map.put(FIELD_thick, StringUtils.toString(thick, eiMetadata.getMeta(FIELD_thick)));
map.put(FIELD_invent_source, StringUtils.toString(inventSource, eiMetadata.getMeta(FIELD_invent_source)));
return map;
}
......
......@@ -292,6 +292,8 @@ public class ServiceHGSC004A extends ServiceBase {
// 全部提交后,发送计划
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004.getId());
//加工的才生成生产计划
mapA.put("inventSource", HGConstant.InventSource.JG);
hgsc004AList = dao.query(HGSC004A.QUERY_BY_MATERIAL_ID,mapA, 0, -999999);
List<HGSC005A> hgsc005AList = new LinkedList<>();
for(HGSC004A hgsc004A : hgsc004AList){
......@@ -337,12 +339,19 @@ public class ServiceHGSC004A extends ServiceBase {
delHgsc005a.setTechFlowId(delHgpz005.getFlowId());
}
HGSCTools.THGSC005A.delete(delHgsc005a);
if(hgsc004A.getInventSource().intValue() == HGConstant.InventSource.JG){
//变更生产计划
HGSCTools.THGSC005A.update(hgsc005a);
}else{
//如果是外购需要删除生产计划
HGSCTools.THGSC005A.delete(hgsc005a);
}
}else{
if(hgsc004A.getInventSource().intValue() == HGConstant.InventSource.JG){
hgsc005AList.add(hgsc005a);
}
}
}
if(hgsc005AList != null && !hgsc005AList.isEmpty()){
HGSCTools.THGSC005A.saveList(hgsc005AList);
}
......@@ -420,7 +429,7 @@ public class ServiceHGSC004A extends ServiceBase {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PRODUCT_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), true);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询存货档案失败");
}
......
......@@ -18,6 +18,7 @@
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
invent_type as "inventType", <!-- 档案类型 -->
invent_source as "inventSource", <!-- 物料来源 1加工 2外购 -->
spec as "spec", <!-- 规格 -->
length as "length", <!-- 长 -->
width as "width", <!-- 宽 -->
......@@ -145,6 +146,9 @@
<isNotEmpty prepend=" AND " property="thick">
thick = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventSource">
invent_source = #inventSource#
</isNotEmpty>
</sql>
......@@ -220,6 +224,7 @@
a.product_code as "productCode", <!-- 产品编号 -->
a.product_name as "productName", <!-- 产品名称 -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.invent_source as "inventSource", <!-- 物料来源 1加工 2外购 -->
a.spec as "spec",
a.length as "length", <!-- 长 -->
a.width as "width", <!-- 宽 -->
......@@ -354,6 +359,7 @@
product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 -->
invent_type, <!-- 档案类型 -->
invent_source, <!-- 物料来源 1加工 2外购 -->
product_status, <!-- 产品状态 0:未提交,1:已提交 -->
change_type, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity, <!-- 数量 -->
......@@ -374,7 +380,7 @@
)
VALUES (#id#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#,
#parentProdCode#, #parentProdName#,#leaf#,#sort#,#lv#, #materialId#, #productId#,#productType#,
#productCode#, #productName#,#inventType#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#productCode#, #productName#,#inventType#,#inventSource#, #productStatus#, #changeType#, #quantity#, #singleWeight#, #totalWeight#,
#approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
#updatedName#, #updatedTime#, #spec#, #length#, #width#, #thick#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
......@@ -406,6 +412,7 @@
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
invent_type = #inventType#, <!-- 档案类型 -->
invent_source = #inventSource#, <!-- 物料来源 1加工 2外购 -->
spec = #spec#,
length = #length#, <!-- 长 -->
width = #width#, <!-- 宽 -->
......
......@@ -113,6 +113,7 @@
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
invent_type as "inventType", <!-- 档案类型 -->
invent_source as "inventSource", <!-- 物料来源 1加工 2外购 -->
product_type as "productType", <!-- 产品类别 -->
length as "length", <!-- 长 -->
width as "width", <!-- 宽 -->
......@@ -166,6 +167,7 @@
product_name, <!-- 产品名称 -->
product_type, <!-- 产品类别 -->
invent_type, <!-- 档案类型 -->
invent_source, <!-- 物料来源 1加工 2外购 -->
product_status, <!-- 产品状态 0:未提交,1:已提交 -->
change_type, <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
quantity, <!-- 数量 -->
......@@ -185,7 +187,7 @@
)
VALUES (#id#,#materialDetailId#, #productId#, #companyCode#, #companyName#, #depCode#, #depName#,
#projCode#, #projName#, #parentProdCode#, #parentProdName#, #materialId#,
#productCode#, #productName#,#productType#,#inventType#, #productStatus#, #changeType#, #quantity#, #singleWeight#,
#productCode#, #productName#,#productType#,#inventType#,#inventSource#, #productStatus#, #changeType#, #quantity#, #singleWeight#,
#totalWeight#, #approvalStatus#, #accountCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #length#, #width#, #thick#)
</insert>
......@@ -212,6 +214,7 @@
product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 -->
invent_type = #inventType#, <!-- 档案类型 -->
invent_source = #inventSource#, <!-- 物料来源 1加工 2外购 -->
length = #length#, <!-- 长 -->
width = #width#, <!-- 宽 -->
thick = #thick#, <!-- 厚 -->
......
......@@ -42,6 +42,9 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventSource" cname="产品来源" width="80" enable="true" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.pz.inventSource"/>
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
......
......@@ -394,6 +394,7 @@ $(function () {
resultGrid.setCellValue(e.items[0],"thick",productCodeBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"productType",productCodeBox[i]['param6Field']);
resultGrid.setCellValue(e.items[0],"spec",productCodeBox[i]['param7Field']);
resultGrid.setCellValue(e.items[0],"inventSource",productCodeBox[i]['param8Field']);
}
}
}
......
......@@ -57,6 +57,9 @@
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" />
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFComboColumn ename="inventSource" cname="产品来源" width="80" enable="false" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.pz.inventSource"/>
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
......
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