java110 лет назад: 4
Родитель
Сommit
50e34d5ca1

+ 19 - 6
java110-db/src/main/resources/mapper/report/ReportOweFeeServiceDaoImplMapper.xml

@@ -87,9 +87,6 @@
     <update id="updateReportOweFeeInfo" parameterType="Map">
         update report_owe_fee t
         <set>
-            <if test="newBId != null and newBId != ''">
-                t.b_id = #{newBId},
-            </if>
             <if test="configName !=null and configName != ''">
                  t.config_name= #{configName},
             </if>
@@ -126,9 +123,7 @@
             <if test="endTime !=null and endTime != ''">
                  t.end_time= #{endTime},
             </if>
-            <if test="communityId !=null and communityId != ''">
-                 t.community_id= #{communityId},
-            </if>
+
             <if test="payerObjType !=null and payerObjType != ''">
                  t.payer_obj_type= #{payerObjType},
             </if>
@@ -138,7 +133,25 @@
         </set>
         where 1=1
             and t.owe_id= #{oweId}
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+    </update>
+
 
+    <!-- 修改欠费统计信息 add by wuxw 2018-07-03 -->
+    <update id="deleteReportOweFeeInfo" parameterType="Map">
+        delete from report_owe_fee
+        where 1=1
+        <if test="oweId !=null and oweId != ''">
+            and owe_id= #{oweId}
+        </if>
+        <if test="feeId !=null and feeId != ''">
+            and fee_id = #{feeId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and community_id= #{communityId}
+        </if>
     </update>
 
     <!-- 查询欠费统计数量 add by wuxw 2018-07-03 -->

+ 112 - 0
service-job/src/main/java/com/java110/job/adapt/fee/DeleteFeeRefreshReportAdapt.java

@@ -0,0 +1,112 @@
+package com.java110.job.adapt.fee;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.entity.order.Business;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.intf.fee.IFeeInnerServiceSMO;
+import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
+import com.java110.intf.report.IReportFeeYearCollectionInnerServiceSMO;
+import com.java110.intf.report.IReportOweFeeInnerServiceSMO;
+import com.java110.job.adapt.DatabusAdaptImpl;
+import com.java110.po.fee.PayFeePo;
+import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+import com.java110.po.reportFeeYearCollection.ReportFeeYearCollectionPo;
+import com.java110.po.reportOweFee.ReportOweFeePo;
+import com.java110.utils.util.BeanConvertUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 缴费收据处理
+ *
+ * @author fqz
+ * @date 2020-12-11  18:54
+ */
+@Component(value = "deleteFeeRefreshReportAdapt")
+public class DeleteFeeRefreshReportAdapt extends DatabusAdaptImpl {
+
+    private static Logger logger = LoggerFactory.getLogger(DeleteFeeRefreshReportAdapt.class);
+
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMO;
+
+
+    @Autowired
+    private IFeeInnerServiceSMO feeInnerServiceSMOImpl;
+
+
+    @Autowired
+    private IReportOweFeeInnerServiceSMO reportOweFeeInnerServiceSMOImpl;
+
+    @Autowired
+    private IReportFeeYearCollectionInnerServiceSMO reportFeeYearCollectionInnerServiceSMOImpl;
+
+    @Autowired
+    private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
+
+    //模板信息推送地址
+    private static String sendMsgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
+
+    public final static String ALI_SMS_DOMAIN = "ALI_SMS";
+
+    @Override
+    public void execute(Business business, List<Business> businesses) {
+        JSONObject data = business.getData();
+        JSONArray businessPayFees = null;
+        if (data.containsKey(PayFeePo.class.getSimpleName())) {
+            Object bObj = data.get(PayFeePo.class.getSimpleName());
+            if (bObj instanceof JSONObject) {
+                businessPayFees = new JSONArray();
+                businessPayFees.add(bObj);
+            } else if (bObj instanceof Map) {
+                businessPayFees = new JSONArray();
+                businessPayFees.add(JSONObject.parseObject(JSONObject.toJSONString(bObj)));
+            } else if (bObj instanceof List) {
+                businessPayFees = JSONArray.parseArray(JSONObject.toJSONString(bObj));
+            } else {
+                businessPayFees = (JSONArray) bObj;
+            }
+        } else {
+            return;
+        }
+
+        if (businessPayFees == null) {
+            return;
+        }
+        for (int bPayFeeIndex = 0; bPayFeeIndex < businessPayFees.size(); bPayFeeIndex++) {
+            JSONObject businessPayFee = businessPayFees.getJSONObject(bPayFeeIndex);
+            doPayFee(business, businessPayFee);
+        }
+    }
+
+    private void doPayFee(Business business, JSONObject businessPayFee) {
+        //查询缴费明细
+        PayFeePo payFeePo = BeanConvertUtil.covertBean(businessPayFee, PayFeePo.class);
+        //查询欠费报表
+        ReportOweFeePo reportOweFeePo = new ReportOweFeePo();
+        reportOweFeePo.setFeeId(payFeePo.getFeeId());
+        reportOweFeePo.setCommunityId(payFeePo.getCommunityId());
+        reportOweFeeInnerServiceSMOImpl.deleteReportOweFee(reportOweFeePo);
+
+
+        ReportFeeYearCollectionPo reportFeeYearCollectionPo = new ReportFeeYearCollectionPo();
+        reportFeeYearCollectionPo.setFeeId(payFeePo.getFeeId());
+        reportFeeYearCollectionPo.setCommunityId(payFeePo.getCommunityId());
+        reportFeeYearCollectionInnerServiceSMOImpl.deleteReportFeeYearCollection(reportFeeYearCollectionPo);
+
+        ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
+        reportFeeMonthStatisticsPo.setFeeId(payFeePo.getFeeId());
+        reportFeeMonthStatisticsPo.setCommunityId(payFeePo.getCommunityId());
+        reportFeeMonthStatisticsInnerServiceSMOImpl.deleteReportFeeMonthStatistics(reportFeeMonthStatisticsPo);
+
+
+    }
+
+
+}

