Commit df0d057e by wancheng

售后维修

parent 5f70e6dc
......@@ -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;
}
}
......@@ -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
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