ezhizao_zx 1 рік тому
батько
коміт
4b0ece3c73

+ 2 - 2
src/main/java/cn/ezhizao/framework/web/domain/BaseEntity.java

@@ -40,7 +40,7 @@ public class BaseEntity implements Serializable
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @TableField(value="create_time",fill= FieldFill.INSERT)
-    @Excel(name = "发单日期", width = 30, dateFormat = "yyyy-MM-dd",sort = 6)
+//    @Excel(name = "发单日期", width = 30, dateFormat = "yyyy-MM-dd",sort = 6)
     private Date createTime;
 
     /** 更新者 */
@@ -71,7 +71,7 @@ public class BaseEntity implements Serializable
     private Date updateTime;
 
     /** 备注 */
-    @Excel(name = "备注")
+//    @Excel(name = "备注")
     private String remark;
 
     /** 请求参数 */

+ 54 - 16
src/main/java/cn/ezhizao/project/business/collection/controller/BizCollectionController.java

@@ -47,11 +47,9 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.sql.Timestamp;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
 
 @RestController
 @Api(tags = "收票 数据接口")
@@ -97,7 +95,7 @@ public class BizCollectionController extends BaseController {
         setTenantId(collection);
         try {
             Long id = collection.getId();
-            collection.setFormDate(collection.getFormDate() != null ? collection.getFormDate() :DateTime.now().toTimestamp());
+            collection.setFormDate(collection.getFormDate() != null ? collection.getFormDate() : DateTime.now().toTimestamp());
             collection.setId(collection.getId() == null || collection.getId().equals(0L) ? snowflakeIdWorker.nextId() : collection.getId());
 
             if (collection.getFlowNo() == null || collection.getFlowNo().isEmpty()) {
@@ -156,6 +154,46 @@ public class BizCollectionController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 导出收款管理
+     */
+    @PreAuthorize("@ss.hasPermi('business:collection:export')")
+    @Log(title = "收款管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizCollection conditions) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(conditions);
+        startPage();
+        startOrderBy();
+        List<BizCollection> list = collectionService.getListByBean(conditions);
+        list.forEach(l -> {
+            switch (l.getStatus()){
+                case 0:
+                    l.setStatusName("未审核");
+                    break;
+                case 1:
+                    l.setStatusName("审核通过");
+                    break;
+                case 2:
+                    l.setStatusName("审核不通过");
+                    break;
+            }
+            switch (l.getArriveStatus()){
+                case 0:
+                    l.setArriveStatusName("未支付");
+                    break;
+                case 1:
+                    l.setArriveStatusName("已支付");
+                    break;
+                case 2:
+                    l.setArriveStatusName("部分支付");
+                    break;
+            }
+        });
+        ExcelUtil<BizCollection> util = new ExcelUtil<BizCollection>(BizCollection.class);
+        util.exportExcel(response, list, "收款信息");
+
+    }
+
     @ApiOperation("获取待收款合同")
     @GetMapping("/getWaitForCollection")
     @PreAuthorize("@ss.hasPermi('business:waitForCollection:list')")
@@ -222,18 +260,15 @@ public class BizCollectionController extends BaseController {
         AtomicBoolean collectionCheck = new AtomicBoolean(true);
         collection.getDetails().forEach(l -> {
             l.setCollectionId(collection.getId());
-//            l.getDetails().forEach(v -> {
-//                l.setId(l.getId() == null || l.getId().equals(0L) ? 0L : l.getId());
             BigDecimal arriveAmount = l.getArriveAmount();
             Map<String, Object> map = new HashMap<>(2);
             map.put("contractDetailId", l.getContractDetailId());
             map.put("verifyStatus", 1);
             List<BizCollectionDetail> vDetail = collectionDetailService.getList(map);
-//                        .eq("contract_detail_id", v.getContractDetailId()).ne("id", v.getId()).list();
             arriveAmount = arriveAmount.add(BigDecimal.valueOf(vDetail.stream().mapToDouble(t -> t.getArriveAmount().doubleValue()).sum()));
             BizArchiveInputDetail contractDetail = contractDetailService.getById(l.getContractDetailId());
             collectionCheck.set(collectionCheck.get() && (contractDetail.getAmount().compareTo(arriveAmount) >= 0));
-//            });
+
         });
 
         if (!collectionCheck.get()) {
@@ -252,8 +287,8 @@ public class BizCollectionController extends BaseController {
             collection.setVerifyDate(collection.getVerifyDate() == null ? DateTime.now().toTimestamp() : collection.getVerifyDate());
             BizArchiveInput contract = archiveInputService.getById(collection.getContractId());
             if (contract != null) {
-                if(collection.getVerifyDate()!= null){
-                    contract.setCollectionStatus((byte) (collection.getStatus()==1?2:3));
+                if (collection.getVerifyDate() != null) {
+                    contract.setCollectionStatus((byte) (collection.getStatus() == 1 ? 2 : 3));
                     archiveInputService.saveOrUpdate(contract);
                 }
             }
@@ -273,6 +308,7 @@ public class BizCollectionController extends BaseController {
         String message = collectionService.importLoop(orderList, SecurityUtils.getUserId(), getTenantId() == null ? 0 : getTenantId());
         return success(message);
     }
+
     @Log(title = "收款导入", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('business:collection:import')")
     @PostMapping("/importOnce")
@@ -316,6 +352,7 @@ public class BizCollectionController extends BaseController {
             }
         }
     }
+
     @Log(title = "合同收款模板导出", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('business:collection:import')")
     @PostMapping("/exportOnce")
@@ -343,7 +380,6 @@ public class BizCollectionController extends BaseController {
     }
 
 
-
     private BizCollection getForId(Long collectionId) {
         BizCollection collection = collectionService.getById(collectionId);
         if (collection != null) {
@@ -356,9 +392,11 @@ public class BizCollectionController extends BaseController {
                 collection.setContractAmount(archiveInput.getTrueAmount());
                 collection.setOrderRemark(archiveInput.getRemark());
                 BizCollection collectionCondition = new BizCollection();
-                collection.setActuallyDate( new Timestamp(archiveInput.getFormDate().getTime()));
+                if (archiveInput.getFormDate() != null) {
+                    collection.setActuallyDate(new Timestamp(archiveInput.getFormDate().getTime()));
+                }
                 collectionCondition.setContractId(archiveInput.getId());
-                collectionCondition.setStatus((byte)1);
+                collectionCondition.setStatus((byte) 1);
                 List<BizCollection> collections = collectionService.getListByBean(collectionCondition);
                 collection.setNonpayment(archiveInput.getTrueAmount().subtract(BigDecimal.valueOf(collections.stream().mapToDouble(v -> v.getAmount().doubleValue()).sum())).compareTo(BigDecimal.ZERO) > 0);
                 collection.setNonpaymentAmount(archiveInput.getTrueAmount().subtract(BigDecimal.valueOf(collections.stream().mapToDouble(v -> v.getArriveAmount().doubleValue()).sum())));
@@ -391,11 +429,11 @@ public class BizCollectionController extends BaseController {
     public AjaxResult remove(@PathVariable List<Long> ids) {
         return toAjax(collectionService.removeBatchByIds(ids));
     }
+
     @ApiOperation("获取账户")
     @GetMapping("/listAccount")
     @PreAuthorize("@ss.hasPermi('business:payment:query')")
-    public TableDataInfo listAccount(BizAccount bizAccount) throws NoSuchFieldException, IllegalAccessException
-    {
+    public TableDataInfo listAccount(BizAccount bizAccount) throws NoSuchFieldException, IllegalAccessException {
         setTenantId(bizAccount);
         startPage();
         List<BizAccount> list = accountService.getList(bizAccount);

+ 54 - 12
src/main/java/cn/ezhizao/project/business/collection/domain/BizCollection.java

@@ -33,6 +33,8 @@ public class BizCollection extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "收款流水号")
     private String flowNo;
 
+
+
     @ApiModelProperty(value = "收款流水号")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Timestamp formDate;
@@ -55,11 +57,9 @@ public class BizCollection extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "客户 Id")
     private Long companyId;
 
-    @ApiModelProperty(value = "客户名称")
-    private String companyName;
 
-    @ApiModelProperty(value = "收款金额")
-    private BigDecimal arriveAmount;
+
+
 
     @ApiModelProperty(value="应收金额")
     private BigDecimal amount;
@@ -110,19 +110,14 @@ public class BizCollection extends BaseEntity implements Serializable {
     @ApiModelProperty("合同id")
     private Long contractId;
 
-    @ApiModelProperty("合同单号")
-    @TableField(exist = false)
-    private String contractNo;
+
 
     @ApiModelProperty(value = "申请人")
     private Long applierId;
 
-    @TableField(exist = false)
-    private String applierName;
 
-    @ApiModelProperty("确认到账时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Timestamp actuallyDate;
+
+
 
     @TableField(exist = false)
     private List<BizCollectionDetail> contractDetails;
@@ -167,4 +162,51 @@ public class BizCollection extends BaseEntity implements Serializable {
 
     @TableField(exist = false)
     private String orderRemark;
+
+    /** 导出数据 */
+
+    @Excel(name = "客户名称",width = 35)
+    @ApiModelProperty(value = "客户名称")
+    private String companyName;
+
+    @Excel(name = "合同编号")
+    @ApiModelProperty("合同单号")
+    @TableField(exist = false)
+    private String contractNo;
+
+    @Excel(name = "实际付款时间",width = 20, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty("确认到账时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Timestamp actuallyDate;
+
+    @Excel(name = "收款金额")
+    @ApiModelProperty(value = "收款金额")
+    private BigDecimal arriveAmount;
+
+    @Excel(name = "申请人")
+    @TableField(exist = false)
+    private String applierName;
+
+    @Excel(name = "审核状态")
+    @TableField(exist = false)
+    private String statusName;
+
+    @Excel(name = "支付状态")
+    @TableField(exist = false)
+    private String arriveStatusName;
+
+    @Excel(name = "备注")
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    public String getRemark()
+    {
+        return remark;
+    }
+
+    public void setRemark(String remark)
+    {
+        this.remark = remark;
+    }
+
 }

+ 1 - 0
src/main/java/cn/ezhizao/project/business/order/domain/BizArchiveInput.java

@@ -195,6 +195,7 @@ public class BizArchiveInput extends BaseEntity {
 
     @TableField(exist = false)
     private String sourceName;
+
     @TableField(exist = false)
     private String referrerDataSource;
 

+ 51 - 0
src/main/java/cn/ezhizao/project/business/payment/controller/BizPaymentController.java

@@ -1,6 +1,7 @@
 package cn.ezhizao.project.business.payment.controller;
 
 import cn.ezhizao.common.exception.ServiceException;
+import cn.ezhizao.common.utils.poi.ExcelUtil;
 import cn.ezhizao.common.utils.uuid.SnowflakeIdWorker;
 import cn.ezhizao.framework.aspectj.lang.annotation.Log;
 import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
@@ -36,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -143,6 +145,7 @@ public class BizPaymentController extends BaseController {
         List<BizPayment> list = paymentService.getListByBean(conditions);
         return getDataTable(list);
     }
+
     @ApiOperation(value = "带条件List 分页查询", notes = "带条件List 分页查询")
     @PreAuthorize("@ss.hasPermi('business:payment:list')")
     @GetMapping("/listTypes")
@@ -266,4 +269,52 @@ public class BizPaymentController extends BaseController {
         }
     }
 
+    /**
+     * 导出支出管理
+     */
+    @PreAuthorize("@ss.hasPermi('business:payment:export')")
+    @Log(title = "支出管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizPayment payment) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(payment);
+        startPage();
+        startOrderBy();
+        List<BizPayment> list = paymentService.getListByBean(payment);
+        list.forEach(l->{
+            switch(l.getVerifyStatus()){
+                case 0:
+                    l.setVerifyStatusStr("未审核");
+                    break;
+                case 1:
+                    l.setVerifyStatusStr("财务审核通过");
+                    break;
+                case 2:
+                    l.setVerifyStatusStr("财务审核不通过");
+                    break;
+                case 3:
+                    l.setVerifyStatusStr("出纳审核通过");
+                    break;
+                case 4:
+                    l.setVerifyStatusStr("出纳审核不通过");
+                    break;
+            }
+
+            switch(l.getPaymentStatus()){
+                case 0:
+                    l.setPaymentStatusStr("未支付");
+                    break;
+                case 1:
+                    l.setPaymentStatusStr("已支付");
+                    break;
+                case 2:
+                    l.setPaymentStatusStr("部分支付");
+                    break;
+            }
+        });
+        ExcelUtil<BizPayment> util = new ExcelUtil<BizPayment>(BizPayment.class);
+        util.exportExcel(response, list, "收款信息");
+
+    }
+
+
 }

+ 45 - 30
src/main/java/cn/ezhizao/project/business/payment/domain/BizPayment.java

@@ -1,5 +1,6 @@
 package cn.ezhizao.project.business.payment.domain;
 
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
 import cn.ezhizao.project.system.domain.SysFileStorage;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -44,9 +45,6 @@ public class BizPayment extends BaseEntity {
     @ApiModelProperty(value = "客户 Id")
     private Long companyId;
 
-    @ApiModelProperty(value = "客户 名称")
-    private String companyName;
-
     @ApiModelProperty(value = "付款金额")
     private BigDecimal amount;
 
@@ -59,21 +57,11 @@ public class BizPayment extends BaseEntity {
     @ApiModelProperty(value = "支出科目")
     private Long paymentSubjectId;
 
-    @TableField(exist = false)
-    private String paymentSubject;
-
     @ApiModelProperty(value = "支出状态 0-未支出 1-已支出")
     private Byte paymentStatus;
-    @TableField(exist = false)
-    private String paymentStatusStr;
 
     @ApiModelProperty(value = "审核状态 0-待审核 1-审核通过 2-审核驳回 3-待提交")
     private Byte verifyStatus;
-    @TableField(exist = false)
-    private String verifyStatusStr;
-
-    @ApiModelProperty(value = "收款账号")
-    private String acceptAccount;
 
     @ApiModelProperty(value = "账户类型")
     private Long acceptAccountTypeId;
@@ -84,32 +72,15 @@ public class BizPayment extends BaseEntity {
     @ApiModelProperty(value = "申请人")
     private Long applierId;
 
-    @TableField(exist = false)
-    private String applierName;
-
-    @ApiModelProperty(value = "收款账号")
-    private String acceptAccountNo;
-
     @ApiModelProperty(value = "开户行")
     private String accountBank;
 
-    @ApiModelProperty(value = "支出日期")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    private Timestamp formDate;
-
     @ApiModelProperty(value = "从表payment_contract")
     @TableField(exist = false)
     private List<BizPaymentDetail> details;
 
     @TableField(exist = false)
     private List<SysFileStorage> files;
-
-    @TableField(exist = false)
-    private String formNo;
-
-    @TableField(exist = false)
-    private BigDecimal sumAmount;
-
     @TableField(exist = false)
     private String applierDept;
 
@@ -159,4 +130,48 @@ public class BizPayment extends BaseEntity {
     private String keyword;
     @TableField(exist = false)
     private BigDecimal payedAmount;
+
+    /** 导出数据 */
+
+    @Excel(name="客户名称",width = 35)
+    @ApiModelProperty(value = "客户 名称")
+    private String companyName;
+
+    @Excel(name="订单号",width = 20)
+    @TableField(exist = false)
+    private String formNo;
+
+    @Excel(name="支出日期",width = 20,dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "支出日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Timestamp formDate;
+
+    @Excel(name="支出科目")
+    @TableField(exist = false)
+    private String paymentSubject;
+
+    @Excel(name="支出金额")
+    @TableField(exist = false)
+    private BigDecimal sumAmount;
+
+    @Excel(name="审核状态")
+    @TableField(exist = false)
+    private String verifyStatusStr;
+
+    @Excel(name="支付状态")
+    @TableField(exist = false)
+    private String paymentStatusStr;
+
+    @Excel(name="收款账户名")
+    @ApiModelProperty(value = "收款账号")
+    private String acceptAccount;
+
+    @Excel(name="收款账号")
+    @ApiModelProperty(value = "收款账号")
+    private String acceptAccountNo;
+
+    @Excel(name="申请人")
+    @TableField(exist = false)
+    private String applierName;
+
 }