Explorar o código

机构结算明细表 优化接口查询

Qchen %!s(int64=2) %!d(string=hai) anos
pai
achega
40e8919e0f

+ 4 - 6
src/main/java/com/ydtech/modules/admin/controller/SysDeptAccountWithdrawController.java

@@ -1,8 +1,6 @@
 package com.ydtech.modules.admin.controller;
 package com.ydtech.modules.admin.controller;
 
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.core.page.PageResult;
 import com.ydtech.modules.admin.model.SysDeptAccountWithdraw;
 import com.ydtech.modules.admin.model.SysDeptAccountWithdraw;
 import com.ydtech.modules.admin.model.vo.SysDeptAccountWithdrawVo;
 import com.ydtech.modules.admin.model.vo.SysDeptAccountWithdrawVo;
 import com.ydtech.modules.admin.service.SysDeptAccountWithdrawService;
 import com.ydtech.modules.admin.service.SysDeptAccountWithdrawService;
@@ -15,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.text.ParseException;
+
 @Api(tags = "机构账户审核")
 @Api(tags = "机构账户审核")
 @RequestMapping("/sysDeptAccountWithdraw")
 @RequestMapping("/sysDeptAccountWithdraw")
 @RestController
 @RestController
@@ -24,10 +24,8 @@ public class SysDeptAccountWithdrawController extends BaseController {
 
 
     @PostMapping("/queryStatus")
     @PostMapping("/queryStatus")
     @ApiOperation(value = "机构账户审核状态查询")
     @ApiOperation(value = "机构账户审核状态查询")
-    public HttpResult queryStatus(@RequestBody SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo){
-        IPage<SysDeptAccountWithdraw> getAnnualAuditOrderPage = sysDeptAccountWithdrawService.getList(sysDeptAccountWithdrawVo);
-        PageResult pageResult = buildPageResponse(getAnnualAuditOrderPage);
-        return HttpResult.ok(pageResult);
+    public HttpResult queryStatus(@RequestBody SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo) throws ParseException {
+        return HttpResult.ok("",sysDeptAccountWithdrawService.getList(sysDeptAccountWithdrawVo));
     }
     }
 
 
     @PostMapping("/audit")
     @PostMapping("/audit")

+ 2 - 2
src/main/java/com/ydtech/modules/admin/dao/SysDeptAccountHistoryMapper.java

@@ -1,14 +1,14 @@
 package com.ydtech.modules.admin.dao;
 package com.ydtech.modules.admin.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysDeptAccountHistory;
 import com.ydtech.modules.admin.model.SysDeptAccountHistory;
 import com.ydtech.modules.admin.model.dto.SysDeptAccountHistoryDto;
 import com.ydtech.modules.admin.model.dto.SysDeptAccountHistoryDto;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
-import java.util.List;
 
 
 @Mapper
 @Mapper
 public interface SysDeptAccountHistoryMapper extends BaseMapper<SysDeptAccountHistory> {
 public interface SysDeptAccountHistoryMapper extends BaseMapper<SysDeptAccountHistory> {
-    List<SysDeptAccountHistoryDto> getDeptHistory(@Param("sysDeptAccountHistoryDto") SysDeptAccountHistoryDto sysDeptAccountHistoryDto);
+    Page<SysDeptAccountHistoryDto> getDeptHistory(Page page,@Param("sysDeptAccountHistoryDto") SysDeptAccountHistoryDto sysDeptAccountHistoryDto);
 }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/admin/dao/SysDeptAccountWithdrawMapper.java

@@ -1,11 +1,15 @@
 package com.ydtech.modules.admin.dao;
 package com.ydtech.modules.admin.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysDeptAccountWithdraw;
 import com.ydtech.modules.admin.model.SysDeptAccountWithdraw;
+import com.ydtech.modules.admin.model.vo.SysDeptAccountWithdrawVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 
 
 
 
 
 @Mapper
 @Mapper
 public interface SysDeptAccountWithdrawMapper extends BaseMapper<SysDeptAccountWithdraw> {
 public interface SysDeptAccountWithdrawMapper extends BaseMapper<SysDeptAccountWithdraw> {
+    Page<SysDeptAccountWithdraw> selectSysDeptAccountWithdraw(Page page,@Param("sysDeptAccountWithdrawVo") SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo);
 }
 }

+ 1 - 2
src/main/java/com/ydtech/modules/admin/model/SysDeptAccountWithdraw.java

@@ -9,7 +9,6 @@ import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
-import java.util.Date;
 
 
 
 
 @Data
 @Data
@@ -42,5 +41,5 @@ public class SysDeptAccountWithdraw implements Serializable {
 
 
     @TableField(value = "create_time")
     @TableField(value = "create_time")
     @ApiModelProperty("创建时间")
     @ApiModelProperty("创建时间")
-    private Date createTime;
+    private String createTime;
 }
 }

+ 8 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysDeptAccountDto.java

@@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 
 
 @Data
 @Data
@@ -19,4 +20,11 @@ public class SysDeptAccountDto {
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private LocalDateTime createTime;
     private LocalDateTime createTime;
 
 
+    @ApiModelProperty(value = "提现中金额")
+    @JsonFormat(pattern = "0.00")
+    private BigDecimal waitAmount;
+
+    @ApiModelProperty(value = "已提现金额")
+    @JsonFormat(pattern = "0.00")
+    private BigDecimal totalAmount;
 }
 }

