Commit af54a682 by 13420

销售开票,采购收票提交

parent 85cd7cac
......@@ -92,7 +92,7 @@ public class HGCW010 extends DaoEPBase {
private String projName = " "; /* 项目名称*/
private String projCode = " "; /* 项目编号*/
private String settlementNumber = " "; /* 来源单号*/
private String billTybe = " "; /* 票据类型*/
private Integer billTybe; /* 票据类型*/
private String billNumber = " "; /* 发票号*/
private Integer billState; /* 开票状态*/
private String signingDate = " "; /* 开票日期*/
......@@ -100,7 +100,7 @@ public class HGCW010 extends DaoEPBase {
private Integer reviewStatus; /* 审批状态*/
private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/
private String taxPoints = " "; /* 税率*/
private Integer taxPoints ; /* 税率*/
private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 开票总额*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
......@@ -349,7 +349,7 @@ public class HGCW010 extends DaoEPBase {
* get the billTybe - 票据类型.
* @return the billTybe
*/
public String getBillTybe() {
public Integer getBillTybe() {
return this.billTybe;
}
......@@ -358,7 +358,7 @@ public class HGCW010 extends DaoEPBase {
*
* @param billTybe - 票据类型
*/
public void setBillTybe(String billTybe) {
public void setBillTybe(Integer billTybe) {
this.billTybe = billTybe;
}
/**
......@@ -477,7 +477,7 @@ public class HGCW010 extends DaoEPBase {
* get the taxPoints - 税率.
* @return the taxPoints
*/
public String getTaxPoints() {
public Integer getTaxPoints() {
return this.taxPoints;
}
......@@ -486,7 +486,7 @@ public class HGCW010 extends DaoEPBase {
*
* @param taxPoints - 税率
*/
public void setTaxPoints(String taxPoints) {
public void setTaxPoints(Integer taxPoints) {
this.taxPoints = taxPoints;
}
/**
......@@ -640,7 +640,7 @@ public class HGCW010 extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
setBillTybe(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillTybe(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_TYBE)), billTybe));
setBillNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BILL_NUMBER)), billNumber));
setBillState(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_BILL_STATE)), billState));
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
......@@ -648,7 +648,7 @@ public class HGCW010 extends DaoEPBase {
setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
setTaxPoints(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
......
......@@ -29,6 +29,7 @@ public class HGCW010A extends DaoEPBase {
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_PARTY_A = "partyA"; /* 项目名称*/
public static final String FIELD_CONTRACT_NUMBER = "contractNumber"; /* 合同号*/
public static final String FIELD_CONTRACT_NAME = "contractName"; /* 合同名称*/
public static final String FIELD_SETTLEMENT_NUMBER = "settlementNumber"; /* 结算编号*/
......@@ -85,8 +86,8 @@ public class HGCW010A extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "HGCW008.query";
public static final String COUNT = "HGCW008.count";
public static final String QUERY = "HGCW010A.query";
public static final String COUNT = "HGCW010A.count";
public static final String INSERT = "HGCW008.insert";
public static final String UPDATE = "HGCW008.update";
public static final String DELETE = "HGCW008.delete";
......@@ -97,6 +98,7 @@ public class HGCW010A extends DaoEPBase {
private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String partyA = " "; /* 客户名称*/
private String contractNumber = " "; /* 合同号*/
private String contractName = " "; /* 合同名称*/
private String settlementNumber = " "; /* 结算编号*/
......@@ -160,6 +162,10 @@ public class HGCW010A extends DaoEPBase {
eiColumn.setDescName("合同名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARTY_A);
eiColumn.setDescName("客户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SETTLEMENT_NUMBER);
eiColumn.setDescName("结算编号");
eiMetadata.addMeta(eiColumn);
......@@ -375,6 +381,22 @@ public class HGCW010A extends DaoEPBase {
this.projName = projName;
}
/**
* get the partyA - 客户名称.
* @return the partyA
*/
public String getPartyA() {
return this.partyA;
}
/**
* set the partyA - 客户名称.
*
* @param partyA - 项目名称
*/
public void setPartyA(String partyA) {
this.partyA = partyA;
}
/**
* get the contractNumber - 合同号.
* @return the contractNumber
*/
......@@ -748,6 +770,7 @@ public class HGCW010A extends DaoEPBase {
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NUMBER)), contractNumber));
setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NAME)), contractName));
setSettlementNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SETTLEMENT_NUMBER)), settlementNumber));
......@@ -786,6 +809,7 @@ public class HGCW010A extends DaoEPBase {
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_PARTY_A, StringUtils.toString(partyA, eiMetadata.getMeta(FIELD_PARTY_A)));
map.put(FIELD_CONTRACT_NUMBER, StringUtils.toString(contractNumber, eiMetadata.getMeta(FIELD_CONTRACT_NUMBER)));
map.put(FIELD_CONTRACT_NAME, StringUtils.toString(contractName, eiMetadata.getMeta(FIELD_CONTRACT_NAME)));
map.put(FIELD_SETTLEMENT_NUMBER, StringUtils.toString(settlementNumber, eiMetadata.getMeta(FIELD_SETTLEMENT_NUMBER)));
......
......@@ -17,7 +17,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-05-28 18:02:47 create
* @history 2024-06-04 8:23:50 create
*/
public class HGCW011 extends DaoEPBase {
......@@ -86,7 +86,7 @@ public class HGCW011 extends DaoEPBase {
private String partyA = " "; /* 客户名称*/
private String thisSettlementTax = " "; /* 税额*/
private String thisSettlementAmount = " "; /* 不含税金额*/
private Boolean taxPoints; /* 税率*/
private Integer taxPoints = new Integer(0); /* 税率*/
private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 开票总额*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
......@@ -396,7 +396,7 @@ public class HGCW011 extends DaoEPBase {
* get the taxPoints - 税率.
* @return the taxPoints
*/
public Boolean getTaxPoints() {
public Integer getTaxPoints() {
return this.taxPoints;
}
......@@ -405,7 +405,7 @@ public class HGCW011 extends DaoEPBase {
*
* @param taxPoints - 税率
*/
public void setTaxPoints(Boolean taxPoints) {
public void setTaxPoints(Integer taxPoints) {
this.taxPoints = taxPoints;
}
/**
......@@ -556,7 +556,7 @@ public class HGCW011 extends DaoEPBase {
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setThisSettlementTax(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_TAX)), thisSettlementTax));
setThisSettlementAmount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_THIS_SETTLEMENT_AMOUNT)), thisSettlementAmount));
setTaxPoints(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTaxPoints(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_TAX_POINTS)), taxPoints));
setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
......
......@@ -25,6 +25,7 @@ import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -76,7 +77,7 @@ public class ServiceHGCW010 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "收款单",operType = "保存",operDesc = "保存")
@OperationLogAnnotation(operModul = "销售开票",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -134,12 +135,22 @@ public class ServiceHGCW010 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "收款单",operType = "删除",operDesc = "删除")
@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("HGCW010.delete", resultRows.get(i));
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
List<HGCW011> hgcw011List = HGCWTools.HgCw011.getMainId(HGCW010.getId());
if (CollectionUtils.isNotEmpty(hgcw011List)) {
for (HGCW011 hgcw011 : hgcw011List) {
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(),
hgcw011.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
DaoUtils.update("HGCW011.delete", hgcw011);
}
}
DaoUtils.update("HGCW010.delete", HGCW010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......@@ -150,7 +161,7 @@ public class ServiceHGCW010 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "收款单",operType = "插入",operDesc = "生成收款单")
@OperationLogAnnotation(operModul = "销售开票",operType = "插入",operDesc = "生成销售开票单")
public EiInfo select(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -165,53 +176,135 @@ public class ServiceHGCW010 extends ServiceBase {
if (CollectionUtils.isNotEmpty(hgcw011List)) {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
HGCW010 HGCW010 = new HGCW010();
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());
hgcw010.setCompanyCode(userVO.getUsercode());
hgcw010.setCompanyName(userVO.getUsername());
hgcw010.setBillTybe(1);
hgcw010.setReviewStatus(0);
hgcw010.setBillState(1);
hgcw010.setSigningDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
StringBuffer settlementNumber = new StringBuffer();
Map<String, BigDecimal> rowMap = new HashMap<>();
for (HGCW011 hgcw011 : hgcw011List) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
settlementNumber.append(hgcw011.getSettlementNumber()).append(",");
}
for (Map m : resultRows) {
String c = m.get("settlementNumber").toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount);
totalContractPriceIncluding = totalContractPriceIncluding.add(remainingAmount);
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW010.setPartyA(hgcw011List.get(0).getPartyA());
hgcw010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
hgcw010.setPartyA(hgcw011List.get(0).getPartyA());
hgcw010.setProjCode(hgcw011List.get(0).getProjCode());
hgcw010.setProjName(hgcw011List.get(0).getProjName());
hgcw010.setTaxPoints(hgcw011List.get(0).getTaxPoints());
hgcw010.setThisSettlementTax(hgcw011List.get(0).getThisSettlementTax());
hgcw010.setThisSettlementAmount(hgcw011List.get(0).getThisSettlementAmount());
hgcw010.setBillNumber(hgcw011List.get(0).getBillNumber());
hgcw010.setSettlementNumber(settlementNumber.toString().substring(0, settlementNumber.length() - 1));
this.add(hgcw010);
this.add(HGCW010);
//生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(HGCW010.getId());
hgcw011.setMainId(hgcw010.getId());
// 反写金额
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(),rowMap.get(hgcw011.getSettlementNumber()));
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
} else {
HGCW010 hgcw010 = HGCWTools.HgCw010.getId(mainId);
Map<String, BigDecimal> rowMap = new HashMap<>();
for (Map m : resultRows) {
String c = m.get("settlementNumber").toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount);
}
// 生成明细表
for (HGCW011 hgcw011 : hgcw011List) {
hgcw011.setMainId(hgcw010.getId());
// 反写金额
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(),rowMap.get(hgcw011.getSettlementNumber()));
this.addHGCW011(hgcw011);
}
List<HGCW011> hgcw011s = HGCWTools.HgCw011.getMainId(hgcw010.getId());
if (CollectionUtils.isNotEmpty(hgcw011s)) {
// 更新主表
HGCW010 HGCW010 = HGCWTools.HgCw010.getId(mainId);
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011List) {
StringBuffer settlementNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011s) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
settlementNumber.append(hgcw011.getSettlementNumber()).append(",");
}
hgcw010.setTotalContractPriceIncluding(totalContractPriceIncluding);
hgcw010.setPartyA(hgcw011s.get(0).getPartyA());
hgcw010.setProjCode(hgcw011s.get(0).getProjCode());
hgcw010.setProjName(hgcw011s.get(0).getProjName());
hgcw010.setTaxPoints(hgcw011List.get(0).getTaxPoints());
hgcw010.setThisSettlementTax(hgcw011List.get(0).getThisSettlementTax());
hgcw010.setThisSettlementAmount(hgcw011List.get(0).getThisSettlementAmount());
hgcw010.setBillNumber(hgcw011List.get(0).getBillNumber());
hgcw010.setSettlementNumber(settlementNumber.toString().substring(0, settlementNumber.length() - 1));
this.modify(hgcw010);
}
HGCW010.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
}inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据生成成功!");
}
}
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;
}
public void addHGCW011(HGCW011 HGCW011) {
DaoUtils.insert("HGCW011.insert", HGCW011);
}
/**
* 提交操作
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
HGCW010.setReviewStatus(3);
DaoUtils.update("HGCW010.submit", HGCW010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo writeoff(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
DaoUtils.update("HGCW010.writeoff", HGCW010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......
......@@ -35,8 +35,30 @@
-->
<sqlMap namespace="HGCW010A">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
T1.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(T1.CREATED_BY = #authOnlyPeople# OR T1.DEP_CODE IN <iterate close=")" open="(" conjunction=","
property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
T1.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
T1.DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
T1.ID = #id#
</isNotEmpty>
......@@ -55,6 +77,9 @@
<isNotEmpty prepend=" AND " property="projName">
T1.PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
B.PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
T1.CONTRACT_NUMBER like ('%$contractNumber$%')
</isNotEmpty>
......@@ -130,7 +155,7 @@
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW008">
resultClass="com.baosight.hggp.hg.cw.domain.HGCW010A">
SELECT
T1.ID as "id",
T1.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
......@@ -138,6 +163,7 @@
T1.COMPANY_NAME as "companyName", <!-- 公司名称 -->
T1.PROJ_CODE as "projCode", <!-- 项目编码 -->
T1.PROJ_NAME as "projName", <!-- 项目名称 -->
B.PARTY_A as "partyA",<!-- 客户名称 -->
T1.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
T1.CONTRACT_NAME as "contractName", <!-- 合同名称 -->
T1.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
......
<?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
Generate time : 2024-05-23 9:08:57
Generate time : 2024-06-04 8:23:50
Version : 1.0
schema : hggp
tableName : HGCW011
ID BIGINT NOT NULL primarykey,
MAIN_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
CONTRACT_NUMBER VARCHAR,
INCOME_NUMBER VARCHAR,
SIGNING_DATE VARCHAR,
PROJ_NAME VARCHAR,
PROJ_CODE VARCHAR,
SETTLEMENT_NUMBER VARCHAR,
BILL_NUMBER VARCHAR,
PARTY_A VARCHAR,
CANCEL_STATUS TINYINT,
REVIEW_STATUS TINYINT,
TOTAL_CONTRACT_PRICE_INCLUDING VARCHAR,
THIS_SETTLEMENT_TAX VARCHAR,
THIS_SETTLEMENT_AMOUNT VARCHAR,
TAX_POINTS INTEGER,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
......@@ -29,6 +32,9 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......@@ -38,23 +44,29 @@
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
......@@ -86,16 +98,19 @@
resultClass="com.baosight.hggp.hg.cw.domain.HGCW011">
SELECT
ID as "id",
MAIN_ID as "mainId", <!-- 主表ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
INCOME_NUMBER as "incomeNumber", <!-- 单号 -->
SIGNING_DATE as "signingDate", <!-- 付款日期 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
CANCEL_STATUS as "cancelStatus", <!-- 核销状态 -->
REVIEW_STATUS as "reviewStatus", <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 付款总额 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PROJ_CODE as "projCode", <!-- 项目编号 -->
SETTLEMENT_NUMBER as "settlementNumber", <!-- 来源单号 -->
BILL_NUMBER as "billNumber", <!-- 发票号 -->
PARTY_A as "partyA", <!-- 客户名称 -->
THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 不含税金额 -->
TAX_POINTS as "taxPoints", <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 开票总额 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
......@@ -125,6 +140,9 @@
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mainId">
MAIN_ID = #mainId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......@@ -134,23 +152,29 @@
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
<isNotEmpty prepend=" AND " property="thisSettlementTax">
THIS_SETTLEMENT_TAX = #thisSettlementTax#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thisSettlementAmount">
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
<isNotEmpty prepend=" AND " property="taxPoints">
TAX_POINTS = #taxPoints#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
......@@ -180,16 +204,19 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW011 (ID,
MAIN_ID, <!-- 主表ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
INCOME_NUMBER, <!-- 单号 -->
SIGNING_DATE, <!-- 付款日期 -->
PARTY_A, <!-- 供应商名称 -->
CANCEL_STATUS, <!-- 核销状态 -->
REVIEW_STATUS, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 付款总额 -->
PROJ_NAME, <!-- 项目名称 -->
PROJ_CODE, <!-- 项目编号 -->
SETTLEMENT_NUMBER, <!-- 来源单号 -->
BILL_NUMBER, <!-- 发票号 -->
PARTY_A, <!-- 客户名称 -->
THIS_SETTLEMENT_TAX, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT, <!-- 不含税金额 -->
TAX_POINTS, <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 开票总额 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
......@@ -198,7 +225,7 @@
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #mainId#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #settlementNumber#, #billNumber#, #partyA#, #thisSettlementTax#, #thisSettlementAmount#, #taxPoints#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
......@@ -209,16 +236,19 @@
<update id="update">
UPDATE ${hggpSchema}.HGCW011
SET
MAIN_ID = #mainId#, <!-- 主表ID -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
INCOME_NUMBER = #incomeNumber#, <!-- 单号 -->
SIGNING_DATE = #signingDate#, <!-- 付款日期 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
CANCEL_STATUS = #cancelStatus#, <!-- 核销状态 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 付款总额 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
SETTLEMENT_NUMBER = #settlementNumber#, <!-- 来源单号 -->
BILL_NUMBER = #billNumber#, <!-- 发票号 -->
PARTY_A = #partyA#, <!-- 客户名称 -->
THIS_SETTLEMENT_TAX = #thisSettlementTax#, <!-- 税额 -->
THIS_SETTLEMENT_AMOUNT = #thisSettlementAmount#, <!-- 不含税金额 -->
TAX_POINTS = #taxPoints#, <!-- 税率 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 开票总额 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
......
......@@ -304,12 +304,31 @@ public class HGCWTools {
public static HGCW010 getId(String id) {
AssertUtils.isNull(id, "销售票据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 updateAmount(Long id) {
AssertUtils.isNull(id, "收款单ID不能为空!");
HGCW010 hgcw010 = HGCWTools.HgCw010.getId(id.toString());
List<HGCW011> hgcw011s = HGCWTools.HgCw011.getMainId(hgcw010.getId());
if (CollectionUtils.isNotEmpty(hgcw011s)) {
// 更新主表
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW011 hgcw011 : hgcw011s) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw011.getTotalContractPriceIncluding());
}
hgcw010.setTotalContractPriceIncluding(totalContractPriceIncluding);
hgcw010.setPartyA(hgcw011s.get(0).getPartyA());
hgcw010.setProjCode(hgcw011s.get(0).getProjCode());
hgcw010.setProjName(hgcw011s.get(0).getProjName());
DaoUtils.update("HGCW010.update", hgcw010);
}
}
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
......@@ -334,23 +353,39 @@ public class HGCWTools {
}
public static class HgCw011 {
public static HGCW011 getId(Long id) {
AssertUtils.isNull(id, "销售开票单ID不能为空!");
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
public static List<HGCW011> mapToList(List<Map> rows, Long mainId) {
List<HGCW011> hgcw011List = new ArrayList<>();
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));
HGCW011 HGCW011 = new HGCW011();
HGCW011.fromMap(row);
String settlementNumber = row.get("settlementNumber").toString();
String remainingAmount = row.get("thisAmount").toString();
HGCW011.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
HGCW011.setSettlementNumber(settlementNumber);
if (mainId != null) {
hgcw011.setMainId(mainId);
HGCW011.setMainId(mainId);
}
hgcw011List.add(hgcw011);
HGCW011List.add(HGCW011);
});
}
return hgcw011List;
return HGCW011List;
}
public static List<HGCW011> getMainId(Long mainId) {
AssertUtils.isNull(mainId, "主表ID不能为空!");
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("mainId",mainId);}
});
return results;
}
}
......
......@@ -53,6 +53,7 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW010A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>
......
......@@ -83,7 +83,7 @@ function updateFunc() {
}
JSColorbox.open({
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%",
height: "90%",
callbackName: windowCallback
......
......@@ -59,17 +59,17 @@ function btnSaveFunc() {
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次开票金额不能大于剩余开票金额");
message("第" + (i + 1) + "行本次开票金额不能大于剩余结算金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售票据吗? ", {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成销售开票单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW010", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
// parent.JSColorbox.setValueCallback();
parent.JSColorbox.setValueCallback();
}
}
);
......@@ -77,3 +77,4 @@ function btnSaveFunc() {
});
}
......@@ -26,7 +26,8 @@
<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="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" 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="contractDate" cname="结算日期" width="120" enable="false" readonly="true" align="center"/>
......@@ -35,6 +36,7 @@
<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="thisAmount" cname="本次结算金额" width="120" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" readonly="true" align="center"/>
......
......@@ -10,14 +10,14 @@
<EF:EFRegion id="inqu" title="查询条件">
<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"
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="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:EFSelect cname="审核状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
......@@ -28,11 +28,10 @@
<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="140" 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="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="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"/>
......
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