Commit c98b67dd by liuyang

2024-06-26 设备管理根据角色查询公司

parent 3c08209f
......@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC004;
......@@ -12,12 +13,11 @@ import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.hg.xs.domain.Company;
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;
......@@ -40,7 +40,12 @@ public class ServiceHGKC004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outEiInfo = super.initLoad(inInfo,new HGKC004());
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID,DdynamicEnum.COMPANY_BOX_BLOCK_ID), null, false);
try {
EiInfoUtils.addBlock(outEiInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outEiInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null, false);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outEiInfo;
}
......@@ -50,6 +55,11 @@ public class ServiceHGKC004 extends ServiceEPBase {
if (CollectionUtils.isNotEmpty(Collections.singleton(receiptDate))) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC004.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo, HGKC004.QUERY, new HGKC004());
}
......
......@@ -5,11 +5,15 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventorySource;
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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -33,13 +37,16 @@ public class ServiceHGKC013 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo,HGKC013.QUERY,new HGKC013());
try {
inInfo = super.initLoad(inInfo, new HGKC013());
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
inInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGKC013().eiMetadata);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.WH_RECORD_BOX_BLOCK_ID));
inInfo.set(HGKC013.FIELD_COMPANY_CODE, userVO.getUsercode());
//inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_COMPANY_CODE, userVO.getUsercode());
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BOX_BLOCK_ID));
//inInfo.set(HGKC013.FIELD_COMPANY_CODE, userVO.getUsercode());
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
......@@ -50,6 +57,11 @@ public class ServiceHGKC013 extends ServiceEPBase {
if (StringUtils.isNotEmpty(receiptDate)){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013.FIELD_RECEIPT_DATE, DateUtils.formatShort(receiptDate));
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGKC013.QUERY,new HGKC013());
}
......
......@@ -266,4 +266,25 @@
ID = #id#
</update>
<select id="queryList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC001
WHERE 1=1 AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriod">
LEFT(DEPOSIT_DATE,6) = #accountPeriod#
</isNotEmpty>
<include refid="orderBy"/>
</select>
</sqlMap>
......@@ -94,6 +94,9 @@
<isNotEmpty prepend=" AND " property="saleOutCodes">
SALE_OUT_CODE IN <iterate close=")" open="(" conjunction="," property="saleOutCodes">#saleOutCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
......@@ -274,6 +277,9 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......
......@@ -89,6 +89,9 @@
<isNotEmpty prepend=" AND " property="isAmount">
INV_QTY != 0
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="idCondition">
......
......@@ -133,6 +133,9 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
......
......@@ -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.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
......@@ -203,10 +204,10 @@ public class ServiceHGSJ003 extends ServiceEPBase {
try {
Map<String, Object> params = new HashMap<>(10);
String fileName = inInfo.getString("fileName");
Map<String,Object> map = HGSJTools.Hgsj003.getCompany(UserSession.getLoginName(),OrgTypeEnum.COMPANY.getCode());
// Map<String,Object> map = HGSJTools.Hgsj003.getCompany(UserSession.getLoginName(),OrgTypeEnum.COMPANY.getCode());
params.put(HGSJ003.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
params.put(HGSJ003.FIELD_FACTORY_CODE, map.get("orgEname"));
params.put(HGSJ003.FIELD_FACTORY_NAME, map.get("orgCname"));
//params.put(HGSJ003.FIELD_FACTORY_CODE, map.get("orgEname"));
//params.put(HGSJ003.FIELD_FACTORY_NAME, map.get("orgCname"));
//解析文件,将文件中数据传入到inInfo中
ExcelUtils.importFromExcel(inInfo, fileName, params, new HGSJ003());
}catch (Exception e){
......@@ -219,31 +220,18 @@ public class ServiceHGSJ003 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "工艺单价",operType = "下载模板",operDesc = "下载模板")
public EiInfo downloadTemplate(EiInfo inInfo){
Map<String, Object> param = new HashMap<>(4);
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)){
Org org = orgList.get(0);
if (!"company".equals(org.getOrgType())) {
//如果不是公司公司,则找到上一级
List<Org> orgList1 = HGXSTools.XsOrg.queryParent(org.getOrgId());
for (Org org1:orgList1) {
if ("company".equals(org1.getOrgType()) && !"root".equals(org1.getParentOrgId())) {
param.put(HGSJ003.FIELD_FACTORY_CODE,org1.getOrgId());
param.put(HGSJ003.FIELD_FACTORY_NAME,org1.getOrgCname());
}
}
}else {
param.put(HGSJ003.FIELD_FACTORY_CODE,org.getOrgId());
param.put(HGSJ003.FIELD_FACTORY_NAME,org.getOrgCname());
}
}
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
param.put("factoryCodes",roleCompanyCode);
param.put(HGSJ003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
param.put(HGSJ003.FIELD_STATUS, CommonConstant.YesNo.YES_1);
//param.put("orgType", OrgTypeEnum.COMPANY.getCode());
//param.put("loginName",UserSession.getLoginName());
param.put(HGSJ003.FIELD_ACCOUNT_CODE,UserSessionUtils.getAccountCode());
List list = new ArrayList<>(Arrays.asList(HGSJ003.FIELD_PROCESS_CODE,HGSJ003.FIELD_PROCESS_NAME,HGSJ003.FIELD_PROCESS_CLASS_NAME,
HGSJ003.FIELD_UNIT,HGSJ003.FIELD_LENGTH,HGSJ003.FIELD_WIDTH,HGSJ003.FIELD_THICK));
List list = new ArrayList<>(Arrays.asList(HGSJ003.FIELD_FACTORY_CODE,HGSJ003.FIELD_FACTORY_NAME,HGSJ003.FIELD_PROCESS_CODE,HGSJ003.FIELD_PROCESS_NAME,HGSJ003.FIELD_PROCESS_CLASS_NAME,
HGSJ003.FIELD_UNIT,HGSJ003.FIELD_LENGTH,HGSJ003.FIELD_WIDTH,HGSJ003.FIELD_THICK,HGSJ003.FIELD_PRICE));
return ExcelUtils.exportToExcel(ACConstants.SQL_COUNT, ACConstants.SQL_TEMPLATE, param, list, new HGSJ003());
}
......
......@@ -361,15 +361,21 @@
<select id="template" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName",
PROCESS_CODE as "processCode",
PROCESS_NAME as "processName",
'' as "processClassName",
UNIT as "unit",
'' as "length",
'' as "width",
'' as "thick"
'' as "thick",
'' as "price"
from ${hggpSchema}.hggy001
where ACCOUNT_CODE = #accountCode#
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
......
......@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
......@@ -13,7 +14,10 @@ import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.hg.yx.domain.HGYX002;
......@@ -45,18 +49,34 @@ public class ServiceHGYX001 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,EiConstant.resultBlock, new HGYX001());
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX001().eiMetadata);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
outInfo.set(HGYX001.FIELD_COMPANY_CODE, userVO.getUsercode());
try {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID
)
);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
}}
);
}catch (Exception e){
LogUtils.setDetailMsg(outInfo,e,"初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGYX001.QUERY,new HGYX001());
}
......
......@@ -4,15 +4,20 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -22,10 +27,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* @author LiuYang
......@@ -35,9 +37,10 @@ public class ServiceHGYX001A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo, new HGYX001A());
try {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001A.FIELD_PARENT_ID);
String type = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type");
EiInfo outInfo = super.initLoad(inInfo, new HGYX001A());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
if (id != null) {
HGYX001 hgYx001 =HGYXTools.Hgyx001.getId(Long.valueOf(id));
......@@ -47,12 +50,9 @@ public class ServiceHGYX001A extends ServiceEPBase {
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
}
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type", type);
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX001A().eiMetadata);
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.COMPANY_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo,Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
......@@ -61,19 +61,22 @@ public class ServiceHGYX001A extends ServiceEPBase {
DdynamicEnum.SPEC_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_COMPANY_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_COMPANY_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_CONS_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_CONS_NAME, userVO.getUsername());
}catch (Exception e){
LogUtils.setDetailMsg(outInfo, e, "初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGYX001A.QUERY,new HGYX001A());
}
......
......@@ -2,14 +2,19 @@ package com.baosight.hggp.hg.yx.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -19,6 +24,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
/**
* @author LiuYang
......@@ -38,7 +44,8 @@ public class ServiceHGYX001B extends ServiceEPBase {
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
}
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX001().eiMetadata);
CommonMethod.initBlock(outInfo,
Arrays.asList(
......@@ -52,13 +59,13 @@ public class ServiceHGYX001B extends ServiceEPBase {
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_COMPANY_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_COMPANY_NAME, userVO.getUsername());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_CONS_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_CONS_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_COMPANY_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_COMPANY_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_CONS_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX001.FIELD_CONS_NAME, userVO.getUsername());
return outInfo;
}
......
......@@ -5,6 +5,8 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001C;
import com.baosight.hggp.util.CommonMethod;
......@@ -15,6 +17,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.List;
/**
* @author LiuYang
......@@ -44,6 +47,11 @@ public class ServiceHGYX001C extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo, HGYX001C.QUERY,new HGYX001C());
}
}
......@@ -4,18 +4,19 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC004;
import com.baosight.hggp.hg.kc.domain.HGKC004A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX002;
import com.baosight.hggp.hg.yx.domain.HGYX002A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
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;
......@@ -40,18 +41,35 @@ public class ServiceHGYX002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo, EiConstant.resultBlock, new HGYX002());
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
try {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX002().eiMetadata);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
outInfo.set(HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
}}
);
//outInfo.set(HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGYX002.QUERY,new HGYX002());
}
......
......@@ -4,14 +4,19 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
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.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX002;
import com.baosight.hggp.hg.yx.domain.HGYX002A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -21,10 +26,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* @author LiuYang
......@@ -37,6 +39,7 @@ public class ServiceHGYX002A extends ServiceEPBase {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002A.FIELD_PARENT_ID);
String type = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type");
EiInfo outInfo = super.initLoad(inInfo, new HGYX002A());
try {
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
if (id != null) {
HGYX002 hgyx002 = HGYXTools.Hgyx002.getId(Long.valueOf(id));
......@@ -46,11 +49,11 @@ public class ServiceHGYX002A extends ServiceEPBase {
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgyx002));
}
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type", type);
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX002A().eiMetadata);
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.COMPANY_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
......@@ -60,25 +63,28 @@ public class ServiceHGYX002A extends ServiceEPBase {
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DELIVERY_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}},false);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
}
},false);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_NAME, userVO.getUsername());
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo,HGYX002A.QUERY,new HGYX002A());
}
......
......@@ -2,14 +2,20 @@ package com.baosight.hggp.hg.yx.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX002;
import com.baosight.hggp.hg.yx.domain.HGYX002A;
import com.baosight.hggp.hg.yx.tools.HGYXTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
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.EiConstant;
......@@ -19,6 +25,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
/**
* @author LiuYang
......@@ -31,6 +38,7 @@ public class ServiceHGYX002B extends ServiceEPBase {
String id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002A.FIELD_PARENT_ID);
EiInfo outInfo = super.initLoad(inInfo, new HGYX002A());
outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
try {
if (id != null) {
HGYX002 hgyx002 = HGYXTools.Hgyx002.getId(Long.valueOf(id));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
......@@ -38,13 +46,9 @@ public class ServiceHGYX002B extends ServiceEPBase {
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgyx002));
}
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
outInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGYX002A().eiMetadata);
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.COMPANY_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BOX_BLOCK_ID, DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
......@@ -52,13 +56,16 @@ public class ServiceHGYX002B extends ServiceEPBase {
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,userVO.getUsercode());
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_NAME, userVO.getUsername());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_CODE, userVO.getUsercode());
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_COMPANY_NAME, userVO.getUsername());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_CODE, userVO.getUsercode());
//outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGYX002.FIELD_CONS_NAME, userVO.getUsername());
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return outInfo;
}
......
......@@ -2,6 +2,8 @@ package com.baosight.hggp.hg.yx.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.yx.domain.HGYX001;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
import com.baosight.hggp.hg.yx.domain.HGYX001C;
......@@ -57,6 +59,11 @@ public class ServiceHGYX002C extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if(!roleCompanyCode.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB001.FIELD_COMPANY_CODES, roleCompanyCode);
}
return super.query(inInfo, HGYX002C.QUERY,new HGYX001A());
}
}
......@@ -163,11 +163,13 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX001">
SELECT
<include refid="column"/>
SELECT <include refid="column"/>
FROM ${hggpSchema}.HGYX001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......
......@@ -118,6 +118,9 @@
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX001A">
......
......@@ -85,6 +85,9 @@
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="idCondition">
......
......@@ -149,6 +149,9 @@
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGYX002">
......
......@@ -136,6 +136,9 @@
<isNotEmpty prepend=" AND " property="inventRecordIds">
INVENT_RECORD_ID NOT IN <iterate close=")" open="(" conjunction="," property="inventRecordIds">#inventRecordIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="HashMap" resultClass="HGYX002A">
......
......@@ -118,6 +118,9 @@
<isNotEmpty prepend=" AND " property="ids">
A.ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
A.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX002C">
......
......@@ -233,6 +233,7 @@ public class ExcelUtils {
// 去除空格
hgsj003.setSpec(StringUtils.trimToEmpty(hgsj003.getSpec()));
hgsj003.setProcessClass(Integer.valueOf(processClass));
hgsj003.setStatus(1);
//校验
checkAddData(hgsj003);
DaoUtils.insert(HGSJ003.INSERT, hgsj003);
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="receiptDate" cname="单据日期" colWidth="3"
format="yyyy-MM-dd"/>
......@@ -35,7 +35,7 @@
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="210" align="center"/>
<EF:EFComboColumn ename="companyCode" enable="true" cname="公司名称" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="true" width="90" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
$(function () {
$(".row").children().attr("class", "col-md-3");
var companyCode = __eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCode = '';//__eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
IPLATUI.EFGrid = {
......@@ -44,12 +44,12 @@ $(function () {
template: function (item) {
let calloutCompanyCode = item.calloutCompanyCode;
for (let i = 0; i < companyCodeBox.length; i++) {
if (calloutCompanyCode === companyCodeBox[i]['valueField']) {
item['calloutCompanyName'] = companyCodeBox[i]['textField'];
if (calloutCompanyCode === companyCodeBox[i]['companyCode']) {
item['calloutCompanyName'] = companyCodeBox[i]['companyName'];
if (!isBlank(item['allotType'])){
item['callinCompanyCode'] = companyCodeBox[i]['valueField'];
item['callinCompanyCode'] = companyCodeBox[i]['companyCode'];
}
return companyCodeBox[i]['textField'];
return companyCodeBox[i]['companyName'];
}
}
return calloutCompanyCode;
......@@ -92,9 +92,9 @@ $(function () {
template: function (item) {
let callinCompanyCode = item.callinCompanyCode;
for (let i = 0; i < companyCodeBox.length; i++) {
if (callinCompanyCode === companyCodeBox[i]['valueField']) {
item['callinCompanyName'] = companyCodeBox[i]['textField'];
return companyCodeBox[i]['textField'];
if (callinCompanyCode === companyCodeBox[i]['companyCode']) {
item['callinCompanyName'] = companyCodeBox[i]['companyName'];
return companyCodeBox[i]['companyName'];
}
}
return callinCompanyCode;
......@@ -185,7 +185,6 @@ $(function () {
//$("#PRINT").on("click", exportPrint);
});
/**
* 页面加载时执行
*/
......
......@@ -38,7 +38,7 @@
<EF:EFColumn ename="allotNo" cname="调拨单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="calloutCompanyCode" enable="true" cname="调出公司名称" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="calloutWhCode" cname="调出仓库名称" enable="true" width="120" align="center" required="true"
blockName="wh_record_box_block_id" textField="textField" valueField="valueField"
......@@ -46,7 +46,7 @@
</EF:EFComboColumn>
<EF:EFComboColumn ename="callinCompanyCode" enable="true" cname="调入公司名称" width="110" align="center"
filter="contains" readonly="false" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="callinWhCode" cname="调入仓库名称" enable="true" width="120" align="center" required="true"
blockName="wh_record_box_block_id" textField="textField" valueField="valueField"
......
$(function () {
$(".row").children().attr("class", "col-md-3");
var companyCode = __eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCode = '';//__eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
IPLATUI.EFGrid = {
......@@ -42,9 +42,9 @@ $(function () {
template: function (item) {
let calloutCompanyCode = item["consCode"];
for (let i = 0; i < companyCodeBox.length; i++) {
if (calloutCompanyCode === companyCodeBox[i]['valueField']) {
item['consName'] = companyCodeBox[i]['textField'];
return companyCodeBox[i]['textField'];
if (calloutCompanyCode === companyCodeBox[i]['companyCode']) {
item['consName'] = companyCodeBox[i]['companyName'];
return companyCodeBox[i]['companyName'];
}
}
return calloutCompanyCode;
......
......@@ -17,7 +17,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" placeholder="模糊查询" colWidth="3"/>
......@@ -47,7 +47,7 @@
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="companyCode" enable="true" cname="公司名称" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" enable="true" cname="项目名称" width="110" align="center"
filter="contains" readonly="true" required="true">
......
$(function() {
/*$(".row").children().attr("class", "col-md-3");*/
var companyBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projRecordBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
......@@ -134,16 +134,19 @@ $(function() {
})
let whRecord = _.filter(whRecordBox, function (item) {
return item["param1Field"] === proj[0]["param1Field"];
})
IPLAT.EFSelect.setDataSource($("#inqu_status-0-consWhCode"),whRecord);
IPLAT.EFSelect.value($("#inqu_status-0-consWhCode"),'');
});
let consWhCode = $("#inqu_status-0-consWhCode");
IPLAT.EFSelect.setDataSource(consWhCode,whRecord);
IPLAT.EFSelect.value(consWhCode,'');
let company = _.filter(companyBox, function (item) {
return item["valueField"] === proj[0]["param1Field"];
})
IPLAT.EFSelect.setDataSource($("#inqu_status-0-consCode"),company);
IPLAT.EFSelect.value($("#inqu_status-0-consCode"),proj[0]["param1Field"]);
return item["companyCode"] === proj[0]["param1Field"];
});
let consCode = $("#inqu_status-0-consCode");
//IPLAT.EFSelect.setDataSource(consCode,company);
IPLAT.EFSelect.value(consCode,proj[0]["param1Field"]);
})
$("#inqu_status-0-consCode").change(function () {
if ($("#inqu_status-0-type").val()=="update"){
NotificationUtil("无法修改发货方!", "error");
......@@ -230,6 +233,7 @@ $(function() {
});
}
});
/**
* 保存并审核提交
*/
......
......@@ -32,7 +32,7 @@
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consName" type="hidden" cname="发货方名称" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="consWhCode" cname="发货仓库" required="true" colWidth="3" filter="contains">
......
$(function () {
$(".row").children().attr("class", "col-md-3");
var companyCode = __eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
//var companyCode = __eiInfo.get("companyCode");
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var whCodeBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
IPLATUI.EFGrid = {
......
......@@ -40,7 +40,7 @@
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="consCode" enable="true" cname="发货方" width="110" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="companyBox_block_id" valueField="valueField" textField="textField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="receCode" enable="true" cname="收货方" width="110" align="center"
filter="contains" readonly="true" required="true">
......
$(function() {
/*$(".row").children().attr("class", "col-md-3");*/
var companyBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projRecordBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
......@@ -143,7 +143,7 @@ $(function() {
IPLAT.EFSelect.setDataSource($("#inqu_status-0-consWhCode"),whRecord);
let company = _.filter(companyBox, function (item) {
return item["valueField"] === proj[0]["param1Field"];
return item["companyCode"] === proj[0]["param1Field"];
})
IPLAT.EFSelect.setDataSource($("#inqu_status-0-consCode"),company);
})
......
......@@ -36,7 +36,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" type="hidden" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" required="true" disabled="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consName" type="hidden" cname="发货方编码" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhCode" type="hidden" cname="发货仓库名称" colWidth="3"/>
......
......@@ -28,7 +28,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" type="hidden" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="consCode" cname="发货方" disabled="true" required="true" colWidth="3" filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="consCode" type="hidden" cname="发货方编码" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="consWhName" type="hidden" cname="发货仓库名称" colWidth="3"/>
......
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