+ 8 - 1
src/main/java/com/ydtech/modules/admin/model/dto/SysDeptAccountHistoryDto.java

@@ -3,7 +3,6 @@ package com.ydtech.modules.admin.model.dto;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ydtech.core.page.PageRequest;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
@@ -58,4 +57,12 @@ public class SysDeptAccountHistoryDto{
     @ApiModelProperty(value = "备注")
     @ApiModelProperty(value = "备注")
     @TableField(value = "remark")
     @TableField(value = "remark")
     private String remark;
     private String remark;
+
+    private String createTimeStart;
+
+    private String createTimeEnd;
+
+    private int pageNo;
+
+    private int pageSize;
 }
 }

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysDeptAccountByUserVo.java

@@ -27,4 +27,10 @@ public class SysDeptAccountByUserVo {
 
 
     @ApiModelProperty("提现人员id")
     @ApiModelProperty("提现人员id")
     private String userId;
     private String userId;
+
+    @ApiModelProperty("提现中金额")
+    private BigDecimal waitAmount;
+
+    @ApiModelProperty("已提现金额")
+    private BigDecimal totalAmount;
 }
 }

+ 8 - 6
src/main/java/com/ydtech/modules/admin/model/vo/SysDeptAccountWithdrawVo.java

@@ -2,16 +2,14 @@ package com.ydtech.modules.admin.model.vo;
 
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.ydtech.core.page.PageRequest;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
-import java.util.Date;
 
 
 @Data
 @Data
-public class SysDeptAccountWithdrawVo extends PageRequest implements Serializable {
+public class SysDeptAccountWithdrawVo implements Serializable {
     @TableId(value = "id")
     @TableId(value = "id")
     @ApiModelProperty(value = "主键id")
     @ApiModelProperty(value = "主键id")
     private String id;
     private String id;
@@ -38,13 +36,17 @@ public class SysDeptAccountWithdrawVo extends PageRequest implements Serializabl
 
 
     @TableField(value = "create_time")
     @TableField(value = "create_time")
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")
-    private Date createTime;
+    private String createTime;
 
 
     @ApiModelProperty(value = "创建时间开始时间")
     @ApiModelProperty(value = "创建时间开始时间")
-    private Date createTimeStart;
+    private String createTimeStart;
 
 
 
 
     @ApiModelProperty(value = "创建时间结束时间")
     @ApiModelProperty(value = "创建时间结束时间")
-    private Date createTimeEnd;
+    private String createTimeEnd;
+
+    private int pageNo;
+
+    private int pageSize;
 
 
 }
 }

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

@@ -3,6 +3,7 @@ package com.ydtech.modules.admin.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.PageRequest;
 import com.ydtech.modules.admin.dao.SysDeptAccountHistoryMapper;
 import com.ydtech.modules.admin.dao.SysDeptAccountHistoryMapper;
 import com.ydtech.modules.admin.model.SysDeptAccountHistory;
 import com.ydtech.modules.admin.model.SysDeptAccountHistory;
 import com.ydtech.modules.admin.model.dto.SysDeptAccountHistoryDto;
 import com.ydtech.modules.admin.model.dto.SysDeptAccountHistoryDto;
