| @@ -25,8 +25,7 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> { | |||||
| List<Long> getShopIdList(WxAllBill record); | List<Long> getShopIdList(WxAllBill record); | ||||
| BigDecimal getMerchantAdvanceGroupSum(WxAllBill wxBillRent); | |||||
| BigDecimal getMerchantDepositGroupSum(WxAllBill wxBillRent); | |||||
| BigDecimal getRemainAdvanceSum(WxAllBill wxBillRent); | |||||
| List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill wxBillRent); | List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill wxBillRent); | ||||
| List<WxBillNotify> getBillNotifyList(WxAllBill record); | List<WxBillNotify> getBillNotifyList(WxAllBill record); | ||||
| @@ -57,8 +57,7 @@ public interface WxAllBillService { | |||||
| void completeBill(EnumBillStatus status,WxShop wxShop,MallUserInfo user); | void completeBill(EnumBillStatus status,WxShop wxShop,MallUserInfo user); | ||||
| BigDecimal getBillSetoffSum(WxAllBill wxBillRent); | |||||
| BigDecimal getBillDepositSum(WxAllBill wxBillRent); | |||||
| BigDecimal getRemainAdvanceSum(WxAllBill wxBillRent); | |||||
| List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill wxBillRent); | List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill wxBillRent); | ||||
| List<WxAllBill> list(WxAllBill record); | List<WxAllBill> list(WxAllBill record); | ||||
| @@ -545,17 +545,11 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||||
| } | } | ||||
| @Override | @Override | ||||
| public BigDecimal getBillSetoffSum(WxAllBill record) { | |||||
| public BigDecimal getRemainAdvanceSum(WxAllBill record) { | |||||
| updateQueryParam(record); | updateQueryParam(record); | ||||
| return wxAllBillMapper.getMerchantAdvanceGroupSum(record); | |||||
| return wxAllBillMapper.getRemainAdvanceSum(record); | |||||
| } | } | ||||
| @Override | |||||
| public BigDecimal getBillDepositSum(WxAllBill record) { | |||||
| updateQueryParam(record); | |||||
| return wxAllBillMapper.getMerchantDepositGroupSum(record); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill record) { | public List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill record) { | ||||
| updateQueryParam(record); | updateQueryParam(record); | ||||
| @@ -261,7 +261,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| abq.updateTenantInfo(record); | abq.updateTenantInfo(record); | ||||
| abq.setShopId(record.getId()); | abq.setShopId(record.getId()); | ||||
| abq.setDepositHasMoney(EnumYesOrNo.YES.getCode()); | abq.setDepositHasMoney(EnumYesOrNo.YES.getCode()); | ||||
| BigDecimal total = wxAllBillService.getBillDepositSum(abq); | |||||
| BigDecimal total = wxAllBillService.getRemainAdvanceSum(abq); | |||||
| if (null == total) { | if (null == total) { | ||||
| total = new BigDecimal(0); | total = new BigDecimal(0); | ||||
| } | } | ||||
| @@ -277,7 +277,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | ||||
| abq.setShopId(record.getId()); | abq.setShopId(record.getId()); | ||||
| abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | ||||
| BigDecimal total = wxAllBillService.getBillSetoffSum(abq); | |||||
| BigDecimal total = wxAllBillService.getRemainAdvanceSum(abq); | |||||
| if (null == total) { | if (null == total) { | ||||
| total = new BigDecimal(0); | total = new BigDecimal(0); | ||||
| } | } | ||||
| @@ -218,15 +218,8 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="getMerchantAdvanceGroupSum" parameterType="com.iformall.domain.po.WxAllBill" resultType="DECIMAL"> | |||||
| select sum(CAST(pay AS DECIMAL(20,2))) pay , sum(CAST(ifnull(use_money,'0') AS DECIMAL(20,2))) use_money | |||||
| from wx_all_bill | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="getMerchantDepositGroupSum" parameterType="com.iformall.domain.po.WxAllBill" resultType="DECIMAL"> | |||||
| select sum(CAST(pay AS DECIMAL(20,2))) pay , sum(CAST(ifnull(return_pay,'0') AS DECIMAL(20,2))) deposit_money | |||||
| <select id="getRemainAdvanceSum" parameterType="com.iformall.domain.po.WxAllBill" resultType="DECIMAL"> | |||||
| select sum(CAST(ifnull(pay,'0') AS DECIMAL(20,2)) - CAST(ifnull(return_pay,'0') AS DECIMAL(20,2)) - CAST(ifnull(use_money,'0') AS DECIMAL(20,2))) | |||||
| from wx_all_bill | from wx_all_bill | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||