+ 2 - 0
service-report/src/main/java/com/java110/report/dao/IReportOweFeeServiceDao.java

@@ -49,6 +49,8 @@ public interface IReportOweFeeServiceDao {
      */
     void updateReportOweFeeInfo(Map info) throws DAOException;
 
+    void deleteReportOweFeeInfo(Map info) throws DAOException;
+
 
     /**
      * 查询欠费统计总数

+ 17 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportOweFeeServiceDaoImpl.java

@@ -76,6 +76,23 @@ public class ReportOweFeeServiceDaoImpl extends BaseServiceDao implements IRepor
             throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改欠费统计信息Instance数据失败:"+ JSONObject.toJSONString(info));
         }
     }
+    /**
+     * 修改欠费统计信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void deleteReportOweFeeInfo(Map info) throws DAOException {
+        logger.debug("修改欠费统计信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("reportOweFeeServiceDaoImpl.deleteReportOweFeeInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改欠费统计信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
 
      /**
      * 查询欠费统计数量

+ 1 - 1
service-report/src/main/java/com/java110/report/smo/impl/ReportOweFeeInnerServiceSMOImpl.java

@@ -47,7 +47,7 @@ public class ReportOweFeeInnerServiceSMOImpl extends BaseServiceSMO implements I
     public int deleteReportOweFee(@RequestBody ReportOweFeePo reportOweFeePo) {
         int saveFlag = 1;
         reportOweFeePo.setStatusCd("1");
-        reportOweFeeServiceDaoImpl.updateReportOweFeeInfo(BeanConvertUtil.beanCovertMap(reportOweFeePo));
+        reportOweFeeServiceDaoImpl.deleteReportOweFeeInfo(BeanConvertUtil.beanCovertMap(reportOweFeePo));
         return saveFlag;
     }