y преди 2 години
родител
ревизия
fe0605635e

+ 2 - 2
src/main/java/com/ydtech/modules/inv/dao/InvAccountMapper.java

@@ -17,11 +17,11 @@ import java.util.List;
  */
 public interface InvAccountMapper extends BaseMapper<InvAccount> {
 
-    IPage<InvAccount> selectAccountsListPage(Page page, @Param("account") InvAccountQueryVo invAccountQueryVo);
+    List<InvAccount> selectAccountsListPage(@Param("account") InvAccountQueryVo invAccountQueryVo);
 
     List<InvAccount> selectAccountsList(@Param("account") InvAccountQueryVo invAccountQueryVo);
 
-    IPage<InvAccount> getSumInvoicingAmount(Page page,@Param("account") InvAccountQueryVo invAccountQueryVo);
+    List<InvAccount> getSumInvoicingAmount(@Param("account") InvAccountQueryVo invAccountQueryVo);
 }
 
 

+ 1 - 2
src/main/java/com/ydtech/modules/inv/model/InvAccount.java

@@ -123,8 +123,7 @@ public class InvAccount implements Serializable {
     private String sumInvoicingAmount;
 
     @ApiModelProperty(value = "暂估")
-    @TableField(value = "tentative_estimates", typeHandler = FastjsonTypeHandler.class)
-    private JSONArray tentativeEstimates;
+    private String tentativeEstimates;
 
     @ApiModelProperty(value = "季度开票额度")
     @TableField(exist = false)

+ 14 - 10
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountServiceImpl.java

@@ -43,23 +43,22 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
         PageRequest pageRequest = new PageRequest();
         pageRequest.setPageNum(invAccountQueryVo.getPageNo());
         pageRequest.setPageSize(invAccountQueryVo.getPageSize());
-        Page page = PageRequest.buildPageRequest(pageRequest);
 
         invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.get12MonthsBefore()); // 获取12月前月的第一天
         invAccountQueryVo.setInvoiceTimeEnd(LocalDateTimeUtils.getTodayLastDay());  //获取当前月最后一天
 
 
-        IPage<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(page, invAccountQueryVo);
-        List<InvAccount> records = invAccountIPage.getRecords();
+        List<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(invAccountQueryVo);
+
 
         //计算当前季度剩余300000减去
         invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.quarterStartTime());
         invAccountQueryVo.setInvoiceTimeEnd(LocalDateTimeUtils.quarterEndTime());
-        IPage<InvAccount> invAccountIPage1 = insAccountMapper.selectAccountsListPage(page, invAccountQueryVo);
+        List<InvAccount> invAccountIPage1 = insAccountMapper.selectAccountsListPage(invAccountQueryVo);
 
         //将当前季度额度赋值
-        List<InvAccount> collect = records.stream()
-                .map(rel -> invAccountIPage1.getRecords().stream()
+        List<InvAccount> collect = invAccountIPage.stream()
+                .map(rel -> invAccountIPage1.stream()
                         .filter(ord -> Objects.equals(rel.getAccountId(), ord.getAccountId()))
                         .findFirst()
                         .map(ord -> {
@@ -73,9 +72,9 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
                 ).collect(Collectors.toList());
 
         //将总开票额度赋值
-        IPage<InvAccount> sumInvoicingAmount = insAccountMapper.getSumInvoicingAmount(page,invAccountQueryVo);
+        List<InvAccount> sumInvoicingAmount = insAccountMapper.getSumInvoicingAmount(invAccountQueryVo);
         List<InvAccount> collect1 = collect.stream()
-                .map(rel -> sumInvoicingAmount.getRecords().stream()
+                .map(rel -> sumInvoicingAmount.stream()
                         .filter(ord -> Objects.equals(rel.getAccountId(), ord.getAccountId()))
                         .findFirst()
                         .map(ord -> {
@@ -96,8 +95,13 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
                 }
             }
         });
-        invAccountIPage.setRecords(collect1);
-        return invAccountIPage;
+        IPage ipage = PageRequest.buildPageRequest(pageRequest);
+        ipage.setRecords(collect1.stream().skip((invAccountQueryVo.getPageNo()-1)*invAccountQueryVo.getPageSize()).limit(invAccountQueryVo.getPageSize()).
+                        collect(Collectors.toList()));
+        ipage.setTotal(collect1.size());
+
+
+        return ipage;
     }
 
 

+ 1 - 2
src/main/resources/mapper/modules/inv/InvAccountMapper.xml

@@ -20,8 +20,7 @@
         <result property="invoicingAmount" column="invoicing_amount" jdbcType="VARCHAR"/>
         <result property="invoicingAmountExcess" column="invoicing_amount_excess" jdbcType="VARCHAR"/>
         <result property="sumInvoicingAmount" column="sum_invoicing_amount" jdbcType="VARCHAR"/>
-        <result property="tentativeEstimates" column="tentative_estimates" javaType="com.alibaba.fastjson.JSONArray"
-                typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
+        <result property="tentativeEstimates" column="tentative_estimates" jdbcType="VARCHAR"/>
         <collection property="invAccountCardList" ofType="com.ydtech.modules.inv.model.InvAccountCard"
                     resultMap="invAccountCardList"/>
     </resultMap>