Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/test' into test

785834757 2 rokov pred
rodič
commit
6efbb6406f

+ 2 - 2
src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java

@@ -45,7 +45,7 @@ public class RestTemplateConfig {
         //路由是对maxTotal的细分
         connectionManager.setDefaultMaxPerRoute(100);
         RequestConfig requestConfig = RequestConfig.custom()
-                .setSocketTimeout(60000)  //返回数据的超时时间
+                .setSocketTimeout(120000)  //返回数据的超时时间
                 .setConnectTimeout(3000) //连接上服务器的超时时间
                 .setConnectionRequestTimeout(1000) //从连接池中获取连接的超时时间
                 .build();
@@ -59,4 +59,4 @@ public class RestTemplateConfig {
                 .build();
     }
 
-}
+}

+ 6 - 6
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -221,11 +221,11 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
 //      通过银行卡id 查询卡包
         String fromBankCardId = sysUserAccountVo.getFromBankCardId();
         if (fromBankCardId != null) {
-            SysUserBankCard byId = sysUserBankCardService.getById(fromBankCardId);
-//            String bankUserId = byId.getUserId();
-//            if (!userId.equals(bankUserId)) {
-//                return HttpResult.ok("非本人提现");
-//            }
+//            SysUserBankCard byId = sysUserBankCardService.getById(fromBankCardId);
+            SysUserBankCard byId = sysUserBankCardService.getByBankNumber(fromBankCardId);
+            if (byId == null) {
+                throw new SystemException("该卡未绑定此账号,或输入卡号错误,或该账号尚未审核通过,请检查");
+            }
             byId.setIsDefault(1);
 
             sysAmountAuditingEntity.setBankNumber(byId.getBankNumber());
@@ -419,7 +419,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         }
          **/
         //预收手续费佣金
-        sysUserAccountVo.setWillHalding(willPromotion);
+        sysUserAccountVo.setWillHalding(willHalding);
         //预收非跟单佣金
         sysUserAccountVo.setWillDocumentary(willDocumentary);
         //实收手续费佣金

+ 0 - 1
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -31,7 +31,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.testng.annotations.Test;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;

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

@@ -159,7 +159,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    insPlyIncome.setTaskId(taskId);
+                    
                     insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
@@ -311,7 +311,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    insPlyIncome.setTaskId(taskId);
+                    
                     insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
@@ -422,7 +422,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    insPlyIncome.setTaskId(taskId);
+                    
                     insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();
@@ -530,7 +530,7 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
                     if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
                         totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
                     }
