Commit fad70131 by liuyang

2024-09-18

1、项目甲方数据过滤修复
2、项目选择数据过滤修复
parent 3f6be941
...@@ -45,23 +45,23 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -45,23 +45,23 @@ public class ServiceHGCW002 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "账期维护", operType = "查询", operDesc = "初始化")
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo,new HGCW002()); EiInfo outInfo = super.initLoad(inInfo, new HGCW002());
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW002().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW002().eiMetadata);
outInfo = super.query(inInfo, HGCW002.QUERY, new HGCW002()); outInfo = super.query(inInfo, HGCW002.QUERY, new HGCW002());
Map<String,Object> qarma = new HashMap<>(); Map<String, Object> qarma = new HashMap<>();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(outInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID,DdynamicEnum.CONTRACT_BLOCK_ID)); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID, DdynamicEnum.CONTRACT_BLOCK_ID));
//角色公司 //角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode); qarma.put(Org.FIELD_ORG_ID, roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID), qarma);
}catch (Exception e){ } catch (Exception e) {
LogUtils.setDetailMsg(inInfo,e,"初始化失败!"); LogUtils.setDetailMsg(inInfo, e, "初始化失败!");
} }
return outInfo; return outInfo;
} }
...@@ -72,12 +72,12 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -72,12 +72,12 @@ public class ServiceHGCW002 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询") @OperationLogAnnotation(operModul = "账期维护", operType = "查询", operDesc = "查询")
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
if (!roleCompanyCode.isEmpty()) { if (!roleCompanyCode.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW002.FIELD_COMPANY_CODES,roleCompanyCode); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW002.FIELD_COMPANY_CODES, roleCompanyCode);
} }
try { try {
inInfo = super.query(inInfo, HGCW002.QUERY, new HGCW002()); inInfo = super.query(inInfo, HGCW002.QUERY, new HGCW002());
...@@ -93,7 +93,7 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -93,7 +93,7 @@ public class ServiceHGCW002 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存") @OperationLogAnnotation(operModul = "账期维护", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
...@@ -117,7 +117,7 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -117,7 +117,7 @@ public class ServiceHGCW002 extends ServiceBase {
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate())); HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate())); HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
if (HGCW002.getId() == null || HGCW002.getId() == 0) { if (HGCW002.getId() == null || HGCW002.getId() == 0) {
String contractNumber =HGCW002.getCompanyCode() + String contractNumber = HGCW002.getCompanyCode() +
HGCW002.getContractType() + HGCW002.getContractType() +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO); SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW002.setContractNumber(contractNumber); HGCW002.setContractNumber(contractNumber);
...@@ -126,8 +126,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -126,8 +126,8 @@ public class ServiceHGCW002 extends ServiceBase {
this.add(HGCW002); this.add(HGCW002);
// 写入其他数据 // 写入其他数据
HGCWTools.HgCw003.save(detail1Rows,contractNumber,HGCW002); HGCWTools.HgCw003.save(detail1Rows, contractNumber, HGCW002);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId()); HGCWTools.HgCw999.batchUpdate(detail2Rows, HGCW002.getId());
} else { } else {
BigDecimal totalContractPriceExcluding = new BigDecimal(0); BigDecimal totalContractPriceExcluding = new BigDecimal(0);
...@@ -137,12 +137,12 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -137,12 +137,12 @@ public class ServiceHGCW002 extends ServiceBase {
for (int i = 0; i < detail1Rows.size(); i++) { for (int i = 0; i < detail1Rows.size(); i++) {
HGCW003 hgcw003 = new HGCW003(); HGCW003 hgcw003 = new HGCW003();
hgcw003.fromMap(detail1Rows.get(i)); hgcw003.fromMap(detail1Rows.get(i));
if (hgcw003.getId() == null || hgcw003.getId() == 0){ if (hgcw003.getId() == null || hgcw003.getId() == 0) {
hgcw003.setCompanyCode(HGCW002.getCompanyCode()); hgcw003.setCompanyCode(HGCW002.getCompanyCode());
hgcw003.setCompanyName(HGCW002.getCompanyName()); hgcw003.setCompanyName(HGCW002.getCompanyName());
hgcw003.setContractNumber(HGCW002.getContractNumber()); hgcw003.setContractNumber(HGCW002.getContractNumber());
DaoUtils.insert(HGCW003.INSERT, hgcw003); DaoUtils.insert(HGCW003.INSERT, hgcw003);
}else { } else {
DaoUtils.update(HGCW003.UPDATE, hgcw003); DaoUtils.update(HGCW003.UPDATE, hgcw003);
} }
totalContractPriceExcluding = totalContractPriceExcluding.add(hgcw003.getTotalPriceExcluding()); totalContractPriceExcluding = totalContractPriceExcluding.add(hgcw003.getTotalPriceExcluding());
...@@ -192,7 +192,7 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -192,7 +192,7 @@ public class ServiceHGCW002 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "账期维护", operType = "删除", operDesc = "删除")
@Override @Override
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
...@@ -211,10 +211,11 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -211,10 +211,11 @@ public class ServiceHGCW002 extends ServiceBase {
/** /**
* 提交操作 * 提交操作
*
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo submit(EiInfo inInfo){ public EiInfo submit(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
...@@ -232,8 +233,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -232,8 +233,8 @@ public class ServiceHGCW002 extends ServiceBase {
return inInfo; return inInfo;
} }
public EiInfo contractComboBox(EiInfo inInfo){ public EiInfo contractComboBox(EiInfo inInfo) {
Map<String,String> params = EiInfoUtils.getFirstRow(inInfo, EiConstant.queryBlock); Map<String, String> params = EiInfoUtils.getFirstRow(inInfo, EiConstant.queryBlock);
/*Map<String, Object> paramMap = new HashMap<>(); /*Map<String, Object> paramMap = new HashMap<>();
if (StringUtils.isNotEmpty(inInfo.getString(HGCW002.FIELD_REVIEW_STATUS))) { if (StringUtils.isNotEmpty(inInfo.getString(HGCW002.FIELD_REVIEW_STATUS))) {
paramMap.put(HGCW002.FIELD_REVIEW_STATUS, inInfo.getString(HGCW002.FIELD_REVIEW_STATUS)); paramMap.put(HGCW002.FIELD_REVIEW_STATUS, inInfo.getString(HGCW002.FIELD_REVIEW_STATUS));
...@@ -249,41 +250,41 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -249,41 +250,41 @@ public class ServiceHGCW002 extends ServiceBase {
} }
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CONTRACT_BLOCK_ID), paramMap, false);*/ CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CONTRACT_BLOCK_ID), paramMap, false);*/
return super.query(inInfo,"HGCW002.queryComboBox",new HGCW002(),false,new HGCW002().eiMetadata,EiConstant.queryBlock, "contract_block_id", "contract_block_id"); return super.query(inInfo, "HGCW002.queryComboBox", new HGCW002(), false, new HGCW002().eiMetadata, EiConstant.queryBlock, "contract_block_id", "contract_block_id");
} }
public EiInfo projectComboBox(EiInfo inInfo){ public EiInfo projectComboBox(EiInfo inInfo) {
List<HGCW002> hgcw002List = MapUtils.toDaoEPBases(inInfo.getBlock(EiConstant.queryBlock).getRows(),HGCW002.class); List<HGCW002> hgcw002List = MapUtils.toDaoEPBases(inInfo.getBlock(EiConstant.queryBlock).getRows(), HGCW002.class);
List<String> contractTypArray = new ArrayList<>(); List<String> contractTypArray = new ArrayList<>();
if (Objects.nonNull(inInfo.getAttr().get("reviewStatus"))) { if (Objects.nonNull(inInfo.getAttr().get("reviewStatus"))) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW002.FIELD_REVIEW_STATUS,inInfo.getAttr().get("reviewStatus")); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW002.FIELD_REVIEW_STATUS, inInfo.getAttr().get("reviewStatus"));
} }
if (Objects.nonNull(inInfo.getAttr().get("contractType"))) { if (Objects.nonNull(inInfo.getAttr().get("contractType"))) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW002.FIELD_CONTRACT_TYPE,inInfo.getAttr().get("contractType")); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW002.FIELD_CONTRACT_TYPE, inInfo.getAttr().get("contractType"));
} }
if (Objects.nonNull(inInfo.getAttr().get("contractTypes"))) { if (Objects.nonNull(inInfo.getAttr().get("contractTypes"))) {
String[] contractTyps = inInfo.getAttr().get("contractTypes").toString().split(","); String[] contractTyps = inInfo.getAttr().get("contractTypes").toString().split(",");
contractTypArray.addAll(Arrays.asList(contractTyps)); contractTypArray.addAll(Arrays.asList(contractTyps));
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"contractTyps",contractTypArray); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "contractTyps", contractTypArray);
} }
//增加根据当前登录人所属公司进行过滤 //增加根据当前登录人所属公司进行过滤
List<String> userVO = UserSessionUtils.getRoleCompany().stream().map(Company::getCompanyCode).collect(Collectors.toList()); List<String> userVO = UserSessionUtils.getRoleCompany().stream().map(Company::getCompanyCode).collect(Collectors.toList());
//map.put("companyCodes", userVO); //map.put("companyCodes", userVO);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW002.FIELD_COMPANY_CODES,userVO); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW002.FIELD_COMPANY_CODES, userVO);
inInfo = super.query(inInfo, "HGCW002.queryProjectComboBox", new HGCW002(),false,new HGCW002().eiMetadata,EiConstant.queryBlock, "projcet_combo_box","projcet_combo_box","HGCW002.queryProjectCount"); inInfo = super.query(inInfo, "HGCW002.queryProjectComboBox", new HGCW002(), false, new HGCW002().eiMetadata, EiConstant.queryBlock, "projcet_combo_box", "projcet_combo_box", "HGCW002.queryProjectCount");
List<HGCW002> hgcw002s = MapUtils.toDaoEPBases(inInfo.getBlock("projcet_combo_box").getRows(), HGCW002.class); List<HGCW002> hgcw002s = MapUtils.toDaoEPBases(inInfo.getBlock("projcet_combo_box").getRows(), HGCW002.class);
if(CollectionUtils.isNotEmpty(hgcw002List)){ if (CollectionUtils.isNotEmpty(hgcw002List)) {
if (CollectionUtils.isNotEmpty(hgcw002s)){ if (CollectionUtils.isNotEmpty(hgcw002s)) {
HGCW002 hgcw0021 = hgcw002List.get(0); HGCW002 hgcw0021 = hgcw002List.get(0);
HGCW002 hgcw0022 = hgcw002List.size()>1?hgcw002List.get(1):null; HGCW002 hgcw0022 = hgcw002List.size() > 1 ? hgcw002List.get(1) : null;
String companyCode = hgcw0021.getCompanyCode().trim(); String companyCode = hgcw0021.getCompanyCode().trim();
String companyName = hgcw0021.getCompanyName().trim(); String companyName = hgcw0021.getCompanyName().trim();
String companyCode1 = hgcw0022==null?null:hgcw0022.getCompanyCode().trim(); String companyCode1 = hgcw0022 == null ? null : hgcw0022.getCompanyCode().trim();
String companyName1 = hgcw0022==null?null:hgcw0022.getCompanyName().trim(); String companyName1 = hgcw0022 == null ? null : hgcw0022.getCompanyName().trim();
if (StringUtils.isNotEmpty(companyCode)){ if (StringUtils.isNotEmpty(companyCode)) {
switch (Objects.requireNonNull(companyCode1)){ switch (Objects.requireNonNull(companyCode1)) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyCode().equals(companyCode)).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyCode().equals(companyCode)).collect(Collectors.toList());
break; break;
...@@ -294,8 +295,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -294,8 +295,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyCode().contains(companyCode)).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyCode().contains(companyCode)).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(companyName)){ if (StringUtils.isNotEmpty(companyName)) {
switch (Objects.requireNonNull(companyName1)){ switch (Objects.requireNonNull(companyName1)) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyName().equals(companyName)).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyName().equals(companyName)).collect(Collectors.toList());
break; break;
...@@ -306,8 +307,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -306,8 +307,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyName().contains(companyName)).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getCompanyName().contains(companyName)).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getProjCode().trim()) && StringUtils.isNotEmpty(hgcw0022.getProjCode())){ if (StringUtils.isNotEmpty(hgcw0021.getProjCode().trim()) && StringUtils.isNotEmpty(hgcw0022.getProjCode())) {
switch (hgcw0022.getProjCode()){ switch (hgcw0022.getProjCode()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().equals(hgcw0021.getProjCode())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().equals(hgcw0021.getProjCode())).collect(Collectors.toList());
break; break;
...@@ -318,8 +319,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -318,8 +319,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().contains(hgcw0021.getProjCode())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().contains(hgcw0021.getProjCode())).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getProjName().trim()) && StringUtils.isNotEmpty(hgcw0022.getProjName())){ if (StringUtils.isNotEmpty(hgcw0021.getProjName().trim()) && StringUtils.isNotEmpty(hgcw0022.getProjName())) {
switch (hgcw0022.getProjName()){ switch (hgcw0022.getProjName()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().equals(hgcw0021.getProjName())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().equals(hgcw0021.getProjName())).collect(Collectors.toList());
break; break;
...@@ -330,8 +331,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -330,8 +331,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().contains(hgcw0021.getProjName())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().contains(hgcw0021.getProjName())).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getContractNumber().trim()) && StringUtils.isNotEmpty(hgcw0022.getContractNumber())){ if (StringUtils.isNotEmpty(hgcw0021.getContractNumber().trim()) && StringUtils.isNotEmpty(hgcw0022.getContractNumber())) {
switch (hgcw0022.getContractNumber()){ switch (hgcw0022.getContractNumber()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().equals(hgcw0021.getContractNumber())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().equals(hgcw0021.getContractNumber())).collect(Collectors.toList());
break; break;
...@@ -342,8 +343,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -342,8 +343,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().contains(hgcw0021.getContractNumber())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().contains(hgcw0021.getContractNumber())).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getContractName().trim()) && StringUtils.isNotEmpty(hgcw0022.getContractName())){ if (StringUtils.isNotEmpty(hgcw0021.getContractName().trim()) && StringUtils.isNotEmpty(hgcw0022.getContractName())) {
switch (hgcw0022.getContractName()){ switch (hgcw0022.getContractName()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().equals(hgcw0021.getContractName())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().equals(hgcw0021.getContractName())).collect(Collectors.toList());
break; break;
...@@ -354,8 +355,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -354,8 +355,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().contains(hgcw0021.getContractName())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().contains(hgcw0021.getContractName())).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getPartyA().trim()) && StringUtils.isNotEmpty(hgcw0022.getPartyA())){ if (StringUtils.isNotEmpty(hgcw0021.getPartyA().trim()) && StringUtils.isNotEmpty(hgcw0022.getPartyA())) {
switch (hgcw0022.getPartyA()){ switch (hgcw0022.getPartyA()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().equals(hgcw0021.getPartyA())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().equals(hgcw0021.getPartyA())).collect(Collectors.toList());
break; break;
...@@ -366,8 +367,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -366,8 +367,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().contains(hgcw0021.getPartyA())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().contains(hgcw0021.getPartyA())).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getPartyB().trim()) && StringUtils.isNotEmpty(hgcw0022.getPartyB())){ if (StringUtils.isNotEmpty(hgcw0021.getPartyB().trim()) && StringUtils.isNotEmpty(hgcw0022.getPartyB())) {
switch (hgcw0022.getPartyB()){ switch (hgcw0022.getPartyB()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyB().equals(hgcw0021.getPartyB())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyB().equals(hgcw0021.getPartyB())).collect(Collectors.toList());
break; break;
...@@ -378,8 +379,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -378,8 +379,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyB().contains(hgcw0021.getPartyB())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyB().contains(hgcw0021.getPartyB())).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(hgcw0021.getContractTypeStr().trim()) && StringUtils.isNotEmpty(hgcw0022.getContractTypeStr())){ if (StringUtils.isNotEmpty(hgcw0021.getContractTypeStr().trim()) && StringUtils.isNotEmpty(hgcw0022.getContractTypeStr())) {
switch (hgcw0022.getContractTypeStr()){ switch (hgcw0022.getContractTypeStr()) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().equals(hgcw0021.getContractTypeStr())).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().equals(hgcw0021.getContractTypeStr())).collect(Collectors.toList());
break; break;
...@@ -396,16 +397,16 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -396,16 +397,16 @@ public class ServiceHGCW002 extends ServiceBase {
return inInfo; return inInfo;
} }
public EiInfo queryContractByType(EiInfo inInfo){ public EiInfo queryContractByType(EiInfo inInfo) {
List<Map<String, String>> params = inInfo.getBlock(EiConstant.queryBlock).getRows(); List<Map<String, String>> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
inInfo = super.query(inInfo, "HGCW002.queryContractByType", new HGCW002()); inInfo = super.query(inInfo, "HGCW002.queryContractByType", new HGCW002());
List<HGCW002> hgcw002s = MapUtils.toDaoEPBases(inInfo.getBlock(EiConstant.resultBlock).getRows(), HGCW002.class); List<HGCW002> hgcw002s = MapUtils.toDaoEPBases(inInfo.getBlock(EiConstant.resultBlock).getRows(), HGCW002.class);
if(CollectionUtils.isNotEmpty(params)){ if (CollectionUtils.isNotEmpty(params)) {
if (CollectionUtils.isNotEmpty(hgcw002s)){ if (CollectionUtils.isNotEmpty(hgcw002s)) {
Map<String, String> map1 = params.get(0); Map<String, String> map1 = params.get(0);
Map<String, String> map2 = params.size()>1?params.get(1):null; Map<String, String> map2 = params.size() > 1 ? params.get(1) : null;
if (StringUtils.isNotEmpty(map1.get("projCode")) && StringUtils.isNotEmpty(map2.get("projCode"))){ if (StringUtils.isNotEmpty(map1.get("projCode")) && StringUtils.isNotEmpty(map2.get("projCode"))) {
switch (map2.get("projCode")){ switch (map2.get("projCode")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().equals(map1.get("projCode"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().equals(map1.get("projCode"))).collect(Collectors.toList());
break; break;
...@@ -416,8 +417,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -416,8 +417,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().contains(map1.get("projCode"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjCode().contains(map1.get("projCode"))).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(map1.get("projName")) && StringUtils.isNotEmpty(map2.get("projName"))){ if (StringUtils.isNotEmpty(map1.get("projName")) && StringUtils.isNotEmpty(map2.get("projName"))) {
switch (map2.get("projName")){ switch (map2.get("projName")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().equals(map1.get("projName"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().equals(map1.get("projName"))).collect(Collectors.toList());
break; break;
...@@ -428,8 +429,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -428,8 +429,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().contains(map1.get("projName"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getProjName().contains(map1.get("projName"))).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(map1.get("contractNumber")) && StringUtils.isNotEmpty(map2.get("contractNumber"))){ if (StringUtils.isNotEmpty(map1.get("contractNumber")) && StringUtils.isNotEmpty(map2.get("contractNumber"))) {
switch (map2.get("contractNumber")){ switch (map2.get("contractNumber")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().equals(map1.get("contractNumber"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().equals(map1.get("contractNumber"))).collect(Collectors.toList());
break; break;
...@@ -440,8 +441,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -440,8 +441,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().contains(map1.get("contractNumber"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractNumber().contains(map1.get("contractNumber"))).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(map1.get("contractName")) && StringUtils.isNotEmpty(map2.get("contractName"))){ if (StringUtils.isNotEmpty(map1.get("contractName")) && StringUtils.isNotEmpty(map2.get("contractName"))) {
switch (map2.get("contractName")){ switch (map2.get("contractName")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().equals(map1.get("contractName"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().equals(map1.get("contractName"))).collect(Collectors.toList());
break; break;
...@@ -452,8 +453,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -452,8 +453,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().contains(map1.get("contractName"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractName().contains(map1.get("contractName"))).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(map1.get("totalContractPriceIncluding")) && StringUtils.isNotEmpty(map2.get("totalContractPriceIncluding"))){ if (StringUtils.isNotEmpty(map1.get("totalContractPriceIncluding")) && StringUtils.isNotEmpty(map2.get("totalContractPriceIncluding"))) {
switch (map2.get("totalContractPriceIncluding")){ switch (map2.get("totalContractPriceIncluding")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().equals(map2.get("totalContractPriceIncluding"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().equals(map2.get("totalContractPriceIncluding"))).collect(Collectors.toList());
break; break;
...@@ -464,8 +465,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -464,8 +465,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().contains(map2.get("totalContractPriceIncluding"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getPartyA().contains(map2.get("totalContractPriceIncluding"))).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(map1.get("contractTypeStr")) && StringUtils.isNotEmpty(map2.get("contractTypeStr"))){ if (StringUtils.isNotEmpty(map1.get("contractTypeStr")) && StringUtils.isNotEmpty(map2.get("contractTypeStr"))) {
switch (map2.get("contractTypeStr")){ switch (map2.get("contractTypeStr")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().equals(map1.get("contractTypeStr"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().equals(map1.get("contractTypeStr"))).collect(Collectors.toList());
break; break;
...@@ -476,8 +477,8 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -476,8 +477,8 @@ public class ServiceHGCW002 extends ServiceBase {
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().contains(map1.get("contractTypeStr"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().contains(map1.get("contractTypeStr"))).collect(Collectors.toList());
} }
} }
if (StringUtils.isNotEmpty(map1.get("remainingAmount")) && StringUtils.isNotEmpty(map2.get("remainingAmount"))){ if (StringUtils.isNotEmpty(map1.get("remainingAmount")) && StringUtils.isNotEmpty(map2.get("remainingAmount"))) {
switch (map2.get("remainingAmount")){ switch (map2.get("remainingAmount")) {
case "eq": case "eq":
hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().equals(map1.get("remainingAmount"))).collect(Collectors.toList()); hgcw002s = hgcw002s.stream().filter(hgpz002 -> hgpz002.getContractTypeStr().equals(map1.get("remainingAmount"))).collect(Collectors.toList());
break; break;
...@@ -495,10 +496,9 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -495,10 +496,9 @@ public class ServiceHGCW002 extends ServiceBase {
} }
public EiInfo queryContractByNumber(EiInfo inInfo){ public EiInfo queryContractByNumber(EiInfo inInfo) {
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(inInfo.getString("contractNumber")); HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(inInfo.getString("contractNumber"));
inInfo.set("hgcw002",hgcw002); inInfo.set("hgcw002", hgcw002);
return inInfo; return inInfo;
} }
} }
...@@ -70,6 +70,8 @@ public class ServiceHGCW002A extends ServiceBase { ...@@ -70,6 +70,8 @@ public class ServiceHGCW002A extends ServiceBase {
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")) {
params.get(0).put("custCode",params.get(0).get("usercode"));
params.get(0).put("custName",params.get(0).get("username"));
inInfo = super.query(inInfo,HGPZ002.QUERY, new HGPZ002(),false,new HGPZ002().eiMetadata,EiConstant.queryBlock, "partyAResult", "partyAResult"); inInfo = super.query(inInfo,HGPZ002.QUERY, new HGPZ002(),false,new HGPZ002().eiMetadata,EiConstant.queryBlock, "partyAResult", "partyAResult");
List<HGPZ002> hgpz002List = MapUtils.toDaoEPBases(inInfo.getBlock("partyAResult").getRows(), HGPZ002.class); List<HGPZ002> hgpz002List = MapUtils.toDaoEPBases(inInfo.getBlock("partyAResult").getRows(), HGPZ002.class);
if (CollectionUtils.isNotEmpty(hgpz002List)) { if (CollectionUtils.isNotEmpty(hgpz002List)) {
......
...@@ -516,7 +516,22 @@ ...@@ -516,7 +516,22 @@
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE like concat('%',#companyCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME like concat('%',#companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE like concat('%',#projCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like concat('%',#projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER like concat('%',#contractNumber#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
CONTRACT_NAME like concat('%',#contractName#, '%')
</isNotEmpty> </isNotEmpty>
<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>
...@@ -530,6 +545,12 @@ ...@@ -530,6 +545,12 @@
<isNotEmpty prepend=" AND " property="contractTyps"> <isNotEmpty prepend=" AND " property="contractTyps">
CONTRACT_TYPE IN <iterate close=")" open="(" conjunction="," property="contractTyps">#contractTyps[]#</iterate> CONTRACT_TYPE IN <iterate close=")" open="(" conjunction="," property="contractTyps">#contractTyps[]#</iterate>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A like concat('%',#partyA#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyB">
PARTY_B like concat('%',#partyB#, '%')
</isNotEmpty>
ORDER BY CONTRACT_TYPE asc, CONTRACT_NUMBER desc ORDER BY CONTRACT_TYPE asc, CONTRACT_NUMBER desc
</select> </select>
...@@ -542,7 +563,22 @@ ...@@ -542,7 +563,22 @@
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE like concat('%',#companyCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME like concat('%',#companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE like concat('%',#projCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like concat('%',#projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER like concat('%',#contractNumber#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
CONTRACT_NAME like concat('%',#contractName#, '%')
</isNotEmpty> </isNotEmpty>
<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>
...@@ -635,6 +671,18 @@ ...@@ -635,6 +671,18 @@
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate> <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
</isNotEqual> </isNotEqual>
<isNotEmpty prepend=" AND " property="projCode">
a.PROJ_CODE like concat('%',#projCode#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
a.PROJ_NAME like concat('%',#projName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
a.CONTRACT_NUMBER like concat('%',#contractNumber#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
a.CONTRACT_NAME like concat('%',#contractName#,'%')
</isNotEmpty>
ORDER BY a.CONTRACT_NUMBER ORDER BY a.CONTRACT_NUMBER
</select> </select>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
CUST_TYPE = #custType# CUST_TYPE = #custType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="custCode"> <isNotEmpty prepend=" AND " property="custCode">
CUST_CODE = #custCode# CUST_CODE LIKE CONCAT('%', #custCode#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="custName"> <isNotEmpty prepend=" AND " property="custName">
CUST_NAME LIKE CONCAT('%', #custName#, '%') CUST_NAME LIKE CONCAT('%', #custName#, '%')
......
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