Explorar el Código

1.所有开票界面都显示 详情添加搜索条件

wuhp hace 2 años
padre
commit
55192f4c78

+ 0 - 2
src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java

@@ -60,6 +60,4 @@ public class SysUserAccountController extends BaseController {
     }
 
 
-
-
 }

+ 1 - 1
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -110,7 +110,7 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      * @param idArr   开票的id
      * @return
      */
-    List<HashMap<String,Object>> groupByInvoic(@Param("idArr") String[] idArr);
+    List<HashMap<String,Object>> groupByInvoic(HashMap<String,Object> params);
 
 
     List<InsPlyIncome> getIncomeIdList(HashMap<String, Object> params);

+ 1 - 1
src/main/java/com/ydtech/modules/fnc/dao/SettlementDocumentaryFeesMapper.java

@@ -21,7 +21,7 @@ public interface SettlementDocumentaryFeesMapper  extends BaseMapper<SettlementD
      * @param invoiceIds   开票id
      * @return   总金额  开票号  开票时间
      */
-    List<HashMap<String, Object>> getOtherSettldetail(@Param("invoiceIds") String[] invoiceIds);
+    List<HashMap<String, Object>> getOtherSettldetail(HashMap<String,Object> params);
 
     void batchByInvoice( HashMap<String,Object> ids);
 

+ 1 - 1
src/main/java/com/ydtech/modules/fnc/service/SettlementDocumentaryFeesService.java

@@ -19,7 +19,7 @@ public interface SettlementDocumentaryFeesService extends IService<SettlementDoc
 
     HttpResult documentarySettle(SettlementDocumentaryFeesVo settlementDocumentaryFeesVo);
 
-    List<HashMap<String, Object>> getOtherSettldetail(@Param("incomeIds") String incomeIds);
+    List<HashMap<String, Object>> getOtherSettldetail(HashMap<String,Object> params);
 
     void batchByInvoice(String ids);
 

