7.11结算接口

jg-waiwang-pro
胡川虎 3 months ago
parent 8a97ed2152
commit 546e28cfc0

@ -117,7 +117,7 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id) storageNumber
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
@ -243,7 +243,7 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id) storageNumber
(SELECT SUM(storage_number) from jg_warehousing_storage_product where product_id = a.product_id and warehousing_storage_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
@ -284,15 +284,12 @@
a.ord_ln ordLn,
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id) storageNumber
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
LEFT JOIN jg_business_order c on a.business_order_id = c.id
LEFT JOIN jg_warehousing_outbound d on c.code = d.business_order_no
LEFT JOIN jg_warehousing_outbound_product e on (e.warehousing_outbound_id = d.id and e.product_id = a.product_id and e.ord_ln = a.ord_ln)
LEFT JOIN jg_business_cargo f on e.outbound_area_id = f.id
WHERE
a.business_order_id IN (
SELECT
@ -369,14 +366,12 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id) storageNumber
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id
LEFT JOIN jg_business_order c on a.business_order_id = c.id
LEFT JOIN jg_warehousing_outbound d on c.code = d.business_order_no
LEFT JOIN jg_warehousing_outbound_product e on (e.warehousing_outbound_id = d.id and e.product_id = a.product_id and e.ord_ln = a.ord_ln)
LEFT JOIN jg_business_cargo f on e.outbound_area_id = f.id
WHERE
a.business_order_id IN (
SELECT
@ -411,7 +406,7 @@
c.code businessCode,
d.document_no docmentNo,
f.cargo_name warehouseName,
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id) storageNumber
(SELECT SUM(outbound_number) from jg_warehousing_outbound_product where product_id = a.product_id and warehousing_outbound_id = d.id and ord_ln = a.ord_ln) storageNumber
FROM
jg_business_order_product_relational a
LEFT JOIN jg_product b ON a.product_id = b.id

@ -9,7 +9,6 @@
<result column="settlement_subject_name" property="settlementSubjectName"/>
<result column="settlement_state" property="settlementState"/>
<result column="payment_state" property="paymentState"/>
<result column="contract_code" property="contractCode"/>
<result column="docment_num" property="docmentNum"/>
<result column="settlement_amount" property="settlementAmount"/>
<result column="settlement_type" property="settlementType"/>
@ -34,11 +33,14 @@
<result column="f_last_modify_user_id" property="lastModifyUserId"/>
<result column="realName" property="realName"/>
<result column="realNameA" property="realNameA"/>
<result column="settlement_sum" property="settlementSum"/>
</resultMap>
<select id="queryCwsettlement" resultMap="cwsettlement">
SELECT
a.*,
e.contract_number AS contractCode,
e.contract_name AS contractName,
i.f_real_name AS realName,
i1.f_real_name AS realNameA
FROM
@ -56,6 +58,9 @@
IS NULL LEFT JOIN base_user i1 ON i1.f_Id = a.f_last_modify_user_id
AND i1.f_delete_mark
${ew.customSqlSegment}
<if test="cwsettlementPagination.keyword != null and cwsettlementPagination.keyword != ''">
AND (a.settlement_sum = #{cwsettlementPagination.keyword} OR a.settlement_subject_name like concat('%',#{cwsettlementPagination.keyword},'%') OR e.contract_name like concat('%',#{cwsettlementPagination.keyword},'%'))
</if>
GROUP BY
a.id
<if test="cwsettlementPagination.sidx != null and cwsettlementPagination.sidx != ''">

@ -481,12 +481,12 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
}
if(ObjectUtil.isNotEmpty(cwsettlementPagination.getSubjectId())){
cwsettlementNum++;
cwsettlementQueryWrapper.inSql("a.id", "SELECT settlement_id FROM jg_cw_settlement_subject WHERE subject_id = " + cwsettlementPagination.getSubjectId());
cwsettlementQueryWrapper.inSql("a.id", "SELECT settlement_id FROM jg_cw_settlement_subject WHERE subject_id = '" + cwsettlementPagination.getSubjectId() + "'");
}
if(ObjectUtil.isNotEmpty(cwsettlementPagination.getContractId())){
cwsettlementNum++;
cwsettlementQueryWrapper.inSql("a.id", "SELECT settlement_id FROM jg_cw_settlement_contract WHERE contract_id = " + cwsettlementPagination.getContractId());
cwsettlementQueryWrapper.inSql("a.id", "SELECT settlement_id FROM jg_cw_settlement_contract WHERE contract_id = '" + cwsettlementPagination.getContractId() + "'");
}
@ -976,19 +976,22 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
CwsettlementsummaryqueryWrapper.lambda().eq(CwsettlementsummaryEntity::getSettlementId, entity.getId());
cwsettlementsummaryService.remove(CwsettlementsummaryqueryWrapper);
}
BigDecimal settlementSum = new BigDecimal("0");
if (cwsettlementForm.getCwsettlementsummaryList()!=null){
List<CwsettlementsummaryEntity> tableField207 = JsonUtil.getJsonToList(cwsettlementForm.getCwsettlementsummaryList(),CwsettlementsummaryEntity.class);
for (int i=0;i<tableField207.size();i++){
tableField207.get(i).setId(RandomUtil.uuId());
tableField207.get(i).setSettlementId(entity.getId());
tableField207.get(i).setLineNo(String.valueOf(i));
settlementSum = settlementSum.add(tableField207.get(i).getSettlementSum());
if(isSave){
}else{
}
cwsettlementsummaryService.saveOrUpdate(tableField207.get(i));
}
}
entity.setSettlementSum(settlementSum);
this.updateById(entity);
//推送结算单到运管
/*if(ObjectUtil.equals(entity.getType(), "2")){
//销售

@ -148,4 +148,10 @@ public class CwsettlementEntity {
private String yunguanMassage;
@TableField("yunguan_time")
private Date yunguanTime;
@TableField("settlement_sum")
private BigDecimal settlementSum;
@TableField("apply_state")
private String applyState;
@TableField(exist = false)
private String contractName;
}

@ -166,4 +166,8 @@ public class CwsettlementForm {
private String yunguanMassage;
@JsonProperty("yunguanTime")
private Date yunguanTime;
@JsonProperty("settlementSum")
private BigDecimal settlementSum;
@JsonProperty("applyState")
private String applyState;
}

Loading…
Cancel
Save