Explorar el Código

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

Your Name hace 2 años
padre
commit
5dba6f9234

+ 1 - 1
java110-db/src/main/resources/mapper/fee/PayFeeDetailDiscountServiceDaoImplMapper.xml

@@ -222,7 +222,7 @@
 
     <!-- 计算费用优惠 -->
     <select id="computeDiscountFee" parameterType="Map" resultType="Map">
-        select t.detail_id detailId,sum(t.discount_price) discountPrice
+        select t.detail_id detailId,ifnull(sum(t.discount_price),0) discountPrice
         from pay_fee_detail_discount t
         where 1 =1
         <if test="detailIds !=null ">

+ 10 - 10
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -302,7 +302,7 @@
         from (
         select t.payer_obj_id
         from report_owe_fee t
-        left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
         left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
         <if test="feeTypeCd != null and feeTypeCd != ''">
             left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
@@ -347,7 +347,7 @@
         from (
             select t.payer_obj_id
             from report_owe_fee t
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+            inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             <if test="feeTypeCd != null and feeTypeCd != ''">
                 left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
@@ -392,7 +392,7 @@
         select count(1) from (
             select bu.floor_id,t.payer_obj_id
             from report_owe_fee t
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             <if test="feeTypeCd != null and feeTypeCd != ''">
                 left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
@@ -421,7 +421,7 @@
             select bu.floor_id,t.payer_obj_id
             from report_owe_fee t
             inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             where
             1=1
@@ -596,7 +596,7 @@
         select count(1) from (
             select pfc.fee_type_cd,t.payer_obj_id
             from report_owe_fee t
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
             where
@@ -623,7 +623,7 @@
         select pf.fee_type_cd,t.payer_obj_id
         from report_owe_fee t
         inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
-        left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
         left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
         where
         1=1
@@ -811,7 +811,7 @@
             select t.payer_ob_id
             from report_owe_fee t
             inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             where
             1=1
@@ -1021,7 +1021,7 @@
         select bu.floor_id,br.room_id
         from pay_fee_detail t
         INNER JOIN pay_fee pf1 on t.fee_id = pf1.fee_id and pf1.payer_obj_type='3333' and pf1.status_cd = '0'
-        LEFT JOIN building_room br on pf1.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner JOIN building_room br on pf1.payer_obj_id = br.room_id and br.status_cd = '0'
         left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
         where
         1=1
@@ -1090,7 +1090,7 @@
             select bu.floor_id,br.room_id
             from report_owe_fee t
             inner join pay_fee pf on pf.fee_id = t.fee_id and pf.status_cd = '0' and pf.state = '2008001'
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             where
             1=1
@@ -1105,7 +1105,7 @@
         select count(1) from (
             select bu.floor_id,br.room_id
             from report_owe_fee t
-            left join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
+        inner join building_room br on t.payer_obj_id = br.room_id and br.status_cd = '0'
             left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
             left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
             where

+ 31 - 0
service-acct/src/main/java/com/java110/acct/payment/business/account/PreStoreOnlinePaymentBusiness.java

@@ -6,12 +6,17 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.doc.annotation.*;
 import com.java110.dto.account.AccountDto;
+import com.java110.dto.account.AccountReceiptDto;
+import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.payment.PaymentOrderDto;
 import com.java110.intf.acct.IAccountInnerServiceSMO;
 import com.java110.intf.community.ICommunitySpacePersonTimeV1InnerServiceSMO;
 import com.java110.intf.community.ICommunitySpacePersonV1InnerServiceSMO;
 import com.java110.intf.community.ICommunitySpaceV1InnerServiceSMO;
+import com.java110.intf.fee.IAccountReceiptV1InnerServiceSMO;
+import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.po.account.AccountDetailPo;
+import com.java110.po.account.AccountReceiptPo;
 import com.java110.utils.util.Assert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -78,6 +83,12 @@ public class PreStoreOnlinePaymentBusiness implements IPaymentBusiness {
     @Autowired
     private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
 
+    @Autowired
+    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
+
+    @Autowired
+    private IAccountReceiptV1InnerServiceSMO accountReceiptV1InnerServiceSMOImpl;
+
     /**
      * @param context
      * @param reqJson{ personName:"",
@@ -133,5 +144,25 @@ public class PreStoreOnlinePaymentBusiness implements IPaymentBusiness {
         accountDetailPo.setObjId(accountDtos.get(0).getObjId());
         accountDetailPo.setObjType(accountDtos.get(0).getObjType());
         accountInnerServiceSMOImpl.prestoreAccount(accountDetailPo);
+
+        // todo 记录账户收款单
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setMemberId(accountDtos.get(0).getObjId());
+        //ownerDto.setCommunityId(accountDtos.get(0).getPartId());
+        List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
+        Assert.listOnlyOne(ownerDtos, "业主不存在");
+
+        AccountReceiptPo accountReceiptPo = new AccountReceiptPo();
+        accountReceiptPo.setOwnerId(accountDtos.get(0).getObjId());
+        accountReceiptPo.setOwnerName(ownerDtos.get(0).getName());
+        accountReceiptPo.setLink(ownerDtos.get(0).getLink());
+        accountReceiptPo.setArId(GenerateCodeFactory.getGeneratorId("11"));
+        accountReceiptPo.setAcctId(accountDto.getAcctId());
+        accountReceiptPo.setPrimeRate("5"); // 线上公众号
+        accountReceiptPo.setReceivableAmount(receivedAmount);
+        accountReceiptPo.setReceivedAmount(receivedAmount);
+        accountReceiptPo.setRemark("线上充值");
+        accountReceiptPo.setCommunityId(ownerDtos.get(0).getCommunityId());
+        accountReceiptV1InnerServiceSMOImpl.saveAccountReceipt(accountReceiptPo);
     }
 }