+ 12 - 15
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -833,13 +833,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
      */
     @Override
     public HttpResult<List<HashMap<String,Object>>> invicdetail(InsPlyIncomeVo insPlyIncomeVo) {
-        if(StringUtils.isNotEmpty(insPlyIncomeVo.getIds())){
-            String ids = insPlyIncomeVo.getIds();
-            String[] idArr = ids.split(",");
-            List<HashMap<String,Object>>  result= this.baseMapper.groupByInvoic(idArr);
-            return HttpResult.ok(result);
-        }
-      return HttpResult.ok();
+        HashMap<String, Object> params = new HashMap<>();
+        params= this.saveParams(insPlyIncomeVo,params);
+        List<HashMap<String,Object>>  result= this.baseMapper.groupByInvoic(params);
+        return HttpResult.ok(result);
     }
 
     /***
@@ -883,13 +880,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
      */
     @Override
     public HttpResult<List<HashMap<String, Object>>> otherSettldetail(InsPlyIncomeVo insPlyIncomeVo) {
-        if (StringUtils.isNotEmpty(insPlyIncomeVo.getIncomeIds())) {
-            String incomeIds = insPlyIncomeVo.getIncomeIds();
-            List<HashMap<String, Object>> resultList = settlementDocumentaryFeesService.getOtherSettldetail(incomeIds);
-            if (resultList.size() > 0) {
-                return HttpResult.ok(resultList);
-            }
+        HashMap<String, Object> params = new HashMap<>();
+        params =this.saveParams(insPlyIncomeVo,params);
+        List<HashMap<String, Object>> resultList = settlementDocumentaryFeesService.getOtherSettldetail(params);
+        if (resultList.size() > 0) {
+            return HttpResult.ok(resultList);
         }
+
         return HttpResult.ok();
     }
 
@@ -1206,7 +1203,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         List<InsPlyIncome>  resultList  =  baseMapper.totalBxAmount(params);
 //      数据库数据太多是 用sql拼接id会丢失 所以只能逻辑拼接
         List<InsPlyIncome> idList=baseMapper.getIncomeIdList(params);
-        if(!CollectionUtils.isEmpty(idList) && !ObjectUtils.isNotEmpty(resultList)){
+        if(!CollectionUtils.isEmpty(idList) && !CollectionUtils.isEmpty(resultList)){
             this.splicingIds(idList,resultList);
         }
         return resultList;
@@ -1227,7 +1224,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         }
 
         for (InsPlyIncome resultItem : resultList) {
-            List<String> ids = idMap.getOrDefault(resultItem.getAgreementId(), Collections.emptyList());
+            List<String> ids = idMap.getOrDefault(resultItem.getPartnerCompaniesId(), Collections.emptyList());
             String idsString = String.join(",", ids);
             resultItem.setIds(idsString);
         }

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

@@ -114,9 +114,8 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
      * @return  返回开票号 开票金额  开票时间
      */
     @Override
-    public List<HashMap<String, Object>> getOtherSettldetail(String incomeIds) {
-        String[] invoiceIds = incomeIds.split(",");
-        return baseMapper.getOtherSettldetail(invoiceIds);
+    public List<HashMap<String, Object>> getOtherSettldetail(HashMap<String,Object> params) {
+        return baseMapper.getOtherSettldetail(params);
     }
 
     @Override

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

@@ -169,7 +169,7 @@ public class InsPlyIncomeVo implements Serializable {
     @ApiModelProperty("用户id")
     private String userId;
 
-    @ApiModelProperty("用户id")
+    @ApiModelProperty("合作公司id")
     private String partnerCompaniesId;
     @ApiModelProperty("未结算手续费")
     private BigDecimal readyCommissionFeevalue;

+ 43 - 13
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -465,10 +465,10 @@
                     and a.no_policyno  =#{noPolicyno}
                 </if>
                 <if test="signdate !=null  and  signdate  !=''">
-                    a.signdate =#{signdate}
+                    and  a.signdate =#{signdate}
                 </if>
                 <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
-                    a.partner_companies_id =#{partnerCompaniesId}
+                    and  a.partner_companies_id =#{partnerCompaniesId}
                 </if>
 
                 <if test="createTime !=null  and  createTime  !=''">
@@ -503,9 +503,11 @@
     <select id="bxTotalAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
             SELECT
             SUM(a.commission_feevalue) AS commissionFeevalue,
-            SUM(CASE WHEN handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END) AS noInvoicCommissionFeevalue,
-            SUM(CASE WHEN handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS readyCommissionFeevalue,
-            SUM(CASE WHEN handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS invoicCommissionFeevalue
+            SUM(CASE WHEN a.handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS "invoicCommissionFeevalue",
+            SUM( CASE WHEN a.handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END ) AS "noInvoicCommissionFeevalue",
+            SUM(CASE WHEN a.handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS "readyCommissionFeevalue",
+            SUM( CASE WHEN ( a.handling_fees_status = '2' or   a.handling_fees_status = '1' ) THEN a.commission_feevalue ELSE 0 END ) AS "allInvoicCommissionFeevalue",
+            SUM( CASE WHEN ( a.handling_fees_status = '2' or   a.handling_fees_status = '0' ) THEN a.commission_feevalue ELSE 0 END ) AS "unSettledAmount"
             FROM
             ins_ply_income a
             LEFT JOIN
@@ -687,17 +689,17 @@
 
             </if>
             <if test="signdate !=null  and  signdate  !=''">
-                a.signdate =#{signdate}
+                and a.signdate =#{signdate}
             </if>
             <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
-                a.partner_companies_id =#{partnerCompaniesId}
+                and  a.partner_companies_id =#{partnerCompaniesId}
             </if>
 
             <if test="createTime !=null  and  createTime  !=''">
-                a.create_time =#{createTime}
+                and a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                a.settlement_time =#{settlementTime}
+                and  a.settlement_time =#{settlementTime}
             </if>
 
             <if test="userId !=null  and  userId  !=''">
@@ -919,10 +921,38 @@
         LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
         LEFT  JOIN  sys_user   su  on su.id=a.user_id
         <where>
-            a.id IN
-            <foreach item="item" index="index" collection="idArr" open="(" separator="," close=")">
-                #{item}
-            </foreach>
+            1=1
+            AND  a.invoic_id is not null
+            <if test="idArr !=null and  idArr!=''">
+                a.id IN
+                <foreach item="item" index="index" collection="idArr" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="agreementType !=null  and agreementType!='' ">
+                AND pa.agreement_type =#{agreementType}
+            </if>
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signdate) =#{year}
+            </if>
+            <if test="isOther !=null  and  isOther  !=''">
+                and a.is_not_documentary =#{isOther}
+            </if>
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signdate) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signdate) =#{day}
+            </if>
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                AND  a.partner_companies_id =#{partnerCompaniesId}
+            </if>
         </where>
         group  by  a.invoic_id
     </select>

+ 11 - 2
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -49,14 +49,23 @@
         GROUP_CONCAT(a.id) as "ids"
         from settlement_documentary_fees a
         <where>
-            a.settlement_status = '1'
+            1=1
+            <if test="settlementStatus !=null and  settlementStatus !=''">
+                and a.settlement_status = =#{settlementStatus}
+            </if>
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                and a.partner_companies_id =#{partnerCompaniesId}
+            </if>
             <if test="invoiceIds !=null and  invoiceIds !=''  and invoiceIds.length>0">
                 and a.id IN
                 <foreach item="item" index="index" collection="invoiceIds" open="(" separator="," close=")">
                     #{item}
                 </foreach>
             </if>
-
         </where>
 
         GROUP BY a.invoice_id