Explorar o código

财务--资金管理

y %!s(int64=2) %!d(string=hai) anos
pai
achega
b67b62de53
Modificáronse 34 ficheiros con 2533 adicións e 44 borrados
  1. 47 0
      src/main/java/com/ydtech/constants/enums/inv/InsAccountOperateEnum.java
  2. 44 0
      src/main/java/com/ydtech/constants/enums/inv/InvPayMethodEnum.java
  3. 0 24
      src/main/java/com/ydtech/modules/ins/utils/EasyExcelUtils.java
  4. 76 0
      src/main/java/com/ydtech/modules/inv/controller/InvAccountController.java
  5. 80 0
      src/main/java/com/ydtech/modules/inv/controller/InvAccountExpensesController.java
  6. 46 0
      src/main/java/com/ydtech/modules/inv/controller/InvAccountOperateController.java
  7. 116 0
      src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java
  8. 22 0
      src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java
  9. 24 0
      src/main/java/com/ydtech/modules/inv/dao/InvAccountExpensesMapper.java
  10. 23 0
      src/main/java/com/ydtech/modules/inv/dao/InvAccountMapper.java
  11. 23 0
      src/main/java/com/ydtech/modules/inv/dao/InvAccountOperateMapper.java
  12. 265 0
      src/main/java/com/ydtech/modules/inv/model/InvAccount.java
  13. 203 0
      src/main/java/com/ydtech/modules/inv/model/InvAccountExcel.java
  14. 90 0
      src/main/java/com/ydtech/modules/inv/model/InvAccountExpenses.java
  15. 114 0
      src/main/java/com/ydtech/modules/inv/model/InvAccountOperate.java
  16. 22 0
      src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java
  17. 21 0
      src/main/java/com/ydtech/modules/inv/service/InvAccountExpensesService.java
  18. 18 0
      src/main/java/com/ydtech/modules/inv/service/InvAccountOperateService.java
  19. 23 0
      src/main/java/com/ydtech/modules/inv/service/InvAccountService.java
  20. 126 0
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java
  21. 78 0
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExpensesServiceImpl.java
  22. 71 0
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java
  23. 164 0
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountServiceImpl.java
  24. 72 0
      src/main/java/com/ydtech/modules/inv/utils/EasyExcelUtils.java
  25. 241 0
      src/main/java/com/ydtech/modules/inv/utils/TransferUtils.java
  26. 0 15
      src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java
  27. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  28. 69 0
      src/main/java/com/ydtech/modules/xxl/handler/InvAccountHandler.java
  29. 27 4
      src/main/resources/application-dev.yml
  30. 120 0
      src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml
  31. 43 0
      src/main/resources/mapper/modules/inv/InvAccountExpensesMapper.xml
  32. 210 0
      src/main/resources/mapper/modules/inv/InvAccountMapper.xml
  33. 54 0
      src/main/resources/mapper/modules/inv/InvAccountOperateMapper.xml
  34. BIN=BIN
      资金申请单模板.xlsx

+ 47 - 0
src/main/java/com/ydtech/constants/enums/inv/InsAccountOperateEnum.java

@@ -0,0 +1,47 @@
+package com.ydtech.constants.enums.inv;
+
+import com.ydtech.aop.request.DictEnum;
+import com.ydtech.utils.StringUtils;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author jianlong
+ * @date 2024-01-05 11:46
+ */
+@Getter
+@AllArgsConstructor
+@DictEnum(key = "InvAccount", desc = "资金用途")
+public enum InsAccountOperateEnum {
+
+    FISCALPROFIT("0", "财税公司利润"),
+
+    INSURANCEPROFIT("1","保险公司回款"),
+
+
+    CLEARINGPROFIT("2","结算卡"),
+
+    EXTERIORPROFIT("3","外部过账金额"),
+
+    PARKPROFIT("4","园区利润"),
+
+    TIANQINGPROFIT("5","天勤利润"),
+
+    OTHERPROFIT("6","其他利润");
+
+    private final String code;
+
+    private final String desc;
+
+    public static String getNameByCode(String code) {
+        if (StringUtils.isEmpty(code)) {
+            return null;
+        }
+        for (InsAccountOperateEnum value : values()) {
+            if (value.getCode().equals(code)) {
+                return value.getDesc();
+            }
+        }
+        return code;
+    }
+}

+ 44 - 0
src/main/java/com/ydtech/constants/enums/inv/InvPayMethodEnum.java

@@ -0,0 +1,44 @@
+package com.ydtech.constants.enums.inv;
+
+import com.ydtech.aop.request.DictEnum;
+import com.ydtech.utils.StringUtils;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author jianlong
+ * @date 2024-01-15 10:02
+ */
+@Getter
+@AllArgsConstructor
+@DictEnum(key = "InvAccount", desc = "资金用途")
+public enum InvPayMethodEnum {
+
+    //支付方式(0现金 1微信 2转账 3其他)
+
+    CASH("0", "现金"),
+
+    WECHAT("1","微信"),
+
+
+    TRANSFER("2","转账"),
+
+    QITA("3","其他");
+
+    private final String code;
+
+    private final String desc;
+
+
+    public static String getNameByCode(String code) {
+        if (StringUtils.isEmpty(code)) {
+            return null;
+        }
+        for (InvPayMethodEnum value : values()) {
+            if (value.getCode().equals(code)) {
+                return value.getDesc();
+            }
+        }
+        return code;
+    }
+}

+ 0 - 24
src/main/java/com/ydtech/modules/ins/utils/EasyExcelUtils.java

@@ -1,24 +0,0 @@
-package com.ydtech.modules.ins.utils;
-
-import com.alibaba.excel.EasyExcel;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-/**
- * @author jianlong
- * @date 2023-12-29 16:46
- */
-@Component
-public class EasyExcelUtils {
-
-
-
-    public static String downExcel(String uploadFilePath,Class clz, List<?> list) {
-
-        String file = System.currentTimeMillis() + ".xlsx";
-        String fileName = uploadFilePath + file;
-        EasyExcel.write(fileName, clz).sheet("1").doWrite(list);
-        return file;
-    }
-}

+ 76 - 0
src/main/java/com/ydtech/modules/inv/controller/InvAccountController.java

@@ -0,0 +1,76 @@
+package com.ydtech.modules.inv.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.service.InvAccountService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ *
+ * @author jianlong
+ * @date 2024-01-05 09:31
+ */
+@RequestMapping("/invAccount")
+@RestController
+public class InvAccountController {
+    @Autowired
+    private InvAccountService invAccountService;
+
+    @ApiOperation("获取账户列表")
+    @PostMapping("getAccount")
+    public HttpResult<IPage<InvAccount>> getInsAccountList(@RequestBody InvAccount insAccount){
+        return HttpResult.ok("", invAccountService.selectAccountsList(insAccount));
+    }
+
+    @ApiOperation("获取账户详细信息")
+    @GetMapping("getAccountById")
+    public HttpResult<InvAccount> getInsAccountById(@RequestParam("accountId") String accountId){
+        return HttpResult.ok("", invAccountService.getById(accountId));
+    }
+
+    @ApiOperation("删除账户(只传一个id就行)")
+    @DeleteMapping("{accountId}")
+    public HttpResult deleteInsAccount(@PathVariable("accountId") String accountId){
+        if (accountId!= null){
+            InvAccount invAccount = invAccountService.getById(accountId);
+            invAccount.setDelFlag("1");
+            if (invAccountService.updateInsAccount(invAccount) > 0){
+                return HttpResult.ok("删除成功");
+            }else {
+                return HttpResult.error();
+            }
+        }else {
+            return HttpResult.error("id不能为空");
+        }
+    }
+
+    @ApiOperation("插入账户信息")
+    @PostMapping("insertAccount")
+    public HttpResult insertInsAccount(@RequestBody InvAccount invAccount){
+        if (invAccountService.insertInsAccount(invAccount) > 0){
+            return HttpResult.ok();
+        }else {
+            return HttpResult.error();
+        }
+    }
+
+    @ApiOperation("修改账户信息")
+    @PostMapping("updateAccount")
+    public HttpResult updateInsAccount(@RequestBody InvAccount invAccount){
+        if (invAccountService.updateInsAccount(invAccount) > 0){
+            return HttpResult.ok();
+        }else {
+            return HttpResult.error();
+        }
+    }
+
+    @ApiOperation("根据户名分类")
+    @GetMapping("getAccountByAccountName")
+    public HttpResult selectByAccountName(){
+        return invAccountService.selectByAccountName();
+    }
+}

+ 80 - 0
src/main/java/com/ydtech/modules/inv/controller/InvAccountExpensesController.java

@@ -0,0 +1,80 @@
+package com.ydtech.modules.inv.controller;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.inv.model.InvAccountExpenses;
+import com.ydtech.modules.inv.service.InvAccountExpensesService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+/**
+ * 费用支出明细表
+ * @author jianlong
+ * @date 2024-01-10 18:32
+ */
+@RestController
+@RequestMapping("accountExpense")
+public class InvAccountExpensesController {
+
+    @Autowired
+    private InvAccountExpensesService invAccountExpensesService;
+
+    /**
+     * 增加费用支出明细
+     */
+    @PostMapping("insertAccountExpenses")
+    @ApiOperation("增加费用支出明细")
+    public HttpResult insertInsAccountExpenses(@RequestBody InvAccountExpenses invAccountExpenses) {
+        BaseController baseController = new BaseController();
+        invAccountExpenses.setExpensesId(String.valueOf(new Date().getTime()));
+        invAccountExpenses.setCreateBy(baseController.getUserName());
+        invAccountExpenses.setCreateTime(new Date());
+
+        return HttpResult.ok("",invAccountExpensesService.save(invAccountExpenses));
+    }
+    /**
+     * 修改费用支出明细表
+     */
+    @PostMapping("updateAccountExpenses")
+    @ApiOperation("修改费用支出明细表")
+    public HttpResult updateInsAccountExpenses(@RequestBody InvAccountExpenses invAccountExpenses) {
+        BaseController baseController = new BaseController();
+        invAccountExpenses.setUpdateBy(baseController.getUserName());
+        invAccountExpenses.setUpdateTime(new Date());
+        return HttpResult.ok("",invAccountExpensesService.updateById(invAccountExpenses));
+    }
+    /**
+     * 删除费用支出明细表
+     */
+    @DeleteMapping("deleteAccountExpenses")
+    @ApiOperation("删除费用支出明细表")
+    public HttpResult deleteInsAccountExpenses(@RequestParam("id") String id) {
+        return HttpResult.ok("",invAccountExpensesService.removeById(id));
+    }
+    /**
+     * 获取费用支出明细表详情
+     */
+    @GetMapping("getAccountExpensesDetail")
+    @ApiOperation("获取费用支出明细表详情")
+    public HttpResult getInsAccountExpensesDetail(@RequestParam("id") String id) {
+        return HttpResult.ok("",invAccountExpensesService.getDetail(id));
+    }
+    /**
+     * 获取费用支出明细表列表
+     */
+    @PostMapping("getAccountExpensesList")
+    @ApiOperation("获取费用支出明细表列表")
+    public HttpResult getInsAccountExpensesList(@RequestBody InvAccountExpenses invAccountExpenses) {
+        return HttpResult.ok("",invAccountExpensesService.selectExpensesList(invAccountExpenses));
+    }
+
+    @GetMapping("getAccountExpensesTreeList")
+    @ApiOperation("获取费用支出明细表树形列表")
+    public HttpResult getInsAccountExpensesTreeList() {
+        return HttpResult.ok("",invAccountExpensesService.selectTreeList());
+    }
+}
+