@@ -10,7 +11,6 @@ import com.ydtech.modules.admin.service.SysDeptAccountHistoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.util.List;
 
 
 @Service
 @Service
 public class SysDeptAccountHistoryServiceImpl extends ServiceImpl<SysDeptAccountHistoryMapper, SysDeptAccountHistory> implements SysDeptAccountHistoryService {
 public class SysDeptAccountHistoryServiceImpl extends ServiceImpl<SysDeptAccountHistoryMapper, SysDeptAccountHistory> implements SysDeptAccountHistoryService {
@@ -21,10 +21,11 @@ public class SysDeptAccountHistoryServiceImpl extends ServiceImpl<SysDeptAccount
     private SysDeptAccountHistoryMapper sysDeptAccountHistoryMapper;
     private SysDeptAccountHistoryMapper sysDeptAccountHistoryMapper;
     @Override
     @Override
     public IPage<SysDeptAccountHistoryDto> selectList(SysDeptAccountHistoryDto sysDeptAccountHistoryDto) {
     public IPage<SysDeptAccountHistoryDto> selectList(SysDeptAccountHistoryDto sysDeptAccountHistoryDto) {
-        Page<SysDeptAccountHistoryDto> page = new Page<>();
-        List<SysDeptAccountHistoryDto> deptHistoryList = sysDeptAccountHistoryMapper.getDeptHistory(sysDeptAccountHistoryDto);
-        page.setRecords(deptHistoryList);
-        page.setTotal(deptHistoryList.size());
-        return page;
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(sysDeptAccountHistoryDto.getPageNo());
+        pageRequest.setPageSize(sysDeptAccountHistoryDto.getPageSize());
+        Page page = PageRequest.buildPageRequest(pageRequest);
+        Page<SysDeptAccountHistoryDto> deptHistoryList = sysDeptAccountHistoryMapper.getDeptHistory(page,sysDeptAccountHistoryDto);
+        return deptHistoryList;
     }
     }
 }
 }

+ 4 - 3
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptAccountServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.constants.sys.SysDeptAccountStatus;
 import com.ydtech.constants.sys.SysDeptAccountStatus;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.dao.SysDeptAccountMapper;
 import com.ydtech.modules.admin.dao.SysDeptAccountMapper;
 import com.ydtech.modules.admin.model.*;
 import com.ydtech.modules.admin.model.*;
 import com.ydtech.modules.admin.model.dto.SysDeptAccountDto;
 import com.ydtech.modules.admin.model.dto.SysDeptAccountDto;
@@ -77,10 +78,10 @@ public class SysDeptAccountServiceImpl extends ServiceImpl<SysDeptAccountMapper,
         SysDept sysDept = sysDeptService.getOne(queryWrapper);
         SysDept sysDept = sysDeptService.getOne(queryWrapper);
 
 
         if (!BaseController.getUser().getId().equals(sysDept.getWithdrawUser())) {
         if (!BaseController.getUser().getId().equals(sysDept.getWithdrawUser())) {
-            return HttpResult.error("您不为该机构账户提现人员");
+            throw new SystemException("您不为该机构账户提现人员");
         }
         }
         if (sysDeptAccount.getAmount().compareTo(deptAccount.getManagementFee()) > 0) {
         if (sysDeptAccount.getAmount().compareTo(deptAccount.getManagementFee()) > 0) {
-            return HttpResult.error("提现金额大于机构账户金额");
+            throw new SystemException("提现金额大于机构账户金额");
         }
         }
         // 减去提现金额
         // 减去提现金额
         deptAccount.setManagementFee(deptAccount.getManagementFee().subtract(sysDeptAccount.getAmount()));
         deptAccount.setManagementFee(deptAccount.getManagementFee().subtract(sysDeptAccount.getAmount()));
@@ -108,7 +109,7 @@ public class SysDeptAccountServiceImpl extends ServiceImpl<SysDeptAccountMapper,
         sysDeptAccountWithdraw.setAmount(sysDeptAccount.getAmount());
         sysDeptAccountWithdraw.setAmount(sysDeptAccount.getAmount());
         sysDeptAccountWithdraw.setStatus(SysDeptAccountStatus.WAIT.getCode()); //待审核
         sysDeptAccountWithdraw.setStatus(SysDeptAccountStatus.WAIT.getCode()); //待审核
         sysDeptAccountWithdraw.setRemark("");
         sysDeptAccountWithdraw.setRemark("");
