Commit b76223c9 by liuyang

2024-08-12 生产任务的报工增加超报原因字段

parent 99af012a
...@@ -69,6 +69,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -69,6 +69,7 @@ public class HGSC008 extends DaoEPBase {
public static final String FIELD_spec = "spec"; /* 规格*/ public static final String FIELD_spec = "spec"; /* 规格*/
public static final String FIELD_length = "length"; /* 长*/ public static final String FIELD_length = "length"; /* 长*/
public static final String FIELD_exceed_reason = "exceedReason";
public static final String COL_id = "id"; public static final String COL_id = "id";
public static final String COL_mat_id = "mat_id"; /* 物料清单ID*/ public static final String COL_mat_id = "mat_id"; /* 物料清单ID*/
...@@ -153,6 +154,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -153,6 +154,7 @@ public class HGSC008 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private String spec = " "; /* 规格*/ private String spec = " "; /* 规格*/
private BigDecimal length = new BigDecimal("0"); /* 长*/ private BigDecimal length = new BigDecimal("0"); /* 长*/
private String exceedReason = " ";
//补充字段 //补充字段
...@@ -412,6 +414,10 @@ public class HGSC008 extends DaoEPBase { ...@@ -412,6 +414,10 @@ public class HGSC008 extends DaoEPBase {
eiColumn.setDescName("长"); eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_exceed_reason);
eiColumn.setDescName("超报原因");
eiMetadata.addMeta(eiColumn);
// private Integer registeredQuantity = new Integer(0); // private Integer registeredQuantity = new Integer(0);
// private BigDecimal registeredWeight = new BigDecimal(0); // private BigDecimal registeredWeight = new BigDecimal(0);
// private Integer unregisterQuantity = new Integer(0); // private Integer unregisterQuantity = new Integer(0);
...@@ -1019,6 +1025,14 @@ public class HGSC008 extends DaoEPBase { ...@@ -1019,6 +1025,14 @@ public class HGSC008 extends DaoEPBase {
this.length = length; this.length = length;
} }
public String getExceedReason() {
return exceedReason;
}
public void setExceedReason(String exceedReason) {
this.exceedReason = exceedReason;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1072,6 +1086,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -1072,6 +1086,7 @@ public class HGSC008 extends DaoEPBase {
setTaskWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_task_weight)), taskWeight)); setTaskWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_task_weight)), taskWeight));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_spec)), spec)); setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_spec)), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_length)), length)); setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_length)), length));
setExceedReason(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_exceed_reason)), exceedReason));
} }
/** /**
...@@ -1125,6 +1140,7 @@ public class HGSC008 extends DaoEPBase { ...@@ -1125,6 +1140,7 @@ public class HGSC008 extends DaoEPBase {
map.put(FIELD_task_weight, StringUtils.toString(taskWeight, eiMetadata.getMeta(FIELD_task_weight))); map.put(FIELD_task_weight, StringUtils.toString(taskWeight, eiMetadata.getMeta(FIELD_task_weight)));
map.put(FIELD_spec, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_spec))); map.put(FIELD_spec, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_spec)));
map.put(FIELD_length, StringUtils.toString(length, eiMetadata.getMeta(FIELD_length))); map.put(FIELD_length, StringUtils.toString(length, eiMetadata.getMeta(FIELD_length)));
map.put(FIELD_exceed_reason, StringUtils.toString(exceedReason, eiMetadata.getMeta(FIELD_exceed_reason)));
return map; return map;
} }
} }
...@@ -196,7 +196,8 @@ ...@@ -196,7 +196,8 @@
updated_name as "updatedName", <!-- 修改人名称 --> updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 --> updated_time as "updatedTime", <!-- 更新时间 -->
length as "length", <!-- 长 --> length as "length", <!-- 长 -->
spec as "spec" <!-- 规格 --> spec as "spec", <!-- 规格 -->
exceed_reason as "exceedReason"
FROM ${hggpSchema}.HGSC008 FROM ${hggpSchema}.HGSC008
WHERE 1=1 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
...@@ -365,13 +366,14 @@ ...@@ -365,13 +366,14 @@
updated_name, <!-- 修改人名称 --> updated_name, <!-- 修改人名称 -->
updated_time, <!-- 更新时间 --> updated_time, <!-- 更新时间 -->
spec, spec,
length length,
exceed_reason
) )
VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, VALUES (#id#, #matId#, #taskId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#,
#processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #workCode#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #workCode#,
#productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#,
#groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#, #groupCode#, #groupName#, #registerDate#, #quantity#, #singleWeight#, #totalWeight#, #accountCode#, #createdBy#,
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,#spec#,#length#) #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,#spec#,#length#,#exceedReason#)
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC008 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC008
</selectKey> </selectKey>
...@@ -385,44 +387,45 @@ ...@@ -385,44 +387,45 @@
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGSC008 UPDATE ${hggpSchema}.HGSC008
SET SET
mat_id = #matId#, <!-- 物料清单ID --> mat_id = #matId#, <!-- 物料清单ID -->
task_id = #taskId#, <!-- 生产任务ID --> task_id = #taskId#, <!-- 生产任务ID -->
tech_flow_id = #techFlowId#, <!-- 工艺流程ID --> tech_flow_id = #techFlowId#, <!-- 工艺流程ID -->
tech_flow_name = #techFlowName#, <!-- 工艺流程名称 --> tech_flow_name = #techFlowName#, <!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id --> invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id -->
process_code = #processCode#, <!-- 工序编码 --> process_code = #processCode#, <!-- 工序编码 -->
process_name = #processName#, <!-- 工序名称 --> process_name = #processName#, <!-- 工序名称 -->
process_order = #processOrder#, <!-- 加工顺序 --> process_order = #processOrder#, <!-- 加工顺序 -->
company_code = #companyCode#, <!-- 公司编码 --> company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 --> company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 --> dep_code = #depCode#, <!-- 部门编码 -->
dep_name = #depName#, <!-- 部门名称 --> dep_name = #depName#, <!-- 部门名称 -->
proj_code = #projCode#, <!-- 项目编码 --> proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 --> proj_name = #projName#, <!-- 项目名称 -->
work_code = #workCode#, <!-- 报工编码 --> work_code = #workCode#, <!-- 报工编码 -->
product_type = #productType#, <!-- 产品类型 --> product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 --> product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 --> product_name = #productName#, <!-- 产品名称 -->
plan_start_date = #planStartDate#, <!-- 计划开始日期 --> plan_start_date = #planStartDate#, <!-- 计划开始日期 -->
plan_end_date = #planEndDate#, <!-- 计划结束日期 --> plan_end_date = #planEndDate#, <!-- 计划结束日期 -->
factory_code = #factoryCode#, <!-- 工厂编号 --> factory_code = #factoryCode#, <!-- 工厂编号 -->
factory_name = #factoryName#, <!-- 工厂名称 --> factory_name = #factoryName#, <!-- 工厂名称 -->
group_code = #groupCode#, <!-- 工作组编号 --> group_code = #groupCode#, <!-- 工作组编号 -->
group_name = #groupName#, <!-- 工作组名称 --> group_name = #groupName#, <!-- 工作组名称 -->
register_date = #registerDate#, <!-- 报工日期 --> register_date = #registerDate#, <!-- 报工日期 -->
quantity = #quantity#, <!-- 数量 --> quantity = #quantity#, <!-- 数量 -->
single_weight = #singleWeight#, <!-- 单重 --> single_weight = #singleWeight#, <!-- 单重 -->
total_weight = #totalWeight#, <!-- 总重 --> total_weight = #totalWeight#, <!-- 总重 -->
account_code = #accountCode#, <!-- 帐套 --> account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 --> created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 --> created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 --> created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 --> updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 --> updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 更新时间 --> updated_time = #updatedTime#, <!-- 更新时间 -->
spec = #spec#, spec = #spec#,
length = #length# length = #length#,
WHERE exceed_reason = #exceedReason#
WHERE
id = #id# id = #id#
</update> </update>
......
...@@ -1223,6 +1223,7 @@ public class HGSCTools { ...@@ -1223,6 +1223,7 @@ public class HGSCTools {
hgsc008.setTaskId(hgsc007.getId()); hgsc008.setTaskId(hgsc007.getId());
hgsc008.setQuantity(NumberUtils.toInteger(resultMap.get(HGSC008.FIELD_quantity))); hgsc008.setQuantity(NumberUtils.toInteger(resultMap.get(HGSC008.FIELD_quantity)));
hgsc008.setRegisterDate(String.valueOf(resultMap.get(HGSC008.FIELD_register_date))); hgsc008.setRegisterDate(String.valueOf(resultMap.get(HGSC008.FIELD_register_date)));
hgsc008.setExceedReason(resultMap.get(HGSC008.FIELD_exceed_reason).toString());
hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hgsc008.getQuantity()))); hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hgsc008.getQuantity())));
checkAddDate(hgsc008); checkAddDate(hgsc008);
hgsc008.setWorkCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC008_WORK_CODE)); hgsc008.setWorkCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC008_WORK_CODE));
......
...@@ -35,6 +35,13 @@ $(function () { ...@@ -35,6 +35,13 @@ $(function () {
message("报工日期不能为空!"); message("报工日期不能为空!");
return ; return ;
} }
let unregisterQuantity = $("#result-0-unregisterQuantity").val();
let exceedReason = $("#result-0-exceedReason").val();
if (quantity - unregisterQuantity > 0 && exceedReason.trim().length === 0){
message("报工数量大于剩余报工数量,请填写超报原因");
return ;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGrid("", "HGSC007A", "save", {isAlldata:true,onSuccessCallback:parent.registerWorkCallback}); JSUtils.submitGrid("", "HGSC007A", "save", {isAlldata:true,onSuccessCallback:parent.registerWorkCallback});
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
format="yyyy-MM-dd" required="true" readonly="false"/> format="yyyy-MM-dd" required="true" readonly="false"/>
<EF:EFInput ename="result-0-quantity" cname="报工数量" format="{0:0}" editType="text" colWidth="4" required="true" /> <EF:EFInput ename="result-0-quantity" cname="报工数量" format="{0:0}" editType="text" colWidth="4" required="true" />
<EF:EFInput ename="result-0-totalWeight" cname="报工重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalWeight" cname="报工重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-exceedReason" cname="超报原因" type="textarea" editType="text" colWidth="8" ratio="2:10"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<EF:EFColumn ename="quantity" cname="数量" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="quantity" cname="数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="singleWeight" cname="单重(KG)" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalWeight" cname="任务总重(KG)" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="totalWeight" cname="任务总重(KG)" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="exceedReason" cname="超报原因" width="200" etype="textarea" enable="false" readonly="true" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
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