瀏覽代碼

1. 結算bug調整

wuhp 2 年之前
父節點
當前提交
fe5cb196cf

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.fnc.dao.ImportAsyncMapper;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
 import com.ydtech.modules.fnc.entity.ImportResult;
@@ -268,6 +269,9 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                 params.put("isOther", "1");
                 params.put("isNotCar", isNotCar);
                 InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
+                if(StringUtils.isNotEmpty(insPlyIncome.getTaskId())){
+                    throw  new SystemException("表中有已经结算的数据");
+                }
                 if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
                     open = false;
                     companyId = insPlyIncome.getCompanyId(); // 保险公司id
@@ -386,6 +390,9 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                 params.put("isOther", "1");
                 params.put("isNotCar", isNotCar);
                 InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
+                if(StringUtils.isNotEmpty(insPlyIncome.getTaskId())){
+                    throw  new SystemException("表中有已经结算的数据");
+                }
                 if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
                     open = false;
                     companyId = insPlyIncome.getCompanyId(); // 保险公司id

+ 2 - 4
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -1560,6 +1560,7 @@ handlingProportion,
     public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         params = this.saveParams(insPlyIncomeVo, params);
+        params.remove("handlingFeesStatus");
         List<InsPlyIncome> resultList = baseMapper.totalBxAmount(params);
         for (InsPlyIncome item : resultList) {
             BigDecimal commissionFeevalue = BigDecimal.ZERO;  //总金额
@@ -1569,7 +1570,6 @@ handlingProportion,
             BigDecimal unSettledAmount; //未结算金额
             params.put("partnerCompaniesId", item.getPartnerCompaniesId());
 
-            params.remove("handlingFeesStatus");
             List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);  //金额总数
             for (InsPlyIncome all : insPlyIncomes) {
                 commissionFeevalue = commissionFeevalue.add(all.getCommissionFeevalue());
@@ -2056,7 +2056,6 @@ handlingProportion,
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         HashMap<String, Object> params = new HashMap<>();
         params = this.saveParams(insPlyIncomeVo, params);
-
         BigDecimal sumCommissionFeevalue = BigDecimal.ZERO;  //总金额
         BigDecimal sumInvoicCommissionFeevalue = BigDecimal.ZERO; //开票未结算
         BigDecimal sumReadyCommissionFeevalue = BigDecimal.ZERO; // 已开票已结算
@@ -2073,8 +2072,7 @@ handlingProportion,
             BigDecimal noInvoicCommissionFeevalue = BigDecimal.ZERO; //未开票金额
             BigDecimal unSettledAmount; //未结算金额
             params.put("partnerCompaniesId", item.getPartnerCompaniesId());
-
-//            params.remove("handlingFeesStatus");
+            params.remove("handlingFeesStatus");
             List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);  //金额总数
             for (InsPlyIncome all : insPlyIncomes) {
                 commissionFeevalue = commissionFeevalue.add(all.getCommissionFeevalue());

+ 6 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -349,6 +349,12 @@ public class InsPlyIncomeVo implements Serializable {
     @ApiModelProperty(value = "结清状态")
     private String completionStatus;
 
+    @ApiModelProperty(value = "年度开始")
+    private String yearStrat;
+
+    @ApiModelProperty(value = "年度结束")
+    private String yearEnd;
+
 
 
 

+ 16 - 0
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -322,6 +322,10 @@
                 AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
 
             </if>
+
+            <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+            </if>
         </where>
         ORDER  BY  a.create_time  desc
 
@@ -685,6 +689,9 @@
                     AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
 
                 </if>
+                <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                    AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+                </if>
 
                 <if test="isOther !=null  and  isOther  !=''">
                     and a.is_not_documentary   =#{isOther}
@@ -813,6 +820,9 @@
                 <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
                     AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
                 </if>
+                <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                    AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+                </if>
 
                 <if test="isOther !=null  and  isOther  !=''">
                     and a.is_not_documentary   =#{isOther}
@@ -1188,6 +1198,9 @@
                 AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
 
             </if>
+            <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+            </if>
         </where>
         GROUP BY  a.partner_companies_id
     </select>
@@ -1631,6 +1644,9 @@
                    <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
                        AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
                    </if>
+                   <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                       AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+                   </if>
                </where>
                GROUP BY YEAR(a.signdate), MONTH(a.signdate)
            ) i

+ 3 - 1
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -89,6 +89,7 @@
                 and a.completion_status =#{completionStatus}
             </if>
         </where>
+        ORDER  BY  a.create_time desc
     </select>
 
     <select id="getOtherSettldetail" resultType="java.util.HashMap">
@@ -173,7 +174,6 @@
             </if>
             <if test="handlingFeesStatus !=null  and  handlingFeesStatus !=''">
                 a.handling_fees_status=#{handlingFeesStatus}
-
             </if>
         </where>
     </select>
@@ -246,6 +246,7 @@
                 and a.completion_status =#{completionStatus}
             </if>
         </where>
+        ORDER  BY  a.create_time desc
 
     </select>
 
@@ -303,6 +304,7 @@
                 and a.completion_status =#{completionStatus}
             </if>
         </where>
+        ORDER  BY  a.create_time desc
     </select>