-        sysDeptAccountWithdraw.setCreateTime(new Date());
+        sysDeptAccountWithdraw.setCreateTime(String.valueOf(new Date()));
         sysDeptAccountWithdrawService.save(sysDeptAccountWithdraw);
         sysDeptAccountWithdrawService.save(sysDeptAccountWithdraw);
 
 
         return HttpResult.ok("", sysDeptAccount);
         return HttpResult.ok("", sysDeptAccount);

+ 4 - 17
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptAccountWithdrawServiceImpl.java

@@ -1,6 +1,6 @@
 package com.ydtech.modules.admin.service.impl;
 package com.ydtech.modules.admin.service.impl;
 
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -27,27 +27,14 @@ public class SysDeptAccountWithdrawServiceImpl extends ServiceImpl<SysDeptAccoun
     private SysDeptAccountWithdrawService sysDeptAccountWithdrawService;
     private SysDeptAccountWithdrawService sysDeptAccountWithdrawService;
     @Autowired
     @Autowired
     private SysDeptAccountService sysDeptAccountService;
     private SysDeptAccountService sysDeptAccountService;
-
     @Override
     @Override
     public IPage<SysDeptAccountWithdraw> getList(SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo) {
     public IPage<SysDeptAccountWithdraw> getList(SysDeptAccountWithdrawVo sysDeptAccountWithdrawVo) {
         PageRequest pageRequest = new PageRequest();
         PageRequest pageRequest = new PageRequest();
-        pageRequest.setPageNum(sysDeptAccountWithdrawVo.getPageNum());
+        pageRequest.setPageNum(sysDeptAccountWithdrawVo.getPageNo());
         pageRequest.setPageSize(sysDeptAccountWithdrawVo.getPageSize());
         pageRequest.setPageSize(sysDeptAccountWithdrawVo.getPageSize());
         Page page = PageRequest.buildPageRequest(pageRequest);
         Page page = PageRequest.buildPageRequest(pageRequest);
-        LambdaQueryWrapper<SysDeptAccountWithdraw> queryWrapper = new LambdaQueryWrapper<>();
-        //审核状态
-        if (sysDeptAccountWithdrawVo.getStatus() != null && !"".equals(sysDeptAccountWithdrawVo.getStatus())) {
-            queryWrapper.eq(SysDeptAccountWithdraw::getStatus, sysDeptAccountWithdrawVo.getStatus());
-        }
-        //创建时间区间
-        if (sysDeptAccountWithdrawVo.getCreateTimeStart() != null && !"".equals(sysDeptAccountWithdrawVo.getCreateTimeStart())) {
-            queryWrapper.ge(SysDeptAccountWithdraw::getCreateTime, sysDeptAccountWithdrawVo.getCreateTimeStart());
-        }
-        if (sysDeptAccountWithdrawVo.getCreateTimeEnd() != null && !"".equals(sysDeptAccountWithdrawVo.getCreateTimeEnd())) {
-            queryWrapper.le(SysDeptAccountWithdraw::getCreateTime, sysDeptAccountWithdrawVo.getCreateTimeEnd());
-        }
-        Page pageData = sysDeptAccountWithdrawMapper.selectPage(page, queryWrapper);
-        return pageData;
+        Page<SysDeptAccountWithdraw> iPage = sysDeptAccountWithdrawMapper.selectSysDeptAccountWithdraw(page,sysDeptAccountWithdrawVo);
+        return iPage;
     }
     }
 
 
     @Override
     @Override

+ 9 - 2
src/main/java/com/ydtech/modules/inv/model/po/InvSource.java

@@ -1,6 +1,5 @@
 package com.ydtech.modules.inv.model.po;
 package com.ydtech.modules.inv.model.po;
 
 
-import cn.hutool.core.date.DateTime;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.HeadFontStyle;
 import com.alibaba.excel.annotation.write.style.HeadFontStyle;
