Commit c03ade8a by wuwenlong

项目立项优化;

parent 5f7c310b
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -214,9 +215,17 @@ public class ServiceHGSC001 extends ServiceBase {
public EiInfo userByCompanyComboBox(EiInfo inInfo) throws InstantiationException, IllegalAccessException {
String companyCode = inInfo.getCellStr(EiConstant.queryBlock,EiConstant.STATUS_DEFAULT,HGSC001.FIELD_company_code);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany(companyCode), User.class);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID.getBlockId(),"loginName","userName");
return inInfo;
}
/**
* 用户下拉框
* @param inInfo
* @return
*/
public EiInfo allUserComboBox(EiInfo inInfo) throws InstantiationException, IllegalAccessException {
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
return inInfo;
}
......
......@@ -6,13 +6,12 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -39,8 +38,7 @@ public class ServiceHGSC001C extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) {
......
......@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -41,7 +42,7 @@ public class ServiceHGSC001D extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), User.class);
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) {
......
......@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -43,7 +44,7 @@ public class ServiceHGSC001U extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), map,false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"depByCompany", UserSessionUtils.getDepByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), Dept.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany((String) resultMap.get(HGSC001.FIELD_company_code)), User.class);
EiInfoUtils.addBlock(inInfo,"userAll", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} catch (InstantiationException e) {
......
......@@ -78,6 +78,20 @@ public class HGXSTools {
queryMap.put("loginNames", loginNames);
return DaoBase.getInstance().query(HGSqlConstant.HgXsUser.QUERY, queryMap);
}
/**
* 查询
* @param accountCode
* @return
*/
public static List<User> listAll(String accountCode) {
if (StringUtils.isBlank(accountCode)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put(User.FIELD_ACCOUNT_CODE, accountCode);
return DaoBase.getInstance().query(HGSqlConstant.HgXsUser.QUERY, queryMap);
}
/**
* 查询
......
$(function () {
var userByCompany ;//= __eiInfo.getBlock("userByCompany").getMappedRows();
var userAll = __eiInfo.getBlock("userAll").getMappedRows();
IPLATUI.EFGrid.detail = {
pageable:false,
columns: [{
field: "userCode",
template: function (dataItem) {
for (let i = 0; i < userByCompany.length; i++) {
if (userByCompany[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userByCompany[i]['userName'];
dataItem['userPhone'] = userByCompany[i]['mobile'];
dataItem['userDepCode'] = userByCompany[i]['depCode'];
dataItem['userDepName'] = userByCompany[i]['depName'];
return userByCompany[i]['userName'];
for (let i = 0; i < userAll.length; i++) {
if (userAll[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userAll[i]['userName'];
dataItem['userPhone'] = userAll[i]['mobile'];
dataItem['userDepCode'] = userAll[i]['depCode'];
dataItem['userDepName'] = userAll[i]['depName'];
return userAll[i]['userName'];
}
}
return dataItem["userName"];
......@@ -23,7 +23,7 @@ $(function () {
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: userByCompany,
dataSource: userAll,
minLength: 0,
dataTextField: "userName",
dataValueField: "loginName",
......@@ -47,13 +47,13 @@ $(function () {
}
});
},
onAdd: function(e) {
if(!userByCompany){
message("请选择分包方!");
e.preventDefault();
return;
}
},
// onAdd: function(e) {
// if(!userAll){
// message("请选择分包方!");
// e.preventDefault();
// return;
// }
// },
onDelete: function(e) {
detailGrid.removeRows(detailGrid.getCheckedRowsIndex())
e.preventDefault();
......@@ -89,11 +89,11 @@ $(function () {
*/
function loadProjMg(companyCode){
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
// inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userAllComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
userByCompany=ei.getBlock("userByCompany").getMappedRows();
userAll=ei.getBlock("userAll").getMappedRows();
}, onFail: function (ei) {
}
}, {async: false});
......
......@@ -21,13 +21,13 @@
</EF:EFCascadeSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="分包方名称" type="hidden"/>
<EF:EFSelect cname="分包方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/>
<EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="总包方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="总包方" ename="result-0-genralContractCode"
<EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" >
......
$(function () {
var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows();
var userAll = __eiInfo.getBlock("userAll").getMappedRows();
IPLATUI.EFGrid.detail = {
pageable:false,
columns: [{
field: "userCode",
template: function (dataItem) {
for (let i = 0; i < userByCompany.length; i++) {
if (userByCompany[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userByCompany[i]['userName'];
dataItem['userPhone'] = userByCompany[i]['mobile'];
dataItem['userDepCode'] = userByCompany[i]['depCode'];
dataItem['userDepName'] = userByCompany[i]['depName'];
return userByCompany[i]['userName'];
for (let i = 0; i < userAll.length; i++) {
if (userAll[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userAll[i]['userName'];
dataItem['userPhone'] = userAll[i]['mobile'];
dataItem['userDepCode'] = userAll[i]['depCode'];
dataItem['userDepName'] = userAll[i]['depName'];
return userAll[i]['userName'];
}
}
return dataItem["userName"];
......@@ -23,7 +23,7 @@ $(function () {
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: userByCompany,
dataSource: userAll,
minLength: 0,
dataTextField: "userName",
dataValueField: "loginName",
......@@ -60,7 +60,7 @@ $(function () {
$("#result-0-subcontractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-subcontractCode"));
$("#result-0-subcontractName").val(textField);
loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
// loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
});
$("#result-0-genralContractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-genralContractCode"));
......@@ -74,10 +74,10 @@ $(function () {
function loadProjMg(companyCode){
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
EiCommunicator.send("HGSC001", "userAllComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
userByCompany=ei.getBlock("userByCompany").getMappedRows();
userAll=ei.getBlock("userAll").getMappedRows();
}, onFail: function (ei) {
}
}, {async: false});
......
......@@ -21,13 +21,13 @@
</EF:EFCascadeSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="分包方名称" type="hidden"/>
<EF:EFSelect cname="分包方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/>
<EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="总包方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="总包方" ename="result-0-genralContractCode"
<EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" >
......
$(function () {
var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows();
var userAll = __eiInfo.getBlock("userAll").getMappedRows();
IPLATUI.EFGrid.detail = {
pageable:false,
columns: [{
field: "userCode",
template: function (dataItem) {
for (let i = 0; i < userByCompany.length; i++) {
if (userByCompany[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userByCompany[i]['userName'];
dataItem['userPhone'] = userByCompany[i]['mobile'];
dataItem['userDepCode'] = userByCompany[i]['depCode'];
dataItem['userDepName'] = userByCompany[i]['depName'];
return userByCompany[i]['userName'];
for (let i = 0; i < userAll.length; i++) {
if (userAll[i]['loginName'] === dataItem['userCode']) {
dataItem['userName'] = userAll[i]['userName'];
dataItem['userPhone'] = userAll[i]['mobile'];
dataItem['userDepCode'] = userAll[i]['depCode'];
dataItem['userDepName'] = userAll[i]['depName'];
return userAll[i]['userName'];
}
}
return dataItem["userName"];
......@@ -23,7 +23,7 @@ $(function () {
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: userByCompany,
dataSource: userAll,
minLength: 0,
dataTextField: "userName",
dataValueField: "loginName",
......@@ -47,13 +47,13 @@ $(function () {
}
});
},
onAdd: function(e) {
if(!userByCompany){
message("请选择分包方!");
e.preventDefault();
return;
}
},
// onAdd: function(e) {
// if(!userAll){
// message("请选择分包方!");
// e.preventDefault();
// return;
// }
// },
onDelete: function(e) {
detailGrid.removeRows(detailGrid.getCheckedRowsIndex())
e.preventDefault();
......@@ -71,7 +71,7 @@ $(function () {
$("#result-0-subcontractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-subcontractCode"));
$("#result-0-subcontractName").val(textField);
loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
// loadProjMg(IPLAT.EFSelect.value($("#result-0-subcontractCode")));
});
$("#result-0-genralContractCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-genralContractCode"));
......@@ -85,10 +85,10 @@ $(function () {
function loadProjMg(companyCode){
var inInfo=new EiInfo();
inInfo.set("inqu_status-0-companyCode",companyCode);
EiCommunicator.send("HGSC001", "userByCompanyComboBox", inInfo, {
EiCommunicator.send("HGSC001", "userAllComboBox", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
userByCompany=ei.getBlock("userByCompany").getMappedRows();
userAll=ei.getBlock("userAll").getMappedRows();
}, onFail: function (ei) {
}
}, {async: false});
......
......@@ -23,13 +23,13 @@
</EF:EFCascadeSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="分包方名称" type="hidden"/>
<EF:EFSelect cname="分包方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/>
<EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="总包方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="总包方" ename="result-0-genralContractCode"
<EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
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