Commit 366ef3cd by liuyang

2024-05-20 优化工序设置添加计算类型

parent 45307280
......@@ -44,6 +44,7 @@ public class HGSJ001 extends DaoEPBase {
public static final String FIELD_PRINC = "princ"; /* 负责人*/
public static final String FIELD_PRINC_NAME = "princName"; /* 负责人名称*/
public static final String FIELD_STATUS = "status"; /* 状态0.停止1.启用*/
public static final String FIELD_COMPUTE_TYPE = "computeType"; /* 计算类型*/
public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
......@@ -95,6 +96,7 @@ public class HGSJ001 extends DaoEPBase {
private String princ = " "; /* 负责人*/
private String princName = " "; /* 负责人名称*/
private Integer status = 0; /* 状态0.停止1.启用*/
private Integer computeType = 0;
/**
* initialize the metadata.
......@@ -196,6 +198,9 @@ public class HGSJ001 extends DaoEPBase {
eiColumn.setDescName("状态0.停止1.启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPUTE_TYPE);
eiColumn.setDescName("计算类型");
eiMetadata.addMeta(eiColumn);
}
......@@ -535,6 +540,15 @@ public class HGSJ001 extends DaoEPBase {
public void setStatus(Integer status) {
this.status = status;
}
public Integer getComputeType() {
return computeType;
}
public void setComputeType(Integer computeType) {
this.computeType = computeType;
}
/**
* get the value from Map.
*
......@@ -564,6 +578,7 @@ public class HGSJ001 extends DaoEPBase {
setPrinc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC)), princ));
setPrincName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC_NAME)), princName));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setComputeType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_COMPUTE_TYPE)), computeType));
}
/**
......@@ -594,6 +609,7 @@ public class HGSJ001 extends DaoEPBase {
map.put(FIELD_PRINC, StringUtils.toString(princ, eiMetadata.getMeta(FIELD_PRINC)));
map.put(FIELD_PRINC_NAME, StringUtils.toString(princName, eiMetadata.getMeta(FIELD_PRINC_NAME)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_COMPUTE_TYPE, StringUtils.toString(computeType, eiMetadata.getMeta(FIELD_COMPUTE_TYPE)));
return map;
}
......
......@@ -6,10 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -79,17 +76,16 @@ public class ServiceHGSJ001 extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
for (Map resultRow : resultRows) {
HGSJ001 hpsj001 = new HGSJ001();
hpsj001.fromMap(resultRows.get(i));
queryDeviceCode(hpsj001);
hpsj001.fromMap(resultRow);
if (hpsj001.getId() == null || hpsj001.getId() == 0) {
queryDeviceCode(hpsj001);
this.add(hpsj001);
} else {
this.modify(hpsj001);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
......@@ -142,7 +138,7 @@ public class ServiceHGSJ001 extends ServiceEPBase {
*/
public void queryDeviceCode(HGSJ001 hgsj001){
Map<String,Object> map = new HashMap<>();
map.put("processName",hgsj001.getProcessName().trim());
map.put(HGSJ001.FIELD_PROCESS_NAME,hgsj001.getProcessName().trim());
map.put(HGSJ001.FIELD_DELETE_FLAG,hgsj001.getDeleteFlag());
List<HGSJ001> hgsj001s = this.dao.query(HGSJ001.QUERY,map);
AssertUtils.isNotEmpty(hgsj001s, String.format("工序名称[%s]已存在,添加失败!", hgsj001.getProcessName()));
......
......@@ -23,7 +23,8 @@
STANDARD_NUM as "standardNum", <!-- 标准工序人数 -->
PRINC as "princ", <!-- 负责人 -->
PRINC_NAME as "princName", <!-- 负责人名称 -->
STATUS as "status" <!-- 状态0.停止1.启动 -->
STATUS as "status", <!-- 状态0.停止1.启动 -->
COMPUTE_TYPE as "computeType"
</sql>
<sql id="authCondition">
......@@ -114,6 +115,9 @@
<isNotEmpty prepend=" AND " property="processNames">
PROCESS_NAME LIKE CONCAT('%', #processNames#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="computeType">
COMPUTE_TYPE = #computeType#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -222,9 +226,10 @@
STANDARD_NUM, <!-- 标准工序人数 -->
PRINC, <!-- 负责人 -->
PRINC_NAME,
STATUS <!-- 状态0.停止1.启动 -->
STATUS, <!-- 状态0.停止1.启动 -->
COMPUTE_TYPE
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #princName#,#status#)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #factoryCode#, #factoryName#, #processCode#, #processName#, #unit#, #standardJob#, #standardDays#, #standardNum#, #princ#, #princName#,#status#,#computeType#)
</insert>
<delete id="delete">
......@@ -266,7 +271,8 @@
STANDARD_NUM = #standardNum#, <!-- 标准工序人数 -->
PRINC = #princ#, <!-- 负责人 -->
PRINC_NAME = #princName#,
STATUS = #status# <!-- 状态0.停止1.启动 -->
STATUS = #status#, <!-- 状态0.停止1.启动 -->
COMPUTE_TYPE = #computeType#
WHERE
ID = #id#
</update>
......
......@@ -2,6 +2,13 @@ $(function () {
$(".row").children().attr("class", "col-md-3");
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
}
});
IPLATUI.EFGrid = {
/*"result": {
pageable: {
......
......@@ -156,6 +156,7 @@ let save = function (btnNode) {
let standardDays= item.get("standardDays");
let standardNum= item.get("standardNum");
let princ= item.get("princ");
let computeType= item.get("computeType");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
......@@ -186,6 +187,11 @@ let save = function (btnNode) {
flag = false;
return false;
}
if(isBlank(computeType)){
message("选中的第"+(index+1)+"行\"计算类型\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -42,7 +42,7 @@
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="processName" cname="工序名称" width="120" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="processName" cname="工序名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" enable="true" readonly="false" align="center"/>
<EF:EFColumn ename="standardJob" cname="标准作业" width="120" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" required="true"
......@@ -56,6 +56,9 @@
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="computeType" cname="计算类型" width="80" enable="true" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgsj.computeType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="princ" cname="负责人"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
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