Commit bc0804a5 by liuyang

2024-06-20 修复工序复制bug

parent 64d215fe
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
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.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
......@@ -40,11 +41,15 @@ public class ServiceHGSJ001 extends ServiceEPBase {
if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID)); //COMPANY_RECORD_BOX_BLOCK_ID
qarma.clear();
List orgIds = getOrgId();
qarma.put(Org.FIELD_ORG_ID,orgIds);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
}
return outInfo;
}
......
......@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
......@@ -14,6 +15,7 @@ import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -40,10 +42,14 @@ public class ServiceHGSJ002 extends ServiceEPBase {
EiInfo outInfo = super.query(inInfo, HGSJ002.QUERY, new HGSJ002());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
/*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
return outInfo;
}
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
......@@ -41,12 +42,12 @@ public class ServiceHGSJ003 extends ServiceEPBase {
EiInfo outInfo = super.query(inInfo, HGSJ003.QUERY, new HGSJ003());
Map qarma = new HashMap();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (orgList.size()>0) {
/*if (orgList.size()>0) {
qarma.put(Org.FIELD_ORG_ID,orgList.get(0).getOrgId());
}
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_RECORD_BOX_BLOCK_ID),qarma);
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),qarma);
qarma.clear();
if (CollectionUtils.isNotEmpty(orgList)){
/*if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
......@@ -59,8 +60,13 @@ public class ServiceHGSJ003 extends ServiceEPBase {
}else {
qarma.put(HGSJ002A.FIELD_FACTORY_CODE,org.getOrgId());
}
}
}*/
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID), qarma);
if (orgList.size() > 0) {
String companyCode = com.baosight.hggp.util.StringUtils.isEmpty(orgList.get(0).getCompanyCode())?orgList.get(0).getOrgId():orgList.get(0).getCompanyCode();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODE,companyCode);
}
return outInfo;
}
......
$(function (){
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); //company_record_box_block_id
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -40,6 +40,15 @@ $(function (){
}
}, {
field: "factoryCode",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -101,6 +110,23 @@ $(function (){
}
}*/
},
/**
* EFGridtr
* @param e
* e.sender Grid
* e.preventDefault dataBoundtr
* e.index
* e.items ([Model,Model, ...])
*/
onAdd: function (e) {
let factoryCode = $("#inqu_status-0-companyCode").val();
$.each(e.items, function(index, item){
if (factoryCode != item['factoryCode']){
item['factoryCode'] = '';
}
item["processCode"] = ''
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......
......@@ -22,7 +22,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="processName" cname="工序名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="princName" cname="负责人" placeholder="模糊查询" colWidth="3"/>
......@@ -30,34 +30,35 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</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="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"
<EF:EFColumn ename="standardJob" cname="标准作业" width="100" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right" required="true"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="15"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardDays" cname="标准人天" width="120" enable="true" format="{0:N0}" editType="number"
<EF:EFColumn ename="standardDays" cname="标准人天" width="100" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="standardNum" cname="标准工序人数" width="120" enable="true" format="{0:N0}" editType="number"
<EF:EFColumn ename="standardNum" cname="标准工序人数" width="100" enable="true" format="{0:N0}" editType="number"
displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}?$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
......
$(function (){
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -41,6 +41,15 @@ $(function (){
}
},{
field: "factoryCode",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -61,6 +70,15 @@ $(function (){
},
afterEdit:function (e) {
},
onAdd: function (e) {
let factoryCode = $("#inqu_status-0-companyCode").val();
$.each(e.items, function(index, item){
if (factoryCode != item['factoryCode']){
item['factoryCode'] = '';
}
item["flowCode"] = ''
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......
......@@ -17,27 +17,28 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="flowCode" cname="流程编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="flowName" cname="流程名称" width="120" enable="true" readonly="false" align="center" required="true"/>
......
......@@ -34,7 +34,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parendId" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<%--<EF:EFComboColumn ename="factoryCode" cname="工厂"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
$(function (){
var factoryCodes = __eiInfo.getBlock("company_record_box_block_id").getMappedRows();
var factoryCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var processCodes = __eiInfo.getBlock("processCode_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -40,6 +40,15 @@ $(function (){
}
}, {
field: "factoryCode",
filter: function (option) {
let companyCode = $("#inqu_status-0-companyCode").val();
if (companyCode){
return _.filter(option.values, function (item) {
return item["valueField"]==companyCode;
})
}
return option.values;
},
template: function (dataItem) {
for (let i = 0; i < factoryCodes.length; i++) {
if (factoryCodes[i]['valueField'] === dataItem['factoryCode']) {
......@@ -52,7 +61,7 @@ $(function (){
}, {
field: "processCode",
filter: function (options) {
var factoryCode = options.model['factoryCode'];
let factoryCode = options.model['factoryCode'];
if(factoryCode) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
......@@ -60,8 +69,9 @@ $(function (){
return item["param1Field"]==factoryCode && item["param4Field"]== "true" && item["param5Field"] == "false";
})
} else {
let companyCode = $("#inqu_status-0-companyCode").val();
return _.filter(processCodes, function (item) {
return item["param4Field"]== "true" && item["param5Field"] == "false";
return item["param1Field"]==companyCode && item["param4Field"]== "true" && item["param5Field"] == "false";
})
}
},
......@@ -131,6 +141,15 @@ $(function (){
}
}
},
onAdd: function (e) {
let factoryCode = $("#inqu_status-0-companyCode").val();
$.each(e.items, function(index, item){
if (factoryCode != item['factoryCode']){
item['factoryCode'] = '';
}
item['spec'] = '';
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="processCode" cname="工序名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -28,25 +28,26 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="processCode" cname="工序名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</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