Commit a9f82509 by liuyang

2024-08-28 合同管理甲方和乙方修复筛选功能

parent 0cdfd3ca
...@@ -16,10 +16,7 @@ import com.baosight.hggp.hg.sj.domain.HGSJ003; ...@@ -16,10 +16,7 @@ import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ExcelUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -27,6 +24,7 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -27,6 +24,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.functions.T;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
...@@ -66,12 +64,46 @@ public class ServiceHGCW002A extends ServiceBase { ...@@ -66,12 +64,46 @@ public class ServiceHGCW002A extends ServiceBase {
*/ */
public EiInfo partyAQuery(EiInfo inInfo) { public EiInfo partyAQuery(EiInfo inInfo) {
try { try {
List<Map> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
List<UserVO> userVOList = new ArrayList<>(); List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory"); String contractCategory = inInfo.getString("contractCategory");
String partyA = inInfo.getString("partyA"); String partyA = inInfo.getString("partyA");
if (contractCategory.equals("1")) { if (contractCategory.equals("1")) {
List<HGPZ002> hgpz002List = HGPZTools.HgPz002.list(1); List<HGPZ002> hgpz002List = MapUtils.toDaoEPBases(super.query(inInfo,HGPZ002.QUERY, new HGPZ002()).getBlock(EiConstant.resultBlock).getRows(), HGPZ002.class);
if (CollectionUtils.isNotEmpty(hgpz002List)) { if (CollectionUtils.isNotEmpty(hgpz002List)) {
if(params.size()>0){
Map<String,String> params1 = params.get(0);
Map<String,String> params2 = params.size()>1?params.get(1):null;
String username = params1.get("username");
String usercode = params1.get("usercode");
String username1 = params2==null?null:params2.get("username");
String usercode1 = params2==null?null:params2.get("usercode");
if (StringUtils.isNotNull(username)){
switch (username1){
case "eq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustName().equals(username)).collect(Collectors.toList());
break;
case "neq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> !hgpz002.getCustName().equals(username)).collect(Collectors.toList());
break;
default:
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustName().contains(username)).collect(Collectors.toList());
}
}
if (StringUtils.isNotNull(usercode)){
switch (usercode1){
case "eq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustCode().equals(usercode)).collect(Collectors.toList());
break;
case "neq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> !hgpz002.getCustCode().equals(usercode)).collect(Collectors.toList());
break;
default:
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustCode().contains(usercode)).collect(Collectors.toList());
}
}
}
hgpz002List.forEach(hgpz002 -> { hgpz002List.forEach(hgpz002 -> {
UserVO userVO = new UserVO(); UserVO userVO = new UserVO();
userVO.setUsercode(hgpz002.getCustCode()); userVO.setUsercode(hgpz002.getCustCode());
...@@ -103,6 +135,7 @@ public class ServiceHGCW002A extends ServiceBase { ...@@ -103,6 +135,7 @@ public class ServiceHGCW002A extends ServiceBase {
*/ */
public EiInfo partyBQuery(EiInfo inInfo) { public EiInfo partyBQuery(EiInfo inInfo) {
try { try {
List<Map> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
List<UserVO> userVOList = new ArrayList<>(); List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory"); String contractCategory = inInfo.getString("contractCategory");
String partyB = inInfo.getString("partyB"); String partyB = inInfo.getString("partyB");
...@@ -116,8 +149,41 @@ public class ServiceHGCW002A extends ServiceBase { ...@@ -116,8 +149,41 @@ public class ServiceHGCW002A extends ServiceBase {
} }
} }
else if (contractCategory.equals("2")) { else if (contractCategory.equals("2")) {
List<HGPZ003> hgpz003List = HGCWTools.HgCw002.list(1); List<HGPZ003> hgpz003List = MapUtils.toDaoEPBases(super.query(inInfo,HGPZ003.QUERY, new HGPZ003()).getBlock(EiConstant.resultBlock).getRows(), HGPZ003.class);
if (CollectionUtils.isNotEmpty(hgpz003List)) { if (CollectionUtils.isNotEmpty(hgpz003List)) {
if(params.size()>0){
Map<String,String> params1 = params.get(0);
Map<String,String> params2 = params.size()>1?params.get(1):null;
String username = params1.get("username");
String usercode = params1.get("usercode");
String username1 = params2==null?null:params2.get("username");
String usercode1 = params2==null?null:params2.get("usercode");
if (StringUtils.isNotNull(username)){
switch (username1){
case "eq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupName().equals(username)).collect(Collectors.toList());
break;
case "neq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> !hgpz002.getSupName().equals(username)).collect(Collectors.toList());
break;
default:
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupName().contains(username)).collect(Collectors.toList());
}
}
if (StringUtils.isNotNull(usercode)){
switch (usercode1){
case "eq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupCode().equals(usercode)).collect(Collectors.toList());
break;
case "neq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> !hgpz002.getSupCode().equals(usercode)).collect(Collectors.toList());
break;
default:
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupCode().contains(usercode)).collect(Collectors.toList());
}
}
}
hgpz003List.forEach(hgpz003 -> { hgpz003List.forEach(hgpz003 -> {
UserVO userVO = new UserVO(); UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode()); userVO.setUsercode(hgpz003.getSupCode());
......
...@@ -57,6 +57,21 @@ public class HGPZTools { ...@@ -57,6 +57,21 @@ public class HGPZTools {
queryMap.put("status", status); queryMap.put("status", status);
return DaoBase.getInstance().query(HGPZ002.QUERY, queryMap); return DaoBase.getInstance().query(HGPZ002.QUERY, queryMap);
} }
public static List<HGPZ002> list(List<Map> params,Integer status) {
if (status == null) {
return null;
}
Map queryMap = new HashMap<>();
queryMap.put("status", status);
if (CollectionUtils.isNotEmpty(params)){
queryMap.put("code", params.get(0));
queryMap.put("name", params.get(1));
}
//queryMap.put("param0", param.get(0));
return DaoBase.getInstance().query(HGPZ002.QUERY, queryMap);
}
} }
public static class HgPz003 { public static class HgPz003 {
......
...@@ -285,6 +285,7 @@ $(function() { ...@@ -285,6 +285,7 @@ $(function() {
var info = new EiInfo(); var info = new EiInfo();
info.set("contractCategory",contractCategory); info.set("contractCategory",contractCategory);
info.set("partyA",$("#result-0-partyA").val()) info.set("partyA",$("#result-0-partyA").val())
info.set("inqu_status-0-status",1);
return info; return info;
}, },
/** /**
...@@ -324,8 +325,9 @@ $(function() { ...@@ -324,8 +325,9 @@ $(function() {
e.preventDefault(); e.preventDefault();
} }
var info = new EiInfo(); var info = new EiInfo();
info.set("contractCategory",contractCategory) info.set("contractCategory",contractCategory);
info.set("partyB",$("#result-0-partyB").val()) info.set("partyB",$("#result-0-partyB").val());
info.set("inqu_status-0-status",1);
return info; return info;
}, },
/** /**
......
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
</div> </div>
<div class="row"> <div class="row">
<EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4" <EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyAQuery" serviceName="HGCW002A" methodName="partyAQuery" resultId="partyAResult"
resultId="partyAResult"
required="true" save="false" popupType="ServiceGrid" required="true" save="false" popupType="ServiceGrid"
valueField="username" textField="username" valueField="username" textField="username"
columnEnames="username,usercode" columnEnames="username,usercode"
...@@ -46,8 +45,7 @@ ...@@ -46,8 +45,7 @@
</EF:EFPopupInput> </EF:EFPopupInput>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" /> <EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" />
<EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4" <EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyBQuery" serviceName="HGCW002A" methodName="partyBQuery" resultId="partyAResult"
resultId="partyAResult"
save="false" popupType="ServiceGrid" save="false" popupType="ServiceGrid"
valueField="username" textField="username" valueField="username" textField="username"
columnEnames="username,usercode" columnEnames="username,usercode"
......
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