利润修改

jg-waiwang-pro
XI_TENG\xixi_ 4 months ago
parent 13b2963693
commit 9409e944af

@ -705,6 +705,20 @@
where a.f_delete_mark is null and a.is_transfer = '2' and a.business_order_id = #{id}
</select>
<select id="queryVoucherByBusinessOrder1" resultType="java.math.BigDecimal">
SELECT
IFNULL( round( sum( d2.tax_count), 2), 0 ) AS purchaseAmount
FROM
jg_purchase_sale_relation a
LEFT JOIN jg_business_order b ON a.sale_order_id=b.id
LEFT JOIN jg_business_order c ON a.purchase_order_id=c.id
LEFT JOIN jg_business_order_product_relational d2 ON c.id=d2.business_order_id
WHERE
b.f_delete_mark is null and
b.id= #{id}
</select>
<select id="queryAmountByBusinessOrder" resultType="java.util.Map">
select
IFNULL(SUM(a.sale_amount), 0 ) AS saleAmount,

@ -49,6 +49,7 @@ public interface VoucherMapper extends BaseMapper<VoucherEntity> {
BigDecimal queryVoucherProductNetWeight(@Param("id") String id);
VoucherEntity queryVoucherDetail(@Param("id") String id);
BigDecimal queryVoucherByBusinessOrder(@Param("id") String id);
BigDecimal queryVoucherByBusinessOrder1(@Param("id") String id); //查询订单利润
Map<String ,BigDecimal> queryAmountByBusinessOrder(@Param("id") String id);

@ -77,6 +77,7 @@ public interface VoucherService extends IService<VoucherEntity> {
VoucherEntity queryVoucherDetailInfo(String id);
BigDecimal queryVoucherProductNetWeightInfo(String id);
BigDecimal queryVoucherByBusinessOrderInfo(String id);
BigDecimal queryVoucherByBusinessOrderInfo1(String id); //查询订单
Map<String, BigDecimal> queryAmountByBusinessOrder(String id);
void updateByVoucherCode(VoucherEntity voucherEntity);

@ -1383,6 +1383,11 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
return voucherMapper.queryVoucherByBusinessOrder(id);
}
@Override
public BigDecimal queryVoucherByBusinessOrderInfo1(String id) {
return voucherMapper.queryVoucherByBusinessOrder1(id);
}
@Override
public Map<String, BigDecimal> queryAmountByBusinessOrder(String id) {
return voucherMapper.queryAmountByBusinessOrder(id);

@ -165,6 +165,11 @@ public class BusinessOrderController {
entity.setProfit(saleAmount.subtract(purchaseAmount));//利润
}
}
if (entity.getProfit().compareTo(BigDecimal.ZERO) == 0){
purchaseAmount = voucherService.queryVoucherByBusinessOrderInfo1(entity.getId()); //采购订单总额
entity.setProfit(saleAmount.subtract(purchaseAmount));//利润
}
Map<String, Object> businessOrderMap=JsonUtil.entityToMap(entity);
businessOrderMap.put("id", businessOrderMap.get("id"));
//副表数据

@ -1036,9 +1036,9 @@
</JnpfInput>
</template>
</el-table-column> -->
<template v-if="!this.productCreate">
<template>
<el-table-column label="操作" width="70"
v-if="!judgeWrite('businessorderproductrelationalList')" fixed="right">
v-if="!judgeWrite('businessorderproductrelationalList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbusinessorderproductrelationalList(scope.$index)">删除</el-button>

Loading…
Cancel
Save