-                    insPlyIncome.setTaskId(taskId);
+                    
                     insPlyIncomeMapper.updateById(insPlyIncome);
                 } else {
                     InsImportResult insImportResult = new InsImportResult();

+ 20 - 8
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -592,10 +592,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(insPlyIncomeVo.getJqStartDate() !=null){
             params.put("jqEndDate",insPlyIncomeVo.getJqEndDate());
         }
-        if(insPlyIncomeVo.getJqStartDate() !=null){
+        if(insPlyIncomeVo.getSyStartDate() !=null){
             params.put("syStartDate",insPlyIncomeVo.getSyStartDate());
         }
-        if(insPlyIncomeVo.getJqStartDate() !=null){
+        if(insPlyIncomeVo.getSyEndDate() !=null){
             params.put("syEndDate",insPlyIncomeVo.getSyEndDate());
         }
         if( StringUtils.isNotEmpty(insPlyIncomeVo.getProvinceId())){
@@ -611,7 +611,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             params.put("deptId",insPlyIncomeVo.getDeptId());
         }
         if( StringUtils.isNotEmpty(insPlyIncomeVo.getAllPartnerCompaniesId())){
-            params.put("allPartnerCompaniesId",insPlyIncomeVo.getAllPartnerCompaniesId());
+            params.put("allPartnerCompaniesId",insPlyIncomeVo.getAllPartnerCompaniesId().substring(0,5));
         }
         if( StringUtils.isNotEmpty(insPlyIncomeVo.getProvincePartnerCompaniesId())){
             params.put("provincePartnerCompaniesId",insPlyIncomeVo.getProvincePartnerCompaniesId());
@@ -1514,13 +1514,24 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
     @Override
     public HttpResult<Object> batchBxBalance(InsPlyIncomeVo insPlyIncomeVo) {
-        if(StringUtils.isNotEmpty(insPlyIncomeVo.getIds())){// 判断 ins_ply_income  是否完全结算完 如果结算完则改为已结算状态
-            this.changeHandStatus(insPlyIncomeVo.getIds(),insPlyIncomeVo);
+//         表内总金额
+        BigDecimal invoicCommissionFeevalue = insPlyIncomeVo.getInvoicCommissionFeevalue();
+        BigDecimal settlementAmount = insPlyIncomeVo.getSettlementAmount();
+
+
+        HashMap<String, Object> params = new HashMap<>();
+        params = this.saveParams(insPlyIncomeVo,params);
+        params.put("handlingFeesStatus",insPlyIncomeVo.getHandlingFeesStatus());
+        List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
+        for (InsPlyIncome  item : insPlyIncomes){
+            if(settlementAmount.compareTo(invoicCommissionFeevalue) ==0){
+                item.setHandlingFeesStatus("1");
+                baseMapper.updateById(item);
+            }
         }
 //            分批结算
         SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo();
 
-
         settlementDocumentaryFeesVo.setInvoiceId(insPlyIncomeVo.getInvoicId());   //开票号
         settlementDocumentaryFeesVo.setSettlementTime(insPlyIncomeVo.getSettlementTime());   //结算时间
         settlementDocumentaryFeesVo.setSettlementStatus("2");   //2为结算状态
@@ -1735,6 +1746,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     public InsPlyIncome ptTotalAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         params = this.saveParams(insPlyIncomeVo, params);
+        params.remove("handlingFeesStatus");
         InsPlyIncome totalledAmount =baseMapper.ptTotalAmount(params);  //总金额
         return totalledAmount;
     }
@@ -1913,8 +1925,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                     BigDecimal jqOtherCostsProportion = item.getJqOtherCostsProportion();
                     BigDecimal syOtherCostsProportion = item.getSyOtherCostsProportion();
 
-                    BigDecimal jqNoTaxPremium = byBxLicenseno.getJqNoTaxPremium();//交强含税保费
-                    BigDecimal syNoTaxPremium = byBxLicenseno.getSyNoTaxPremium();// 商业不含税比例
+                    BigDecimal jqNoTaxPremium = byBxLicenseno.getJqPremium();//交强含税
+                    BigDecimal syNoTaxPremium = byBxLicenseno.getSyPremium();// 商业不含税
                     BigDecimal jqOtherAmount = jqNoTaxPremium.multiply(item.getJqOtherCostsProportion().divide(new BigDecimal(100)));  //交强跟单费用
                     BigDecimal syOtherAmount = syNoTaxPremium.multiply(item.getSyOtherCostsProportion().divide(new BigDecimal(100)));
 

+ 3 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/SettlementDocumentaryFeesServiceImpl.java

@@ -60,6 +60,9 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
             if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getPartnerCompaniesId())){
                 params.put("partnerCompaniesId",settlementDocumentaryFeesVo.getPartnerCompaniesId());
             }
+            if(StringUtils.isNotEmpty(settlementDocumentaryFeesVo.getParentId())){
+                params.put("parentId",settlementDocumentaryFeesVo.getParentId());
+            }
             PageInfo<List<SettlementDocumentaryFeesEntity>> pageHelper = null;
             List<SettlementDocumentaryFeesEntity> list = this.baseMapper.querySettle(params);
             pageHelper = new PageInfo(list);

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

@@ -340,6 +340,9 @@ public class InsPlyIncomeVo implements Serializable {
     @ApiModelProperty(value = "保司省公司")
     private String provincePartnerCompaniesId;
 
+    @ApiModelProperty(value = "parentId")
+    private String parentId;
+
 
 
 

+ 1 - 1
src/main/java/com/ydtech/modules/fnc/vo/SettlementDocumentaryFeesVo.java

@@ -99,7 +99,7 @@ public class SettlementDocumentaryFeesVo implements Serializable {
     private LocalDate settlementTime;
 
 
-    @ApiModelProperty("开票id")
+    @ApiModelProperty("父母id")
     private String parentId;
 
 

+ 21 - 19
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -184,9 +184,10 @@
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
 
-               <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
-                    and eic.parent_id =#{allPartnerCompaniesId}
+                <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
+                    AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
                 </if>
+
                <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
                     and eic.parent_id =#{provincePartnerCompaniesId}
                 </if>
@@ -196,15 +197,15 @@
                 </if>
 
                 <if test="provinceId != null and provinceId != ''">
-                    and a.deptid like "${provinceId}%"
+                    and a.dept_id LIKE CONCAT(#{provinceId}, '%')
                 </if>
 
                 <if test="cityId != null and cityId != ''">
-                    and a.deptid like "${cityId}%"
+                    and a.dept_id LIKE CONCAT(#{cityId}, '%')
                 </if>
 
                 <if test="countyId != null and countyId != ''">
-                    and a.deptid like "${countyId}%"
+                    and a.dept_id  LIKE CONCAT(#{countyId}, '%')
                 </if>
                <if test="taskId != null and taskId != ''">
                     and a.task_id = #{taskId}
@@ -306,10 +307,12 @@
                   AND  a.insured_name =#{insuredName}
                 </if>
                 <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
-                   AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate}  AND a.jq_start_date &gt; = #{jqStartDate}
+                    AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
                 </if>
                 <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
-                   AND a.sy_start_date BETWEEN #{syStartDate} AND #{syEndDate}  AND a.sy_start_date &gt; = #{syStartDate}
+                    AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
                 </if>
 
             </where>
@@ -659,10 +662,12 @@
                     and a.is_not_car =#{isNotCar}
                 </if>
                 <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
-                    AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate}  AND a.jq_start_date &gt; = #{jqStartDate}
+                    AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
                 </if>
                 <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
-                    AND a.sy_start_date BETWEEN #{syStartDate} AND #{syEndDate}  AND a.sy_start_date &gt; = #{syStartDate}
+                    AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
                 </if>
 
                 <if test="isOther !=null  and  isOther  !=''">
@@ -1071,7 +1076,7 @@
                 AND   a.partner_companies_name =#{partnerCompaniesName}
             </if>
             <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
-                and eic.parent_id =#{allPartnerCompaniesId}
+                AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
             </if>
             <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
                 and eic.parent_id =#{provincePartnerCompaniesId}
@@ -1124,8 +1129,8 @@
         IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00)  as "invoicCommissionFeevalue",
         sum(COALESCE( a.other_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00)  as "noInvoicCommissionFeevalue",
         sum(COALESCE( a.other_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00)  AS "unSettledAmount",
-        IFNULL(IFNULL(max(f.settleMentAmount) , 0.00)  *  MAX(f.taxPoints) /100,0) as  "taxesFees",
-        IFNULL  ( IFNULL(max(f.settleMentAmount) , 0.00)  - ( IFNULL(max(f.settleMentAmount) , 0.00)  *  MAX(f.taxPoints) /100) ,0) as   "expendAmount",
+        IFNULL(max(f.taxesFees) , 0.00) as  "taxesFees",
+        IFNULL(max(f.expendAmount),0) as   "expendAmount",
         sum( a.other_feevalue ) AS "otherFeevalue"
         FROM
         ins_ply_income a
@@ -1152,6 +1157,7 @@
         LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId",sum(
         settlement_amount ) AS "settleMentAmount",
         SUM(a.expend_amount) as  "expendAmount",
+        IFNULL(sum(settlement_amount ) ,0) -IFNULL(SUM(a.expend_amount),0) as  "taxesFees",
         SUM(a.tax_points) as  "taxPoints"
         FROM settlement_documentary_fees a
         WHERE a.settlement_status = '2'
@@ -1204,7 +1210,7 @@
                 and a.is_not_documentary   =#{isOther}
             </if>
             <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
-                and eic.parent_id =#{allPartnerCompaniesId}
+                AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
             </if>
             <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
                 and eic.parent_id =#{provincePartnerCompaniesId}
@@ -1411,16 +1417,12 @@
                        and  pa.docking_person  =#{dockingPerson}
                    </if>
 
-                   <if test="provinceId != null and provinceId != ''">
-                       and a.deptid like "${provinceId}%"
-                   </if>
-
                    <if test="cityId != null and cityId != ''">
-                       and a.deptid like "${cityId}%"
+                       and a.dept_id LIKE CONCAT(#{cityId}, '%')
                    </if>
 
                    <if test="countyId != null and countyId != ''">
-                       and a.deptid like "${countyId}%"
+                       and a.dept_id  LIKE CONCAT(#{countyId}, '%')
                    </if>
 
                    <if test="orderno !=null  and  orderno  !=''">

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

@@ -73,6 +73,9 @@
             <if test="agreementType !=null  and  agreementType  !=''">
                 and a.agreement_type =#{agreementType}
             </if>
+            <if test="parentId !=null  and  parentId  !=''">
+                and a.parent_id =#{parentId}
+            </if>
         </where>
     </select>