Commit 3faec388 by wuwenlong

Merge remote-tracking branch 'origin/dev' into dev

parents 4f1b8139 ae07fcdd
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
SUP_CODE = #supCode# SUP_CODE = #supCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="supName"> <isNotEmpty prepend=" AND " property="supName">
SUP_NAME = #supName# SUP_NAME like concat('%',#supName#,'%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="purUserId"> <isNotEmpty prepend=" AND " property="purUserId">
PUR_USER_ID = #purUserId# PUR_USER_ID = #purUserId#
...@@ -109,6 +109,12 @@ ...@@ -109,6 +109,12 @@
<isNotEmpty prepend=" AND " property="inventTypeDetails"> <isNotEmpty prepend=" AND " property="inventTypeDetails">
INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate> INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
RECEIVE_DATE >= #signingDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
RECEIVE_DATE &lt;= #signingDateTo#
</isNotEmpty>
</sql> </sql>
<sql id="idCondition"> <sql id="idCondition">
......
...@@ -148,7 +148,7 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -148,7 +148,7 @@ public class ServiceHGCW012 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "采购收票",operType = "插入",operDesc = "生成采购收票") @OperationLogAnnotation(operModul = "采购收票",operType = "插入",operDesc = "生成采购收票劳务合同")
public EiInfo select(EiInfo inInfo) { public EiInfo select(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock("resultA").getRows(); List<Map> resultRows = inInfo.getBlock("resultA").getRows();
...@@ -169,7 +169,8 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -169,7 +169,8 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012.setCompanyName(userVO.getUsername()); hgcw012.setCompanyName(userVO.getUsername());
hgcw012.setReviewStatus(0); hgcw012.setReviewStatus(0);
hgcw012.setBillState(1); hgcw012.setBillState(1);
hgcw012.setSigningDate(DateUtils.shortDate()); //hgcw012.setSigningDate(DateUtils.shortDate());
hgcw012.setReceiveDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO; BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer settlementNumber = new StringBuffer(); StringBuffer settlementNumber = new StringBuffer();
Map<String, BigDecimal> rowMap = new HashMap<>(); Map<String, BigDecimal> rowMap = new HashMap<>();
...@@ -244,7 +245,7 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -244,7 +245,7 @@ public class ServiceHGCW012 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "采购收票",operType = "插入",operDesc = "生成采购收票")
public EiInfo selecta(EiInfo inInfo) { public EiInfo selecta(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock("result").getRows(); List<Map> resultRows = inInfo.getBlock("result").getRows();
...@@ -265,7 +266,9 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -265,7 +266,9 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012.setCompanyName(userVO.getUsername()); hgcw012.setCompanyName(userVO.getUsername());
hgcw012.setReviewStatus(0); hgcw012.setReviewStatus(0);
hgcw012.setBillState(1); hgcw012.setBillState(1);
hgcw012.setSigningDate(DateUtils.shortDate()); hgcw012.setBillTybe(1);
//hgcw012.setSigningDate(DateUtils.shortDate());
hgcw012.setReceiveDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO; BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer settlementNumber = new StringBuffer(); StringBuffer settlementNumber = new StringBuffer();
Map<String, BigDecimal> rowMap = new HashMap<>(); Map<String, BigDecimal> rowMap = new HashMap<>();
...@@ -332,6 +335,7 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -332,6 +335,7 @@ public class ServiceHGCW012 extends ServiceBase {
} }
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "采购收票",operType = "插入",operDesc = "生成租赁合同")
public EiInfo selectb(EiInfo inInfo) { public EiInfo selectb(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock("resultB").getRows(); List<Map> resultRows = inInfo.getBlock("resultB").getRows();
...@@ -352,7 +356,9 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -352,7 +356,9 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012.setCompanyName(userVO.getUsername()); hgcw012.setCompanyName(userVO.getUsername());
hgcw012.setReviewStatus(0); hgcw012.setReviewStatus(0);
hgcw012.setBillState(1); hgcw012.setBillState(1);
hgcw012.setSigningDate(DateUtils.shortDate()); hgcw012.setBillTybe(1);
//hgcw012.setSigningDate(DateUtils.shortDate());
hgcw012.setReceiveDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO; BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer settlementNumber = new StringBuffer(); StringBuffer settlementNumber = new StringBuffer();
Map<String, BigDecimal> rowMap = new HashMap<>(); Map<String, BigDecimal> rowMap = new HashMap<>();
...@@ -378,7 +384,9 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -378,7 +384,9 @@ public class ServiceHGCW012 extends ServiceBase {
//生成明细表 //生成明细表
for (HGCW013 hgcw013 : hgcw013List) { for (HGCW013 hgcw013 : hgcw013List) {
hgcw013.setMainId(hgcw012.getId()); hgcw013.setMainId(hgcw012.getId());
HGCWTools.HgCw006.deductionAmount(hgcw013.getSettlementNumber(),rowMap.get(hgcw013.getSettlementNumber()));
hgcw013.setId(null); hgcw013.setId(null);
this.addHGCW013(hgcw013);
} }
} else { } else {
HGCW012 hgcw012 = HGCWTools.HgCw012.getId(mainId); HGCW012 hgcw012 = HGCWTools.HgCw012.getId(mainId);
...@@ -393,7 +401,7 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -393,7 +401,7 @@ public class ServiceHGCW012 extends ServiceBase {
for (HGCW013 hgcw013 : hgcw013List) { for (HGCW013 hgcw013 : hgcw013List) {
hgcw013.setMainId(hgcw012.getId()); hgcw013.setMainId(hgcw012.getId());
// 反写金额 // 反写金额
HGCWTools.HgCw008.deductionAmount(hgcw013.getSettlementNumber(),rowMap.get(hgcw013.getSettlementNumber())); HGCWTools.HgCw006.deductionAmount(hgcw013.getSettlementNumber(),rowMap.get(hgcw013.getSettlementNumber()));
this.addHGCW013(hgcw013); this.addHGCW013(hgcw013);
} }
List<HGCW013> hgcw013s = HGCWTools.HgCw013.getMainId(hgcw012.getId()); List<HGCW013> hgcw013s = HGCWTools.HgCw013.getMainId(hgcw012.getId());
......
package com.baosight.hggp.hg.cw.service; package com.baosight.hggp.hg.cw.service;
import com.baosight.bpm.util.StringUtil;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.cg.domain.HGCG003; import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cw.domain.*; import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
...@@ -44,6 +47,14 @@ public class ServiceHGCW012A extends ServiceBase { ...@@ -44,6 +47,14 @@ public class ServiceHGCW012A extends ServiceBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
String signingDateFrom = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "signingDateFrom");
String signingDateTo = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "signingDateTo");
if (!signingDateFrom.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"signingDateFrom", DateUtils.formatShort(signingDateFrom));
}
if (!signingDateTo.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"signingDateTo", DateUtils.formatShort(signingDateTo));
}
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003()); inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -54,7 +65,16 @@ public class ServiceHGCW012A extends ServiceBase { ...@@ -54,7 +65,16 @@ public class ServiceHGCW012A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购开票",operType = "查询",operDesc = "查询劳务") @OperationLogAnnotation(operModul = "采购开票",operType = "查询",operDesc = "查询劳务")
public EiInfo queryA(EiInfo inInfo) { public EiInfo queryA(EiInfo inInfo) {
try { try {
String signingDateFrom = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "signingDateFrom");
String signingDateTo = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "signingDateTo");
if (!signingDateFrom.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"signingDateFrom", DateUtils.formatShort(signingDateFrom));
}
if (!signingDateTo.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"signingDateTo", DateUtils.formatShort(signingDateTo));
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW002.FIELD_CONTRACT_TYPE, 2); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW002.FIELD_CONTRACT_TYPE, 2);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW006.FIELD_REMAINING_AMOUNT, 0);
inInfo = super.query(inInfo, HGCW012A.QUERY, new HGCW012A(),false,new HGCW012A().eiMetadata,EiConstant.queryBlock,"resultA","resultA"); inInfo = super.query(inInfo, HGCW012A.QUERY, new HGCW012A(),false,new HGCW012A().eiMetadata,EiConstant.queryBlock,"resultA","resultA");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -65,7 +85,15 @@ public class ServiceHGCW012A extends ServiceBase { ...@@ -65,7 +85,15 @@ public class ServiceHGCW012A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购开票",operType = "查询",operDesc = "查询租赁") @OperationLogAnnotation(operModul = "采购开票",operType = "查询",operDesc = "查询租赁")
public EiInfo queryB(EiInfo inInfo) { public EiInfo queryB(EiInfo inInfo) {
try { try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW002.FIELD_CONTRACT_TYPE, 2); String signingDateFrom = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "signingDateFrom");
String signingDateTo = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "signingDateTo");
if (!signingDateFrom.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"signingDateFrom", DateUtils.formatShort(signingDateFrom));
}
if (!signingDateTo.isEmpty()){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"signingDateTo", DateUtils.formatShort(signingDateTo));
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW006.FIELD_REMAINING_AMOUNT, 0);
inInfo = super.query(inInfo, HGCW006.QUERY, new HGCW006(), false, new HGCW006().eiMetadata, EiConstant.queryBlock, "resultB", "resultB"); inInfo = super.query(inInfo, HGCW006.QUERY, new HGCW006(), false, new HGCW006().eiMetadata, EiConstant.queryBlock, "resultB", "resultB");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.hg.cw.domain.HGCW015;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW012C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW015().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW012.QUERY, new HGCW012());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -144,6 +144,18 @@ ...@@ -144,6 +144,18 @@
<isNotEmpty prepend=" AND " property="companyCodes"> <isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate> COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingAmount">
REMAINING_AMOUNT > #remainingAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE >= #signingDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= #signingDateTo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
PARTY_B like concat('%',#supName#,'%')
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc ID desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
T1.COMPANY_NAME as "companyName", <!-- 公司名称 --> T1.COMPANY_NAME as "companyName", <!-- 公司名称 -->
T1.PROJ_CODE as "projCode", <!-- 项目编码 --> T1.PROJ_CODE as "projCode", <!-- 项目编码 -->
T1.PROJ_NAME as "projName", <!-- 项目名称 --> T1.PROJ_NAME as "projName", <!-- 项目名称 -->
B.PARTY_B AS "partyB", <!-- 乙方名称 -->
T1.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 --> T1.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
T1.CONTRACT_NAME as "contractName", <!-- 合同名称 --> T1.CONTRACT_NAME as "contractName", <!-- 合同名称 -->
T1.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 --> T1.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
...@@ -182,15 +183,26 @@ ...@@ -182,15 +183,26 @@
B.CONTRACT_TYPE = #contractType# B.CONTRACT_TYPE = #contractType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes"> <isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate> T1.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingAmount">
T1.REMAINING_AMOUNT > #remainingAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
T1.CONTRACT_DATE >= #signingDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
T1.CONTRACT_DATE &lt;= #signingDateTo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supName">
B.PARTY_B like concat('%',#supName#,'%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW008"> resultClass="com.baosight.hggp.hg.cw.domain.HGCW008">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGCW008 T1 LEFT JOIN FROM ${hggpSchema}.HGCW008 T1 LEFT JOIN ${hggpSchema}.HGCW002 B
${hggpSchema}.HGCW002 B
ON T1.PROJ_CODE = B.PROJ_CODE ON T1.PROJ_CODE = B.PROJ_CODE
AND T1.CONTRACT_NUMBER = B.CONTRACT_NUMBER AND T1.CONTRACT_NUMBER = B.CONTRACT_NUMBER
AND T1.COMPANY_CODE = B.COMPANY_CODE AND T1.COMPANY_CODE = B.COMPANY_CODE
......
...@@ -137,6 +137,29 @@ public class HGCWTools { ...@@ -137,6 +137,29 @@ public class HGCWTools {
}); });
return results.get(0); return results.get(0);
} }
public static void deductionAmount(String settlementNumber, BigDecimal deductionAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (deductionAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW006> results = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("contractNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的结算单!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW006 hgcw006 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(hgcw006.getRemainingAmount().subtract(deductionAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("扣款金额不能大于结算单剩余金额!");
}
hgcw006.setRemainingAmount(remainingAmount);
DaoUtils.update("HGCW006.updateDeductionAmount", hgcw006);
}
} }
public static class HgCw007 { public static class HgCw007 {
...@@ -525,6 +548,7 @@ public class HGCWTools { ...@@ -525,6 +548,7 @@ public class HGCWTools {
HGCW013.setSettlementNumber(settlementNumber); HGCW013.setSettlementNumber(settlementNumber);
HGCW013.setThisSettlementTax(thisSettlementTax.toString()); HGCW013.setThisSettlementTax(thisSettlementTax.toString());
HGCW013.setThisSettlementAmount(thisSettlementAmount.toString()); HGCW013.setThisSettlementAmount(thisSettlementAmount.toString());
HGCW013.setPartyA(row.get("partyB").toString());
if (mainId != null) { if (mainId != null) {
HGCW013.setMainId(mainId); HGCW013.setMainId(mainId);
} }
...@@ -550,6 +574,7 @@ public class HGCWTools { ...@@ -550,6 +574,7 @@ public class HGCWTools {
HGCW013.setSettlementNumber(settlementNumber); HGCW013.setSettlementNumber(settlementNumber);
HGCW013.setThisSettlementTax(thisSettlementTax.toString()); HGCW013.setThisSettlementTax(thisSettlementTax.toString());
HGCW013.setThisSettlementAmount(thisSettlementAmount.toString()); HGCW013.setThisSettlementAmount(thisSettlementAmount.toString());
HGCW013.setPartyA(row.get("partyB").toString());
if (mainId != null) { if (mainId != null) {
HGCW013.setMainId(mainId); HGCW013.setMainId(mainId);
} }
......
...@@ -141,9 +141,9 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -141,9 +141,9 @@ public class ServiceHGKC006 extends ServiceBase {
*/ */
private void add(HGKC006 hgkc006) throws Exception { private void add(HGKC006 hgkc006) throws Exception {
hgkc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_ENTER_NO)); hgkc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_ENTER_NO));
UserVO userVO = HGCWTools.HgCw002.getUserCompany(); // UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc006.setCompanyCode(userVO.getUsercode()); // hgkc006.setCompanyCode(userVO.getUsercode());
hgkc006.setCompanyName(userVO.getUsername()); // hgkc006.setCompanyName(userVO.getUsername());
hgkc006.setSource(InventorySource.MANUAL_ENTRY.getCode()); hgkc006.setSource(InventorySource.MANUAL_ENTRY.getCode());
hgkc006.setSubmitStatus(HGConstant.ProductStatus.WTJ); hgkc006.setSubmitStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC006.INSERT, hgkc006); DaoUtils.insert(HGKC006.INSERT, hgkc006);
......
...@@ -54,7 +54,7 @@ public class ServiceHGYX001C extends ServiceEPBase { ...@@ -54,7 +54,7 @@ public class ServiceHGYX001C extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getInentTypeTwo());
return super.query(inInfo, HGYX001C.QUERY,new HGYX001C()); return super.query(inInfo, HGYX001C.QUERY,new HGYX001C());
} }
} }
...@@ -4,14 +4,8 @@ ...@@ -4,14 +4,8 @@
<sql id="column"> <sql id="column">
ID as "id", ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> <!--ACCOUNT_CODE as "accountCode", 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> <!--DEP_CODE as "depCode", 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 --> DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 --> COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 --> COMPANY_NAME as "companyName", <!-- 公司名称 -->
......
...@@ -12,13 +12,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext; ...@@ -12,13 +12,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.StringUtils; import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.xservices.xs.util.LoginUserDetails; import com.baosight.xservices.xs.util.LoginUserDetails;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -46,10 +40,10 @@ public class AuthenticationInfo { ...@@ -46,10 +40,10 @@ public class AuthenticationInfo {
private static final int DEFAULT_GROUP_THRESHOLD = 20; private static final int DEFAULT_GROUP_THRESHOLD = 20;
private static Map<String, String> param = null; private static Map<String, String> param = null;
private static final Logger logger = LogManager.getLogger(AuthenticationInfo.class); private static final Logger logger = LogManager.getLogger(AuthenticationInfo.class);
public AuthenticationInfo() { public AuthenticationInfo() {
} }
public static String getSubjectId(String subjectType, String subjectName) { public static String getSubjectId(String subjectType, String subjectName) {
String memberId = null; String memberId = null;
Map paramMap = new HashMap(); Map paramMap = new HashMap();
...@@ -69,7 +63,7 @@ public class AuthenticationInfo { ...@@ -69,7 +63,7 @@ public class AuthenticationInfo {
var9 = 0; var9 = 0;
} }
} }
switch(var9) { switch(var9) {
case 0: case 0:
subjectParam = "loginName"; subjectParam = "loginName";
...@@ -86,7 +80,7 @@ public class AuthenticationInfo { ...@@ -86,7 +80,7 @@ public class AuthenticationInfo {
resultParam = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".subjectIdParam"); resultParam = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".subjectIdParam");
checkSqlId = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".checkSqlId"); checkSqlId = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".checkSqlId");
} }
if (StringUtils.isNotEmpty(subjectParam) && StringUtils.isNotEmpty(resultParam) && StringUtils.isNotEmpty(checkSqlId)) { if (StringUtils.isNotEmpty(subjectParam) && StringUtils.isNotEmpty(resultParam) && StringUtils.isNotEmpty(checkSqlId)) {
paramMap.put(subjectParam, subjectName); paramMap.put(subjectParam, subjectName);
List members = getDao().query(checkSqlId, paramMap); List members = getDao().query(checkSqlId, paramMap);
...@@ -95,23 +89,23 @@ public class AuthenticationInfo { ...@@ -95,23 +89,23 @@ public class AuthenticationInfo {
} else { } else {
memberId = ((Map)members.get(0)).get(resultParam).toString(); memberId = ((Map)members.get(0)).get(resultParam).toString();
} }
return memberId; return memberId;
} else { } else {
throw new PlatException("当前授权类型主体配置缺失,请检查"); throw new PlatException("当前授权类型主体配置缺失,请检查");
} }
} }
public static Map<String, Object> getUserBelongToGroups(String loginName) { public static Map<String, Object> getUserBelongToGroups(String loginName) {
userBelongToGroups = CacheManager.getCache("iplat:security:subjectParentCache"); userBelongToGroups = CacheManager.getCache("iplat:security:subjectParentCache");
getUserBelongToGroupsList(loginName); getUserBelongToGroupsList(loginName);
return userBelongToGroups; return userBelongToGroups;
} }
public static List getUserBelongToGroupsList(String loginName) { public static List getUserBelongToGroupsList(String loginName) {
return getSubjectParentList("loginName", loginName, "XSAuthorization.queryUserGroupsByLoginName"); return getSubjectParentList("loginName", loginName, "XSAuthorization.queryUserGroupsByLoginName");
} }
private static List getSubjectParentList(String paramKey, String paramVal, String sqlId) { private static List getSubjectParentList(String paramKey, String paramVal, String sqlId) {
List result = (List)CacheManager.getCacheValue("iplat:security:subjectParentCache", paramVal, () -> { List result = (List)CacheManager.getCacheValue("iplat:security:subjectParentCache", paramVal, () -> {
param = new HashMap(); param = new HashMap();
...@@ -120,14 +114,14 @@ public class AuthenticationInfo { ...@@ -120,14 +114,14 @@ public class AuthenticationInfo {
}); });
return result; return result;
} }
public static Map<String, Object> getResourceBelongToGroups(String resourceEname) { public static Map<String, Object> getResourceBelongToGroups(String resourceEname) {
param = new HashMap(); param = new HashMap();
param.put("resourceEname", resourceEname); param.put("resourceEname", resourceEname);
getResultList("XSAuthorization.queryResourceGroupsByResourceEname", param, resourceBelongToGroups, resourceEname); getResultList("XSAuthorization.queryResourceGroupsByResourceEname", param, resourceBelongToGroups, resourceEname);
return resourceBelongToGroups; return resourceBelongToGroups;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getUserParentGroupsByGroupEname(String groupEname) { public static Map<String, Object> getUserParentGroupsByGroupEname(String groupEname) {
...@@ -136,20 +130,20 @@ public class AuthenticationInfo { ...@@ -136,20 +130,20 @@ public class AuthenticationInfo {
returnMap.put(groupEname, result); returnMap.put(groupEname, result);
return returnMap; return returnMap;
} }
public static List getUserParentGroupsByGroupEnameList(String groupEname) { public static List getUserParentGroupsByGroupEnameList(String groupEname) {
param = new HashMap(); param = new HashMap();
param.put("groupEname", groupEname); param.put("groupEname", groupEname);
return getResultList("XSAuthorization.queryUserParentGroups", param); return getResultList("XSAuthorization.queryUserParentGroups", param);
} }
public static Map<String, Object> getUserManagerGroups(String loginName) { public static Map<String, Object> getUserManagerGroups(String loginName) {
param = new HashMap(); param = new HashMap();
param.put("loginName", loginName); param.put("loginName", loginName);
getResultList("XSAuthorization.queryUserManagerGroups", param, userManagerGroups, loginName); getResultList("XSAuthorization.queryUserManagerGroups", param, userManagerGroups, loginName);
return userManagerGroups; return userManagerGroups;
} }
public static Map<String, Object> getUserManageAuthentication(String loginName) { public static Map<String, Object> getUserManageAuthentication(String loginName) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
Map param = new HashMap(); Map param = new HashMap();
...@@ -160,7 +154,7 @@ public class AuthenticationInfo { ...@@ -160,7 +154,7 @@ public class AuthenticationInfo {
System.out.println("getUserManageAuthentication使用时间:" + (endTime - startTime) + "毫秒"); System.out.println("getUserManageAuthentication使用时间:" + (endTime - startTime) + "毫秒");
return userManageAuthentication; return userManageAuthentication;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getAuthenticationByParam(String subjectName, String subjectType) { public static Map<String, Object> getAuthenticationByParam(String subjectName, String subjectType) {
...@@ -172,10 +166,10 @@ public class AuthenticationInfo { ...@@ -172,10 +166,10 @@ public class AuthenticationInfo {
authenticationByParam.put(subjectName, result); authenticationByParam.put(subjectName, result);
resultMap = authenticationByParam; resultMap = authenticationByParam;
} }
return resultMap; return resultMap;
} }
public static List getAuthenticationByParamList(String subjectName, String subjectType) { public static List getAuthenticationByParamList(String subjectName, String subjectType) {
List resultList = null; List resultList = null;
if (subjectType.equals("USER")) { if (subjectType.equals("USER")) {
...@@ -198,19 +192,19 @@ public class AuthenticationInfo { ...@@ -198,19 +192,19 @@ public class AuthenticationInfo {
result.addAll(list); result.addAll(list);
} }
} }
if (null != subjectList && subjectList.size() > 0) { if (null != subjectList && subjectList.size() > 0) {
subjectId = ((Map)subjectList.get(0)).get("groupId").toString(); subjectId = ((Map)subjectList.get(0)).get("groupId").toString();
} }
List list = getCachedSubjectAuthList(subjectId, subjectName); List list = getCachedSubjectAuthList(subjectId, subjectName);
result.addAll(list); result.addAll(list);
resultList = result; resultList = result;
} }
return (List)resultList; return (List)resultList;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getOldAuthenticationByParam(String subjectName, String subjectType) { public static Map<String, Object> getOldAuthenticationByParam(String subjectName, String subjectType) {
...@@ -245,7 +239,7 @@ public class AuthenticationInfo { ...@@ -245,7 +239,7 @@ public class AuthenticationInfo {
paramMap.put(paramKey, subjectName); paramMap.put(paramKey, subjectName);
subjectList = getDao().query("XSResourceManage.queryResourceGroup", paramMap); subjectList = getDao().query("XSResourceManage.queryResourceGroup", paramMap);
} }
if (null != parentGroupList && parentGroupList.size() > 0) { if (null != parentGroupList && parentGroupList.size() > 0) {
for(int i = 0; i < parentGroupList.size(); ++i) { for(int i = 0; i < parentGroupList.size(); ++i) {
Map map = new HashMap(); Map map = new HashMap();
...@@ -254,11 +248,11 @@ public class AuthenticationInfo { ...@@ -254,11 +248,11 @@ public class AuthenticationInfo {
result.addAll(list); result.addAll(list);
} }
} }
if (null != subjectList && subjectList.size() > 0) { if (null != subjectList && subjectList.size() > 0) {
subjectId = ((Map)subjectList.get(0)).get(subjectKey).toString(); subjectId = ((Map)subjectList.get(0)).get(subjectKey).toString();
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("subjectId", subjectId); map.put("subjectId", subjectId);
List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map); List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map);
...@@ -268,7 +262,7 @@ public class AuthenticationInfo { ...@@ -268,7 +262,7 @@ public class AuthenticationInfo {
return retMap; return retMap;
} }
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getUserAuthentication(String loginName) { public static Map<String, Object> getUserAuthentication(String loginName) {
...@@ -276,11 +270,11 @@ public class AuthenticationInfo { ...@@ -276,11 +270,11 @@ public class AuthenticationInfo {
userAuthentication.put(loginName, result); userAuthentication.put(loginName, result);
return userAuthentication; return userAuthentication;
} }
public static List getUserAuthenticationList(String loginName) { public static List getUserAuthenticationList(String loginName) {
return getSubjectAuthenticationList(loginName, "USER"); return getSubjectAuthenticationList(loginName, "USER");
} }
public static List getSubjectAuthenticationList(String subjectName, String subjectType) { public static List getSubjectAuthenticationList(String subjectName, String subjectType) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
...@@ -313,7 +307,7 @@ public class AuthenticationInfo { ...@@ -313,7 +307,7 @@ public class AuthenticationInfo {
String parentGroupSqlId = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".parentGroupSqlId"); String parentGroupSqlId = PlatApplicationContext.getProperty("xservices.security.subjectType." + subjectType + ".parentGroupSqlId");
userGroupsList = getSubjectParentList(subjectParam, subjectName, parentGroupSqlId); userGroupsList = getSubjectParentList(subjectParam, subjectName, parentGroupSqlId);
} }
long endTime1 = System.currentTimeMillis(); long endTime1 = System.currentTimeMillis();
long executionTime1 = endTime1 - startTime1; long executionTime1 = endTime1 - startTime1;
logger.info("getUserAuthenticationList:List userGroupsList = getUserBelongToGroupsList(loginName);Time:" + executionTime1); logger.info("getUserAuthenticationList:List userGroupsList = getUserBelongToGroupsList(loginName);Time:" + executionTime1);
...@@ -326,7 +320,7 @@ public class AuthenticationInfo { ...@@ -326,7 +320,7 @@ public class AuthenticationInfo {
} catch (NumberFormatException | NullPointerException var41) { } catch (NumberFormatException | NullPointerException var41) {
groupThreshold = 20; groupThreshold = 20;
} }
List groupListAuthList; List groupListAuthList;
if (userGroupsList.size() > groupThreshold) { if (userGroupsList.size() > groupThreshold) {
List paramUserGroupList = new ArrayList(userGroupsList); List paramUserGroupList = new ArrayList(userGroupsList);
...@@ -336,10 +330,10 @@ public class AuthenticationInfo { ...@@ -336,10 +330,10 @@ public class AuthenticationInfo {
} else { } else {
groupListAuthList = getGroupListAuthList(userGroupsList); groupListAuthList = getGroupListAuthList(userGroupsList);
} }
result.addAll(groupListAuthList); result.addAll(groupListAuthList);
} }
long endTime3 = System.currentTimeMillis(); long endTime3 = System.currentTimeMillis();
long executionTime3 = endTime3 - startTime3; long executionTime3 = endTime3 - startTime3;
logger.info("getUserAuthenticationList:groupListAuthList = getGroupListAuthList(userGroupsList);Time:" + executionTime3); logger.info("getUserAuthenticationList:groupListAuthList = getGroupListAuthList(userGroupsList);Time:" + executionTime3);
...@@ -349,29 +343,29 @@ public class AuthenticationInfo { ...@@ -349,29 +343,29 @@ public class AuthenticationInfo {
long endTime4 = System.currentTimeMillis(); long endTime4 = System.currentTimeMillis();
long executionTime4 = endTime4 - startTime3; long executionTime4 = endTime4 - startTime3;
logger.info("getUserAuthenticationList:List list = getCachedSubjectAuthList(userId, loginName);Time:" + executionTime4); logger.info("getUserAuthenticationList:List list = getCachedSubjectAuthList(userId, loginName);Time:" + executionTime4);
for(int k = 0; k < result.size(); ++k) { for(int k = 0; k < result.size(); ++k) {
Map resultMap = (Map)result.get(k); Map resultMap = (Map)result.get(k);
resultMap.put(resultParam, subjectId); resultMap.put(resultParam, subjectId);
} }
long endTime5 = System.currentTimeMillis(); long endTime5 = System.currentTimeMillis();
long executionTime5 = endTime5 - startTime; long executionTime5 = endTime5 - startTime;
logger.info("getUserAuthenticationList:TotalTime:" + executionTime5); logger.info("getUserAuthenticationList:TotalTime:" + executionTime5);
return result; return result;
} }
} }
private static List getGroupListAuthList(List userGroupsList) { private static List getGroupListAuthList(List userGroupsList) {
Set resultGroupIds = new HashSet(); Set resultGroupIds = new HashSet();
List resultGroups = new ArrayList(); List resultGroups = new ArrayList();
for(int i = 0; i < userGroupsList.size(); ++i) { for(int i = 0; i < userGroupsList.size(); ++i) {
String subjectId = (String)((Map)userGroupsList.get(i)).get("groupId"); String subjectId = (String)((Map)userGroupsList.get(i)).get("groupId");
String groupEname = (String)((Map)userGroupsList.get(i)).get("groupEname"); String groupEname = (String)((Map)userGroupsList.get(i)).get("groupEname");
List list = getCachedSubjectAuthList(subjectId, groupEname); List list = getCachedSubjectAuthList(subjectId, groupEname);
Iterator var7 = list.iterator(); Iterator var7 = list.iterator();
while(var7.hasNext()) { while(var7.hasNext()) {
Object cacheVal = var7.next(); Object cacheVal = var7.next();
if (cacheVal instanceof Map) { if (cacheVal instanceof Map) {
...@@ -386,11 +380,11 @@ public class AuthenticationInfo { ...@@ -386,11 +380,11 @@ public class AuthenticationInfo {
} }
} }
} }
resultGroupIds.clear(); resultGroupIds.clear();
return resultGroups; return resultGroups;
} }
private static List getCachedSubjectAuthList(String subjectId, String subjectEname) { private static List getCachedSubjectAuthList(String subjectId, String subjectEname) {
List list = (List)CacheManager.getCacheValue("iplat:security:subjectCache", subjectEname, () -> { List list = (List)CacheManager.getCacheValue("iplat:security:subjectCache", subjectEname, () -> {
Map map = new HashMap(); Map map = new HashMap();
...@@ -399,7 +393,7 @@ public class AuthenticationInfo { ...@@ -399,7 +393,7 @@ public class AuthenticationInfo {
}); });
return list; return list;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getOldUserAuthentication(String loginName) { public static Map<String, Object> getOldUserAuthentication(String loginName) {
...@@ -415,22 +409,22 @@ public class AuthenticationInfo { ...@@ -415,22 +409,22 @@ public class AuthenticationInfo {
result.addAll(list); result.addAll(list);
} }
} }
Map map = new HashMap(); Map map = new HashMap();
map.put("subjectId", userDetails.get("userId")); map.put("subjectId", userDetails.get("userId"));
List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map); List list = getResultList("XSAuthorization.queryRecursiveResourceAuthzBySubjectId", map);
for(int k = 0; k < result.size(); ++k) { for(int k = 0; k < result.size(); ++k) {
Map resultMap = (Map)list.get(k); Map resultMap = (Map)list.get(k);
resultMap.put("userId", userDetails.get("userId")); resultMap.put("userId", userDetails.get("userId"));
} }
result.addAll(list); result.addAll(list);
Map retMap = new HashMap(); Map retMap = new HashMap();
retMap.put(loginName, result); retMap.put(loginName, result);
return retMap; return retMap;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getUserAuthenticationOfResource(String loginName) { public static Map<String, Object> getUserAuthenticationOfResource(String loginName) {
...@@ -438,7 +432,7 @@ public class AuthenticationInfo { ...@@ -438,7 +432,7 @@ public class AuthenticationInfo {
userAuthenticationOfResource.put(loginName, result); userAuthenticationOfResource.put(loginName, result);
return userAuthenticationOfResource; return userAuthenticationOfResource;
} }
public static List getUserAuthenticationOfResourceList(String loginName) { public static List getUserAuthenticationOfResourceList(String loginName) {
Map<String, Object> userBelongToGroups = getUserBelongToGroups(loginName); Map<String, Object> userBelongToGroups = getUserBelongToGroups(loginName);
List userGroupsList = (List)userBelongToGroups.get(loginName); List userGroupsList = (List)userBelongToGroups.get(loginName);
...@@ -455,11 +449,11 @@ public class AuthenticationInfo { ...@@ -455,11 +449,11 @@ public class AuthenticationInfo {
filterAuthResourceList(result, resEnameSet, list); filterAuthResourceList(result, resEnameSet, list);
} }
} }
sortResorceList(result); sortResorceList(result);
return result; return result;
} }
private static void sortResorceList(List<Map> result) { private static void sortResorceList(List<Map> result) {
result.sort((map1, map2) -> { result.sort((map1, map2) -> {
String key1 = map1.get("resourceEname").toString() + map1.get("operationType").toString(); String key1 = map1.get("resourceEname").toString() + map1.get("operationType").toString();
...@@ -467,10 +461,10 @@ public class AuthenticationInfo { ...@@ -467,10 +461,10 @@ public class AuthenticationInfo {
return key1.compareTo(key2); return key1.compareTo(key2);
}); });
} }
private static void filterAuthResourceList(List result, Set<String> resEnameSet, List list) { private static void filterAuthResourceList(List result, Set<String> resEnameSet, List list) {
Iterator var3 = list.iterator(); Iterator var3 = list.iterator();
while(var3.hasNext()) { while(var3.hasNext()) {
Object resultObj = var3.next(); Object resultObj = var3.next();
String resEname = (String)((Map)resultObj).get("resourceEname"); String resEname = (String)((Map)resultObj).get("resourceEname");
...@@ -481,9 +475,9 @@ public class AuthenticationInfo { ...@@ -481,9 +475,9 @@ public class AuthenticationInfo {
resEnameSet.add(key); resEnameSet.add(key);
} }
} }
} }
private static List<Map> clearButtonOfResource(List<Map> list) { private static List<Map> clearButtonOfResource(List<Map> list) {
List<Map> result = new ArrayList(); List<Map> result = new ArrayList();
if (null != list && list.size() > 0) { if (null != list && list.size() > 0) {
...@@ -494,10 +488,10 @@ public class AuthenticationInfo { ...@@ -494,10 +488,10 @@ public class AuthenticationInfo {
} }
} }
} }
return result; return result;
} }
private static List getCachedSubjectResList(String subjectId, String subjectEname) { private static List getCachedSubjectResList(String subjectId, String subjectEname) {
List<Map> list = (List)CacheManager.getCacheValue("iplat:security:subjectResourceCache", subjectEname, () -> { List<Map> list = (List)CacheManager.getCacheValue("iplat:security:subjectResourceCache", subjectEname, () -> {
Map map = new HashMap(); Map map = new HashMap();
...@@ -508,7 +502,7 @@ public class AuthenticationInfo { ...@@ -508,7 +502,7 @@ public class AuthenticationInfo {
List newList2 = (List)Stream.concat(list.stream(), listUnAuthed.stream()).collect(Collectors.toList()); List newList2 = (List)Stream.concat(list.stream(), listUnAuthed.stream()).collect(Collectors.toList());
return newList2; return newList2;
} }
public static List getAllUnAuthPageButt() { public static List getAllUnAuthPageButt() {
List<Map> list = (List)CacheManager.getCacheValue("iplat:security:unAuthPageButtCache", "unAuthPageButtCache", () -> { List<Map> list = (List)CacheManager.getCacheValue("iplat:security:unAuthPageButtCache", "unAuthPageButtCache", () -> {
List resultList = getResultList("XSAuthorization.queryAllUnAuthPageButt", new HashMap()); List resultList = getResultList("XSAuthorization.queryAllUnAuthPageButt", new HashMap());
...@@ -516,7 +510,7 @@ public class AuthenticationInfo { ...@@ -516,7 +510,7 @@ public class AuthenticationInfo {
}); });
return list; return list;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getOldUserAuthenticationOfResource(String loginName) { public static Map<String, Object> getOldUserAuthenticationOfResource(String loginName) {
...@@ -530,7 +524,7 @@ public class AuthenticationInfo { ...@@ -530,7 +524,7 @@ public class AuthenticationInfo {
res.put(loginName, result); res.put(loginName, result);
return res; return res;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getUserAuthMenuPages(String p, String loginName) { public static Map<String, Object> getUserAuthMenuPages(String p, String loginName) {
...@@ -538,7 +532,7 @@ public class AuthenticationInfo { ...@@ -538,7 +532,7 @@ public class AuthenticationInfo {
userAuthMenuPages.put(loginName, menuAndPageListForTree); userAuthMenuPages.put(loginName, menuAndPageListForTree);
return userAuthMenuPages; return userAuthMenuPages;
} }
public static List getUserAuthMenuPagesList(String p, String loginName, String source) { public static List getUserAuthMenuPagesList(String p, String loginName, String source) {
List result = null; List result = null;
p = !org.apache.commons.lang.StringUtils.isEmpty(p) && !"$".equals(p) ? p : "root"; p = !org.apache.commons.lang.StringUtils.isEmpty(p) && !"$".equals(p) ? p : "root";
...@@ -557,7 +551,7 @@ public class AuthenticationInfo { ...@@ -557,7 +551,7 @@ public class AuthenticationInfo {
List pageAuthList = getUserAuthPagesList(loginName); List pageAuthList = getUserAuthPagesList(loginName);
List menuList = new ArrayList(); List menuList = new ArrayList();
List pageList = new ArrayList(); List pageList = new ArrayList();
for(int i = 0; i < ret.size(); ++i) { for(int i = 0; i < ret.size(); ++i) {
Map retMap = (Map)ret.get(i); Map retMap = (Map)ret.get(i);
if ("1".equals(retMap.get("leaf").toString())) { if ("1".equals(retMap.get("leaf").toString())) {
...@@ -566,67 +560,86 @@ public class AuthenticationInfo { ...@@ -566,67 +560,86 @@ public class AuthenticationInfo {
menuList.add(retMap); menuList.add(retMap);
} }
} }
List menuAndPageListForTree = new ArrayList(); List menuAndPageListForTree = new ArrayList();
for(int i = 0; i < ret.size(); ++i) { for(int i = 0; i < ret.size(); ++i) {
Map retResultMap = (Map)ret.get(i); Map retResultMap = (Map)ret.get(i);
BigDecimal retLeaf = (BigDecimal)retResultMap.get("leaf"); BigDecimal retLeaf = (BigDecimal)retResultMap.get("leaf");
BigDecimal menuDecimal = new BigDecimal("2"); BigDecimal menuDecimal = new BigDecimal("2");
BigDecimal leafDecimal = new BigDecimal("1"); BigDecimal leafDecimal = new BigDecimal("1");
String parent = (String)retResultMap.get("parent");
if (retLeaf != null && menuDecimal.equals(retLeaf)) { if (retLeaf != null && menuDecimal.equals(retLeaf)) {
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("node", retResultMap.get("label").toString()); paramMap.put("node", retResultMap.get("label").toString());
List childPageForMenu = getDao().query("XSMenu.queryForRecursiveChildPage", paramMap); List childPageForMenu = getDao().query("XSMenu.queryForRecursiveChildPage", paramMap);
boolean flag = false; boolean flag = false;
List childList = new LinkedList();
if (childPageForMenu != null && childPageForMenu.size() > 0) { if (childPageForMenu != null && childPageForMenu.size() > 0) {
label85: //APP需要遍历所有子菜单
for(int j = 0; j < pageAuthList.size(); ++j) { if(parent.equals("APP")){
Map pageAuthMap = (Map)pageAuthList.get(j); label85:
for(int j = 0; j < pageAuthList.size(); ++j) {
for(int k = 0; k < childPageForMenu.size(); ++k) { Map pageAuthMap = (Map)pageAuthList.get(j);
Map childPageMap = (Map)childPageForMenu.get(k);
if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) { for(int k = 0; k < childPageForMenu.size(); ++k) {
flag = true; Map childPageMap = (Map)childPageForMenu.get(k);
break label85; if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) {
flag = true;
childList.add(pageAuthMap);
}
}
}
}else{
label85:
for(int j = 0; j < pageAuthList.size(); ++j) {
Map pageAuthMap = (Map)pageAuthList.get(j);
for(int k = 0; k < childPageForMenu.size(); ++k) {
Map childPageMap = (Map)childPageForMenu.get(k);
if (childPageMap.get("label").toString().equals(pageAuthMap.get("label").toString())) {
flag = true;
childList.add(pageAuthMap);
break label85;
}
} }
} }
} }
retResultMap.put("childMenu",childList);
} }
if (flag) { if (flag) {
menuAndPageListForTree.add(retResultMap); menuAndPageListForTree.add(retResultMap);
} }
} else if (retLeaf != null && leafDecimal.equals(retLeaf)) { } else if (retLeaf != null && leafDecimal.equals(retLeaf)) {
boolean pageFlag = false; boolean pageFlag = false;
for(int k = 0; k < pageAuthList.size(); ++k) { for(int k = 0; k < pageAuthList.size(); ++k) {
Map pageAuthMap = (Map)pageAuthList.get(k); Map pageAuthMap = (Map)pageAuthList.get(k);
if (pageAuthMap.get("label").toString().equals(retResultMap.get("label").toString())) { if (pageAuthMap.get("label").toString().equals(retResultMap.get("label").toString())) {
pageFlag = true; pageFlag = true;
} }
} }
if (pageFlag) { if (pageFlag) {
menuAndPageListForTree.add(retResultMap); menuAndPageListForTree.add(retResultMap);
} }
} }
} }
result = menuAndPageListForTree; result = menuAndPageListForTree;
} }
List newResult = new ArrayList(); List newResult = new ArrayList();
for(int i = 0; i < ((List)result).size(); ++i) { for(int i = 0; i < ((List)result).size(); ++i) {
if (((Map)((List)result).get(i)).get("show_flag") == null || ((Map)((List)result).get(i)).get("show_flag").equals("1")) { if (((Map)((List)result).get(i)).get("show_flag") == null || ((Map)((List)result).get(i)).get("show_flag").equals("1")) {
newResult.add(((List)result).get(i)); newResult.add(((List)result).get(i));
} }
} }
return newResult; return newResult;
} }
public static List getUserAllAuthMenuPagesList(String loginName) { public static List getUserAllAuthMenuPagesList(String loginName) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
List result = new ArrayList(); List result = new ArrayList();
...@@ -660,7 +673,7 @@ public class AuthenticationInfo { ...@@ -660,7 +673,7 @@ public class AuthenticationInfo {
long startTime4 = System.currentTimeMillis(); long startTime4 = System.currentTimeMillis();
List menuList = new ArrayList(); List menuList = new ArrayList();
List pageList = new ArrayList(); List pageList = new ArrayList();
for(int i = 0; i < ret.size(); ++i) { for(int i = 0; i < ret.size(); ++i) {
Map retMap = (Map)ret.get(i); Map retMap = (Map)ret.get(i);
if ("1".equals(retMap.get("leaf").toString())) { if ("1".equals(retMap.get("leaf").toString())) {
...@@ -669,24 +682,24 @@ public class AuthenticationInfo { ...@@ -669,24 +682,24 @@ public class AuthenticationInfo {
menuList.add(retMap); menuList.add(retMap);
} }
} }
Map authPageMap = new HashMap(); Map authPageMap = new HashMap();
for(int i = 0; i < pageAuthList.size(); ++i) { for(int i = 0; i < pageAuthList.size(); ++i) {
String label = (String)((Map)pageAuthList.get(i)).get("label"); String label = (String)((Map)pageAuthList.get(i)).get("label");
authPageMap.put(label, pageAuthList.get(i)); authPageMap.put(label, pageAuthList.get(i));
} }
Map menuMap = new HashMap(); Map menuMap = new HashMap();
for(int i = 0; i < menuList.size(); ++i) { for(int i = 0; i < menuList.size(); ++i) {
String label = (String)((Map)menuList.get(i)).get("label"); String label = (String)((Map)menuList.get(i)).get("label");
menuMap.put(label, menuList.get(i)); menuMap.put(label, menuList.get(i));
} }
Map pageResultMap = new HashMap(); Map pageResultMap = new HashMap();
Map menuResultMap = new HashMap(); Map menuResultMap = new HashMap();
int i; int i;
Map entity; Map entity;
for(i = 0; i < pageList.size(); ++i) { for(i = 0; i < pageList.size(); ++i) {
...@@ -699,25 +712,25 @@ public class AuthenticationInfo { ...@@ -699,25 +712,25 @@ public class AuthenticationInfo {
menuResultMap = setMenuResultMap(parent, (Map)menuResultMap, menuMap); menuResultMap = setMenuResultMap(parent, (Map)menuResultMap, menuMap);
} }
} }
for(i = 0; i < ret.size(); ++i) { for(i = 0; i < ret.size(); ++i) {
entity = (Map)ret.get(i); entity = (Map)ret.get(i);
if (((Map)menuResultMap).get(entity.get("label")) != null || pageResultMap.get(entity.get("label")) != null) { if (((Map)menuResultMap).get(entity.get("label")) != null || pageResultMap.get(entity.get("label")) != null) {
((List)result).add(ret.get(i)); ((List)result).add(ret.get(i));
} }
} }
long endTime4 = System.currentTimeMillis(); long endTime4 = System.currentTimeMillis();
long executionTime4 = endTime4 - startTime4; long executionTime4 = endTime4 - startTime4;
logger.info("getUserAllAuthMenuPagesList:my_set_resultTime:" + executionTime4); logger.info("getUserAllAuthMenuPagesList:my_set_resultTime:" + executionTime4);
} }
endTime5 = System.currentTimeMillis(); endTime5 = System.currentTimeMillis();
executionTime5 = endTime5 - startTime; executionTime5 = endTime5 - startTime;
logger.info("getUserAllAuthMenuPagesList:totalTime:" + executionTime5); logger.info("getUserAllAuthMenuPagesList:totalTime:" + executionTime5);
return (List)result; return (List)result;
} }
private static Map setMenuResultMap(String parentLabel, Map menuResultMap, Map<String, Map> menuMap) { private static Map setMenuResultMap(String parentLabel, Map menuResultMap, Map<String, Map> menuMap) {
Map menu = (Map)menuMap.get(parentLabel); Map menu = (Map)menuMap.get(parentLabel);
if (menu != null && menuResultMap.get(parentLabel) == null) { if (menu != null && menuResultMap.get(parentLabel) == null) {
...@@ -725,10 +738,10 @@ public class AuthenticationInfo { ...@@ -725,10 +738,10 @@ public class AuthenticationInfo {
String parent = (String)menu.get("parent"); String parent = (String)menu.get("parent");
menuResultMap = setMenuResultMap(parent, menuResultMap, menuMap); menuResultMap = setMenuResultMap(parent, menuResultMap, menuMap);
} }
return menuResultMap; return menuResultMap;
} }
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public static Map<String, Object> getUserAuthPages(String loginName) { public static Map<String, Object> getUserAuthPages(String loginName) {
...@@ -736,7 +749,7 @@ public class AuthenticationInfo { ...@@ -736,7 +749,7 @@ public class AuthenticationInfo {
userAuthPages.put(loginName, pageAuthList); userAuthPages.put(loginName, pageAuthList);
return userAuthPages; return userAuthPages;
} }
public static List getUserAuthPagesList(String loginName) { public static List getUserAuthPagesList(String loginName) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
List authList = getUserAuthenticationList(loginName); List authList = getUserAuthenticationList(loginName);
...@@ -750,7 +763,7 @@ public class AuthenticationInfo { ...@@ -750,7 +763,7 @@ public class AuthenticationInfo {
long executionTime1 = endTime1 - startTime1; long executionTime1 = endTime1 - startTime1;
logger.info("getUserAuthPagesList:List ret = getResultList(\"XSMenu.query\", new HashMap());Time:" + executionTime1); logger.info("getUserAuthPagesList:List ret = getResultList(\"XSMenu.query\", new HashMap());Time:" + executionTime1);
List pageAuthList = new ArrayList(); List pageAuthList = new ArrayList();
int i; int i;
Map pageMap; Map pageMap;
for(i = 0; i < ret.size(); ++i) { for(i = 0; i < ret.size(); ++i) {
...@@ -759,7 +772,7 @@ public class AuthenticationInfo { ...@@ -759,7 +772,7 @@ public class AuthenticationInfo {
pageList.add(pageMap); pageList.add(pageMap);
} }
} }
if (pageList.size() > 0) { if (pageList.size() > 0) {
for(i = 0; i < pageList.size(); ++i) { for(i = 0; i < pageList.size(); ++i) {
pageMap = (Map)pageList.get(i); pageMap = (Map)pageList.get(i);
...@@ -776,35 +789,35 @@ public class AuthenticationInfo { ...@@ -776,35 +789,35 @@ public class AuthenticationInfo {
} else { } else {
flag = true; flag = true;
} }
if (flag) { if (flag) {
pageAuthList.add(pageMap); pageAuthList.add(pageMap);
} }
} }
} }
long endTime2 = System.currentTimeMillis(); long endTime2 = System.currentTimeMillis();
long executionTime2 = endTime2 - startTime; long executionTime2 = endTime2 - startTime;
logger.info("getUserAuthPagesList:TotalTime:" + executionTime2); logger.info("getUserAuthPagesList:TotalTime:" + executionTime2);
return pageAuthList; return pageAuthList;
} }
public static List getResultList(String sqlMap, Map params) { public static List getResultList(String sqlMap, Map params) {
List resultList = getDao().query(sqlMap, params, 0, -999999); List resultList = getDao().query(sqlMap, params, 0, -999999);
return resultList; return resultList;
} }
/** @deprecated */ /** @deprecated */
public static Map<String, Object> getResultList(String sqlMap, Map params, Map result, String subjectName) { public static Map<String, Object> getResultList(String sqlMap, Map params, Map result, String subjectName) {
if (params == null) { if (params == null) {
params = new HashMap(); params = new HashMap();
} }
List resultList = getResultList(sqlMap, (Map)params); List resultList = getResultList(sqlMap, (Map)params);
result.put(subjectName, resultList); result.put(subjectName, resultList);
return result; return result;
} }
public static List getUserAuthenticationPageOfResource(String loginName) { public static List getUserAuthenticationPageOfResource(String loginName) {
Map<String, Object> userBelongToGroups = getUserBelongToGroups(loginName); Map<String, Object> userBelongToGroups = getUserBelongToGroups(loginName);
List userGroupsList = (List)userBelongToGroups.get(loginName); List userGroupsList = (List)userBelongToGroups.get(loginName);
...@@ -821,12 +834,12 @@ public class AuthenticationInfo { ...@@ -821,12 +834,12 @@ public class AuthenticationInfo {
filterAuthResourceList(result, resEnameSet, list); filterAuthResourceList(result, resEnameSet, list);
} }
} }
List<Map> pageList = clearButtonOfResource(result); List<Map> pageList = clearButtonOfResource(result);
sortResorceList(pageList); sortResorceList(pageList);
return pageList; return pageList;
} }
private static List getCachedSubjectPageList(String subjectId, String subjectEname) { private static List getCachedSubjectPageList(String subjectId, String subjectEname) {
List list = (List)CacheManager.getCacheValue("iplat:security:subjectPageCache", subjectEname, () -> { List list = (List)CacheManager.getCacheValue("iplat:security:subjectPageCache", subjectEname, () -> {
Map map = new HashMap(); Map map = new HashMap();
...@@ -837,7 +850,7 @@ public class AuthenticationInfo { ...@@ -837,7 +850,7 @@ public class AuthenticationInfo {
List newList2 = (List)Stream.concat(list.stream(), listUnAuthed.stream()).collect(Collectors.toList()); List newList2 = (List)Stream.concat(list.stream(), listUnAuthed.stream()).collect(Collectors.toList());
return newList2; return newList2;
} }
private static Dao getDao() { private static Dao getDao() {
return (Dao)PlatApplicationContext.getBean("dao"); return (Dao)PlatApplicationContext.getBean("dao");
} }
......
...@@ -21,11 +21,10 @@ $(function() { ...@@ -21,11 +21,10 @@ $(function() {
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>'; + 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template; return template;
} }
} }],
],
loadComplete: function (e) { loadComplete: function (e) {
$("#SELECT_BILL").on("click",addFunc); $("#SELECT_BILL").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc); //$("#BTN_UPDATE").on("click",updateFunc);
$("#SUBMIT").on("click",submitFunc); $("#SUBMIT").on("click",submitFunc);
$("#B_SAVE").on("click",saveFunc); $("#B_SAVE").on("click",saveFunc);
}, },
...@@ -123,23 +122,7 @@ function saveFunc() { ...@@ -123,23 +122,7 @@ function saveFunc() {
} }
} }
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW010B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function windowCallback() { function windowCallback() {
...@@ -151,7 +134,7 @@ function windowCallback() { ...@@ -151,7 +134,7 @@ function windowCallback() {
function contractDetailFunc(id) { function contractDetailFunc(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW010", href: "HGCW012C?methodName=initLoad&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>明细详情</div>", title: "<div style='text-align: center;'>明细详情</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
......
...@@ -28,16 +28,16 @@ ...@@ -28,16 +28,16 @@
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFColumn ename="partyA" cname="供应商名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="partyA" cname="供应商名称" width="220" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="settlementNumber" cname="来源单号" width="200" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="true" <EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" > columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" >
<EF:EFCodeOption codeName="hggp.cw.billTybe"/> <EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="receiveDate" cname="收票日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="receiveDate" cname="收票日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true" /> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" />
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true" /> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" />
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="taxPoints" cname="税率" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
......
...@@ -37,7 +37,15 @@ $(window).load(function () { ...@@ -37,7 +37,15 @@ $(window).load(function () {
* 查询 * 查询
*/ */
let query = function () { let query = function () {
resultGrid.dataSource.page(1);
if (selectedTab == 0){
resultGrid.dataSource.page(1);
}else if (selectedTab == 1){
resultAGrid.dataSource.page(1);
}else if (selectedTab == 2){
resultBGrid.dataSource.page(1);
}
} }
function cancelFunc() { function cancelFunc() {
...@@ -124,7 +132,14 @@ function btnSaveFunc(btnNode, gridNode) { ...@@ -124,7 +132,14 @@ function btnSaveFunc(btnNode, gridNode) {
}); });
} }
} }
var selectedTab = '';
function onSelect(e) {
var selecTab = e.item; // e.item是被选中的标签DOM元素
selectedTab = $("#info").find("li").index(selecTab); // 获取被选中标签的索引
//var selectedTabText = $(selectedTab).find("a").text(); // 获取被选中标签的文本
}
$(function () { $(function () {
$("#SEARCH").click(function () { $("#SEARCH").click(function () {
var ei = new EiInfo(); var ei = new EiInfo();
...@@ -236,10 +251,18 @@ $(function () { ...@@ -236,10 +251,18 @@ $(function () {
{ {
field: "projName", field: "projName",
title: "项目名称", title: "项目名称",
width: 200,
headerTemplate: "<span style='color: '>项目名称 </span>", headerTemplate: "<span style='color: '>项目名称 </span>",
locked: false locked: false
}, },
{ {
field: "partyB",
title: "供应商",
hidden: true,
headerTemplate: "<span style='color: '>供应商 </span>",
locked: false
},
{
field: "settlementNumber", field: "settlementNumber",
title: "结算编号", title: "结算编号",
headerTemplate: "<span style='color: '>结算编号 </span>", headerTemplate: "<span style='color: '>结算编号 </span>",
...@@ -328,6 +351,13 @@ $(function () { ...@@ -328,6 +351,13 @@ $(function () {
locked: false locked: false
}, },
{ {
field: "partyB",
title: "供应商",
hidden: true,
headerTemplate: "<span style='color: '>供应商 </span>",
locked: false
},
{
field: "contractNumber", field: "contractNumber",
title: "结算编号", title: "结算编号",
headerTemplate: "<span style='color: '>结算编号 </span>", headerTemplate: "<span style='color: '>结算编号 </span>",
...@@ -403,7 +433,8 @@ $(function () { ...@@ -403,7 +433,8 @@ $(function () {
} else if (e.name == "info-tab-3") { } else if (e.name == "info-tab-3") {
$("#info-tab-3").click(); $("#info-tab-3").click();
}*/ }*/
} },
select: onSelect // 绑定select事件处理函数
} }
} }
}); });
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head> <head>
</head> </head>
<EF:EFPage title="销售开票清单"> <EF:EFPage title="详情清单">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
......
...@@ -87,6 +87,10 @@ $(function () { ...@@ -87,6 +87,10 @@ $(function () {
return _.filter(options.values, function (item) { return _.filter(options.values, function (item) {
return item["valueField"]===calloutCompanyCode; return item["valueField"]===calloutCompanyCode;
}) })
}else if (allotType === "2" && calloutCompanyCode){
return _.filter(options.values, function (item) {
return item["valueField"]!==calloutCompanyCode;
})
} }
return options.values; return options.values;
}, },
...@@ -106,8 +110,14 @@ $(function () { ...@@ -106,8 +110,14 @@ $(function () {
filter: function (options) { filter: function (options) {
// let calloutCompanyCode = options.model['calloutCompanyCode']; // let calloutCompanyCode = options.model['calloutCompanyCode'];
// let callinCompanyCode = options.model['callinCompanyCode']; // let callinCompanyCode = options.model['callinCompanyCode'];
// let calloutWhCode = options.model['calloutWhCode']; let calloutWhCode = options.model['calloutWhCode'];
// if (callinCompanyCode == calloutCompanyCode){ let allotType = options.model['allotType'];
if (calloutWhCode && allotType === "1"){
return _.filter(whInCodeBox, function (item) {
return item["valueField"] != calloutWhCode;
})
}
//if (callinCompanyCode == calloutCompanyCode){
// return _.filter(whCodeBox, function (item) { // return _.filter(whCodeBox, function (item) {
// return item["param1Field"]===callinCompanyCode && item["valueField"]!=calloutWhCode; // return item["param1Field"]===callinCompanyCode && item["valueField"]!=calloutWhCode;
// }) // })
......
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