@@ -1,6 +1,7 @@ | |||
package cn.com.taiji.core.entity.settle.mobilepay; | |||
import cn.com.taiji.core.entity.settle.AbstractUUIDEntity; | |||
import cn.com.taiji.core.entity.settle.notice.InpTransNotice; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -19,44 +20,71 @@ import java.time.LocalDateTime; | |||
@Entity | |||
@Table(name = "settle_mobile_pay_inp_notice") | |||
public class MobilePayInpNotice extends AbstractUUIDEntity { | |||
//清分日期 | |||
@Column(name = "clear_date") | |||
private String clearDate; | |||
//清分月份 | |||
@Column(name = "CLEAR_MONTH") | |||
private String clearMonth; | |||
//UP上半月、DOWN下半月 | |||
@Column(name = "clear_type") | |||
private String clearType; | |||
//清分开始日期 | |||
@Column(name = "START_CLEAR_DATE") | |||
private String startClearDate; | |||
// 清分截止日期 | |||
@Column(name = "END_CLEAR_DATE") | |||
private String endClearDate; | |||
//交易数量 | |||
@Column(name = "count") | |||
@Column(name = "COUNT") | |||
private Long count; | |||
//交易金额 | |||
@Column(name = "amount") | |||
@Column(name = "AMOUNT") | |||
private Long amount; | |||
//银行收款交易数量 | |||
@Column(name = "cash_count") | |||
@Column(name = "CASH_COUNT") | |||
private Long cashCount; | |||
//银行收款交易金额 | |||
@Column(name = "cash_amount") | |||
@Column(name = "CASH_AMOUNT") | |||
private Long cashAmount; | |||
//付款单是否生成 | |||
@Column(name = "pay_bill") | |||
@Column(name = "PAY_BILL") | |||
private boolean payBill = false; | |||
//付款单生成时间 | |||
@Column(name = "pay_bill_time") | |||
@Column(name = "PAY_BILL_TIME") | |||
private LocalDateTime payBillTime; | |||
//付款单文件路径 | |||
@Column(name = "pay_bill_url") | |||
@Column(name = "PAY_BILL_URL") | |||
private String payBillUrl; | |||
//是否生成文件 | |||
@Column(name = "DATA_FILE") | |||
private boolean dataFile = false; | |||
//文件生成时间 | |||
@Column(name = "DATA_FILE_TIME") | |||
private LocalDateTime dataFileTime; | |||
//文件路径 | |||
@Column(name = "DATA_FILE_URL") | |||
private String dataFileUrl; | |||
public MobilePayInpNotice savePayBill(String url){ | |||
this.setPayBill(true); | |||
this.setPayBillUrl(url); | |||
this.setPayBillTime(LocalDateTime.now()); | |||
// this.setPayBillId(payBillId); | |||
return this; | |||
} | |||
public MobilePayInpNotice saveDataFile(String url){ | |||
this.setDataFile(true); | |||
this.setDataFileUrl(url); | |||
this.setDataFileTime(LocalDateTime.now()); | |||
return this; | |||
} | |||
} |
@@ -44,6 +44,24 @@ public class MobilePayOutNotice extends AbstractUUIDEntity { | |||
@Column(name = "pay_bill_url") | |||
private String payBillUrl; | |||
//是否生成文件 | |||
@Column(name = "data_file") | |||
private boolean dataFile = false; | |||
//文件生成时间 | |||
@Column(name = "data_file_time") | |||
private LocalDateTime dataFileTime; | |||
//文件路径 | |||
@Column(name = "data_file_url") | |||
private String dataFileUrl; | |||
public MobilePayOutNotice saveDataFile(String url){ | |||
this.setDataFile(true); | |||
this.setDataFileUrl(url); | |||
this.setDataFileTime(LocalDateTime.now()); | |||
return this; | |||
} | |||
public MobilePayOutNotice savePayBill(String url){ | |||
this.setPayBill(true); | |||
this.setPayBillUrl(url); |
@@ -54,7 +54,7 @@ public class EtcTollConfirmZfb extends AbstractUUIDEntity { | |||
@Column(name = "initial_num") | |||
private Long initialNum;//期初数 | |||
@Column(name = "validate_num") | |||
private Long validateNum;//校验 | |||
private String validateNum;//校验 | |||
@Column(name = "update_time") | |||
private LocalDateTime updateTime;//更新时间 | |||
} |
@@ -2,6 +2,7 @@ package cn.com.taiji.core.repo.jpa.settle.mobilepay; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.settle.mobilepay.MobilePayInpNotice; | |||
import cn.com.taiji.core.entity.settle.notice.InpTransNotice; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
@@ -13,10 +14,8 @@ import java.util.List; | |||
*/ | |||
public interface MobilePayInpNoticeRepo extends AbstractJpaRepo<MobilePayInpNotice, String> { | |||
MobilePayInpNotice findByClearDate(String clearDate); | |||
// 省内清分方式 上半月: 1-15 日 下半月: 16-月底 | |||
@Query(" from MobilePayInpNotice where clearType = ?1 and clearMonth = ?2") | |||
MobilePayInpNotice findBy(String clearType, String clearMonth); | |||
@Query("from MobilePayInpNotice where clearDate between ?1 and ?2") | |||
List<MobilePayInpNotice> listByBetweenClearDate(String startClearDate, String endClearDate); | |||
// List<MobilePayInpNotice> findByPayBillId(String payBillId); | |||
} |
@@ -2,6 +2,10 @@ package cn.com.taiji.core.repo.jpa.settle.mobilepay; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.settle.mobilepay.MobilePayOutNotice; | |||
import cn.com.taiji.core.entity.settle.notice.OutTransNotice; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
/** | |||
* @author nieqiongqiong | |||
@@ -12,4 +16,7 @@ public interface MobilePayOutNoticeRepo extends AbstractJpaRepo<MobilePayOutNoti | |||
MobilePayOutNotice findByClearDate(String clearDate); | |||
@Query(" from MobilePayOutNotice where clearDate >= ?1 and clearDate <= ?2 order by clearDate asc") | |||
List<MobilePayOutNotice> listBy(String startClearDate, String endClearDate); | |||
} |
@@ -4,10 +4,10 @@ import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.settlew.api.MyValidController; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmAgencyEditDTO; | |||
import cn.com.taiji.settlew.manager.report.EtcTollConfirmAgencyManager; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmAgencyPageRequestDTO; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmAgencyViewResponse; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
/** | |||
* @description: | |||
* @description: ETC通行费确认单(渠道) 接口 | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 15:59 | |||
*/ | |||
@@ -42,8 +42,8 @@ public class EtcTollConfirmAgencyController extends MyValidController { | |||
} | |||
@ApiOperation("修改") | |||
@PostMapping("/edit") | |||
public ApiResponse<Void> edit(@Validated @RequestBody EtcTollConfirmAgencyViewResponse req) throws ManagerException { | |||
manager.edit(req); | |||
public ApiResponse<Void> edit(@Validated @RequestBody EtcTollConfirmAgencyEditDTO dto) throws ManagerException { | |||
manager.edit(dto); | |||
return ApiResponse.success(); | |||
} | |||
@@ -4,10 +4,11 @@ import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.settlew.api.MyValidController; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmZfbEditDTO; | |||
import cn.com.taiji.settlew.manager.report.EtcTollConfirmZfbManager; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmZfbPageRequestDTO; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmZfbViewResponse; | |||
import cn.com.taiji.settlew.vo.report.EtcTollConfirmZfbVo; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -42,8 +43,8 @@ public class EtcTollConfirmZfbController extends MyValidController { | |||
} | |||
@ApiOperation("修改") | |||
@PostMapping("/edit") | |||
public ApiResponse<Void> edit(@Validated @RequestBody EtcTollConfirmZfbViewResponse req) throws ManagerException { | |||
manager.edit(req); | |||
public ApiResponse<Void> edit(@Validated @RequestBody EtcTollConfirmZfbEditDTO editDTO) throws ManagerException { | |||
manager.edit(editDTO); | |||
return ApiResponse.success(); | |||
} | |||
@@ -0,0 +1,64 @@ | |||
package cn.com.taiji.settlew.dto.report; | |||
import cn.com.taiji.common.model.BaseDTO; | |||
import lombok.Data; | |||
/** | |||
* ETC通行费确认单 - 渠道 | |||
* @Author jiangsong | |||
* @create 2025/9/20 | |||
*/ | |||
@Data | |||
public class EtcTollConfirmAgencyDTO extends BaseDTO { | |||
//交易时间 | |||
private String transDate; | |||
//ETC资金渠道名称 | |||
private String agencyName; | |||
//卡类型 | |||
private String cardType; | |||
//产品名称 | |||
private String productName; | |||
//结算组负责人 | |||
private String settlementManager; | |||
//截止上月最后一天未支付金额 | |||
private Long lastMonthFee; | |||
//其他货币资金商户号未到账余额(上月) | |||
private Long lastMonthOther; | |||
//商务卡未到账余额(上月) | |||
private Long lastMonthSwk; | |||
//当月交易金额 | |||
private Long currentMonthFee; | |||
//银行实际收款金额 | |||
private Long bankCollection; | |||
//渠道费金额 | |||
private Long agencyFee; | |||
//其他货币资金商户号未到账余额 | |||
private Long otherWdzFee; | |||
//商务卡未到账余额 | |||
private Long swkFee; | |||
//当月收款合计 = 银行实际收款金额 + 渠道费金额 + 其他货币资金商户号未到账余额 + 商务卡未到账余额 | |||
private Long currentTollFee; | |||
public Long getCurrentTollFee() { | |||
return (bankCollection == null ? 0L : bankCollection) + | |||
(agencyFee == null ? 0L : agencyFee) + | |||
(otherWdzFee == null ? 0L : otherWdzFee) + | |||
(swkFee == null ? 0L : swkFee); | |||
} | |||
//截止当月最后一天未支付金额 = 截止上月最后一天未支付金额 + 其他货币资金商户号未到账余额(上月) + 商务卡未到账余额(上月) | |||
private Long currentWzfFee; | |||
public Long getCurrentWzfFee() { | |||
return (lastMonthFee == null ? 0L : lastMonthFee) + | |||
(lastMonthOther == null ? 0L : lastMonthOther) + | |||
(lastMonthSwk == null ? 0L : lastMonthSwk); | |||
} | |||
//备注 | |||
private String remark; | |||
} |
@@ -0,0 +1,18 @@ | |||
package cn.com.taiji.settlew.dto.report; | |||
import cn.com.taiji.common.model.BaseDTO; | |||
import lombok.Data; | |||
/** | |||
* ETC通行费确认单 - 编辑 - 渠道 | |||
* @Author jiangsong | |||
* @create 2025/9/20 | |||
*/ | |||
@Data | |||
public class EtcTollConfirmAgencyEditDTO extends BaseDTO { | |||
//商务卡未到账余额 | |||
private Long swkFee; | |||
// 备注 | |||
private String remark; | |||
} |
@@ -0,0 +1,94 @@ | |||
package cn.com.taiji.settlew.dto.report; | |||
import cn.com.taiji.common.model.BaseDTO; | |||
import lombok.Data; | |||
import java.time.LocalDateTime; | |||
/** | |||
* ETC通行费确认单 - 支付宝 | |||
* @Author jiangsong | |||
* @create 2025/9/20 | |||
*/ | |||
@Data | |||
public class EtcTollConfirmZfbDTO extends BaseDTO { | |||
//统计日期 | |||
private String statisticalDate; | |||
//============= 交易金额 - 开始 ========== | |||
//在线支付 | |||
private Long transOnline; | |||
//转账 | |||
private Long transZz; | |||
//退款 | |||
private Long transRefund; | |||
//退转账 | |||
private Long transZzRefund; | |||
//现金退回 | |||
private Long transCashRefund; | |||
//公式 - 合计 = 在线支付 + 转账 - 退款 - 退转账 - 现金退回 | |||
private Long transToll; | |||
public Long getTransToll() { | |||
return (transOnline == null ? 0L : transOnline) + | |||
(transZz == null ? 0L : transZz) - | |||
(transRefund == null ? 0L : transRefund) - | |||
(transZzRefund == null ? 0L : transZzRefund) - | |||
(transCashRefund == null ? 0L : transCashRefund); | |||
} | |||
//============= 交易金额 - 结束 ========== | |||
//============= 银行收款 - 开始 =========== | |||
//银行收款 - 来源于网银 , 参考银行流水明细 , 根据备注区分 | |||
private Long bankCollection; | |||
// 银行合计 = 银行收款 | |||
private Long bankToll; | |||
public Long getBankToll() { | |||
return bankCollection; | |||
} | |||
//============= 银行收款 - 结束=========== | |||
//============= 手续费 - 开始 =========== | |||
//收费 | |||
private Long handlingFee; | |||
//退收费 | |||
private Long handlingRefund; | |||
//手续费合计 = 收费 - 退收费 | |||
private Long handlingToll; | |||
public Long getHandlingToll() { | |||
return (handlingFee == null ? 0L : handlingFee) - | |||
(handlingRefund == null ? 0L : handlingRefund); | |||
} | |||
//============= 手续费 - 结束=========== | |||
//============= 余额 - 开始 =========== | |||
//商户号已提现银行未达收款额 # 一般为 0 ,如果有数据,需要人工填报 | |||
private Long balanceWd; | |||
//支付宝余额 | |||
private Long balanceZfb; | |||
//未到账合计 = 商户号已提现银行未达收款额 + 支付宝余额 | |||
private Long wdzToll; | |||
public Long getWdzToll() { | |||
return (balanceWd == null ? 0L : balanceWd) - | |||
(balanceZfb == null ? 0L : balanceZfb); | |||
} | |||
//============= 余额 - 结束 =========== | |||
//期初数 - 来源于支付宝 | |||
private Long initialNum; | |||
//校验 | |||
private String validateNum; | |||
private LocalDateTime insertTime; | |||
private LocalDateTime updateTime; | |||
} |
@@ -0,0 +1,20 @@ | |||
package cn.com.taiji.settlew.dto.report; | |||
import cn.com.taiji.common.model.BaseDTO; | |||
import lombok.Data; | |||
/** | |||
* ETC通行费确认单 - 支付宝 编辑信息 | |||
* @Author jiangsong | |||
* @create 2025/9/20 | |||
*/ | |||
@Data | |||
public class EtcTollConfirmZfbEditDTO extends BaseDTO { | |||
//银行收款 - 来源于网银 , 参考银行流水明细 , 根据备注区分 | |||
private Long bankCollection; | |||
//商户号已提现银行未达收款额 # 一般为 0 ,如果有数据,需要人工填报 | |||
private Long balanceWd; | |||
//期初数 - 来源于支付宝 | |||
private Long initialNum; | |||
} |
@@ -9,26 +9,16 @@ import cn.com.taiji.common.pub.BeanTools; | |||
import cn.com.taiji.core.entity.dict.BucketFileBus; | |||
import cn.com.taiji.core.entity.settle.mobilepay.MobilePayInpNotice; | |||
import cn.com.taiji.core.entity.settle.mobilepay.MobilePayInpNoticeDetail; | |||
import cn.com.taiji.core.entity.settle.notice.InpTransNotice; | |||
import cn.com.taiji.core.entity.settle.notice.InpTransNoticeDetail; | |||
import cn.com.taiji.core.manager.tools.minio.MinioUtil; | |||
import cn.com.taiji.core.repo.jpa.settle.mobilepay.MobilePayInpNoticeDetailRepo; | |||
import cn.com.taiji.core.repo.jpa.settle.mobilepay.MobilePayInpNoticeRepo; | |||
import cn.com.taiji.core.repo.jpa.settle.notice.InpTransNoticeDetailRepo; | |||
import cn.com.taiji.core.repo.jpa.settle.notice.InpTransNoticeRepo; | |||
import cn.com.taiji.settlew.manager.notice.InpTransNoticeManager; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.mobilepay.in.*; | |||
import cn.com.taiji.settlew.model.notice.in.*; | |||
import cn.com.taiji.settlew.repo.jpa.request.mobilepay.MobilePayInpNoticeDetailListRequest; | |||
import cn.com.taiji.settlew.repo.jpa.request.mobilepay.MobilePayInpNoticePageRequest; | |||
import cn.com.taiji.settlew.repo.jpa.request.notice.InpTransNoticeDetailListRequest; | |||
import cn.com.taiji.settlew.repo.jpa.request.notice.InpTransNoticePageRequest; | |||
import cn.com.taiji.settlew.util.NumberConvert; | |||
import cn.com.taiji.settlew.vo.mobilepay.MobilePayInpNoticeDetailVo; | |||
import cn.com.taiji.settlew.vo.mobilepay.MobilePayInpNoticeVo; | |||
import cn.com.taiji.settlew.vo.notice.InpTransNoticeDetailVo; | |||
import cn.com.taiji.settlew.vo.notice.InpTransNoticeVo; | |||
import com.alibaba.excel.EasyExcel; | |||
import com.alibaba.excel.ExcelWriter; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -46,7 +36,7 @@ import java.util.stream.Collectors; | |||
* @author jiangsong | |||
*/ | |||
@Service | |||
public class MobileInpNoticeManagerImpl extends AbstractManager implements MobilePayInpNoticeManager { | |||
public class MobilePayInpNoticeManagerImpl extends AbstractManager implements MobilePayInpNoticeManager { | |||
@Autowired | |||
private MobilePayInpNoticeRepo mobilePayInpNoticeRepo; |
@@ -2,12 +2,12 @@ package cn.com.taiji.settlew.manager.report; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmAgencyEditDTO; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmAgencyPageRequestDTO; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmAgencyViewResponse; | |||
/** | |||
* @description: | |||
* @description: ETC通行费确认单(渠道) | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 16:00 | |||
*/ | |||
@@ -16,5 +16,5 @@ public interface EtcTollConfirmAgencyManager { | |||
Pagination query(EtcTollConfirmAgencyPageRequestDTO pageRequest); | |||
CommonExportResponse export(EtcTollConfirmAgencyPageRequestDTO req) throws ManagerException; | |||
void edit(EtcTollConfirmAgencyViewResponse req) throws ManagerException; | |||
void edit(EtcTollConfirmAgencyEditDTO dto) throws ManagerException; | |||
} |
@@ -12,11 +12,13 @@ import cn.com.taiji.core.entity.dict.BucketFileBus; | |||
import cn.com.taiji.core.entity.settle.report.EtcTollConfirmAgency; | |||
import cn.com.taiji.core.manager.tools.minio.MinioUtil; | |||
import cn.com.taiji.core.repo.jpa.settle.report.EtcTollConfirmAgencyRepo; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmAgencyDTO; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmAgencyEditDTO; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmAgencyPageRequestDTO; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmAgencyViewResponse; | |||
import cn.com.taiji.settlew.repo.jpa.request.report.EtcTollConfirmAgencyPageRequest; | |||
import cn.com.taiji.settlew.util.NumberConvert; | |||
import cn.com.taiji.settlew.vo.report.EtcTollConfirmAgencyVo; | |||
import com.alibaba.excel.EasyExcel; | |||
import com.alibaba.excel.ExcelWriter; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -24,20 +26,18 @@ import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.io.File; | |||
import java.math.BigDecimal; | |||
import java.math.RoundingMode; | |||
import java.time.LocalDateTime; | |||
import java.time.format.DateTimeFormatter; | |||
import java.util.List; | |||
/** | |||
* @description: | |||
* @description: ETC通行费确认单(渠道) | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 16:00 | |||
*/ | |||
@Service | |||
public class EtcTollConfirmAgencyManagerImpl extends AbstractManager implements | |||
EtcTollConfirmAgencyManager, ResultConverter<EtcTollConfirmAgency,EtcTollConfirmAgencyViewResponse> { | |||
EtcTollConfirmAgencyManager, ResultConverter<EtcTollConfirmAgency, EtcTollConfirmAgencyDTO> { | |||
@Autowired | |||
private EtcTollConfirmAgencyRepo agencyRepo; | |||
@@ -49,7 +49,7 @@ public class EtcTollConfirmAgencyManagerImpl extends AbstractManager implements | |||
public Pagination query(EtcTollConfirmAgencyPageRequestDTO pageRequest) { | |||
EtcTollConfirmAgencyPageRequest request = new EtcTollConfirmAgencyPageRequest(); | |||
BeanTools.copyProperties(pageRequest, request); | |||
return agencyRepo.page(request); | |||
return agencyRepo.page(request).convertResult(this); | |||
} | |||
@Override | |||
@@ -59,8 +59,10 @@ public class EtcTollConfirmAgencyManagerImpl extends AbstractManager implements | |||
EtcTollConfirmAgencyPageRequest reqList = new EtcTollConfirmAgencyPageRequest(); | |||
BeanTools.copyProperties(req, reqList); | |||
List<EtcTollConfirmAgency> result=agencyRepo.list(reqList); | |||
List<EtcTollConfirmAgencyViewResponse> responseList= LambdaTools.doMap(result,this::convert); | |||
//转DTO 自动 计算合计 相关值 | |||
List<EtcTollConfirmAgencyDTO> dtoList= LambdaTools.doMap(result,this::convert); | |||
// 将分转为元,方便输出到excel | |||
List<EtcTollConfirmAgencyVo> voList= LambdaTools.doMap(dtoList,this::fenConvertYuan); | |||
// 获取模板 | |||
File templateFile = new File(AppEnv.getDataPath() + "tollCollectionAgencyExcel.xlsx"); | |||
DateTimeFormatter formatter= DateTimeFormatter.ofPattern("yyyy-MM"); | |||
@@ -69,7 +71,7 @@ public class EtcTollConfirmAgencyManagerImpl extends AbstractManager implements | |||
File targetFile = new File(AppEnv.getTmpPath() + fileName); | |||
// 填充数据 | |||
try (ExcelWriter excelWriter = EasyExcel.write(targetFile).withTemplate(templateFile).build()) { | |||
excelWriter.fill(responseList, EasyExcel.writerSheet("sheet1").build()); | |||
excelWriter.fill(voList, EasyExcel.writerSheet("sheet1").build()); | |||
} | |||
// 上传minio | |||
String url = minioUtil.fileUploadHttp(targetFile, BucketFileBus.SETTLEW); | |||
@@ -81,43 +83,57 @@ public class EtcTollConfirmAgencyManagerImpl extends AbstractManager implements | |||
@Override | |||
@Transactional(rollbackFor = Exception.class) | |||
public void edit(EtcTollConfirmAgencyViewResponse req) throws ManagerException { | |||
EtcTollConfirmAgency old=agencyRepo.findById(req.getId()).orElse(null); | |||
public void edit(EtcTollConfirmAgencyEditDTO dto) throws ManagerException { | |||
if(dto.getId() == null){ | |||
throw new ManagerException("缺失ID信息,不可进行修改!"); | |||
} | |||
EtcTollConfirmAgency old=agencyRepo.findById(dto.getId()).orElse(null); | |||
if(old == null){ | |||
throw new ManagerException("不存在该信息!"); | |||
} | |||
BeanTools.copyProperties(req,old,"id","insertTime"); | |||
//元变成分 | |||
old.setBankCollection(NumberConvert.yuanToFen(req.getBankCollection())); | |||
old.setAgencyFee(NumberConvert.yuanToFen(req.getAgencyFee())); | |||
old.setCurrentTollFee(NumberConvert.yuanToFen(req.getCurrentTollFee())); | |||
old.setCurrentMonthFee(NumberConvert.yuanToFen(req.getCurrentMonthFee())); | |||
old.setCurrentWzfFee(NumberConvert.yuanToFen(req.getCurrentWzfFee())); | |||
old.setLastMonthFee(NumberConvert.yuanToFen(req.getLastMonthFee())); | |||
old.setLastMonthSwk(NumberConvert.yuanToFen(req.getLastMonthSwk())); | |||
old.setLastMonthOther(NumberConvert.yuanToFen(req.getLastMonthOther())); | |||
old.setOtherWdzFee(NumberConvert.yuanToFen(req.getOtherWdzFee())); | |||
old.setSwkFee(NumberConvert.yuanToFen(req.getSwkFee())); | |||
BeanTools.copyProperties(dto,old,"id","insertTime"); | |||
old.setUpdateTime(LocalDateTime.now()); | |||
agencyRepo.save(old); | |||
} | |||
@Override | |||
public EtcTollConfirmAgencyViewResponse convert(EtcTollConfirmAgency from) { | |||
EtcTollConfirmAgencyViewResponse response=new EtcTollConfirmAgencyViewResponse(); | |||
public EtcTollConfirmAgencyDTO convert(EtcTollConfirmAgency from) { | |||
EtcTollConfirmAgencyDTO response=new EtcTollConfirmAgencyDTO(); | |||
BeanTools.copyProperties(from,response); | |||
response.setBankCollection(NumberConvert.fenToYuan(from.getBankCollection())); | |||
response.setAgencyFee(NumberConvert.fenToYuan(from.getAgencyFee())); | |||
response.setCurrentTollFee(NumberConvert.fenToYuan(from.getCurrentTollFee())); | |||
response.setCurrentMonthFee(NumberConvert.fenToYuan(from.getCurrentMonthFee())); | |||
response.setCurrentWzfFee(NumberConvert.fenToYuan(from.getCurrentWzfFee())); | |||
response.setLastMonthFee(NumberConvert.fenToYuan(from.getLastMonthFee())); | |||
response.setLastMonthSwk(NumberConvert.fenToYuan(from.getLastMonthSwk())); | |||
response.setLastMonthOther(NumberConvert.fenToYuan(from.getLastMonthOther())); | |||
response.setOtherWdzFee(NumberConvert.fenToYuan(from.getOtherWdzFee())); | |||
response.setSwkFee(NumberConvert.fenToYuan(from.getSwkFee())); | |||
return response; | |||
} | |||
// 将 DTO 中的分 转为 VO 的元 | |||
public EtcTollConfirmAgencyVo fenConvertYuan(EtcTollConfirmAgencyDTO from) { | |||
EtcTollConfirmAgencyVo agencyVo =new EtcTollConfirmAgencyVo(); | |||
BeanTools.copyProperties(from,agencyVo); | |||
//截止上月最后一天未支付金额 | |||
agencyVo.setLastMonthFee(NumberConvert.fenToYuan(from.getLastMonthFee())); | |||
//其他货币资金商户号未到账余额(上月) | |||
agencyVo.setLastMonthOther(NumberConvert.fenToYuan(from.getLastMonthOther())); | |||
//商务卡未到账余额(上月) | |||
agencyVo.setLastMonthSwk(NumberConvert.fenToYuan(from.getLastMonthSwk())); | |||
//当月交易金额 | |||
agencyVo.setCurrentMonthFee(NumberConvert.fenToYuan(from.getCurrentMonthFee())); | |||
//银行实际收款金额 | |||
agencyVo.setBankCollection(NumberConvert.fenToYuan(from.getBankCollection())); | |||
//渠道费金额 | |||
agencyVo.setAgencyFee(NumberConvert.fenToYuan(from.getAgencyFee())); | |||
//其他货币资金商户号未到账余额 | |||
agencyVo.setOtherWdzFee(NumberConvert.fenToYuan(from.getOtherWdzFee())); | |||
//商务卡未到账余额 | |||
agencyVo.setSwkFee(NumberConvert.fenToYuan(from.getSwkFee())); | |||
//当月收款合计 = 银行实际收款金额 + 渠道费金额 + 其他货币资金商户号未到账余额 + 商务卡未到账余额 | |||
agencyVo.setCurrentTollFee(NumberConvert.fenToYuan(from.getCurrentTollFee())); | |||
//截止当月最后一天未支付金额 = 截止上月最后一天未支付金额 + 其他货币资金商户号未到账余额(上月) + 商务卡未到账余额(上月) | |||
agencyVo.setCurrentWzfFee(NumberConvert.fenToYuan(from.getCurrentWzfFee())); | |||
return agencyVo; | |||
} | |||
} |
@@ -2,12 +2,12 @@ package cn.com.taiji.settlew.manager.report; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmZfbEditDTO; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmZfbPageRequestDTO; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmZfbViewResponse; | |||
/** | |||
* @description: | |||
* @description: ETC通行费确认单(支付宝) | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 15:11 | |||
*/ | |||
@@ -15,5 +15,5 @@ public interface EtcTollConfirmZfbManager { | |||
Pagination query(EtcTollConfirmZfbPageRequestDTO pageRequest); | |||
CommonExportResponse export(EtcTollConfirmZfbPageRequestDTO req) throws ManagerException; | |||
void edit(EtcTollConfirmZfbViewResponse req) throws ManagerException; | |||
void edit(EtcTollConfirmZfbEditDTO dto) throws ManagerException; | |||
} |
@@ -12,11 +12,13 @@ import cn.com.taiji.core.entity.dict.BucketFileBus; | |||
import cn.com.taiji.core.entity.settle.report.EtcTollConfirmZfb; | |||
import cn.com.taiji.core.manager.tools.minio.MinioUtil; | |||
import cn.com.taiji.core.repo.jpa.settle.report.EtcTollConfirmZfbRepo; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmZfbDTO; | |||
import cn.com.taiji.settlew.dto.report.EtcTollConfirmZfbEditDTO; | |||
import cn.com.taiji.settlew.model.CommonExportResponse; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmZfbPageRequestDTO; | |||
import cn.com.taiji.settlew.model.report.EtcTollConfirmZfbViewResponse; | |||
import cn.com.taiji.settlew.repo.jpa.request.report.EtcTollConfirmZfbPageRequest; | |||
import cn.com.taiji.settlew.util.NumberConvert; | |||
import cn.com.taiji.settlew.vo.report.EtcTollConfirmZfbVo; | |||
import com.alibaba.excel.EasyExcel; | |||
import com.alibaba.excel.ExcelWriter; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -24,20 +26,18 @@ import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.io.File; | |||
import java.math.BigDecimal; | |||
import java.math.RoundingMode; | |||
import java.time.LocalDateTime; | |||
import java.time.format.DateTimeFormatter; | |||
import java.util.List; | |||
/** | |||
* @description: | |||
* @description: ETC通行费确认单(支付宝) | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 15:13 | |||
*/ | |||
@Service | |||
public class EtcTollConfirmZfbManagerImpl extends AbstractManager implements | |||
EtcTollConfirmZfbManager, ResultConverter<EtcTollConfirmZfb, EtcTollConfirmZfbViewResponse> { | |||
EtcTollConfirmZfbManager, ResultConverter<EtcTollConfirmZfb, EtcTollConfirmZfbDTO> { | |||
@Autowired | |||
private EtcTollConfirmZfbRepo zfbRepo; | |||
@@ -46,10 +46,9 @@ public class EtcTollConfirmZfbManagerImpl extends AbstractManager implements | |||
@Override | |||
public Pagination query(EtcTollConfirmZfbPageRequestDTO pageRequest) { | |||
EtcTollConfirmZfbPageRequest zfbPageRequest = new EtcTollConfirmZfbPageRequest(); | |||
BeanTools.copyProperties(pageRequest, zfbPageRequest); | |||
return zfbRepo.page(zfbPageRequest); | |||
return zfbRepo.page(zfbPageRequest).convertResult(this); | |||
} | |||
@Override | |||
@@ -58,9 +57,11 @@ public class EtcTollConfirmZfbManagerImpl extends AbstractManager implements | |||
EtcTollConfirmZfbPageRequest zfbPageRequest=new EtcTollConfirmZfbPageRequest(); | |||
BeanTools.copyProperties(req, zfbPageRequest); | |||
List<EtcTollConfirmZfb> result=zfbRepo.list(zfbPageRequest); | |||
List<EtcTollConfirmZfbViewResponse> responseList= LambdaTools.doMap(result,this::convert); | |||
List<EtcTollConfirmZfb> result= zfbRepo.list(zfbPageRequest); | |||
//转DTO 自动 计算合计 相关值 | |||
List<EtcTollConfirmZfbDTO> dtoList= LambdaTools.doMap(result,this::convert); | |||
// 将分转为元,方便输出到excel | |||
List<EtcTollConfirmZfbVo> voList= LambdaTools.doMap(dtoList,this::fenConvertYuan); | |||
// 获取模板 | |||
File templateFile = new File(AppEnv.getDataPath() + "tollCollectionZfbExcel.xlsx"); | |||
DateTimeFormatter formatter= DateTimeFormatter.ofPattern("yyyy-MM"); | |||
@@ -69,7 +70,7 @@ public class EtcTollConfirmZfbManagerImpl extends AbstractManager implements | |||
File targetFile = new File(AppEnv.getTmpPath() + fileName); | |||
// 填充数据 | |||
try (ExcelWriter excelWriter = EasyExcel.write(targetFile).withTemplate(templateFile).build()) { | |||
excelWriter.fill(responseList, EasyExcel.writerSheet("sheet1").build()); | |||
excelWriter.fill(voList, EasyExcel.writerSheet("sheet1").build()); | |||
} | |||
// 上传minio | |||
String url = minioUtil.fileUploadHttp(targetFile, BucketFileBus.SETTLEW); | |||
@@ -81,55 +82,72 @@ public class EtcTollConfirmZfbManagerImpl extends AbstractManager implements | |||
@Override | |||
@Transactional(rollbackFor = Exception.class) | |||
public void edit(EtcTollConfirmZfbViewResponse req) throws ManagerException { | |||
EtcTollConfirmZfb old=zfbRepo.findById(req.getId()).get(); | |||
public void edit(EtcTollConfirmZfbEditDTO dto) throws ManagerException { | |||
if(dto.getId() == null){ | |||
throw new ManagerException("缺失ID信息,不可进行修改!"); | |||
} | |||
EtcTollConfirmZfb old = zfbRepo.findById(dto.getId()).orElse(null); | |||
if(null==old){ | |||
throw new ManagerException("不存在该信息!"); | |||
} | |||
BeanTools.copyProperties(req,old,"id","insertTime"); | |||
old.setBalanceZfb(NumberConvert.yuanToFen(req.getBalanceZfb())); | |||
old.setBalanceQtzl(NumberConvert.yuanToFen(req.getBalanceQtzl())); | |||
old.setBalanceWd(NumberConvert.yuanToFen(req.getBalanceWd())); | |||
old.setBankToll(NumberConvert.yuanToFen(req.getBankToll())); | |||
old.setBankCollection(NumberConvert.yuanToFen(req.getBankCollection())); | |||
old.setHandlingFee(NumberConvert.yuanToFen(req.getHandlingFee())); | |||
old.setHandlingToll(NumberConvert.yuanToFen(req.getHandlingToll())); | |||
old.setHandlingRefund(NumberConvert.yuanToFen(req.getHandlingRefund())); | |||
old.setTransToll(NumberConvert.yuanToFen(req.getTransToll())); | |||
old.setTransRefund(NumberConvert.yuanToFen(req.getTransRefund())); | |||
old.setTransCashRefund(NumberConvert.yuanToFen(req.getTransCashRefund())); | |||
old.setTransOnline(NumberConvert.yuanToFen(req.getTransOnline())); | |||
old.setTransZz(NumberConvert.yuanToFen(req.getTransZz())); | |||
old.setWdzToll(NumberConvert.yuanToFen(req.getWdzToll())); | |||
old.setInitialNum(NumberConvert.yuanToFen(req.getInitialNum())); | |||
old.setValidateNum(NumberConvert.yuanToFen(req.getValidateNum())); | |||
old.setTransZzRefund(NumberConvert.yuanToFen(req.getTransZzRefund())); | |||
BeanTools.copyProperties(dto,old,"id","insertTime"); | |||
old.setUpdateTime(LocalDateTime.now()); | |||
zfbRepo.save(old); | |||
} | |||
@Override | |||
public EtcTollConfirmZfbViewResponse convert(EtcTollConfirmZfb from) { | |||
EtcTollConfirmZfbViewResponse response=new EtcTollConfirmZfbViewResponse(); | |||
public EtcTollConfirmZfbDTO convert(EtcTollConfirmZfb from) { | |||
EtcTollConfirmZfbDTO response=new EtcTollConfirmZfbDTO(); | |||
BeanTools.copyProperties(from,response); | |||
response.setBalanceZfb(NumberConvert.fenToYuan(from.getBalanceZfb())); | |||
response.setBalanceQtzl(NumberConvert.fenToYuan(from.getBalanceQtzl())); | |||
response.setBalanceWd(NumberConvert.fenToYuan(from.getBalanceWd())); | |||
response.setBankToll(NumberConvert.fenToYuan(from.getBankToll())); | |||
response.setBankCollection(NumberConvert.fenToYuan(from.getBankCollection())); | |||
response.setHandlingFee(NumberConvert.fenToYuan(from.getHandlingFee())); | |||
response.setHandlingToll(NumberConvert.fenToYuan(from.getHandlingToll())); | |||
response.setHandlingRefund(NumberConvert.fenToYuan(from.getHandlingRefund())); | |||
response.setTransToll(NumberConvert.fenToYuan(from.getTransToll())); | |||
response.setTransRefund(NumberConvert.fenToYuan(from.getTransRefund())); | |||
response.setTransCashRefund(NumberConvert.fenToYuan(from.getTransCashRefund())); | |||
response.setTransOnline(NumberConvert.fenToYuan(from.getTransOnline())); | |||
response.setTransZz(NumberConvert.fenToYuan(from.getTransZz())); | |||
response.setWdzToll(NumberConvert.fenToYuan(from.getWdzToll())); | |||
response.setInitialNum(NumberConvert.fenToYuan(from.getInitialNum())); | |||
response.setValidateNum(NumberConvert.fenToYuan(from.getValidateNum())); | |||
response.setTransZzRefund(NumberConvert.fenToYuan(from.getTransZzRefund())); | |||
return response; | |||
} | |||
// 将 DTO 中的分 转为 VO 的元 | |||
public EtcTollConfirmZfbVo fenConvertYuan(EtcTollConfirmZfbDTO from) { | |||
EtcTollConfirmZfbVo zfbVo =new EtcTollConfirmZfbVo(); | |||
BeanTools.copyProperties(from,zfbVo); | |||
// ------- 交易金额 | |||
//在线支付 | |||
zfbVo.setTransOnline(NumberConvert.fenToYuan(from.getTransToll())); | |||
//转账 | |||
zfbVo.setTransZz(NumberConvert.fenToYuan(from.getTransZz())); | |||
//退款 | |||
zfbVo.setTransRefund(NumberConvert.fenToYuan(from.getTransRefund())); | |||
//退转账 | |||
zfbVo.setTransZzRefund(NumberConvert.fenToYuan(from.getTransZzRefund())); | |||
//现金退回 | |||
zfbVo.setTransCashRefund(NumberConvert.fenToYuan(from.getTransCashRefund())); | |||
// 交易金额合计 | |||
zfbVo.setTransToll(NumberConvert.fenToYuan(from.getTransToll())); | |||
// ------- 银行收款 | |||
//银行收款 | |||
zfbVo.setBankCollection(NumberConvert.fenToYuan(from.getBankCollection())); | |||
//银行合计 | |||
zfbVo.setBankToll(NumberConvert.fenToYuan(from.getBankToll())); | |||
// ------- 手续费 | |||
//收费 | |||
zfbVo.setHandlingFee(NumberConvert.fenToYuan(from.getHandlingFee())); | |||
//退收费 | |||
zfbVo.setHandlingRefund(NumberConvert.fenToYuan(from.getHandlingRefund())); | |||
//手续费合计 | |||
zfbVo.setHandlingToll(NumberConvert.fenToYuan(from.getHandlingToll())); | |||
// ------- 余额 | |||
//商户号已提现银行未达收款额 # 一般为 0 ,如果有数据,需要人工填报 | |||
zfbVo.setBalanceWd(NumberConvert.fenToYuan(from.getBalanceWd())); | |||
//支付宝余额 | |||
zfbVo.setBalanceZfb(NumberConvert.fenToYuan(from.getBalanceZfb())); | |||
//未到账合计 | |||
zfbVo.setWdzToll(NumberConvert.fenToYuan(from.getWdzToll())); | |||
// 期初数 | |||
zfbVo.setInitialNum(NumberConvert.fenToYuan(from.getInitialNum())); | |||
return zfbVo; | |||
} | |||
} |
@@ -5,15 +5,20 @@ import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
/** | |||
* @description: | |||
* @description: ETC通行费确认单(渠道) 分页查询对象 | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 16:03 | |||
*/ | |||
@Data | |||
public class EtcTollConfirmAgencyPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||
@NotBlank(message = "统计起始时间不能为空") | |||
@ApiModelProperty(value="统计时间 YYYY-MM") | |||
private String transDateStart; | |||
@NotBlank(message = "统计结束时间不能为空") | |||
@ApiModelProperty(value="统计时间 YYYY-MM") | |||
private String transDateEnd; | |||
@@ -0,0 +1,54 @@ | |||
package cn.com.taiji.settlew.vo.report; | |||
import cn.com.taiji.common.model.BaseDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
/** | |||
* @description: ETC通行费确认单 - 渠道 (转为元 用于 excel 输出) | |||
* @author: jiangosng | |||
*/ | |||
@Data | |||
public class EtcTollConfirmAgencyVo extends BaseDTO { | |||
//交易时间 | |||
private String transDate; | |||
//ETC资金渠道名称 | |||
private String agencyName; | |||
//卡类型 | |||
private String cardType; | |||
//产品名称 | |||
private String productName; | |||
//结算组负责人 | |||
private String settlementManager; | |||
//截止上月最后一天未支付金额 | |||
private BigDecimal lastMonthFee; | |||
//其他货币资金商户号未到账余额(上月) | |||
private BigDecimal lastMonthOther; | |||
//商务卡未到账余额(上月) | |||
private BigDecimal lastMonthSwk; | |||
//当月交易金额 | |||
private BigDecimal currentMonthFee; | |||
//银行实际收款金额 | |||
private BigDecimal bankCollection; | |||
//渠道费金额 | |||
private BigDecimal agencyFee; | |||
//其他货币资金商户号未到账余额 | |||
private BigDecimal otherWdzFee; | |||
//商务卡未到账余额 | |||
private BigDecimal swkFee; | |||
//当月收款合计 = 银行实际收款金额 + 渠道费金额 + 其他货币资金商户号未到账余额 + 商务卡未到账余额 | |||
private BigDecimal currentTollFee; | |||
//截止当月最后一天未支付金额 = 截止上月最后一天未支付金额 + 其他货币资金商户号未到账余额(上月) + 商务卡未到账余额(上月) | |||
private BigDecimal currentWzfFee; | |||
//备注 | |||
private String remark; | |||
} |
@@ -1,4 +1,4 @@ | |||
package cn.com.taiji.settlew.model.report; | |||
package cn.com.taiji.settlew.vo.report; | |||
import cn.com.taiji.common.model.BaseDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
@@ -7,12 +7,11 @@ import lombok.Data; | |||
import java.math.BigDecimal; | |||
/** | |||
* @description: | |||
* @author: wangyan | |||
* @date Created in 2025/05/07 15:31 | |||
* @description: ETC通行费确认单 - 支付宝 (转为元 用于 excel 输出) | |||
* @author: jiangsong | |||
*/ | |||
@Data | |||
public class EtcTollConfirmZfbViewResponse extends BaseDTO { | |||
public class EtcTollConfirmZfbVo extends BaseDTO { | |||
@ApiModelProperty(value = "统计日期") | |||
private String statisticalDate; | |||
@ApiModelProperty(value = "在线支付") | |||
@@ -48,5 +47,5 @@ public class EtcTollConfirmZfbViewResponse extends BaseDTO { | |||
@ApiModelProperty(value = "期初数") | |||
private BigDecimal initialNum; | |||
@ApiModelProperty(value = "校验") | |||
private BigDecimal validateNum; | |||
private String validateNum; | |||
} |