Commit 61c3e7be by liuyang

Merge branch 'dev' of http://git.pseer.com/platform/hp-smart into dev-ly

 Conflicts:
	src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC005A.java
parents 9a3d0464 df0d057e
......@@ -130,6 +130,14 @@ public enum DdynamicEnum {
* 编写:songx
*/
GROUP_RECORD_BLOCK_ID("group_record_block_id","orgId","orgCname","HPXSOrg.queryGroupComboBox"),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:songx
*/
USER_GROUP_BLOCK_ID("user_group_block_id","groupCode","groupName","factoryCode","HPXSOrg.queryAppGroup"),
/**
* 分厂与组一起查出,用于生产任务分派
*/
......
......@@ -6,6 +6,7 @@ import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
......@@ -56,6 +57,8 @@ public class ServiceHPKC003A extends ServiceEPBase {
try {
Map queryMap = new HashMap();
queryMap.put("inventTypes", new String[]{"2","3"});
queryMap.put("userId", UserSessionUtils.getUserId());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_GROUP_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
......
......@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.ProdOrderStatusEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
......@@ -48,6 +49,9 @@ public class ServiceHPSC005A extends ServiceBase {
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO);
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005);
queryMap.put("userId", UserSessionUtils.getUserId());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_GROUP_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,DdynamicEnum.GROUP_PRO_BLOCK_ID),
new HashMap<String,Object>(){{put(HPSC005.FIELD_FACTORY_CODE,dbSc005.getFactoryCode());}}, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPSC005A().eiMetadata);
......
......@@ -39,6 +39,7 @@ public class HPXS006 extends DaoEPBase {
public static final String INSERT = "HPXS006.insert";
public static final String UPDATE = "HPXS006.update";
public static final String DELETE = "HPXS006.delete";
public static final String QUERYFACTORY = "HPXS006.getFactoryCode";
public static final String CHECK = "HPXS006.check";
/**
* initialize the metadata
......
......@@ -41,10 +41,11 @@ public class ServiceHPXS006 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
/*inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0, "userId",UserSessionUtils.getFactoryCode().get(0));*/
inInfo = super.query(inInfo, HPXS006.QUERY, new HPSC001());
Map map = new HashMap();
map.put("companyCode", UserSessionUtils.getCompanyCode());
map.put("factoryCodes", UserSessionUtils.getFactoryCode());
map.put("factoryCodes", getFactoryCode(inInfo));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.REP_USER_ID_BLOCK_ID), map,true);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
} catch (PlatException e) {
......@@ -227,4 +228,28 @@ public class ServiceHPXS006 extends ServiceBase {
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
/**
* @param inInfo
* @return
*/
public List<String> getFactoryCode(EiInfo inInfo) {
List<String> factorycodes = new ArrayList();
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "userId", UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HPXS006.QUERYFACTORY);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
List rows = new ArrayList();
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
String factory = (String) map.get("factoryCode");
factorycodes.add(factory);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return factorycodes;
}
}
......@@ -3,10 +3,13 @@ package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
......@@ -51,6 +54,26 @@ public class ServiceHPXSOrg extends ServiceBase {
list.add(DdynamicEnum.GROUP_RECORD_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryRow, false);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询组失败");
}
return inInfo;
}
/**
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "组织管理", operType = "查询", operDesc = "组下拉框")
public EiInfo queryAppGroup(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "userId", UserSessionUtils.getUserId());
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.USER_GROUP_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, queryRow, false);
} catch (Exception e) {
inInfo.setStatus(500);
LogUtils.setMsg(inInfo, e, "查询组失败");
}
......
......@@ -206,4 +206,19 @@
c.FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
</select>
<select id="getFactoryCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select distinct c.FACTORY_CODE as "factoryCode"
from iplat.txsog02 a
join iplat.xs_user b on a.USER_ID=b.USER_ID
join iplat.txsog01 c on c.ORG_ID = a.ORG_ID and c.IS_DELETED = 0
where 1=1
<isNotEmpty prepend=" AND " property="companyCode">
c.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
b.USER_ID = #userId#
</isNotEmpty>
</select>
</sqlMap>
\ No newline at end of file
......@@ -183,6 +183,17 @@
ORDER BY T2.LEVEL, T3.ORG_ID
</select>
<select id="queryAppGroup" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select c.ORG_ID as "groupCode",c.ORG_CNAME as "groupName",c.FACTORY_CODE as "factoryCode"
from iplat.txsog02 a
join iplat.xs_user b on a.USER_ID=b.USER_ID
join iplat.txsog01 c on c.ORG_ID = a.ORG_ID and c.IS_DELETED = 0
where 1=1 and c.ORG_TYPE = 'prodGroup'
<isNotEmpty prepend=" AND " property="userId">
b.USER_ID = #userId#
</isNotEmpty>
</select>
<!-- 查询组织信息 -->
<select id="queryList" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ011">
SELECT
......
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