Commit a9f82509 by liuyang

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

parent 0cdfd3ca
......@@ -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.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ExcelUtils;
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;
......@@ -27,6 +24,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.functions.T;
import java.math.BigDecimal;
import java.util.*;
......@@ -66,12 +64,46 @@ public class ServiceHGCW002A extends ServiceBase {
*/
public EiInfo partyAQuery(EiInfo inInfo) {
try {
List<Map> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
String partyA = inInfo.getString("partyA");
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(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 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz002.getCustCode());
......@@ -103,6 +135,7 @@ public class ServiceHGCW002A extends ServiceBase {
*/
public EiInfo partyBQuery(EiInfo inInfo) {
try {
List<Map> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
String partyB = inInfo.getString("partyB");
......@@ -116,8 +149,41 @@ public class ServiceHGCW002A extends ServiceBase {
}
}
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(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 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode());
......
......@@ -57,6 +57,21 @@ public class HGPZTools {
queryMap.put("status", status);
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 {
......
......@@ -285,6 +285,7 @@ $(function() {
var info = new EiInfo();
info.set("contractCategory",contractCategory);
info.set("partyA",$("#result-0-partyA").val())
info.set("inqu_status-0-status",1);
return info;
},
/**
......@@ -324,8 +325,9 @@ $(function() {
e.preventDefault();
}
var info = new EiInfo();
info.set("contractCategory",contractCategory)
info.set("partyB",$("#result-0-partyB").val())
info.set("contractCategory",contractCategory);
info.set("partyB",$("#result-0-partyB").val());
info.set("inqu_status-0-status",1);
return info;
},
/**
......
......@@ -35,8 +35,7 @@
</div>
<div class="row">
<EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyAQuery"
resultId="partyAResult"
serviceName="HGCW002A" methodName="partyAQuery" resultId="partyAResult"
required="true" save="false" popupType="ServiceGrid"
valueField="username" textField="username"
columnEnames="username,usercode"
......@@ -46,8 +45,7 @@
</EF:EFPopupInput>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" />
<EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyBQuery"
resultId="partyAResult"
serviceName="HGCW002A" methodName="partyBQuery" resultId="partyAResult"
save="false" popupType="ServiceGrid"
valueField="username" textField="username"
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