+ 46 - 0
src/main/java/com/ydtech/modules/inv/controller/InvAccountOperateController.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.inv.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.inv.model.InvAccountOperate;
+import com.ydtech.modules.inv.service.InvAccountOperateService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * @author jianlong
+ * @date 2024-01-04 18:33
+ */
+
+@RequestMapping("accountOperate")
+@RestController
+public class InvAccountOperateController {
+
+    @Autowired
+    private InvAccountOperateService invAccountOperateService;
+
+
+
+    @PostMapping("getAccountOperate")
+    @ApiOperation("获取账户操作")
+    public HttpResult<IPage<InvAccountOperate>>  getAccountOperate(@RequestBody InvAccountOperate accountOperate){
+        return HttpResult.ok("",invAccountOperateService.selectList(accountOperate));
+    }
+
+
+
+    @GetMapping("getAccountOperateDetail")
+    @ApiOperation("获取账户操作详情")
+    public HttpResult<InvAccountOperate> getAccountOperateDetail(@RequestParam("accountOperateId")String accountOperateId){
+        return HttpResult.ok("",invAccountOperateService.getById(accountOperateId));
+    }
+
+
+    @PostMapping("insertAccountOperate")
+    @ApiOperation("新增外部收入")
+    public HttpResult insertAccountOperate(@RequestBody InvAccountOperate accountOperate){
+        return invAccountOperateService.insert(accountOperate);
+    }
+}

+ 116 - 0
src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java

