Commit 21df8859 by liuyang

2024-07-26 采购开票选择采购收货逻辑调整

parent 00386c8f
......@@ -58,6 +58,7 @@ public class HGCG003B extends DaoEPBase {
public static final String FIELD_AMOUNT = "amount"; /* 金额(不含税金额)*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /* 存货类型大类*/
public static final String FIELD_PRIMARY_ID = "primaryId"; /* 主表id*/
public static final String FIELD_IS_INVOICING = "isInvoicing"; /*是否开票 0否 1是*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -138,6 +139,7 @@ public class HGCG003B extends DaoEPBase {
private BigDecimal amount = new BigDecimal("0"); /* 金额(不含税金额)*/
private Boolean inventTypeDetail; /* 存货类型大类*/
private Long primaryId = new Long(0); /* 主表id*/
private Integer isInvoicing = 0; /*是否开票 0-否 1-是*/
/**
* initialize the metadata.
......@@ -320,7 +322,9 @@ public class HGCG003B extends DaoEPBase {
eiColumn.setDescName("主表id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_INVOICING);
eiColumn.setDescName("是否开票");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -906,6 +910,15 @@ public class HGCG003B extends DaoEPBase {
public void setPrimaryId(Long primaryId) {
this.primaryId = primaryId;
}
public Integer getIsInvoicing() {
return isInvoicing;
}
public void setIsInvoicing(Integer isInvoicing) {
this.isInvoicing = isInvoicing;
}
/**
* get the value from Map.
*
......@@ -950,6 +963,7 @@ public class HGCG003B extends DaoEPBase {
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setInventTypeDetail(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setPrimaryId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PRIMARY_ID)), primaryId));
setIsInvoicing(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_INVOICING)), isInvoicing));
}
/**
......@@ -995,6 +1009,7 @@ public class HGCG003B extends DaoEPBase {
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_INVENT_TYPE_DETAIL, StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_PRIMARY_ID, StringUtils.toString(primaryId, eiMetadata.getMeta(FIELD_PRIMARY_ID)));
map.put(FIELD_IS_INVOICING, StringUtils.toString(isInvoicing, eiMetadata.getMeta(FIELD_IS_INVOICING)));
return map;
}
......
......@@ -151,7 +151,8 @@
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId" <!-- 主表id -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
IS_INVOICING as "isInvoicing"
FROM ${hggpSchema}.HGCG003A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -206,9 +207,10 @@
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL, <!-- 存货类型大类 -->
PRIMARY_ID <!-- 主表id -->
PRIMARY_ID, <!-- 主表id -->
IS_INVOICING
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#, #planNo#, #contractNo#, #inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#, #depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#, #inventTypeDetail#, #primaryId#)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#, #planNo#, #contractNo#, #inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#, #depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#, #inventTypeDetail#, #primaryId#,#isInvoicing#)
</insert>
<delete id="delete">
......@@ -253,9 +255,20 @@
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL = #inventTypeDetail#, <!-- 存货类型大类 -->
PRIMARY_ID = #primaryId# <!-- 主表id -->
PRIMARY_ID = #primaryId#, <!-- 主表id -->
IS_INVOICING = #isInvoicing#
WHERE
ID = #id#
</update>
<!-- 修改开票 -->
<update id="updateIsInvoicing">
UPDATE ${hggpSchema}.HGCG003A
SET
IS_INVOICING = #isInvoicing#,
<include refid="updateRevise"/>
WHERE RECEIVE_NO = #receiveNo#
</update>
</sqlMap>
......@@ -353,7 +353,7 @@ public class HGCGTools {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("receiveNo", receiveNo);
paramMap.put("isInvoicing", isInvoicing);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_IS_INVOICING, paramMap);
DaoUtils.update(HGSqlConstant.HgCw003A.UPDATE_IS_INVOICING, paramMap);
}
/**
......
......@@ -81,6 +81,13 @@ public class HGSqlConstant {
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
// 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
public class HgCw003A {
/**
* 模块名称:HGCW003A
*/
private static final String MODULE_NAME = "HGCW003A.";
public static final String UPDATE_IS_INVOICING = MODULE_NAME + "updateIsInvoicing";
}
......@@ -96,6 +103,17 @@ public class HGSqlConstant {
public static final String INVOICING = MODULE_NAME + "queryInvoicing";
}
public class HgCw012A {
/**
* 模块名称:HGCW012A
*/
private static final String MODULE_NAME = "HGCW012A.";
/**
* 查询采购已审核开票金额
*/
public static final String QUERY_HGCG003A = MODULE_NAME + "queryHgcg003a";
}
/**
* HGKC001 SQL 定义
*
......
......@@ -161,6 +161,7 @@ public class ServiceHGCW012 extends ServiceBase {
for (String settlementNumber : settlementNumbers) {
Map<String, BigDecimal> parmap = results.stream().filter(item-> Objects.equals(item.getSettlementNumber(), settlementNumber)).collect(Collectors.toMap(HGCW013::getSettlementNumber, HGCW013::getTotalContractPriceIncluding,(v1, v2) -> v2));
if (hgcw012.getContractType() == 1) {
// 更新采购收票状态
HGCGTools.HgCg003.updateIsInvoicing(settlementNumber, HGConstant.CgIsInvoicing.S_0);
DaoUtils.update(HGCW013.DELETE_MAIN, hgcw012);
}else if (hgcw012.getContractType() == 2){
......@@ -334,6 +335,7 @@ public class ServiceHGCW012 extends ServiceBase {
for (HGCW013 hgcw013 : hgcw013List) {
hgcw013.setMainId(hgcw012.getId());
hgcw013.setId(null);
//跟新采购收票状态
HGCGTools.HgCg003.updateIsInvoicing(hgcw013.getSettlementNumber(), HGConstant.CgIsInvoicing.S_1);
this.addHGCW013(hgcw013);
}
......
......@@ -4,7 +4,9 @@ import com.baosight.bpm.util.StringUtil;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.DateUtils;
......@@ -29,7 +31,6 @@ public class ServiceHGCW012A extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购开票",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
......@@ -62,7 +63,7 @@ public class ServiceHGCW012A extends ServiceBase {
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCG003.FIELD_STATUS, HGConstant.CgReceiveStatus.S_5);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCG003.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_0);
inInfo = super.query(inInfo, HGCG003.QUERY, new HGCG003());
inInfo = super.query(inInfo, HGSqlConstant.HgCw012A.QUERY_HGCG003A, new HGCG003B());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -415,6 +415,154 @@
ID = #id#
</update>
<select id="queryHgcg003a" resultClass="com.baosight.hggp.hg.cg.domain.HGCG003B">
SELECT
A.ID as "id",
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.SUP_CODE as "supCode", <!-- 供应商编码 -->
B.SUP_NAME as "supName", <!-- 供应商名称 -->
A.RECEIVE_DATE as "receiveDate", <!-- 收货日期 -->
A.RECEIVE_NO as "receiveNo", <!-- 收货单号 -->
A.PLAN_NO as "planNo", <!-- 计划单号 -->
A.CONTRACT_NO as "contractNo", <!-- 合同号 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.SPEC_ID as "specId", <!-- 规格ID -->
A.SPEC as "spec", <!-- 规格 -->
A.MATERIAL as "material", <!-- 材质 -->
A.UNIT as "unit", <!-- 单位 -->
A.LENGTH as "length", <!-- 长度 -->
A.WIDTH as "width", <!-- 宽度 -->
A.THICK as "thick", <!-- 厚度 -->
A.RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
A.DELIVER_QTY as "deliverQty", <!-- 退货数量 -->
A.DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
A.RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 -->
A.RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
A.STATUS as "status", <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
A.PRICE as "price", <!-- 单价 -->
A.AMOUNT as "amount", <!-- 金额(不含税金额) -->
A.INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
A.PRIMARY_ID as "primaryId", <!-- 主表id -->
A.CONTRACT_DETAIL_ID as "contractDetailId", <!-- 合同明细id -->
A.IS_INVOICING as "isInvoicing"
FROM ${hggpSchema}.HGCG003A A LEFT JOIN ${hggpSchema}.HGCG003 B ON A.PRIMARY_ID = B.ID
WHERE A.DELETE_FLAG = 0 and b.delete_flag = 0
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo">
A.RECEIVE_NO = #receiveNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNos">
A.RECEIVE_NO IN <iterate open="(" close=")" conjunction="," property="receiveNos">#receiveNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
A.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveDate">
A.RECEIVE_DATE = #receiveDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveNo">
A.RECEIVE_NO = #receiveNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planNo">
A.PLAN_NO = #planNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNo">
A.CONTRACT_NO = #contractNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
A.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
A.MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
A.UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
A.LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
A.WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
A.THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveQty">
A.RECEIVE_QTY = #receiveQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deliverQty">
A.DELIVER_QTY = #deliverQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositQty">
A.DEPOSIT_QTY = #depositQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveUnitWeight">
A.RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveWeight">
A.RECEIVE_WEIGHT = #receiveWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
A.STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="price">
A.PRICE = #price#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
A.AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
A.INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="primaryId">
A.PRIMARY_ID = #primaryId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractDetailId">
A.CONTRACT_DETAIL_ID = #contractDetailId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
A.RECEIVE_DATE >= #signingDateFrom#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
A.RECEIVE_DATE &lt;= #signingDateTo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isInvoicing">
A.IS_INVOICING = #isInvoicing#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.ID asc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -54,6 +54,7 @@ public class HGZL001 extends DaoEPBase {
public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/
public static final String FIELD_STATUS = "status"; /* 状态:0-质检中,1-质检完成*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_RECEIVE_DETAIL_ID = "receiveDetailId";
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -125,6 +126,7 @@ public class HGZL001 extends DaoEPBase {
private BigDecimal receiveWeight = new BigDecimal(0.000); /* 收货重量*/
private Integer status; /* 状态:0-质检中,1-质检完成*/
private Integer inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Long receiveDetailId = 0l;
/**
* initialize the metadata.
......@@ -284,6 +286,10 @@ public class HGZL001 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RECEIVE_DETAIL_ID);
eiColumn.setDescName("采购收货明细ID");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -797,6 +803,15 @@ public class HGZL001 extends DaoEPBase {
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
public Long getReceiveDetailId() {
return receiveDetailId;
}
public void setReceiveDetailId(Long receiveDetailId) {
this.receiveDetailId = receiveDetailId;
}
/**
* get the value from Map.
*
......@@ -837,6 +852,7 @@ public class HGZL001 extends DaoEPBase {
setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
setReceiveDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_RECEIVE_DETAIL_ID)), receiveDetailId));
}
/**
......@@ -878,6 +894,7 @@ public class HGZL001 extends DaoEPBase {
map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
map.put(FIELD_RECEIVE_DETAIL_ID,StringUtils.toString(receiveDetailId, eiMetadata.getMeta(FIELD_RECEIVE_DETAIL_ID)));
return map;
}
......
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