@@ -379,8 +378,16 @@ public class InvSource implements Serializable {
     @ApiModelProperty("导入人Id")
     @ApiModelProperty("导入人Id")
     private String revenueUserId;
     private String revenueUserId;
 
 
+    @TableField(value = "update_name")
+    @ApiModelProperty("修改人名字")
+    private String updateName;
+
+    @TableField(value = "update_userid")
+    @ApiModelProperty("修改人Id")
+    private String updateUserId;
+
     @TableField(value = "inv_source_type")
     @TableField(value = "inv_source_type")
-    @ApiModelProperty("应收类型(平台,私有)")
+    @ApiModelProperty("应收类型(含税,不含税)")
     private String invSourceType;
     private String invSourceType;
 
 
     @TableField(exist = false)
     @TableField(exist = false)

+ 11 - 8
src/main/java/com/ydtech/modules/inv/service/impl/InvReceivableServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageRequest;
+import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.inv.dao.InvReceivableMapper;
 import com.ydtech.modules.inv.dao.InvReceivableMapper;
 import com.ydtech.modules.inv.dao.InvSettlementSourceMapper;
 import com.ydtech.modules.inv.dao.InvSettlementSourceMapper;
@@ -457,6 +458,8 @@ public class InvReceivableServiceImpl implements InvReceivableService {
                 "已结算".equals(invSource.getClearingState()) ? "1" : invSource.getClearingState());
                 "已结算".equals(invSource.getClearingState()) ? "1" : invSource.getClearingState());
         invSource.setInsuranceClearingState("未结算".equals(invSource.getInsuranceClearingState()) ? "0" :
         invSource.setInsuranceClearingState("未结算".equals(invSource.getInsuranceClearingState()) ? "0" :
                 "已结算".equals(invSource.getInsuranceClearingState()) ? "1" : invSource.getInsuranceClearingState());
                 "已结算".equals(invSource.getInsuranceClearingState()) ? "1" : invSource.getInsuranceClearingState());
+        invSource.setUpdateUserId(BaseController.getUser().getId());
+        invSource.setUpdateName(BaseController.getUser().getName());
         return invSourceMapper.updateById(invSource) > 0;
         return invSourceMapper.updateById(invSource) > 0;
     }
     }
 
 
