jg-waiwang-pro
XI_TENG\xixi_ 4 months ago
commit c3da479153

@ -72,6 +72,8 @@
<result column="is_used" property="isUsed"/>
<result column="clear_weight" property="clearWeight"/>
<result column="order_no" property="orderNo"/>
<result column="sale_amount" property="saleAmount"/>
<result column="purchase_amount" property="purchaseAmount"/>
</resultMap>
<resultMap id="purchaseReturn" type="jnpf.entity.WarehousingStoragePoundlistEntity">
<id column="id" property="id"/>
@ -700,4 +702,12 @@
left join jg_business_order_product_relational e on d.id = e.business_order_id and b.product_id = e.product_id and e.f_delete_mark is null
where a.f_delete_mark is null and a.is_transfer = '2' and a.business_order_id = #{id}
</select>
<select id="queryAmountByBusinessOrder" resultType="java.util.Map">
select
IFNULL(SUM(a.sale_amount), 0 ) AS saleAmount,
IFNULL(SUM(a.purchase_amount), 0 ) AS purchaseAmount
from jg_voucher a
where a.f_delete_mark is null and a.is_transfer = '2' and a.business_order_id = #{id}
</select>
</mapper>

@ -15,6 +15,7 @@ import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* voucher
@ -48,4 +49,6 @@ public interface VoucherMapper extends BaseMapper<VoucherEntity> {
BigDecimal queryVoucherProductNetWeight(@Param("id") String id);
VoucherEntity queryVoucherDetail(@Param("id") String id);
BigDecimal queryVoucherByBusinessOrder(@Param("id") String id);
Map<String ,BigDecimal> queryAmountByBusinessOrder(@Param("id") String id);
}

@ -97,5 +97,5 @@ public interface BusinessOrderService extends IService<BusinessOrderEntity> {
void getPdfInfo(BusinessOrderEntity businessOrderEntity, HttpServletResponse response, String token) throws Exception;
BigDecimal getSaleAmountSumInfo(@Param("id") String id);
BigDecimal getSaleAmountSumInfo(String id);
}

@ -77,4 +77,5 @@ public interface VoucherService extends IService<VoucherEntity> {
VoucherEntity queryVoucherDetailInfo(String id);
BigDecimal queryVoucherProductNetWeightInfo(String id);
BigDecimal queryVoucherByBusinessOrderInfo(String id);
Map<String, BigDecimal> queryAmountByBusinessOrder(String id);
}

@ -1348,4 +1348,9 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
public BigDecimal queryVoucherByBusinessOrderInfo(String id) {
return voucherMapper.queryVoucherByBusinessOrder(id);
}
@Override
public Map<String, BigDecimal> queryAmountByBusinessOrder(String id) {
return voucherMapper.queryAmountByBusinessOrder(id);
}
}

@ -158,7 +158,12 @@ public class BusinessOrderController {
// }
// }
if (saleAmount!=null){
entity.setProfit(saleAmount.subtract(purchaseAmount));//利润
if (purchaseAmount.compareTo(BigDecimal.ZERO) == 0){
Map<String, BigDecimal> map = voucherService.queryAmountByBusinessOrder(entity.getId());
entity.setProfit(map.get("saleAmount").subtract(map.get("purchaseAmount")));
}else {
entity.setProfit(saleAmount.subtract(purchaseAmount));//利润
}
}
Map<String, Object> businessOrderMap=JsonUtil.entityToMap(entity);
businessOrderMap.put("id", businessOrderMap.get("id"));

@ -1737,6 +1737,14 @@ export default {
item.batchNo = undefined
item.inventoryNo = undefined
item.produceDate = undefined
item.saleNum = 0
item.grossWeight = 0
item.tareWeight = 0
item.buckleWeight = 0
item.netWeight = 0
item.clearWeight = 0
item.taxCount = 0
item.notTaxCount = 0
this.dataForm.deliveryProductRelationList.push(item)
this.childIndex = this.dataForm.deliveryProductRelationList.length - 1
this.isEdit = true

Loading…
Cancel
Save