@@ -0,0 +1,116 @@
+package com.ydtech.modules.inv.controller;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.service.InvAccountExcelService;
+import com.ydtech.modules.inv.service.InvAccountService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author jianlong
+ * @date 2024-01-10 09:49
+ */
+@RequestMapping("accountExcel")
+@RestController
+public class invAccountExcelController {
+    @Autowired
+    private InvAccountExcelService invAccountExcelService;
+    @Autowired
+    private InvAccountService invAccountService;
+
+    @PostMapping("excel")
+    @ApiOperation("导出资金申请模板")
+    public HttpResult excelAccountOperate(@RequestBody List<String> idList) {
+        return invAccountExcelService.excelAccount(idList);
+    }
+
+    @PostMapping("invert")
+    @ApiOperation("插入资金模板信息")
+    public HttpResult invertAccount(@RequestBody InvAccountExcel invAccountExcel) {
+        BaseController baseController = new BaseController();
+        Date date = new Date();
+        invAccountExcel.setCreateBy(baseController.getUserName());
+        invAccountExcel.setCreateTime(date);
+        InvAccount byId = invAccountService.getById(invAccountExcel.getOutAccountId());
+
+        if (invAccountExcel.getEnterAccountId() != null) {
+            if (invAccountExcel.getOutAccountId().equals(invAccountExcel.getEnterAccountId())) {
+                throw new SystemException("无法转账给本公司");
+            }
+        }
+        if (invAccountExcel.getOutFlag().equals("1") && byId.getOuterFlag().equals("1")) {
+            throw new SystemException("外部账户转出到外部账户无法生成资金模板");
+        }
+
+        if (invAccountExcelService.save(invAccountExcel)) {
+            return HttpResult.ok("", invAccountExcel.getExcelAccountOperateId());
+        }
+        return HttpResult.error("新增失败");
+    }
+
+    @PostMapping("update")
+    @ApiOperation("修改资金模板信息")
+    public HttpResult updateAccount(@RequestBody InvAccountExcel invAccountExcel) {
+        if (invAccountExcel.getExcelAccountOperateId() != null) {
+            if (invAccountExcel.getTransferFlag().equals("1")) {
+                BaseController baseController = new BaseController();
+                invAccountExcel.setUpdateBy(baseController.getUserName());
+                invAccountExcel.setUpdateTime(new Date());
+                return HttpResult.ok("", invAccountExcelService.updateById(invAccountExcel));
+            } else {
+                return HttpResult.error("已转账无法修改");
+            }
+        } else {
+            return HttpResult.error("id不能为空");
+        }
+    }
+
+    @ApiOperation("获取资金模板详细信息")
+    @GetMapping("getAccountExcelById")
+    public HttpResult<InvAccountExcel> getAccountExcelById(@RequestParam("excelAccountOperateId") String excelAccountOperateId) {
+        if (excelAccountOperateId != null) {
+            return HttpResult.ok("", invAccountExcelService.getById(excelAccountOperateId));
+        } else {
+            return HttpResult.error("id不能为空");
+        }
+    }
+
+    @ApiOperation("获取资金模板列表")
+    @PostMapping("getAccountExcel")
+    public HttpResult getAccountExcel(@RequestBody InvAccountExcel invAccountExcel) {
+        return invAccountExcelService.selectAccountExcel(invAccountExcel);
+    }
+
+    @ApiOperation("删除资金模板")
+    @DeleteMapping("{excelAccountOperateId}")
+    public HttpResult deleteAccountExcel(@PathVariable("excelAccountOperateId") String excelAccountOperateId) {
+        InvAccountExcel invAccountExcel = invAccountExcelService.getById(excelAccountOperateId);
+        if (excelAccountOperateId != null) {
+            if (invAccountExcel.getTransferFlag().equals("1")) {
+                invAccountExcel.setDelFlag("1");
+                return HttpResult.ok("", invAccountExcelService.updateById(invAccountExcel));
+            } else {
+                return HttpResult.error("已转账无法删除");
+            }
+        } else {
+            return HttpResult.error("id不能为空");
+        }
+    }
+
+    @ApiOperation("修改转账状态")
+    @GetMapping("updateTransferFlag")
+    public HttpResult updateTransferFlag(@RequestParam("excelAccountOperateId") String excelAccountOperateId) {
+        if (excelAccountOperateId == null) {
+            return HttpResult.error("id不能为空");
+        }
+        return invAccountExcelService.updateTransferFlag(excelAccountOperateId);
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.inv.dao;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.modules.inv.model.InvAccountExcel;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_excel(资金申请单表)】的数据库操作Mapper
+* @createDate 2024-01-10 08:53:59
+* @Entity generator.domain.InsAccountExcel
+*/
+public interface InvAccountExcelMapper extends BaseMapper<InvAccountExcel> {
+    IPage<InvAccountExcel> selectExcelAccount(Page page, @Param("insAccountExcel") InvAccountExcel insAccountExcel);
+}
+
+
+
+

+ 24 - 0
src/main/java/com/ydtech/modules/inv/dao/InvAccountExpensesMapper.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.inv.dao;
+
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.modules.inv.model.InvAccountExpenses;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_expenses(费用支出明细表)】的数据库操作Mapper
+* @createDate 2024-01-10 18:13:14
+* @Entity generator.domain.InsAccountExpenses
+*/
+public interface InvAccountExpensesMapper extends BaseMapper<InvAccountExpenses> {
+
+    IPage<InvAccountExpenses> selectExpensesList(Page page, @Param("accountExpenses") InvAccountExpenses accountExpenses);
+}
+
+
+
+

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

@@ -0,0 +1,23 @@
+package com.ydtech.modules.inv.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.inv.model.InvAccount;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author Administrator
+ * @description 针对表【ins_account(账户信息表)】的数据库操作Mapper
+ * @createDate 2024-01-04 18:29:20
+ * @Entity com.ydtech.modules.inv.model.InsAccount
+ */
+public interface InvAccountMapper extends BaseMapper<InvAccount> {
+
+    IPage<InvAccount> SelectAccountsList(Page page, @Param("account")InvAccount account);
+
+}
+
+
+
+

+ 23 - 0
src/main/java/com/ydtech/modules/inv/dao/InvAccountOperateMapper.java

@@ -0,0 +1,23 @@
+package com.ydtech.modules.inv.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.modules.inv.model.InvAccountOperate;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_operate(账户操作记录表)】的数据库操作Mapper
+* @createDate 2024-01-04 18:29:20
+* @Entity com.ydtech.modules.inv.model.InsAccountOperate
+*/
+public interface InvAccountOperateMapper extends BaseMapper<InvAccountOperate> {
+
+    IPage<InvAccountOperate> selectInsAccountOperate(Page page, @Param("insAccountOperate") InvAccountOperate insAccountOperate);
+
+}
+
+
+
+

+ 265 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccount.java

@@ -0,0 +1,265 @@
+package com.ydtech.modules.inv.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 账户信息表
+ * @TableName ins_account
+ */
+@TableName(value ="inv_account")
+@Data
+public class InvAccount implements Serializable {
+    /**
+     * 账户id
+     */
+    @TableId
+    @ApiModelProperty(value = "账户id")
+    private String accountId;
+
+    /**
+     * 户名
+     */
+    @ApiModelProperty(value = "户名")
+    private String accountName;
+
+    /**
+     * 银行卡号
+     */
+    @ApiModelProperty(value = "银行卡号")
+    private String bankCardNum;
+
+    /**
+     * 开户行名称
+     */
+    @ApiModelProperty(value = "开户行名称")
+    private String bankName;
+
+    /**
+     * 开户行
+     */
+    @ApiModelProperty(value = "开户行")
+    private String bank;
+
+    /**
+     * 开户行号
+     */
+    @ApiModelProperty(value = "开户行号")
+    private String bankNum;
+
+    /**
+     * 证书有效期开始
+     */
+    @ApiModelProperty(value = "证书有效期开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date startCertExpirationDate;
+
+
+    /**
+     * 创建者
+     */
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新者
+     */
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 账户性质(0公户 1私户)
+     */
+    @ApiModelProperty(value = "账户性质(0公户 1私户)")
+    private String accountQuality;
+
+    /**
+     * 对公单笔限额
+     */
+    @ApiModelProperty(value = "对公单笔限额")
+    private String pubSingleLines;
+
+    /**
+     * 对私单笔限额
+     */
+    @ApiModelProperty(value = "对私单笔限额")
+    private String priSingleLines;
+
+    /**
+     * 对公年额度
+     */
+    @ApiModelProperty(value = "对公年额度")
+    private String pubYearLines;
+
+    /**
+     * 对私年额度
+     */
+    @ApiModelProperty(value = "对私年额度")
+    private String priYearLines;
+
+    /**
+     * 单日转账笔数限制
+     */
+    @ApiModelProperty(value = "单日转账笔数限制")
+    private String dayStrokeNum;
+
+    /**
+     * 对公单日限额
+     */
+    @ApiModelProperty(value = "对公单日限额")
+    private String pubDayLines;
+
+    /**
+     * 对私单日限额
+     */
+    @ApiModelProperty(value = "对私单日限额")
+    private String priDayLines;
+
+    /**
+     * 对公年剩余额度
+     */
+    @ApiModelProperty(value = "对公年剩余额度")
+    private String pubYearExcess;
+
+    /**
+     * 对私年剩余额度
+     */
+    @ApiModelProperty(value = "对私年剩余额度")
+    private String priYearExcess;
+
+    /**
+     * 财税公司利润
+     */
+    @ApiModelProperty(value = "财务公司利润")
+    private String fiscalProfit;
+
+    /**
+     * 保险公司回款
+     */
+    @ApiModelProperty(value = "保险公司利润")
+    private String insuranceProfit;
+
+    /**
+     * 结算卡
+     */
+    @ApiModelProperty(value = "结算卡")
+    private String clearingProfit;
+
+    /**
+     * 外部过账金额
+     */
+    @ApiModelProperty(value = "外部过账金额")
+    private String exteriorProfit;
+
+    /**
+     * 园区利润
+     */
+    @ApiModelProperty(value = "园区利润")
+    private String parkProfit;
+
+    /**
+     * 天勤利润
+     */
+    @ApiModelProperty(value = "天勤利润")
+    private String tianqinProfit;
+
+    /**
+     * 其他利润
+     */
+    @ApiModelProperty(value = "其他利润")
+    private String otherProfit;
+
+    /**
+     * 证书有效期结束
+     */
+    @ApiModelProperty(value = "证书有效期结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date endCertExpirationDate;
+
+    /**
+     * 余额
+     */
+    @ApiModelProperty(value = "余额")
+    private String balance;
+
+    /**
+     * 单日转账笔数剩余
+     */
+    @ApiModelProperty(value = "单日转账笔数剩余")
+    private String dayStrokeNumExcess;
+
+    /**
+     * 对公单日限额剩余
+     */
+    @ApiModelProperty(value = "对公单日限额剩余")
+    private String pubDayLinesExcess;
+
+    /**
+     * 对私单日限额剩余
+     */
+    @ApiModelProperty(value = "对私单日限额剩余")
+    private String priDayLinesExcess;
+
+    @ApiModelProperty(value = "删除标志 删除时不需要传递")
+    private String delFlag;
+
+    /**
+     * 外部账户标识(0内部账户 1外部账户)
+     */
+    @ApiModelProperty(value = "外部账户标识(0内部账户 1外部账户)")
+    private String outerFlag;
+
+    /**
+     * 支出金额
+     */
+    @ApiModelProperty("支出金额")
+    private String spend;
+
+
+
+
+    @TableField(exist = false)
+    private int pageNo;
+
+    @TableField(exist = false)
+    private int PageSize;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        InvAccount that = (InvAccount) o;
+        return Objects.equals(pubSingleLines, that.pubSingleLines) && Objects.equals(priSingleLines, that.priSingleLines) && Objects.equals(pubYearLines, that.pubYearLines) && Objects.equals(priYearLines, that.priYearLines) && Objects.equals(dayStrokeNum, that.dayStrokeNum) && Objects.equals(pubDayLines, that.pubDayLines) && Objects.equals(priDayLines, that.priDayLines);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(pubSingleLines, priSingleLines, pubYearLines, priYearLines, dayStrokeNum, pubDayLines, priDayLines);
+    }
+}

+ 203 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountExcel.java

@@ -0,0 +1,203 @@
+package com.ydtech.modules.inv.model;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.alibaba.excel.enums.poi.BorderStyleEnum;
+import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
+import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 资金申请单表
+ * @TableName ins_account_excel
+ */
+@TableName(value ="inv_account_excel")
+@Data
+@ContentStyle(borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN,
+horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER
+)
+@ExcelIgnoreUnannotated
+public class InvAccountExcel implements Serializable {
+    /**
+     * 资金申请表id
+     */
+    @TableId
+    @ApiModelProperty(value = "资金申请表id")
+    private String excelAccountOperateId;
+
+    /**
+     * 单位
+     */
+    @ApiModelProperty(value = "单位")
+    @NotBlank
+    private String company;
+
+    /**
+     * 申请人
+     */
+    @ApiModelProperty(value = "申请人")
+    @NotBlank
+    private String applicant;
+
+    /**
+     * 申请时间
+     */
+    @ApiModelProperty(value = "申请时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @NotBlank
+    private Date applyTime;
+
+    /**
+     * 解决excel日期格式转换问题
+     */
+    @ApiModelProperty(value = "无需理会")
+    @TableField(exist = false)
+    private String excelApplyTime;
+
+    /**
+     * 申请部门
+     */
+    @ApiModelProperty(value = "申请部门")
+    @NotBlank
+    private String applySector;
+
+    /**
+     * 收款单位信息
+     */
+    @ApiModelProperty(value = "收款单位信息")
+    @NotBlank
+    private String collectionMessage;
+
+    /**
+     * 资金流程
+     */
+    @ApiModelProperty(value = "资金流程")
+    @NotBlank
+    private String fundFlow;
+
+    /**
+     * 资金用途
+     */
+    @ApiModelProperty(value = "资金用途")
+    @NotBlank
+    private String fundUse;
+
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    @NotBlank
+    private String remark;
+
+    /**
+     * 申请金额
+     */
+    @ApiModelProperty(value = "申请金额")
+    @NotBlank
+    private String applyAmount;
+
+    /**
+     * 大写金额
+     */
+    @ApiModelProperty(value = "大写金额")
+    @NotBlank
+    private String bigApplyAmount;
+
+    /**
+     * 下载地址
+     */
+    @ApiModelProperty(value = "下载地址")
+    private String uplodePath;
+
+    /**
+     * 更新者
+     */
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 创建者
+     */
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 转入的账户id
+     */
+    @ApiModelProperty(value = "转入的账户id")
+    private String enterAccountId;
+
+    /**
+     * 转出的账户id
+     */
+    @ApiModelProperty(value = "转出的账户id")
+    private String outAccountId;
+
+
+    /**
+     * 对内对外标志(0对内 1对外)
+     */
+    @ApiModelProperty(value = "对内对外标志(0对内 1对外)")
+    @NotBlank
+    private String outFlag;
+
+    /**
+     * 如果对外则填写账户性质(0公户 1私户)
+     */
+    @ApiModelProperty(value = "如果对外则填写账户性质(0公户 1私户)")
+    private String outAccountQuality;
+
+    /**
+     * 删除标志
+     */
+    @ApiModelProperty("做删除时无需传值 只需删除的id即可")
+    private String delFlag;
+
+    /**
+     * 转账标志(0已转 1未转)
+     */
+    @ApiModelProperty(value = "转账标志(0已转 1未转)")
+    private String transferFlag;
+
+
+    /**
+     * 支付方式(0现金 1微信 2转账 3其他)
+     */
+    @ApiModelProperty(value = "支付方式(0现金 1微信 2转账 3其他)")
+    @NotBlank
+    private String payMethod;
+
+    @TableField(exist = false)
+    private int pageNo;
+
+    @TableField(exist = false)
+    private int PageSize;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 90 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountExpenses.java

@@ -0,0 +1,90 @@
+package com.ydtech.modules.inv.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 费用支出明细表
+ * @TableName ins_account_expenses
+ */
+@TableName(value ="inv_account_expenses")
+@Data
+public class InvAccountExpenses implements Serializable {
+    /**
+     * 收入支出明细id
+     */
+    @ApiModelProperty(value = "收入支出明细id")
+    @TableId
+    private String expensesId;
+
+    /**
+     * 类目
+     */
+    @ApiModelProperty(value = "类目")
+    private String category;
+
+    /**
+     * 父id
+     */
+    @ApiModelProperty(value = "父id")
+    private String parentId;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    /**
+     * 删除标志(0代表存在 1代表删除)
+     */
+    @ApiModelProperty(value = "删除标志(0代表存在 1代表删除)")
+    private String delFlag;
+
+    /**
+     * 创建者
+     */
+    @ApiModelProperty(value = "创建者")
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新者
+     */
+    @ApiModelProperty(value = "更新者")
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "子类")
+    private List<InvAccountExpenses> child;
+
+    @TableField(exist = false)
+    private int pageNo;
+
+    @TableField(exist = false)
+    private int pageSize;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 114 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountOperate.java

@@ -0,0 +1,114 @@
+package com.ydtech.modules.inv.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 账户操作记录表
+ * @TableName ins_account_operate
+ */
+@TableName(value ="inv_account_operate")
+@Data
+public class InvAccountOperate implements Serializable {
+    /**
+     * 账户操作id
+     */
+    @TableId
+    @ApiModelProperty(value = "账户操作id")
+    private String accountOperateId;
+
+    /**
+     * 申请人
+     */
+    @ApiModelProperty(value = "申请人")
+    private String applicant;
+
+    /**
+     * 申请部门
+     */
+    @ApiModelProperty(value = "申请部门")
+    private String applySector;
+
+    /**
+     * 申请时间
+     */
+    @ApiModelProperty(value = "申请时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date applyTime;
+
+    /**
+     * 收款信息
+     */
+    @ApiModelProperty(value = "收款信息")
+    private String collectionMessage;
+
+    /**
+     * 资金流向
+     */
+    @ApiModelProperty(value = "资金流向")
+    private String fundFlow;
+
+    /**
+     * 资金用途
+     */
+    @ApiModelProperty(value = "资金用途")
+    private String fundUse;
+
+    /**
+     * 申请金额
+     */
+    @ApiModelProperty(value = "申请金额")
+    private String applyAmount;
+
+    /**
+     * 支付方式(0现金 1微信 2转账 3其他)
+     */
+    @ApiModelProperty(value = "支付方式(0现金 1微信 2转账 3其他)")
+    private String payMethod;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    /**
+     * 单位
+     */
+    @ApiModelProperty(value = "单位")
+    private String company;
+
+    /**
+     * 大写金额
+     */
+    @ApiModelProperty(value = "大写金额")
+    private String bigApplyAmount;
+
+    /**
+     * 收入0支出1
+     */
+    @ApiModelProperty(value = "收入0支出1")
+    private String revenueOutlay;
+
+    @ApiModelProperty(value = "外部转内部需携带转入id")
+    @TableField(exist = false)
+    private String enterAccountId;
+
+
+    @TableField(exist = false)
+    private int pageNo;
+
+    @TableField(exist = false)
+    private int PageSize;
+
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 22 - 0
src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.inv.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.inv.model.InvAccountExcel;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_excel(资金申请单表)】的数据库操作Service
+* @createDate 2024-01-10 08:53:59
+*/
+public interface InvAccountExcelService extends IService<InvAccountExcel> {
+    HttpResult excelAccount(List<String> idList);
+
+    HttpResult selectAccountExcel(InvAccountExcel invAccountExcel);
+
+    HttpResult updateTransferFlag(String excelAccountOperateId);
+
+}

+ 21 - 0
src/main/java/com/ydtech/modules/inv/service/InvAccountExpensesService.java

@@ -0,0 +1,21 @@
+package com.ydtech.modules.inv.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.inv.model.InvAccountExpenses;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_expenses(费用支出明细表)】的数据库操作Service
+* @createDate 2024-01-10 18:13:14
+*/
+public interface InvAccountExpensesService extends IService<InvAccountExpenses> {
+     IPage<InvAccountExpenses> selectExpensesList(InvAccountExpenses accountExpenses);
+
+     List<InvAccountExpenses> selectTreeList();
+
+     InvAccountExpenses getDetail(String id);
+}

+ 18 - 0
src/main/java/com/ydtech/modules/inv/service/InvAccountOperateService.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.inv.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.inv.model.InvAccountOperate;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_operate(账户操作记录表)】的数据库操作Service
+* @createDate 2024-01-04 18:29:20
+*/
+public interface InvAccountOperateService extends IService<InvAccountOperate> {
+
+    IPage<InvAccountOperate> selectList(InvAccountOperate list);
+
+    HttpResult insert(InvAccountOperate invAccountOperate);
+}

+ 23 - 0
src/main/java/com/ydtech/modules/inv/service/InvAccountService.java

@@ -0,0 +1,23 @@
+package com.ydtech.modules.inv.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account(账户信息表)】的数据库操作Service
+* @createDate 2024-01-04 18:29:20
+*/
+public interface InvAccountService extends IService<InvAccount> {
+
+    IPage<InvAccount> selectAccountsList(InvAccount account);
+
+    int updateInsAccount(InvAccount insAccount);
+
+    int insertInsAccount(InvAccount insAccount);
+
+    HttpResult selectByAccountName();
+
+}

+ 126 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java

@@ -0,0 +1,126 @@
+package com.ydtech.modules.inv.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageRequest;
+import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.InvAccountOperate;
+import com.ydtech.modules.inv.service.InvAccountExcelService;
+import com.ydtech.modules.inv.service.InvAccountOperateService;
+import com.ydtech.modules.inv.service.InvAccountService;
+import com.ydtech.modules.inv.utils.EasyExcelUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import static com.ydtech.modules.inv.utils.TransferUtils.*;
+
+/**
+ * @author Administrator
+ * @description 针对表【ins_account_excel(资金申请单表)】的数据库操作Service实现
+ * @createDate 2024-01-10 08:53:59
+ */
+@Service
+public class InvAccountExcelServiceImpl extends ServiceImpl<InvAccountExcelMapper, InvAccountExcel>
+        implements InvAccountExcelService {
+
+    @Autowired
+    private InvAccountExcelMapper insAccountExcelMapper;
+    @Autowired
+    private InvAccountOperateService insAccountOperateService;
+    @Autowired
+    private InvAccountService insAccountService;
+    @Autowired
+    private EasyExcelUtils easyExcelUtils;
+
+    @Value("${upload.file.path}")
+    String uploadFilePath;
+
+    @Override
+    public HttpResult excelAccount(List<String> idList) {
+        List<InvAccountExcel> insAccountExcels = insAccountExcelMapper.selectBatchIds(idList);
+        if (!insAccountExcels.isEmpty()) {
+            return HttpResult.ok("", easyExcelUtils.downAccountExcel(uploadFilePath, insAccountExcels));
+        }
+        return HttpResult.error("导出失败");
+    }
+
+    @Override
+    public HttpResult selectAccountExcel(InvAccountExcel invAccountExcel) {
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(invAccountExcel.getPageNo());
+        pageRequest.setPageSize(invAccountExcel.getPageSize());
+        Page page = PageRequest.buildPageRequest(pageRequest);
+        return HttpResult.ok("", insAccountExcelMapper.selectExcelAccount(page, invAccountExcel));
+    }
+
+    /**
+     * 修改已转账状态
+     *
+     * @param excelAccountOperateId
+     * @return
+     */
+    @Override
+    public HttpResult updateTransferFlag(String excelAccountOperateId) {
+        InvAccountExcel invAccountExcel = insAccountExcelMapper.selectById(excelAccountOperateId);
+        if (invAccountExcel == null) {
+            throw new RuntimeException("该记录不存在");
+        }
+        InvAccount outAccount = insAccountService.getById(invAccountExcel.getOutAccountId());
+        InvAccount enterAccount = insAccountService.getById(invAccountExcel.getEnterAccountId());
+        BaseController baseController = new BaseController();
+        String userName = baseController.getUserName();
+        outAccount.setUpdateBy(userName);
+        outAccount.setUpdateTime(new Date());
+        enterAccount.setUpdateBy(userName);
+        enterAccount.setUpdateTime(new Date());
+        //修改转账状态
+        invAccountExcel.setTransferFlag("0");
+        //判断是转账给内部还是外部
+        if (invAccountExcel.getOutFlag().equals("0")) {
+            //转账操作
+
+            //如果转账失败就返回错误
+            List<InvAccount> insAccounts = insideTransfer(outAccount, enterAccount, invAccountExcel);
+            if (insAccounts.isEmpty()) {
+                throw new RuntimeException("转账失败");
+            }
+            if (!insAccountService.updateBatchById(insAccounts)){
+                throw new RuntimeException("转账失败");
+            }
+
+            //内部转账操作
+            List<InvAccountOperate> list = new ArrayList<>();
+            //支出信息
+            list.add(insertOutAccountOperate(invAccountExcel));
+            //收入信息
+            list.add(insertRevenueAccountOperate(invAccountExcel));
+            if (!insAccountOperateService.saveBatch(list)){
+                throw new RuntimeException("添加转账信息失败");
+            }
+        } else {
+            //内转外部转账
+            List<InvAccount> invAccounts = enterDeTransfer(outAccount, enterAccount, invAccountExcel);
+            insAccountOperateService.save(insertOutAccountOperate(invAccountExcel));
+            if (!insAccountService.saveBatch(invAccounts)){
+                throw new RuntimeException("添加转账信息失败");
+            }
+        }
+        return HttpResult.ok("", insAccountExcelMapper.updateById(invAccountExcel));
+    }
+
+
+}
+
+
+
+
+

+ 78 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExpensesServiceImpl.java

@@ -0,0 +1,78 @@
+package com.ydtech.modules.inv.service.impl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.PageRequest;
+import com.ydtech.modules.inv.dao.InvAccountExpensesMapper;
+import com.ydtech.modules.inv.model.InvAccountExpenses;
+import com.ydtech.modules.inv.service.InvAccountExpensesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+* @author Administrator
+* @description 针对表【ins_account_expenses(费用支出明细表)】的数据库操作Service实现
+* @createDate 2024-01-10 18:13:14
+*/
+@Service
+public class InvAccountExpensesServiceImpl extends ServiceImpl<InvAccountExpensesMapper, InvAccountExpenses>
+    implements InvAccountExpensesService {
+
+    @Autowired
+    InvAccountExpensesMapper invAccountExpensesMapper;
+
+    @Override
+    public IPage<InvAccountExpenses> selectExpensesList(InvAccountExpenses accountExpenses) {
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(accountExpenses.getPageNo());
+        pageRequest.setPageSize(accountExpenses.getPageSize());
+        Page page = PageRequest.buildPageRequest(pageRequest);
+
+        return invAccountExpensesMapper.selectExpensesList(page,accountExpenses);
+    }
+
+    public InvAccountExpenses getDetail(String id) {
+        return invAccountExpensesMapper.selectById(id);
+    }
+
+    @Override
+    public List<InvAccountExpenses> selectTreeList() {
+        LambdaQueryWrapper<InvAccountExpenses> wrapper = new LambdaQueryWrapper<>();
+        return getTree(invAccountExpensesMapper.selectList(wrapper));
+    }
+
+    /**
+     * 组装树形结构结果集方法
+     */
+
+    public List<InvAccountExpenses> getTree(List<InvAccountExpenses> list){
+
+        return list.stream().filter(accountExpenses -> accountExpenses.getParentId().equals("0"))
+                .peek(accountExpenses -> accountExpenses.setChild(getChildren(accountExpenses,list))).collect(Collectors.toList());
+    }
+
+    public List<InvAccountExpenses> getChildren(InvAccountExpenses user,List<InvAccountExpenses> userList){
+        return userList.stream().filter(u -> Objects.equals(u.getParentId(),user.getExpensesId())).map(
+                u -> {
+                    u.setChild(getChildren(u,userList));
+                    return u;
+                }
+        ).collect(Collectors.toList());
+    }
+
+
+
+
+
+}
+
+
+
+

+ 71 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java

@@ -0,0 +1,71 @@
+package com.ydtech.modules.inv.service.impl;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageRequest;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.model.InvAccountOperate;
+import com.ydtech.modules.inv.service.InvAccountOperateService;
+import com.ydtech.modules.inv.dao.InvAccountOperateMapper;
+import com.ydtech.modules.inv.service.InvAccountService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import static com.ydtech.modules.inv.utils.TransferUtils.outsideTransfer;
+
+/**
+ * @author Administrator
+ * @description 针对表【ins_account_operate(账户操作记录表)】的数据库操作Service实现
+ * @createDate 2024-01-04 18:29:20
+ */
+@Service
+public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateMapper, InvAccountOperate>
+        implements InvAccountOperateService {
+
+    @Autowired
+    private InvAccountOperateMapper insAccountOperateMapper;
+
+    @Autowired
+    private InvAccountService insAccountService;
+
+    /**
+     * 查询操作列表
+     *
+     * @param accountOperate
+     * @return
+     */
+    @Override
+    public IPage<InvAccountOperate> selectList(InvAccountOperate accountOperate) {
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(accountOperate.getPageNo());
+        pageRequest.setPageSize(accountOperate.getPageSize());
+        Page page = PageRequest.buildPageRequest(pageRequest);
+        return insAccountOperateMapper.selectInsAccountOperate(page, accountOperate);
+    }
+
+    /**
+     * 外部转内部
+     * @param invAccountOperate
+     * @return
+     */
+    @Override
+    public HttpResult insert(InvAccountOperate invAccountOperate) {
+        InvAccount enterAccount = insAccountService.getById(invAccountOperate.getEnterAccountId());
+        InvAccount invAccount = outsideTransfer(enterAccount, invAccountOperate);
+
+        if (!insAccountService.updateById(invAccount)){
+
+            return HttpResult.error("新增收入失败");
+        }
+        insAccountOperateMapper.insert(invAccountOperate);
+        return HttpResult.ok("新增收入成功");
+    }
+
+}
+
+
+
+

+ 164 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountServiceImpl.java

@@ -0,0 +1,164 @@
+package com.ydtech.modules.inv.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageRequest;
+import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.service.InvAccountService;
+import com.ydtech.modules.inv.dao.InvAccountMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Administrator
+ * @description 针对表【ins_account(账户信息表)】的数据库操作Service实现
+ * @createDate 2024-01-04 18:29:20
+ */
+@Service
+public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAccount>
+        implements InvAccountService {
+
+    @Autowired
+    private InvAccountMapper insAccountMapper;
+
+    /**
+     * 分页查询
+     *
+     * @param account
+     * @return
+     */
+    @Override
+    public IPage<InvAccount> selectAccountsList(InvAccount account) {
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(account.getPageNo());
+        pageRequest.setPageSize(account.getPageSize());
+        Page page = PageRequest.buildPageRequest(pageRequest);
+        return insAccountMapper.SelectAccountsList(page, account);
+    }
+
+    /**
+     * 修改方法
+     *
+     * @param insAccount
+     * @return
+     */
+    @Override
+    public int updateInsAccount(InvAccount invAccount) {
+        BaseController baseController = new BaseController();
+        invAccount.setUpdateBy(baseController.getUserName());
+        invAccount.setUpdateTime(new Date());
+        //不允许修改余额
+        invAccount.setBalance(null);
+        invAccount.setDayStrokeNumExcess(null);
+        invAccount.setPubDayLinesExcess(null);
+        invAccount.setPubYearExcess(null);
+        invAccount.setPriDayLinesExcess(null);
+        invAccount.setPriYearExcess(null);
+
+        InvAccount oldeInsAccount = insAccountMapper.selectById(invAccount.getAccountId());
+        //判断是否修改额度
+        if (!oldeInsAccount.equals(invAccount)) {
+            return insAccountMapper.updateById(updateInsAccountLines(oldeInsAccount, invAccount));
+        }
+        return insAccountMapper.updateById(invAccount);
+    }
+
+
+    /**
+     * 修改额度方法
+     */
+    private InvAccount updateInsAccountLines(InvAccount oldeInvAccount, InvAccount newInvAccount) {
+        if (oldeInvAccount.getPriYearLines().equals(newInvAccount.getPriYearLines())) {
+            //对私年额度已经消费
+            BigDecimal subtract = new BigDecimal(oldeInvAccount.getPriYearLines()).subtract(new BigDecimal(oldeInvAccount.getPriYearExcess()));
+            newInvAccount.setPriYearExcess(subtract.toString());
+        }
+        if (oldeInvAccount.getPubYearLines().equals(newInvAccount.getPubYearLines())) {
+            //对公年额度已经消费
+            BigDecimal subtract = new BigDecimal(oldeInvAccount.getPubYearLines()).subtract(new BigDecimal(oldeInvAccount.getPubYearExcess()));
+            newInvAccount.setPubYearExcess(subtract.toString());
+        }
+        if (oldeInvAccount.getPubDayLines().equals(newInvAccount.getPubDayLines())) {
+            //对公单日额度已经消费
+            BigDecimal subtract = new BigDecimal(oldeInvAccount.getPubDayLines()).subtract(new BigDecimal(oldeInvAccount.getPubDayLinesExcess()));
+            newInvAccount.setPubDayLinesExcess(subtract.toString());
+        }
+        if (oldeInvAccount.getPriDayLines().equals(newInvAccount.getPriDayLines())) {
+            //对私单日额度已经消费
+            BigDecimal subtract = new BigDecimal(oldeInvAccount.getPriDayLines()).subtract(new BigDecimal(oldeInvAccount.getPriDayLinesExcess()));
+            newInvAccount.setPriDayLinesExcess(subtract.toString());
+        }
+        if (oldeInvAccount.getDayStrokeNum().equals(newInvAccount.getDayStrokeNum())) {
+            //单日转账笔数已经消费
+            BigDecimal subtract = new BigDecimal(oldeInvAccount.getDayStrokeNum()).subtract(new BigDecimal(oldeInvAccount.getDayStrokeNumExcess()));
+            newInvAccount.setDayStrokeNumExcess(subtract.toString());
+        }
+
+        return newInvAccount;
+    }
+
+    /**
+     * 插入
+     *
+     * @param insAccount
+     * @return
+     */
+    @Override
+    public int insertInsAccount(InvAccount invAccount) {
+        if(invAccount.getOuterFlag().equals("0")){
+            //插入剩余额度以及笔数
+            invAccount.setPubYearExcess(invAccount.getPubYearLines());
+            invAccount.setPubDayLinesExcess(invAccount.getPubDayLines());
+            invAccount.setPriYearExcess(invAccount.getPriYearLines());
+            invAccount.setPriDayLinesExcess((invAccount.getPriDayLines()));
+            invAccount.setDayStrokeNumExcess(invAccount.getDayStrokeNum());
+            invAccount.setPubSingleLines(invAccount.getPubSingleLines());
+            invAccount.setPriSingleLines(invAccount.getPriSingleLines());
+
+
+            //计算余额
+            BigDecimal count = new BigDecimal(invAccount.getFiscalProfit())
+                    .add(new BigDecimal(invAccount.getInsuranceProfit())) //财税公司利润
+                    .add(new BigDecimal(invAccount.getInsuranceProfit())) //保险公司回款
+                    .add(new BigDecimal(invAccount.getExteriorProfit()))//外部过账金额
+                    .add(new BigDecimal(invAccount.getParkProfit()))//园区利润
+                    .add(new BigDecimal(invAccount.getTianqinProfit()))//天勤利润
+                    .add(new BigDecimal(invAccount.getOtherProfit()))//其他利润
+                    .add(new BigDecimal(invAccount.getClearingProfit()));//结算卡
+            BaseController baseController = new BaseController();
+            invAccount.setBalance(String.valueOf(count));
+            invAccount.setCreateBy(baseController.getUserName());
+            invAccount.setCreateTime(new Date());
+        }
+
+        return insAccountMapper.insert(invAccount);
+    }
+
+    /**
+     * 根据户名分类
+     *
+     * @return
+     */
+    @Override
+    public HttpResult selectByAccountName() {
+        LambdaQueryWrapper<InvAccount> wrapper = new LambdaQueryWrapper<>();
+        List<InvAccount> insAccounts = insAccountMapper.selectList(wrapper);
+        if (!insAccounts.isEmpty()) {
+            return HttpResult.ok("", insAccounts);
+        }
+        return HttpResult.error("查询错误");
+    }
+
+}
+
+
+
+

+ 72 - 0
src/main/java/com/ydtech/modules/inv/utils/EasyExcelUtils.java

@@ -0,0 +1,72 @@
+package com.ydtech.modules.inv.utils;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.write.builder.ExcelWriterBuilder;
+import com.ydtech.constants.enums.inv.InsAccountOperateEnum;
+import com.ydtech.constants.enums.inv.InvPayMethodEnum;
+import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.service.InvAccountExcelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author jianlong
+ * @date 2023-12-29 16:46
+ */
+@Component
+public class EasyExcelUtils {
+
+    @Autowired
+    private InvAccountExcelService insAccountExcelService;
+
+
+    public static String downExcel(String uploadFilePath, Class clz, List<?> list) {
+
+        String file = System.currentTimeMillis() + ".xlsx";
+        String fileName = uploadFilePath + file;
+        EasyExcel.write(fileName, clz).sheet("1").doWrite(list);
+        return file;
+    }
+
+
+    /**
+     * 导出资金申请模板
+     */
+    public List<InvAccountExcel> downAccountExcel(String uploadFilePath, List<InvAccountExcel> invAccountExcel) {
+        // 加载模板
+        String templateFile = "资金申请单模板.xlsx";
+        List<InvAccountExcel> list = new ArrayList<>();
+        // 获取工作表并填充
+        for (InvAccountExcel excel : invAccountExcel) {
+            if (excel.getTransferFlag().equals("1")) {
+                // 写入文件
+                Date date = new Date();
+                String file = date.getTime() + ".xlsx";
+                String fileName = uploadFilePath + file;
+                excel.setExcelApplyTime(new SimpleDateFormat("yyyy-MM-dd").format(excel.getApplyTime()));
+                excel.setRemark(InsAccountOperateEnum.getNameByCode(excel.getRemark()));
+                String payMethod = excel.getPayMethod();
+                String[] split = payMethod.split(",");
+                StringBuilder a = new StringBuilder();
+                for (String i : split) {
+                    a.append(InvPayMethodEnum.getNameByCode(i)).append(",");
+                }
+                excel.setPayMethod(a.toString());
+                // 生成工作簿对象
+                ExcelWriterBuilder workBookWriter = EasyExcel.write(fileName, InvAccountExcel.class)
+                        .withTemplate(templateFile);
+
+                workBookWriter.sheet().doFill(excel);
+                excel.setUplodePath(file);
+                excel.setPayMethod(payMethod);
+                list.add(excel);
+            }
+        }
+        insAccountExcelService.updateBatchById(list);
+        return list;
+    }
+
+}

+ 241 - 0
src/main/java/com/ydtech/modules/inv/utils/TransferUtils.java

@@ -0,0 +1,241 @@
+package com.ydtech.modules.inv.utils;
+
+import com.ydtech.constants.enums.inv.InsAccountOperateEnum;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.InvAccountOperate;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 转账工具类
+ *
+ * @author jianlong
+ * @date 2024-01-10 14:10
+ */
+public class TransferUtils {
+    /**
+     * 转账成功后添加支出账户操作信息
+     */
+    public static InvAccountOperate insertOutAccountOperate(InvAccountExcel insAccountExcel) {
+        //支出公司
+        InvAccountOperate insAccountOperate = new InvAccountOperate();
+        operate(insAccountExcel, insAccountOperate);
+        insAccountOperate.setRevenueOutlay("1");
+        return insAccountOperate;
+    }
+
+    /**
+     * 转账成功后添加收入账户操作信息
+     */
+    public static InvAccountOperate insertRevenueAccountOperate(InvAccountExcel insAccountExcel) {
+        //支出公司
+        InvAccountOperate insAccountOperate = new InvAccountOperate();
+        operate(insAccountExcel, insAccountOperate);
+        insAccountOperate.setRevenueOutlay("0");
+        return insAccountOperate;
+    }
+
+    private static void operate(InvAccountExcel invAccountExcel, InvAccountOperate invAccountOperate) {
+        invAccountOperate.setApplicant(invAccountExcel.getApplicant());
+        invAccountOperate.setApplySector(invAccountExcel.getApplySector());
+        invAccountOperate.setApplyTime(invAccountExcel.getApplyTime());
+        invAccountOperate.setCollectionMessage(invAccountExcel.getCollectionMessage());
+        invAccountOperate.setFundFlow(invAccountExcel.getFundFlow());
+        invAccountOperate.setFundUse(invAccountExcel.getFundUse());
+        invAccountOperate.setPayMethod(invAccountExcel.getPayMethod());
+        invAccountOperate.setRemark(InsAccountOperateEnum.getNameByCode(invAccountExcel.getRemark()));
+        invAccountOperate.setCompany(invAccountExcel.getCompany());
+        invAccountOperate.setApplyAmount(invAccountExcel.getApplyAmount());
+        invAccountOperate.setBigApplyAmount(invAccountExcel.getBigApplyAmount());
+    }
+
+    /**
+     * 内部转内部方法
+     */
+    public static List<InvAccount> insideTransfer(InvAccount outAccount, InvAccount enterAccount, InvAccountExcel invAccountExcel) {
+        List<InvAccount> list = new ArrayList<>();
+        if (outAccount != null && enterAccount != null && invAccountExcel != null) {
+            //公户单日转账剩余
+            BigDecimal pubDayLinesExcess = new BigDecimal(outAccount.getPubDayLinesExcess());
+            //私户单日转账剩余
+            BigDecimal priDayLinesExcess = new BigDecimal(outAccount.getPriDayLinesExcess());
+            //公户年额度剩余
+            BigDecimal pubYearExcess = new BigDecimal(outAccount.getPubYearExcess());
+            //私户年额度剩余
+            BigDecimal priYearExcess = new BigDecimal(outAccount.getPriYearExcess());
+            //对公单笔限额
+            BigDecimal pubSingleLines = new BigDecimal(outAccount.getPubSingleLines());
+            //对私单笔限额
+            BigDecimal priSingleLines = new BigDecimal(outAccount.getPriSingleLines());
+            //单日转账笔数剩余
+            long dayStrokeNumExcess = Long.parseLong(outAccount.getDayStrokeNumExcess());
+            //申请金额
+            BigDecimal insAccountExcelApplyAmount = new BigDecimal(invAccountExcel.getApplyAmount());
+            //转出账户现支出金额
+            BigDecimal outAccountSpend = new BigDecimal(outAccount.getSpend());
+
+            if (enterAccount.getAccountQuality().equals("0")) {
+                //公户操作
+                if (pubSingleLines.compareTo(insAccountExcelApplyAmount) > 0){
+                    //收入方增加余额
+                    String remark = invAccountExcel.getRemark();
+
+                    list.add(pubAccountUtils(dayStrokeNumExcess,pubDayLinesExcess,pubYearExcess,insAccountExcelApplyAmount,outAccount,outAccountSpend));
+                    list.add(enterAccountUtils(remark, enterAccount, insAccountExcelApplyAmount));
+                    return list;
+                }
+                throw new SystemException("公户转账金额超出单笔限额");
+            } else {
+                if(priSingleLines.compareTo(insAccountExcelApplyAmount) > 0){
+                    //私户操作
+                    String remark = invAccountExcel.getRemark();
+                    list.add(priAccountUtils(dayStrokeNumExcess,priDayLinesExcess,insAccountExcelApplyAmount, priYearExcess,outAccountSpend,outAccount));
+                    list.add(enterAccountUtils(remark, enterAccount, insAccountExcelApplyAmount));
+
+                    return list;
+                }
+                throw new SystemException("私户转账金额超出单笔限额");
+            }
+        }
+        return list;
+    }
+
+
+    /**
+     * 外部转内部方法
+     */
+    public static InvAccount outsideTransfer(InvAccount enterAccount, InvAccountOperate invAccountOperate) {
+        if (enterAccount == null && invAccountOperate == null) {
+            throw new SystemException("收入账户为空");
+        }
+        String remark = invAccountOperate.getRemark();
+        BigDecimal applyAmount = new BigDecimal(invAccountOperate.getApplyAmount());
+
+        return enterAccountUtils(remark, enterAccount, applyAmount);
+    }
+
+    /**
+     * 内部转外部方法
+     */
+    public static List<InvAccount> enterDeTransfer(InvAccount outAccount, InvAccount enterAccount, InvAccountExcel invAccountExcel) {
+        List<InvAccount> list = new ArrayList<>();
+        if (outAccount != null && enterAccount != null && invAccountExcel != null) {
+            //公户单日转账剩余
+            BigDecimal pubDayLinesExcess = new BigDecimal(outAccount.getPubDayLinesExcess());
+            //私户单日转账剩余
+            BigDecimal priDayLinesExcess = new BigDecimal(outAccount.getPriDayLinesExcess());
+            //公户年额度剩余
+            BigDecimal pubYearExcess = new BigDecimal(outAccount.getPubYearExcess());
+            //私户年额度剩余
+            BigDecimal priYearExcess = new BigDecimal(outAccount.getPriYearExcess());
+            //单日转账笔数剩余
+            long dayStrokeNumExcess = Long.parseLong(outAccount.getDayStrokeNumExcess());
+            //申请金额
+            BigDecimal insAccountExcelApplyAmount = new BigDecimal(invAccountExcel.getApplyAmount());
+            //转出账户现支出金额
+            BigDecimal outAccountSpend = new BigDecimal(outAccount.getSpend());
+
+            if (invAccountExcel.getOutAccountQuality().equals("0")) {
+                //公户操作
+                list.add(pubAccountUtils(dayStrokeNumExcess,pubDayLinesExcess,pubYearExcess,insAccountExcelApplyAmount,outAccount,outAccountSpend));
+                return list;
+
+            } else {
+                //私户操作
+                list.add(priAccountUtils(dayStrokeNumExcess,priDayLinesExcess,insAccountExcelApplyAmount, priYearExcess,outAccountSpend,outAccount));
+                return list;
+            }
+        }
+        return list;
+    }
+
+
+    /**
+     * 收入方增加利润方法
+     *
+     * @return
+     */
+    private static InvAccount enterAccountUtils(String remark, InvAccount enterAccount, BigDecimal invAccountExcelApplyAmount) {
+        switch (remark) {
+            case "0":
+                enterAccount.setInsuranceProfit(new BigDecimal(enterAccount.getInsuranceProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+            case "1":
+                enterAccount.setClearingProfit(new BigDecimal(enterAccount.getClearingProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+            case "2":
+                enterAccount.setTianqinProfit(new BigDecimal(enterAccount.getTianqinProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+            case "3":
+                enterAccount.setParkProfit(new BigDecimal(enterAccount.getParkProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+            case "4":
+                enterAccount.setOtherProfit(new BigDecimal(enterAccount.getOtherProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+            case "5":
+                enterAccount.setFiscalProfit(new BigDecimal(enterAccount.getFiscalProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+            case "6":
+                enterAccount.setExteriorProfit(new BigDecimal(enterAccount.getExteriorProfit()).add(invAccountExcelApplyAmount).toString());
+                break;
+        }
+        enterAccount.setBalance(new BigDecimal(enterAccount.getBalance()).add(invAccountExcelApplyAmount).toString());
+        return enterAccount;
+    }
+
+    /**
+     * 公户扣除余额方法
+     */
+    private static InvAccount pubAccountUtils(long dayStrokeNumExcess, BigDecimal pubDayLinesExcess, BigDecimal pubYearExcess, BigDecimal invAccountExcelApplyAmount, InvAccount outAccount,BigDecimal outAccountSpend) {
+        //判断单日转账笔数是否超过
+        if (dayStrokeNumExcess <= 0) {
+            throw new SystemException("公户单日转账笔数不足");
+        }
+        //判断单日转账金额是否超过
+        if (pubDayLinesExcess.compareTo(BigDecimal.valueOf(0)) != 0 && pubDayLinesExcess.compareTo(invAccountExcelApplyAmount) < 0) {
+            throw new SystemException("公户单日转账金额不足");
+        }
+        //判断年额度是否超过
+        if (pubYearExcess.compareTo(BigDecimal.valueOf(0)) != 0 && pubYearExcess.compareTo(invAccountExcelApplyAmount) < 0) {
+            throw new SystemException("公户年额度不足");
+        }
+
+        //支出方减少余额
+        outAccount.setSpend(outAccountSpend.add(invAccountExcelApplyAmount).toString());
+        outAccount.setBalance(new BigDecimal(outAccount.getBalance()).subtract(invAccountExcelApplyAmount).toString());
+        //公户单日转账笔数减少
+        outAccount.setDayStrokeNumExcess(String.valueOf(dayStrokeNumExcess - 1));
+        //公户单日转账剩余减少
+        outAccount.setPubDayLinesExcess(pubDayLinesExcess.subtract(invAccountExcelApplyAmount).toString());
+        //公户年额度减少
+        outAccount.setPubYearExcess(pubYearExcess.subtract(invAccountExcelApplyAmount).toString());
+        return outAccount;
+    }
+    /**
+     * 私户扣除余额方法
+     */
+    private static InvAccount priAccountUtils(long dayStrokeNumExcess, BigDecimal priDayLinesExcess, BigDecimal invAccountExcelApplyAmount, BigDecimal priYearExcess, BigDecimal outAccountSpend,InvAccount outAccount) {
+        if (dayStrokeNumExcess <= 0) {
+            throw new SystemException("私户单日转账笔数不足");
+        }
+        if (priDayLinesExcess.compareTo(BigDecimal.valueOf(0)) != 0 && priDayLinesExcess.compareTo(invAccountExcelApplyAmount) < 0) {
+            throw new SystemException("私户单日转账金额不足");
+        }
+        if (priYearExcess.compareTo(BigDecimal.valueOf(0)) != 0 && priYearExcess.compareTo(invAccountExcelApplyAmount) < 0) {
+            throw new SystemException("私户年额度不足");
+        }
+
+        outAccount.setSpend(outAccountSpend.add(invAccountExcelApplyAmount).toString());
+        outAccount.setBalance(new BigDecimal(outAccount.getBalance()).subtract(invAccountExcelApplyAmount).toString());
+        outAccount.setDayStrokeNumExcess(String.valueOf(dayStrokeNumExcess - 1));
+        outAccount.setPriDayLinesExcess(priDayLinesExcess.subtract(invAccountExcelApplyAmount).toString());
+        outAccount.setPriYearExcess(priYearExcess.subtract(invAccountExcelApplyAmount).toString());
+        return outAccount;
+    }
+
+
+}

+ 0 - 15
src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java

@@ -1,21 +1,11 @@
 package com.ydtech.modules.order.controller;
 
-import cn.afterturn.easypoi.excel.entity.ExportParams;
-import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.admin.model.SysUserRole;
 import com.ydtech.modules.base.controller.BaseController;
-import com.ydtech.modules.ins.model.InsOrdersExcel;
 import com.ydtech.modules.ins.model.InsOrdersExcelVo;
-import com.ydtech.modules.ins.model.vo.res.InsSettleResVo;
-import com.ydtech.modules.ins.utils.EasyExcelUtils;
-import com.ydtech.modules.ins.utils.ExcelStyleUtil;
-import com.ydtech.modules.ins.utils.ExcelUtils2;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsAccidentalDriving;
@@ -36,12 +26,7 @@ import org.springframework.util.ObjectUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -34,7 +34,7 @@ import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.ins.model.ya.ExtendInfoDto;
 import com.ydtech.modules.ins.model.ya.ResponseDataC2;
-import com.ydtech.modules.ins.utils.EasyExcelUtils;
+import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import com.ydtech.modules.order.convert.CarModelDTOConvert;
 import com.ydtech.modules.order.convert.MapToYaExtendInfoDto;
 import com.ydtech.modules.order.dao.InsOrdersMapper;

+ 69 - 0
src/main/java/com/ydtech/modules/xxl/handler/InvAccountHandler.java

@@ -0,0 +1,69 @@
+package com.ydtech.modules.xxl.handler;
+
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.service.InvAccountService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 重置额度定时任务
+ *
+ * @author jianlong
+ * @date 2024-01-11 10:38
+ */
+@Component
+public class InvAccountHandler {
+
+
+    @Autowired
+    private InvAccountService insAccountService;
+
+    Logger logger = LoggerFactory.getLogger(getClass());
+
+    @XxlJob("insAccountHandlerDay")
+    public void insAccountHandlerDay() {
+        // 获取当前时间
+        LocalDateTime currentDateTime = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        logger.info("重置日额度开始" + currentDateTime.format(formatter));
+
+        List<InvAccount> invAccounts = insAccountService.list();
+        List<InvAccount> invAccountList = new ArrayList<>();
+        for (InvAccount insAccount : invAccounts) {
+            insAccount.setDayStrokeNumExcess(insAccount.getDayStrokeNum());
+            insAccount.setPubDayLinesExcess(insAccount.getPubDayLines());
+            insAccount.setPriDayLinesExcess(insAccount.getPriDayLines());
+            invAccountList.add(insAccount);
+        }
+        insAccountService.updateBatchById(invAccountList);
+        LocalDateTime currentDateTime2 = LocalDateTime.now();
+        logger.info("重置日额度结束" + currentDateTime2.format(formatter));
+    }
+
+    @XxlJob("insAccountHandlerYear")
+    public void insAccountHandlerYear() {
+        LocalDateTime currentDateTime = LocalDateTime.now();
+        logger.info("重置年额度开始" + currentDateTime);
+
+        List<InvAccount> invAccounts = insAccountService.list();
+        List<InvAccount> invAccountList = new ArrayList<>();
+        for (InvAccount invAccount : invAccounts) {
+            invAccount.setPubYearExcess(invAccount.getPubDayLines());
+            invAccount.setPriYearExcess(invAccount.getPriDayLines());
+            invAccountList.add(invAccount);
+        }
+        insAccountService.updateBatchById(invAccountList);
+        LocalDateTime currentDateTime2 = LocalDateTime.now();
+        logger.info("重置年额度结束" + currentDateTime2);
+    }
+
+
+}

+ 27 - 4
src/main/resources/application-dev.yml

@@ -28,9 +28,9 @@ spring:
 #    username: root
 #    password: root
     # 测试库
-      url: jdbc:mysql://47.92.254.66:3306/zgdd?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
+      url: jdbc:mysql://127.0.0.1:3306/zgdd?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
       username: root
-      password: '@RqGHG#KZ*C9ytkQ'
+      password: 1234
     # 生产库
       #password: 'Iy$@$koH@oURxyvw'
       #url: jdbc:mysql://121.89.62.56:3306/agent?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
@@ -39,7 +39,7 @@ spring:
   redis:
     database: 5
     #host: 127.0.0.1
-    host: 121.40.215.87
+    host: 127.0.0.1
     lettuce:
       pool:
         # 连接池最大连接数
@@ -51,7 +51,7 @@ spring:
         # 连接池中的最小空闲连接
         min-idle: 0
     #password: aaaaaa
-    password: guoguo.123
+    password: 1234
     port: 6379
     timeOut: 3000
   servlet:
@@ -360,3 +360,26 @@ dajia:
     encryptKey: "qwertyuiopasdfgh"
 qrcode:
   genAddress: http://39.98.239.48/order/qrCode/index
+
+
+xxl:
+  job:
+    admin:
+      # 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。
+      addresses: http://192.168.0.253:8083/xxl-job-admin
+      # 执行器通讯TOKEN [选填]:非空时启用 系统默认 default_token
+      accessToken: default_token
+    executor:
+      # 执行器的应用名称
+      appname: xxl-job-executor-sample
+      # 执行器注册 [选填]:优先使用该配置作为注册地址
+      address: ""
+      # 执行器IP [选填]:默认为空表示自动获取IP
+      ip:
+      # 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999
+      port: 0
+      # 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
+      logpath:
+      #logpath: /data/logs/mls/job
+      # 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
+      logretentiondays: 7

+ 120 - 0
src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml

@@ -0,0 +1,120 @@
+<?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">
+<mapper namespace="com.ydtech.modules.inv.dao.InvAccountExcelMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.inv.model.InvAccountExcel">
+            <id property="excelAccountOperateId" column="excel_account_operate_id" jdbcType="VARCHAR"/>
+            <result property="company" column="company" jdbcType="VARCHAR"/>
+            <result property="applicant" column="applicant" jdbcType="VARCHAR"/>
+            <result property="applyTime" column="apply_time" jdbcType="TIMESTAMP"/>
+            <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
+            <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
+            <result property="fundFlow" column="fund_flow" jdbcType="VARCHAR"/>
+            <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
+            <result property="remark" column="remark" jdbcType="VARCHAR"/>
+            <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
+            <result property="bigApplyAmount" column="big_apply_amount" jdbcType="VARCHAR"/>
+            <result property="uplodePath" column="uplode_path" jdbcType="VARCHAR"/>
+            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="enterAccountId" column="enter_account_id" jdbcType="VARCHAR"/>
+            <result property="outAccountId" column="out_account_id" jdbcType="VARCHAR"/>
+            <result property="transferFlag" column="transfer_flag" jdbcType="CHAR"/>
+            <result property="outFlag" column="out_flag" jdbcType="CHAR"/>
+            <result property="outAccountQuality" column="out_account_quality" jdbcType="CHAR"/>
+            <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        excel_account_operate_id,company,applicant,
+        apply_time,apply_sector,collection_message,
+        fund_flow,fund_use,remark,
+        apply_amount,big_apply_amount,uplode_path,
+        update_by,update_time,create_by,
+        create_time,enter_account_id,out_account_id,
+        del_flag,out_flag,out_account_quality,transfer_flag
+    </sql>
+    <select id="selectExcelAccount" resultType="com.ydtech.modules.inv.model.InvAccountExcel">
+        select
+            <include refid="Base_Column_List"/>
+        from inv_account_excel
+        where
+            del_flag = '0'
+        <if test="insAccountExcel.excelAccountOperateId!= null and insAccountExcel.excelAccountOperateId!= ''">
+            and excel_account_operate_id = #{insAccountExcel.excelAccountOperateId}
+        </if>
+        <if test="insAccountExcel.company!= null and insAccountExcel.company!= ''">
+            and company = #{insAccountExcel.company}
+        </if>
+        <if test="insAccountExcel.applicant!= null and insAccountExcel.applicant!= ''">
+            and applicant = #{insAccountExcel.applicant}
+        </if>
+        <if test="insAccountExcel.applyTime!= null">
+            and apply_time &gt;= #{insAccountExcel.applyTime}
+        </if>
+        <if test="insAccountExcel.applyTime!= null">
+            and apply_time &lt;= #{insAccountExcel.applyTime}
+        </if>
+        <if test="insAccountExcel.applySector!= null and insAccountExcel.applySector!= ''">
+            and apply_sector = #{insAccountExcel.applySector}
+        </if>
+        <if test="insAccountExcel.collectionMessage!= null and insAccountExcel.collectionMessage!= ''">
+            and collection_message = #{insAccountExcel.collectionMessage}
+        </if>
+        <if test="insAccountExcel.fundFlow!= null and insAccountExcel.fundFlow!= ''">
+            and fund_flow = #{insAccountExcel.fundFlow}
+        </if>
+        <if test="insAccountExcel.fundUse!= null and insAccountExcel.fundUse!= ''">
+            and fund_use = #{insAccountExcel.fundUse}
+        </if>
+        <if test="insAccountExcel.remark!= null and insAccountExcel.remark!= ''">
+            and remark = #{insAccountExcel.remark}
+        </if>
+        <if test="insAccountExcel.applyAmount!= null and insAccountExcel.applyAmount!= ''">
+            and apply_amount = #{insAccountExcel.applyAmount}
+        </if>
+        <if test="insAccountExcel.bigApplyAmount!= null and insAccountExcel.bigApplyAmount!= ''">
+            and big_apply_amount = #{insAccount}
+        </if>
+        <if test="insAccountExcel.uplodePath!= null and insAccountExcel.uplodePath!= ''">
+            and uplode_path = #{insAccountExcel.uplodePath}
+        </if>
+        <if test="insAccountExcel.updateBy!= null and insAccountExcel.updateBy!= ''">
+            and update_by = #{insAccountExcel.updateBy}
+        </if>
+        <if test="insAccountExcel.updateTime!= null">
+            and update_time &gt;= #{insAccountExcel.updateTime}
+        </if>
+        <if test="insAccountExcel.updateTime!= null">
+            and update_time &lt;= #{insAccountExcel.updateTime}
+        </if>
+        <if test="insAccountExcel.createBy!= null and insAccountExcel.createBy!= ''">
+            and create_by = #{insAccountExcel.createBy}
+        </if>
+        <if test="insAccountExcel.createTime!= null">
+            and create_time &gt;= #{insAccountExcel.createTime}
+        </if>
+        <if test="insAccountExcel.createTime!= null">
+            and create_time &lt;= #{insAccountExcel.createTime}
+        </if>
+        <if test="insAccountExcel.enterAccountId!= null and insAccountExcel.enterAccountId!= ''">
+            and enter_account_id = #{insAccountExcel.enterAccountId}
+        </if>
+        <if test="insAccountExcel.outAccountId!= null and insAccountExcel.outAccountId!= ''">
+            and out_account_id = #{insAccountExcel.outAccountId}
+        </if>
+        <if test="insAccountExcel.outFlag!= null and insAccountExcel.outFlag!= ''">
+            and out_flag = #{insAccountExcel.outFlag}
+        </if>
+        <if test="insAccountExcel.outAccountQuality!= null and insAccountExcel.outAccountQuality!= ''">
+            and out_account_quality = #{insAccountExcel.outAccountQuality}
+        </if>
+        <if test="insAccountExcel.transferFlag!= null and insAccountExcel.transferFlag!= ''">
+            and transfer_flag = #{insAccountExcel.transferFlag}
+        </if>
+    </select>
+</mapper>

+ 43 - 0
src/main/resources/mapper/modules/inv/InvAccountExpensesMapper.xml

@@ -0,0 +1,43 @@
+<?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">
+<mapper namespace="com.ydtech.modules.inv.dao.InvAccountExpensesMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.inv.model.InvAccountExpenses">
+            <result property="expensesId" column="expenses_id" jdbcType="VARCHAR"/>
+            <result property="category" column="category" jdbcType="VARCHAR"/>
+            <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+            <result property="remark" column="remark" jdbcType="VARCHAR"/>
+            <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
+            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        expenses_id,category,parent_id,
+        remark,del_flag,create_by,
+        create_time,update_by,update_time
+    </sql>
+    <select id="selectExpensesList" resultType="com.ydtech.modules.inv.model.InvAccountExpenses">
+        select
+        <include refid="Base_Column_List"/>
+        from inv_account_expenses
+        where del_flag = '0'
+        <if test="accountExpenses.expensesId != null and accountExpenses.expensesId != ''">
+            and parent_id = #{accountExpenses.expensesId}
+        </if>
+        <if test="accountExpenses.category!= null and accountExpenses.category!= ''">
+            and category = #{accountExpenses.category}
+        </if>
+        <if test="accountExpenses.remark!= null and accountExpenses.remark!= ''">
+            and remark like concat('%',#{accountExpenses.remark},'%')
+        </if>
+        <if test="accountExpenses.parentId!= null and accountExpenses.parentId!= ''">
+            and parent_id like concat('%',#{accountExpenses.parentId},'%')
+        </if>
+        order by expenses_id
+    </select>
+</mapper>

+ 210 - 0
src/main/resources/mapper/modules/inv/InvAccountMapper.xml

@@ -0,0 +1,210 @@
+<?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">
+<mapper namespace="com.ydtech.modules.inv.dao.InvAccountMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.inv.model.InvAccount">
+        <id property="accountId" column="account_id" jdbcType="BIGINT"/>
+        <result property="accountName" column="account_name" jdbcType="VARCHAR"/>
+        <result property="bankCardNum" column="bank_card_num" jdbcType="VARCHAR"/>
+        <result property="bankName" column="bank_name" jdbcType="VARCHAR"/>
+        <result property="bank" column="bank" jdbcType="VARCHAR"/>
+        <result property="bankNum" column="bank_num" jdbcType="VARCHAR"/>
+        <result property="startCertExpirationDate" column="start_cert_expiration_date" jdbcType="TIMESTAMP"/>
+        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="accountQuality" column="account_quality" jdbcType="CHAR"/>
+        <result property="pubSingleLines" column="pub_single_lines" jdbcType="VARCHAR"/>
+        <result property="priSingleLines" column="pri_single_lines" jdbcType="VARCHAR"/>
+        <result property="pubYearLines" column="pub_year_lines" jdbcType="VARCHAR"/>
+        <result property="priYearLines" column="pri_year_lines" jdbcType="VARCHAR"/>
+        <result property="dayStrokeNum" column="day_stroke_num" jdbcType="VARCHAR"/>
+        <result property="pubDayLines" column="pub_day_lines" jdbcType="VARCHAR"/>
+        <result property="priDayLines" column="pri_day_lines" jdbcType="VARCHAR"/>
+        <result property="pubYearExcess" column="pub_year_excess" jdbcType="VARCHAR"/>
+        <result property="priYearExcess" column="pri_year_excess" jdbcType="VARCHAR"/>
+        <result property="fiscalProfit" column="fiscal_profit" jdbcType="VARCHAR"/>
+        <result property="insuranceProfit" column="insurance_profit" jdbcType="VARCHAR"/>
+        <result property="clearingProfit" column="clearing_profit" jdbcType="VARCHAR"/>
+        <result property="exteriorProfit" column="exterior_profit" jdbcType="VARCHAR"/>
+        <result property="parkProfit" column="park_profit" jdbcType="VARCHAR"/>
+        <result property="tianqinProfit" column="tianqin_profit" jdbcType="VARCHAR"/>
+        <result property="otherProfit" column="other_profit" jdbcType="VARCHAR"/>
+        <result property="endCertExpirationDate" column="end_cert_expiration_date" jdbcType="TIMESTAMP"/>
+        <result property="balance" column="balance" jdbcType="VARCHAR"/>
+        <result property="dayStrokeNumExcess" column="day_stroke_num_excess" jdbcType="VARCHAR"/>
+        <result property="pubDayLinesExcess" column="pub_day_lines_excess" jdbcType="VARCHAR"/>
+        <result property="priDayLinesExcess" column="pri_day_lines_excess" jdbcType="VARCHAR"/>
+        <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
+        <result property="outerFlag" column="outer_flag" jdbcType="CHAR"/>
+        <result property="spend" column="spend" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        account_id,
+        account_name,
+        bank_card_num,
+        bank_name,
+        bank,
+        bank_num,
+        start_cert_expiration_date,
+        end_cert_expiration_date,
+        create_by,
+        create_time,
+        update_by,
+        update_time,
+        account_quality,
+        pub_single_lines,
+        pri_single_lines,
+        pub_year_lines,
+        pri_year_lines,
+        day_stroke_num,
+        pub_day_lines,
+        pri_day_lines,
+        pub_year_excess,
+        pri_year_excess,
+        fiscal_profit,
+        insurance_profit,
+        clearing_profit,
+        exterior_profit,
+        park_profit,
+        tianqin_profit,
+        other_profit,
+        balance,
+        day_stroke_num_excess,
+        pub_day_lines_excess,
+        pri_day_lines_excess,
+        del_flag,
+        outer_flag,
+        spend
+    </sql>
+    <select id="SelectAccountsList" resultType="com.ydtech.modules.inv.model.InvAccount">
+        select
+        <include refid="Base_Column_List"/>
+        from inv_account
+        where del_flag = '0'
+        <if test="account.accountId != null and account.accountId != ''">
+            and account_id = #{account.accountId}
+        </if>
+        <if test="account.accountName!= null and account.accountName!= ''">
+            and account_name like concat('%',#{account.accountName},'%')
+        </if>
+        <if test="account.bankCardNum!= null and account.bankCardNum!= ''">
+            and bank_card_num = #{account.bankCardNum}
+        </if>
+        <if test="account.bankName!= null and account.bankName!= ''">
+            and bank_name = #{account.bankName}
+        </if>
+        <if test="account.bank!= null and account.bank!= ''">
+            and bank = #{account.bank}
+        </if>
+        <if test="account.bankNum!= null and account.bankNum!= ''">
+            and bank_num = #{account.bankNum}
+        </if>
+        <if test="account.startCertExpirationDate!= null">
+            and start_cert_expiration_date &gt;= #{account.startCertExpirationDate}
+        </if>
+        <if test="account.endCertExpirationDate!= null">
+            and end_cert_expiration_date &lt;= #{account.endCertExpirationDate}
+        </if>
+        <if test="account.createBy!= null and account.createBy!= ''">
+            and create_by like concat('%',#{account.createBy},'%')
+        </if>
+        <if test="account.updateBy!= null and account.updateBy!= ''">
+            and update_by like concat('%', #{account.updateBy},'%')
+        </if>
+        <if test="account.createTime!= null">
+            and create_time &gt;= #{account.createTime}
+        </if>
+        <if test="account.createTime != null">
+            and create_time &lt;= #{account.createTime}
+        </if>
+        <if test="account.updateTime!= null">
+            and update_time &gt;= #{account.updateTime}
+        </if>
+        <if test="account.updateTime!= null">
+            and update_time &lt;= #{account.updateTime}
+        </if>
+        <if test="account.accountQuality!= null and account.accountQuality!= ''">
+            and account_quality = #{account.accountQuality}
+        </if>
+        <if test="account.pubSingleLines!= null and account.pubSingleLines!= ''">
+            and pub_single_lines = #{account.pubSingleLines}
+        </if>
+        <if test="account.priSingleLines!= null and account.priSingleLines!= ''">
+            and pri_single_lines = #{account.priSingleLines}
+        </if>
+        <if test="account.pubYearLines!= null and account.pubYearLines!= ''">
+            and pub_year_lines = #{account.pubYearLines}
+        </if>
+        <if test="account.priYearLines!= null and account.priYearLines!= ''">
+            and pri_year_lines = #{account.priYearLines}
+        </if>
+        <if test="account.dayStrokeNum!= null and account.dayStrokeNum!= ''">
+            and day_stroke_num = #{account.dayStrokeNum}
+        </if>
+        <if test="account.pubDayLines!= null and account.pubDayLines!= ''">
+            and pub_day_lines = #{account.pubDayLines}
+        </if>
+        <if test="account.priDayLines!= null and account.priDayLines!= ''">
+            and pri_day_lines = #{account.priDayLines}
+        </if>
+        <if test="account.pubYearExcess!= null and account.pubYearExcess!= ''">
+            and pub_year_excess = #{account.pubYearExcess}
+        </if>
+        <if test="account.priYearExcess!= null and account.priYearExcess!= ''">
+            and pri_year_excess = #{account.priYearExcess}
+        </if>
+        <if test="account.fiscalProfit!= null and account.fiscalProfit!= ''">
+            and fiscal_profit = #{account.fiscalProfit}
+        </if>
+        <if test="account.insuranceProfit!= null and account.insuranceProfit!= ''">
+            and insurance_profit = #{insuranceProfit}
+        </if>
+        <if test="account.clearingProfit!= null and account.clearingProfit!= ''">
+            and clearing_profit = #{account.clearingProfit}
+        </if>
+        <if test="account.exteriorProfit!= null and account.exteriorProfit!= ''">
+            and exterior_profit = #{account.exteriorProfit}
+        </if>
+        <if test="account.parkProfit!= null and account.parkProfit!= ''">
+            and park_profit = #{parkProfit}
+        </if>
+        <if test="account.tianqinProfit!= null and account.tianqinProfit!= ''">
+            and tianqin_profit = #{account.tianqinProfit}
+        </if>
+        <if test="account.otherProfit!= null and account.otherProfit!= ''">
+            and other_profit = #{otherProfit}
+        </if>
+        <if test="account.balance!= null and account.balance!= ''">
+            and balance = #{account.balance}
+        </if>
+        <if test="account.dayStrokeNumExcess!= null and account.dayStrokeNumExcess!= ''">
+            and day_stroke_num_excess = #{account.dayStrokeNumExcess}
+        </if>
+        <if test="account.pubDayLinesExcess!= null and account.pubDayLinesExcess!= ''">
+            and pub_day_lines_excess = #{account.pubDayLinesExcess}
+        </if>
+        <if test="account.priDayLinesExcess!= null and account.priDayLinesExcess!= ''">
+            and pri_day_lines_excess = #{account.priDayLinesExcess}
+        </if>
+        <if test="account.pubYearExcess!= null and account.pubYearExcess!= ''">
+            and pub_year_excess = #{account.pubYearExcess}
+        </if>
+        <if test="account.priYearExcess!= null and account.priYearExcess!= ''">
+            and pri_year_excess = #{account.priYearExcess}
+        </if>
+        <if test="account.delFlag!= null and account.delFlag!= ''">
+            and del_flag = #{account.delFlag}
+        </if>
+        <if test="account.outerFlag != null and account.outerFlag != '' ">
+            and outer_flag = #{account.outerFlag}
+        </if>
+        <if test="account.spend != null and account.spend != ''">
+            and spend = #{account.spend}
+        </if>
+    </select>
+</mapper>

+ 54 - 0
src/main/resources/mapper/modules/inv/InvAccountOperateMapper.xml

@@ -0,0 +1,54 @@
+<?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">
+<mapper namespace="com.ydtech.modules.inv.dao.InvAccountOperateMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.inv.model.InvAccountOperate">
+            <id property="accountOperateId" column="account_operate_id" jdbcType="VARCHAR"/>
+            <result property="applicant" column="applicant" jdbcType="VARCHAR"/>
+            <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
+            <result property="applyTime" column="apply_time" jdbcType="TIMESTAMP"/>
+            <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
+            <result property="fundFlow" column="fund_flow" jdbcType="VARCHAR"/>
+            <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
+            <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
+            <result property="payMethod" column="pay_method" jdbcType="VARCHAR"/>
+            <result property="remark" column="remark" jdbcType="VARCHAR"/>
+            <result property="company" column="company" jdbcType="VARCHAR"/>
+            <result property="bigApplyAmount" column="big_apply_amount" jdbcType="VARCHAR"/>
+            <result property="revenueOutlay" column="revenue_outlay" jdbcType="CHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        account_operate_id,applicant,apply_sector,
+        apply_time,collection_message,fund_flow,
+        fund_use,apply_amount,pay_method,
+        remark,company,big_apply_amount,
+        revenue_outlay
+    </sql>
+    <select id="selectInsAccountOperate" resultMap="BaseResultMap">
+        select
+            <include refid="Base_Column_List"/>
+            from inv_account_operate
+        where 1=1
+        <if test="insAccountOperate.accountOperateId != null and insAccountOperate.accountOperateId != ''">
+            and account_operate_id = #{insAccountOperate.accountOperateId}
+        </if>
+        <if test="insAccountOperate.applicant != null and insAccountOperate.applicant != ''">
+            and applicant = #{insAccountOperate.applicant}
+        </if>
+        <if test="insAccountOperate.applySector != null and insAccountOperate.applySector != ''">
+            and apply_sector = #{insAccountOperate.applySector}
+        </if>
+        <if test="insAccountOperate.applyTime != null">
+            and apply_time = #{insAccountOperate.applyTime}
+        </if>
+        <if test="insAccountOperate.collectionMessage != null and insAccountOperate.collectionMessage != ''">
+            and collection_message = #{insAccountOperate.collectionMessage}
+        </if>
+        <if test="insAccountOperate.fundFlow != null and insAccountOperate.fundFlow != ''">
+            and fund_flow = #{insAccountOperate.fundFlow}
+        </if>
+    </select>
+</mapper>

BIN=BIN
资金申请单模板.xlsx