@@ -627,9 +630,9 @@ public class InvReceivableServiceImpl implements InvReceivableService {
         invSource.builder();
         invSource.builder();
         BigDecimal tax = new BigDecimal(1.06);
         BigDecimal tax = new BigDecimal(1.06);
         /**
         /**
-         * jqPremiumTax  交强险保费
-         * syPremiumTax  商业险保费
-         * nonCarPremiumTax 非车保费
+         * jqPremiumTax  交强险保费(含税)
+         * syPremiumTax  商业险保费(含税)
+         * nonCarPremiumTax 非车保费(含税)
          * jqReceivableRatio 交强应收比例
          * jqReceivableRatio 交强应收比例
          * syReceivableRatio 商业应收比列
          * syReceivableRatio 商业应收比列
          * nonCarReceivableRatio 非车应收比列
          * nonCarReceivableRatio 非车应收比列
@@ -668,14 +671,14 @@ public class InvReceivableServiceImpl implements InvReceivableService {
                 .add(invSource.getSyPremium().multiply(invSource.getSyPremiumRatio())
                 .add(invSource.getSyPremium().multiply(invSource.getSyPremiumRatio())
                         .add(invSource.getNonCarPremium().multiply(invSource.getNonCarPremiumRatio()))));
                         .add(invSource.getNonCarPremium().multiply(invSource.getNonCarPremiumRatio()))));
 
 
-        //非跟单金额  nonCopying
+        //非跟单金额  nonCopying 不含税保费 * 非跟单比例
         invSource.setNonCopying(invSource.getJqPremium().multiply(invSource.getJqNonCopyingRatio())
         invSource.setNonCopying(invSource.getJqPremium().multiply(invSource.getJqNonCopyingRatio())
                 .add(invSource.getSyPremium().multiply(invSource.getSyNonCopyingRatio())
                 .add(invSource.getSyPremium().multiply(invSource.getSyNonCopyingRatio())
                         .add(invSource.getNonCarPremium().multiply(invSource.getNonCarNonCopyingRatio()))));
                         .add(invSource.getNonCarPremium().multiply(invSource.getNonCarNonCopyingRatio()))));
 
 
 
 
-        //选择类型为平台类型时 应收金额 = 含税保费 * 应收比例
-        if (invSource.getInvSourceType().equals("platform")) {
+        //选择类型为含税类型时 应收金额 = 含税保费 * 应收比例
+        if (invSource.getInvSourceType().equals("inclusive")) {
             //处理应收金额
             //处理应收金额
             invSource.setReceivable(invSource.getJqPremiumTax().multiply(invSource.getJqReceivableRatio())
             invSource.setReceivable(invSource.getJqPremiumTax().multiply(invSource.getJqReceivableRatio())
                     .add(invSource.getSyPremiumTax().multiply(invSource.getSyReceivableRatio())
                     .add(invSource.getSyPremiumTax().multiply(invSource.getSyReceivableRatio())
@@ -685,8 +688,8 @@ public class InvReceivableServiceImpl implements InvReceivableService {
                     invSource.getReceivable().add(invSource.getSubsidyAmount()));
                     invSource.getReceivable().add(invSource.getSubsidyAmount()));
         }
         }
 
 
-        //选择类型为私有类型时 应收金额 = ( 不含税保费 * 手续费 )+ (不含税保费 * 非跟单比例)
-        if (invSource.getInvSourceType().equals("privately")) {
+        //选择类型为不含税类型时 应收金额 = (不含税保费 * 手续费)+ (不含税保费 * 非跟单比例)
+        if (invSource.getInvSourceType().equals("exclusive")) {
             //应收金额
             //应收金额
             invSource.setReceivable(invSource.getPremium().add(invSource.getNonCopying()));
             invSource.setReceivable(invSource.getPremium().add(invSource.getNonCopying()));
 
 

+ 8 - 0
src/main/resources/mapper/modules/admin/SysDeptAccountHistoryMapper.xml

@@ -13,6 +13,8 @@
         <result column="user_id" jdbcType="VARCHAR" property="userId"/>
         <result column="user_id" jdbcType="VARCHAR" property="userId"/>
         <result column="remark" jdbcType="VARCHAR" property="remark"/>
         <result column="remark" jdbcType="VARCHAR" property="remark"/>
         <result column="create_date" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="create_date" jdbcType="TIMESTAMP" property="createTime"/>
+        <result property="createTimeStart" column="createTimeStart" jdbcType="VARCHAR"/>
+        <result property="createTimeEnd" column="createTimeEnd" jdbcType="VARCHAR"/>
     </resultMap>
     </resultMap>
 
 
     <select id="getDeptHistory" resultMap="BaseResultMap">
     <select id="getDeptHistory" resultMap="BaseResultMap">
@@ -41,6 +43,12 @@
         <if test="sysDeptAccountHistoryDto.documentary != null and sysDeptAccountHistoryDto.documentary != ''">
         <if test="sysDeptAccountHistoryDto.documentary != null and sysDeptAccountHistoryDto.documentary != ''">
             AND a.documentary = #{sysDeptAccountHistoryDto.documentary}
             AND a.documentary = #{sysDeptAccountHistoryDto.documentary}
         </if>
         </if>
+        <if test="sysDeptAccountHistoryDto.createTimeStart != null and sysDeptAccountHistoryDto.createTimeStart != ''">
+            and DATE(a.create_time) &gt;= #{sysDeptAccountHistoryDto.createTimeStart}
+        </if>
+        <if test="sysDeptAccountHistoryDto.createTimeEnd != null and sysDeptAccountHistoryDto.createTimeEnd != ''">
+            and DATE(a.create_time) &lt;= #{sysDeptAccountHistoryDto.createTimeEnd}
+        </if>
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 12 - 2
src/main/resources/mapper/modules/admin/SysDeptAccountMapper.xml

@@ -8,6 +8,8 @@
         <result column="name" jdbcType="VARCHAR" property="deptName"/>
         <result column="name" jdbcType="VARCHAR" property="deptName"/>
         <result column="management_fee" jdbcType="DECIMAL" property="managementFee"/>
         <result column="management_fee" jdbcType="DECIMAL" property="managementFee"/>
         <result column="create_date" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="create_date" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="waitAmount" jdbcType="DECIMAL" property="waitAmount"/>
+        <result column="totalAmount" jdbcType="DECIMAL" property="totalAmount"/>
     </resultMap>
     </resultMap>
 
 
     <select id="getDept" resultMap="BaseResultMap">
     <select id="getDept" resultMap="BaseResultMap">
@@ -15,10 +17,13 @@
         a.dept_id,
         a.dept_id,
         b.NAME,
         b.NAME,
         a.management_fee,
         a.management_fee,
-        DATE(a.create_time) as create_date
+        DATE(a.create_time) as create_date,
+        SUM(CASE WHEN c.status = 0 THEN c.amount ELSE 0 END) AS waitAmount,
+        SUM(CASE WHEN c.status = 1 THEN c.amount ELSE 0 END) AS totalAmount
         FROM
         FROM
         sys_dept_account a
         sys_dept_account a
         LEFT JOIN sys_dept b ON a.dept_id = b.id
         LEFT JOIN sys_dept b ON a.dept_id = b.id
+        LEFT JOIN sys_dept_account_withdraw c on a.dept_id = c.dept_id
         where
         where
             b.del_flag = 0
             b.del_flag = 0
         <if test="sysDeptAccountDto.deptId != null and sysDeptAccountDto.deptId != ''">
         <if test="sysDeptAccountDto.deptId != null and sysDeptAccountDto.deptId != ''">
@@ -27,6 +32,7 @@
         <if test="sysDeptAccountDto.deptName != null and sysDeptAccountDto.deptName != ''">
         <if test="sysDeptAccountDto.deptName != null and sysDeptAccountDto.deptName != ''">
             AND b.name like concat(#{sysDeptAccountDto.deptName},'%')
             AND b.name like concat(#{sysDeptAccountDto.deptName},'%')
         </if>
         </if>
+        group by a.dept_id
     </select>
     </select>
 
 
 
 
@@ -48,15 +54,19 @@
         a.comattribute,
         a.comattribute,
         a.comtype,
         a.comtype,
         b.management_fee,
         b.management_fee,
-        a.withdraw_user
+        a.withdraw_user,
+        SUM(CASE WHEN c.status = 0 THEN c.amount ELSE 0 END) AS waitAmount,
+        SUM(CASE WHEN c.status = 1 THEN c.amount ELSE 0 END) AS totalAmount
         FROM
         FROM
         sys_dept a
         sys_dept a
         RIGHT JOIN sys_dept_account b ON a.id = b.dept_id
         RIGHT JOIN sys_dept_account b ON a.id = b.dept_id
+        LEFT JOIN sys_dept_account_withdraw c on a.id = c.dept_id
         where
         where
         a.del_flag = 0
         a.del_flag = 0
         <if test="userId != null and userId != ''">
         <if test="userId != null and userId != ''">
             AND a.withdraw_user = #{userId}
             AND a.withdraw_user = #{userId}
         </if>
         </if>
+        group by a.id
     </select>
     </select>
 
 
     <select id="getDeptAccountByDept" resultMap="SysAccountByUserMap">
     <select id="getDeptAccountByDept" resultMap="SysAccountByUserMap">

+ 37 - 0
src/main/resources/mapper/modules/admin/SysDeptAccountWithdrawMapper.xml

@@ -1,4 +1,41 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ydtech.modules.admin.dao.SysDeptAccountWithdrawMapper">
 <mapper namespace="com.ydtech.modules.admin.dao.SysDeptAccountWithdrawMapper">
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.vo.SysDeptAccountWithdrawVo">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="amount" column="amount" jdbcType="DECIMAL"/>
+        <result property="status" column="status" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+        <result property="createTimeStart" column="createTimeStart" jdbcType="VARCHAR"/>
+        <result property="createTimeEnd" column="createTimeEnd" jdbcType="VARCHAR"/>
+    </resultMap>
+
+
+    <select id="selectSysDeptAccountWithdraw" resultMap="BaseResultMap">
+        select
+        id,
+        dept_id,
+        name,amount,
+        status,
+        remark,
+        DATE(create_time) as create_date
+        from sys_dept_account_withdraw
+        where
+        <if test="sysDeptAccountWithdrawVo.status != null and sysDeptAccountWithdrawVo.status != ''">
+             status = #{sysDeptAccountWithdrawVo.status}
+        </if>
+        <if test="sysDeptAccountWithdrawVo.deptId != null and sysDeptAccountWithdrawVo.deptId != ''">
+            and dept_id  = #{sysDeptAccountWithdrawVo.deptId}
+        </if>
+        <if test="sysDeptAccountWithdrawVo.createTimeStart != null and sysDeptAccountWithdrawVo.createTimeStart != ''">
+            and create_time &gt;= #{sysDeptAccountWithdrawVo.createTimeStart}
+        </if>
+        <if test="sysDeptAccountWithdrawVo.createTimeEnd != null and sysDeptAccountWithdrawVo.createTimeEnd != ''">
+            and create_time &lt;= #{sysDeptAccountWithdrawVo.createTimeEnd}
+        </if>
+    </select>
+
 </mapper>
 </mapper>