Commit 60b613c3 by yukang

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

# Conflicts:
#	src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
parents ae6d0b7d 8596a267
...@@ -94,10 +94,10 @@ public class HGCW010 extends DaoEPBase { ...@@ -94,10 +94,10 @@ public class HGCW010 extends DaoEPBase {
private String settlementNumber = " "; /* 来源单号*/ private String settlementNumber = " "; /* 来源单号*/
private String billTybe = " "; /* 票据类型*/ private String billTybe = " "; /* 票据类型*/
private String billNumber = " "; /* 发票号*/ private String billNumber = " "; /* 发票号*/
private String billState = " "; /* 开票状态*/ private Integer billState; /* 开票状态*/
private String signingDate = " "; /* 开票日期*/ private String signingDate = " "; /* 开票日期*/
private String partyA = " "; /* 客户名称*/ private String partyA = " "; /* 客户名称*/
private Boolean reviewStatus; /* 审批状态*/ private Integer reviewStatus; /* 审批状态*/
private String thisSettlementTax = " "; /* 税额*/ private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/ private String thisSettlementAmount = " "; /* 不含税金额*/
private String taxPoints = " "; /* 税率*/ private String taxPoints = " "; /* 税率*/
...@@ -381,7 +381,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -381,7 +381,7 @@ public class HGCW010 extends DaoEPBase {
* get the billState - 开票状态. * get the billState - 开票状态.
* @return the billState * @return the billState
*/ */
public String getBillState() { public Integer getBillState() {
return this.billState; return this.billState;
} }
...@@ -390,7 +390,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -390,7 +390,7 @@ public class HGCW010 extends DaoEPBase {
* *
* @param billState - 开票状态 * @param billState - 开票状态
*/ */
public void setBillState(String billState) { public void setBillState(Integer billState) {
this.billState = billState; this.billState = billState;
} }
/** /**
...@@ -429,7 +429,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -429,7 +429,7 @@ public class HGCW010 extends DaoEPBase {
* get the reviewStatus - 审批状态. * get the reviewStatus - 审批状态.
* @return the reviewStatus * @return the reviewStatus
*/ */
public Boolean getReviewStatus() { public Integer getReviewStatus() {
return this.reviewStatus; return this.reviewStatus;
} }
...@@ -438,7 +438,7 @@ public class HGCW010 extends DaoEPBase { ...@@ -438,7 +438,7 @@ public class HGCW010 extends DaoEPBase {
* *
* @param reviewStatus - 审批状态 * @param reviewStatus - 审批状态
*/ */
public void setReviewStatus(Boolean reviewStatus) { public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus; this.reviewStatus = reviewStatus;
} }
/** /**
...@@ -642,10 +642,10 @@ public class HGCW010 extends DaoEPBase { ...@@ -642,10 +642,10 @@ public class HGCW010 extends DaoEPBase {
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber)); setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe)); setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber)); setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber));
setBillState(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState)); setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate)); setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA)); setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus)); setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax)); setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount)); setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
setTaxPoints(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints)); setTaxPoints(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
......
package com.baosight.hggp.hg.cw.domain; package com.baosight.hggp.hg.cw.domain;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
...@@ -12,12 +13,13 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -12,12 +13,13 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Project: <br> * Project: <br>
* Title:HGCW012.java <br> * Title:HGCW012.java <br>
* Description: <br> * Description: <br>
* yukang *
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-27 16:53:39 create * @history 2024-05-30 14:16:59 create
*/ */
public class HGCW012 extends DaoEPBase { public class HGCW012 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -44,6 +46,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -44,6 +46,7 @@ public class HGCW012 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -67,6 +70,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -67,6 +70,7 @@ public class HGCW012 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT"; /* 剩余开票/收票金额*/
public static final String QUERY = "HGCW012.query"; public static final String QUERY = "HGCW012.query";
public static final String COUNT = "HGCW012.count"; public static final String COUNT = "HGCW012.count";
...@@ -84,7 +88,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -84,7 +88,7 @@ public class HGCW012 extends DaoEPBase {
private Integer billState = new Integer(0); /* 开票状态*/ private Integer billState = new Integer(0); /* 开票状态*/
private String signingDate = " "; /* 开票日期*/ private String signingDate = " "; /* 开票日期*/
private String partyA = " "; /* 供应商名称*/ private String partyA = " "; /* 供应商名称*/
private Boolean reviewStatus; /* 审批状态*/ private Integer reviewStatus; /* 审批状态*/
private Integer taxPoints = new Integer(0); /* 税率*/ private Integer taxPoints = new Integer(0); /* 税率*/
private String thisSettlementTax = " "; /* 税额*/ private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/ private String thisSettlementAmount = " "; /* 不含税金额*/
...@@ -96,6 +100,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -96,6 +100,7 @@ public class HGCW012 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/ private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/ private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -145,7 +150,6 @@ public class HGCW012 extends DaoEPBase { ...@@ -145,7 +150,6 @@ public class HGCW012 extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REVIEW_STATUS); eiColumn = new EiColumn(FIELD_REVIEW_STATUS);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("审批状态"); eiColumn.setDescName("审批状态");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -196,6 +200,13 @@ public class HGCW012 extends DaoEPBase { ...@@ -196,6 +200,13 @@ public class HGCW012 extends DaoEPBase {
eiColumn.setDescName("部门编码"); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
} }
...@@ -370,7 +381,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -370,7 +381,7 @@ public class HGCW012 extends DaoEPBase {
* get the reviewStatus - 审批状态. * get the reviewStatus - 审批状态.
* @return the reviewStatus * @return the reviewStatus
*/ */
public Boolean getReviewStatus() { public Integer getReviewStatus() {
return this.reviewStatus; return this.reviewStatus;
} }
...@@ -379,7 +390,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -379,7 +390,7 @@ public class HGCW012 extends DaoEPBase {
* *
* @param reviewStatus - 审批状态 * @param reviewStatus - 审批状态
*/ */
public void setReviewStatus(Boolean reviewStatus) { public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus; this.reviewStatus = reviewStatus;
} }
/** /**
...@@ -559,6 +570,22 @@ public class HGCW012 extends DaoEPBase { ...@@ -559,6 +570,22 @@ public class HGCW012 extends DaoEPBase {
this.depCode = depCode; this.depCode = depCode;
} }
/** /**
* get the remainingAmount - 剩余开票/收票金额.
* @return the remainingAmount
*/
public BigDecimal getRemainingAmount() {
return this.remainingAmount;
}
/**
* set the remainingAmount - 剩余开票/收票金额.
*
* @param remainingAmount - 剩余开票/收票金额
*/
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -576,7 +603,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -576,7 +603,7 @@ public class HGCW012 extends DaoEPBase {
setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState)); setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate)); setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA)); setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus)); setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints)); setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax)); setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount)); setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
...@@ -588,6 +615,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -588,6 +615,7 @@ public class HGCW012 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
} }
/** /**
...@@ -619,6 +647,7 @@ public class HGCW012 extends DaoEPBase { ...@@ -619,6 +647,7 @@ public class HGCW012 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
return map; return map;
} }
......
package com.baosight.hggp.hg.cw.domain; package com.baosight.hggp.hg.cw.domain;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
...@@ -16,8 +17,9 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,8 +17,9 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-27 16:30:51 create * @history 2024-05-30 14:16:59 create
*/ */
public class HGCW013 extends DaoEPBase { public class HGCW013 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -2,22 +2,24 @@ package com.baosight.hggp.hg.cw.service; ...@@ -2,22 +2,24 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW010; import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW010A;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO; import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; 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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.*; import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* @author yukang * @author yukang
...@@ -31,129 +33,38 @@ public class ServiceHGCW010A extends ServiceBase { ...@@ -31,129 +33,38 @@ public class ServiceHGCW010A extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010A().eiMetadata);
inInfo.addBlock("detail1").addBlockMeta(new HGCW010().eiMetadata);
inInfo.addBlock("detail2").addBlockMeta(new HGCW010().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 甲方名称查询 * 查询操作
* 合同类别为收入时,乙方为组织机构中的公司,甲方选择客户档案里的客户;数据提交之后需要把客户档案中的客户类别更新为正式客户 *
* 合同类别为支出时,甲方为组织机构中的公司,乙方选择供应商档案里面的供应商 *
* @param inInfo
* @return
*/
public EiInfo partyAQuery(EiInfo inInfo) {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
if (contractCategory.equals("1")) {
List<HGPZ002> hgpz002List = HGPZTools.HgPz002.list(1);
if (CollectionUtils.isNotEmpty(hgpz002List)) {
hgpz002List.forEach(hgpz002 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz002.getCustCode());
userVO.setUsername(hgpz002.getCustName());
userVOList.add(userVO);
});
}
} else if (contractCategory.equals("2")) {
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
UserVO userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "甲方名称查询失败");
}
return inInfo;
}
/**
* 乙方名称查询
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo partyBQuery(EiInfo inInfo) { @OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try { try {
List<UserVO> userVOList = new ArrayList<>(); inInfo = super.query(inInfo, HGCW010A.QUERY, new HGCW010A());
String contractCategory = inInfo.getString("contractCategory"); } catch (Exception e) {
if (contractCategory.equals("1")) { LogUtils.setDetailMsg(inInfo, e, "查询失败");
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
UserVO userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
} else if (contractCategory.equals("2")) {
List<HGPZ003> hgpz003List = HGPZTools.HgPz003.list(4);
if (CollectionUtils.isNotEmpty(hgpz003List)) {
hgpz003List.forEach(hgpz003 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode());
userVO.setUsername(hgpz003.getSupName());
userVOList.add(userVO);
});
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "乙方名称查询失败");
} }
return inInfo; return inInfo;
} }
public EiInfo queryconteractComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
List<String> contractTypArray = new ArrayList<>();
if (StringUtils.isNotEmpty(inInfo.getString("contractNumber"))) {
map.put("contractNumber", inInfo.getString("contractNumber"));
}
if (StringUtils.isNotEmpty(inInfo.getString("settlementNumber"))) {
map.put("settlementNumber", inInfo.getString("settlementNumber"));
}
if (StringUtils.isNotEmpty(inInfo.getString("settlementNumbers"))) {
String[] settlementNumbers = inInfo.getString("settlementNumbers").split(",");
for (String c : settlementNumbers) {
contractTypArray.add(c);
}
map.put("settlementNumbers", contractTypArray);
}
List<HGCW010> HGCW010List = dao.query("HGCW010.queryconteractComboBox", map);
inInfo.addBlock("conteract_combo_box").setRows(HGCW010List);
return inInfo;
}
} }
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW011;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
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;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW011 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 HGCW011().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, HGCW011.QUERY, new HGCW011());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW011 HGCW011 = new HGCW011();
HGCW011.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW011.setCompanyCode(userVO.getUsercode());
HGCW011.setCompanyName(userVO.getUsername());
if (HGCW011.getId() == null || HGCW011.getId() == 0) {
this.add(HGCW011);
} else {
this.modify(HGCW011);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW011
* @return
*/
public void add(HGCW011 HGCW011) {
DaoUtils.insert("HGCW011.insert", HGCW011);
}
/**
* 修改操作
*
* @param HGCW011
* @return
*/
public void modify(HGCW011 HGCW011) {
DaoUtils.update("HGCW011.update", HGCW011);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW011.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service; package com.baosight.hggp.hg.cw.service;
import com.baosight.eplat.utils.StringUtils;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW012; import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW011;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO; import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -33,12 +39,12 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -33,12 +39,12 @@ public class ServiceHGCW012 extends ServiceBase {
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化") @OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID, CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false); DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW012().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW010().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
...@@ -51,11 +57,11 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -51,11 +57,11 @@ public class ServiceHGCW012 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) {
try { try {
inInfo = super.query(inInfo, HGCW012.QUERY, new HGCW012()); inInfo = super.query(inInfo, HGCW010.QUERY, new HGCW010());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
...@@ -68,23 +74,27 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -68,23 +74,27 @@ public class ServiceHGCW012 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();
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGCW012 HGCW012 = new HGCW012(); HGCW010 HGCW010 = new HGCW010();
HGCW012.fromMap(resultRows.get(i)); HGCW010.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany(); UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW012.setCompanyCode(userVO.getUsercode()); HGCW010.setCompanyCode(userVO.getUsercode());
HGCW012.setCompanyName(userVO.getUsername()); HGCW010.setCompanyName(userVO.getUsername());
HGCW010.setBillState(1);
HGCW010.setReviewStatus(0);
if (HGCW012.getId() == null || HGCW012.getId() == 0) { HGCW010.setSigningDate(DateUtils.formatShort(HGCW010.getSigningDate()));
this.add(HGCW012); // 获取项目名称
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(HGCW010.getProjCode());
HGCW010.setProjName(HGSC001.getProjName());
if (HGCW010.getId() == null || HGCW010.getId() == 0) {
this.add(HGCW010);
} else { } else {
this.modify(HGCW012); this.modify(HGCW010);
} }
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
...@@ -99,21 +109,21 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -99,21 +109,21 @@ public class ServiceHGCW012 extends ServiceBase {
/** /**
* 新增操作 * 新增操作
* *
* @param HGCW012 * @param HGCW010
* @return * @return
*/ */
public void add(HGCW012 HGCW012) { public void add(HGCW010 HGCW010) {
DaoUtils.insert("HGCW012.insert", HGCW012); DaoUtils.insert("HGCW010.insert", HGCW010);
} }
/** /**
* 修改操作 * 修改操作
* *
* @param HGCW012 * @param HGCW010
* @return * @return
*/ */
public void modify(HGCW012 HGCW012) { public void modify(HGCW010 HGCW010) {
DaoUtils.update("HGCW012.update", HGCW012); DaoUtils.update("HGCW010.update", HGCW010);
} }
/** /**
...@@ -122,12 +132,12 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -122,12 +132,12 @@ public class ServiceHGCW012 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "收款单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(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++) {
DaoUtils.update("HGCW012.delete", resultRows.get(i)); DaoUtils.update("HGCW010.delete", resultRows.get(i));
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -138,6 +148,68 @@ public class ServiceHGCW012 extends ServiceBase { ...@@ -138,6 +148,68 @@ public class ServiceHGCW012 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "收款单",operType = "插入",operDesc = "生成收款单")
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> queryRows = inInfo.getBlock(EiConstant.queryBlock).getRows();
String mainId = "";
if (CollectionUtils.isNotEmpty(queryRows)) {
mainId = queryRows.get(0).get("mainId").toString();
}
//获取相应的数据
List<HGCW011> hgcw011List = HGCWTools.HgCw011.mapToList(resultRows, NumberUtils.toLong(mainId));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
HGCW010 HGCW010 = new HGCW010();
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW010.setCompanyCode(userVO.getUsercode());
HGCW010.setCompanyName(userVO.getUsername());
HGCW010.setBillState(1);
HGCW010.setReviewStatus(0);
HGCW010.setSigningDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW010.setPartyA(hgcw011List.get(0).getPartyA());
this.add(HGCW010);
//生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
} else {
// 更新主表
HGCW010 HGCW010 = HGCWTools.HgCw010.getId(mainId);
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
this.modify(HGCW010);
// 生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
}
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
}
return inInfo;
}
} }
......
...@@ -294,32 +294,6 @@ ...@@ -294,32 +294,6 @@
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<select id="queryconteractComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
A.COMPANY_NAME as "companyName", <!-- 所属公司 -->
A.PROJ_CODE as "projCode", <!-- 项目编号 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
A.CONTRACT_NAME as "contractName", <!-- 合同名称 -->
A.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
A.THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税金 -->
A.THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 结算金额 -->
A.THIS_PRICE_TAX as "thisPriceTax", <!-- 税价合计 -->
B.CONTRACT_TYPE as "contractType" <!-- 合同类型 -->
FROM ${hggpSchema}.HGCW008 A LEFT JOIN ${hggpSchema}.HGCW002 B
ON A.PROJ_CODE = B.PROJ_CODE
AND A.CONTRACT_NUMBER = B.CONTRACT_NUMBER
AND A.COMPANY_CODE = B.COMPANY_CODE
WHERE 1=1 AND B.CONTRACT_TYPE = 1 AND A.SETTLEMENT_TYPE = 2
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
A.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
ORDER BY A.CONTRACT_NUMBER
</select>
<update id="updateDeductionAmount"> <update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW010 UPDATE ${hggpSchema}.HGCW010
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-27 16:53:39 Generate time : 2024-05-30 14:16:59
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGCW012 tableName : HGCW012
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
BILL_STATE TINYINT, BILL_STATE TINYINT,
SIGNING_DATE VARCHAR, SIGNING_DATE VARCHAR,
PARTY_A VARCHAR, PARTY_A VARCHAR,
REVIEW_STATUS TINYINT NOT NULL primarykey, REVIEW_STATUS TINYINT,
TAX_POINTS INTEGER, TAX_POINTS INTEGER,
THIS_SETTLEMENT_TAX VARCHAR, THIS_SETTLEMENT_TAX VARCHAR,
THIS_SETTLEMENT_AMOUNT VARCHAR, THIS_SETTLEMENT_AMOUNT VARCHAR,
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
UPDATED_BY VARCHAR NOT NULL, UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL, UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL, UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR DEP_CODE VARCHAR,
REMAINING_AMOUNT DECIMAL
--> -->
<sqlMap namespace="HGCW012"> <sqlMap namespace="HGCW012">
...@@ -96,10 +97,13 @@ ...@@ -96,10 +97,13 @@
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingAmount">
REMAINING_AMOUNT = #remainingAmount#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW012"> resultClass="com.baosight.hggp.hg.cw.service.HGCW012">
SELECT SELECT
ID as "id", ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
...@@ -122,7 +126,8 @@ ...@@ -122,7 +126,8 @@
UPDATED_BY as "updatedBy", <!-- 记录修改者 --> UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 --> UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 --> UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
REMAINING_AMOUNT as "remainingAmount" <!-- 剩余开票/收票金额 -->
FROM ${hggpSchema}.HGCW012 WHERE 1=1 FROM ${hggpSchema}.HGCW012 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -130,8 +135,7 @@ ...@@ -130,8 +135,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc, ID asc
REVIEW_STATUS asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -209,6 +213,9 @@ ...@@ -209,6 +213,9 @@
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingAmount">
REMAINING_AMOUNT = #remainingAmount#
</isNotEmpty>
--> -->
<insert id="insert"> <insert id="insert">
...@@ -233,15 +240,15 @@ ...@@ -233,15 +240,15 @@
UPDATED_BY, <!-- 记录修改者 --> UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 --> UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 --> UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
REMAINING_AMOUNT <!-- 剩余开票/收票金额 -->
) )
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #settlementNumber#, #billTybe#, #billNumber#, #billState#, #signingDate#, #partyA#, #reviewStatus#, #taxPoints#, #thisSettlementTax#, #thisSettlementAmount#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#) VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #settlementNumber#, #billTybe#, #billNumber#, #billState#, #signingDate#, #partyA#, #reviewStatus#, #taxPoints#, #thisSettlementTax#, #thisSettlementAmount#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #remainingAmount#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGCW012 WHERE DELETE FROM ${hggpSchema}.HGCW012 WHERE
ID = #id# AND ID = #id#
REVIEW_STATUS = #reviewStatus#
</delete> </delete>
<update id="update"> <update id="update">
...@@ -256,6 +263,7 @@ ...@@ -256,6 +263,7 @@
BILL_STATE = #billState#, <!-- 开票状态 --> BILL_STATE = #billState#, <!-- 开票状态 -->
SIGNING_DATE = #signingDate#, <!-- 开票日期 --> SIGNING_DATE = #signingDate#, <!-- 开票日期 -->
PARTY_A = #partyA#, <!-- 供应商名称 --> PARTY_A = #partyA#, <!-- 供应商名称 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审批状态 -->
TAX_POINTS = #taxPoints#, <!-- 税率 --> TAX_POINTS = #taxPoints#, <!-- 税率 -->
THIS_SETTLEMENT_TAX = #thisSettlementTax#, <!-- 税额 --> THIS_SETTLEMENT_TAX = #thisSettlementTax#, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#, <!-- 不含税金额 --> THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#, <!-- 不含税金额 -->
...@@ -266,10 +274,10 @@ ...@@ -266,10 +274,10 @@
UPDATED_BY = #updatedBy#, <!-- 记录修改者 --> UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 --> UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 --> DEP_CODE = #depCode#, <!-- 部门编码 -->
REMAINING_AMOUNT = #remainingAmount# <!-- 剩余开票/收票金额 -->
WHERE WHERE
ID = #id# AND ID = #id#
REVIEW_STATUS = #reviewStatus#
</update> </update>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-27 16:30:51 Generate time : 2024-05-30 14:16:59
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGCW013 tableName : HGCW013
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
UPDATED_TIME VARCHAR NOT NULL, UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR DEP_CODE VARCHAR
--> -->
<sqlMap namespace="HGCW013"> <sqlMap namespace="hgcw013">
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW013"> resultClass="com.baosight.hggp.hg.cw.service.Hgcw013">
SELECT SELECT
ID as "id", ID as "id",
MAIN_ID as "mainId", <!-- 主表ID --> MAIN_ID as "mainId", <!-- 主表ID -->
......
...@@ -301,6 +301,15 @@ public class HGCWTools { ...@@ -301,6 +301,15 @@ public class HGCWTools {
} }
public static class HgCw010 { public static class HgCw010 {
public static HGCW010 getId(String id) {
AssertUtils.isNull(id, "销售票据ID不能为空!");
List<HGCW010> results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) { public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!"); AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) { // if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
...@@ -323,6 +332,27 @@ public class HGCWTools { ...@@ -323,6 +332,27 @@ public class HGCWTools {
} }
} }
public static class HgCw011 {
public static List<HGCW011> mapToList(List<Map> rows, Long mainId) {
List<HGCW011> hgcw011List = new ArrayList<>();
if (CollectionUtils.isNotEmpty(rows)) {
rows.forEach(row -> {
HGCW011 hgcw011 = new HGCW011();
hgcw011.fromMap(row);
String contractNumber = row.get("settlementNumber").toString();
String remainingAmount = row.get("remainingAmount").toString();
hgcw011.setBillNumber(contractNumber);
hgcw011.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
if (mainId != null) {
hgcw011.setMainId(mainId);
}
hgcw011List.add(hgcw011);
});
}
return hgcw011List;
}
}
public static class HgCw012 { public static class HgCw012 {
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) { public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
......
...@@ -16,7 +16,7 @@ $(function() { ...@@ -16,7 +16,7 @@ $(function() {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>'; + 'onclick="contractDetailFunc(' + item.id + ')">明细详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>'; + 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template; return template;
...@@ -100,8 +100,8 @@ function windowCallback() { ...@@ -100,8 +100,8 @@ function windowCallback() {
function contractDetailFunc(id) { function contractDetailFunc(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGCW010C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW010", href: "HGCW011?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW011",
title: "<div style='text-align: center;'>合同详情</div>", title: "<div style='text-align: center;'>明细详情</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
callbackName: windowCallback callbackName: windowCallback
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<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="100" 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="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" width="120" 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="120" enable="false" readonly="true" align="center"/>
......
$(function() { $(function() {
// 查询 // 查询
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
query(); query();
}); });
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [10,20,30,50,100,200], pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
} }
},
} }
...@@ -55,79 +37,43 @@ $(window).load(function () { ...@@ -55,79 +37,43 @@ $(window).load(function () {
* 查询 * 查询
*/ */
let query = function () { let query = function () {
resultGrid.dataSource.page(2);
}
/**
* 结算单选择
*/
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
} }
function cancelFunc() {
function fileDetailFunc(id) { // 关闭弹窗
JSColorbox.open({ parent.JSColorbox.setValueCallback();
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=KP&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
} }
function submitFunc() { function btnSaveFunc() {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length != 1) { if (rows.length < 1) {
message("请选择一条数据"); message("请选择数据")
return; return;
} }
var flag = true; for (let i = 0; i < rows.length; i++) {
rows.forEach(function (row) { let thisAmount = rows[i]['thisAmount'];
if (row.reviewStatus == "3") { let remainingAmount = rows[i]['remainingAmount'];
message("勾选的数据中有已经提交的合同!"); if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
flag = false; message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字");
return;
} }
}) if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
if (flag) { return;
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW010", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
} }
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
} }
} else { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
NotificationUtil(ei, "error"); ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
} }
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
} }
}); );
} }
}); });
}
} }
...@@ -6,31 +6,38 @@ ...@@ -6,31 +6,38 @@
<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:EFRegion id="detail1" title="结算单明细">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/> <div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="项目编号" ename="projCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="所属公司" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center" /> <EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="合同号" width="120" serviceName="HGCW010" methodName="queryconteractComboBox" resultId="conteract_combo_box" enable="false" readonly="true" align="center" />
<EF:EFColumn ename="contractName" cname="合同名称" width="120" 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="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="thisSettlementTax" 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"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;"> <div class="row" style="display:flex;justify-content:center;">
......
...@@ -16,7 +16,7 @@ $(function() { ...@@ -16,7 +16,7 @@ $(function() {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>'; + 'onclick="contractDetailFunc(' + item.id + ')">明细详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>'; + 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template; return template;
...@@ -64,7 +64,7 @@ let query = function () { ...@@ -64,7 +64,7 @@ let query = function () {
*/ */
function addFunc() { function addFunc() {
JSColorbox.open({ JSColorbox.open({
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW012", href: "HGCW010A?methodName=initLoad&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>结算单</div>", title: "<div style='text-align: center;'>结算单</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
...@@ -82,7 +82,7 @@ function updateFunc() { ...@@ -82,7 +82,7 @@ function updateFunc() {
return; return;
} }
JSColorbox.open({ JSColorbox.open({
href: "HGCW012B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW012", href: "HGCW010B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>修改合同</div>", title: "<div style='text-align: center;'>修改合同</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
...@@ -100,8 +100,8 @@ function windowCallback() { ...@@ -100,8 +100,8 @@ function windowCallback() {
function contractDetailFunc(id) { function contractDetailFunc(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGCW012C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW012", href: "HGCW011?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW011",
title: "<div style='text-align: center;'>合同详情</div>", title: "<div style='text-align: center;'>明细详情</div>",
width: "90%", width: "90%",
height: "90%", height: "90%",
callbackName: windowCallback callbackName: windowCallback
...@@ -110,7 +110,7 @@ function contractDetailFunc(id) { ...@@ -110,7 +110,7 @@ function contractDetailFunc(id) {
function fileDetailFunc(id) { function fileDetailFunc(id) {
JSColorbox.open({ JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW012", href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>", title: "<div style='text-align: center;'>附件清单</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
...@@ -136,7 +136,7 @@ function submitFunc() { ...@@ -136,7 +136,7 @@ function submitFunc() {
ok: function () { ok: function () {
var info = new EiInfo(); var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result")); info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW012", "submit", info, { EiCommunicator.send("HGCW010", "submit", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try { try {
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDateSpan startCname="付款日期(从)" endCname="至" blockId="inqu_status" <EF:EFDateSpan startCname="开票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date" startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true"> format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan> </EF:EFDateSpan>
<EF:EFInput cname="供应商名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="票据类型" ename="billTybe" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="票据类型" ename="billTybe" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="审批状态" ename="inqu_status-0-billState" colWidth="3" filter="contains"> <EF:EFSelect cname="开票状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/> <EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect> </EF:EFSelect>
...@@ -27,17 +27,22 @@ ...@@ -27,17 +27,22 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<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="100" 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="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" 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="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billTybe" cname="票据类型" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="billTybe" cname="票据类型" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" cname="票日期" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="signingDate" 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="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"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="发票总额" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="totalContractPriceIncluding" cname="开票总额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billState" cname="开票状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.billState"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true" <EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" > columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/> <EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
......
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let thisAmount = rows[i]['thisAmount'];
let remainingAmount = rows[i]['remainingAmount'];
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
message("勾选的第" + (i + 1) + "行本次开票金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="结算单选择">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="项目编号" ename="projCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" hidden="true"/>
<EF:EFColumn ename="thisSettlementTax" 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="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#SELECT_BILL").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 结算单选择
*/
function addFunc() {
JSColorbox.open({
href: "HGCW012A?methodName=initLoad&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>结算单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW012B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW012C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>合同详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW012",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的合同!");
flag = false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW012", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="销售开票">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDateSpan startCname="付款日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="供应商名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="票据类型" ename="billTybe" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="审批状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="partyA" cname="供应商名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billTybe" cname="票据类型" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="signingDate" 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="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="发票总额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
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