Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-08-01 11:19:52 +08:00
commit d429c6a1eb
4 files changed
+51 -3

No files matched your search

@@ -0,0 +1,16 @@
package com.bsd.pjcloud.wallet.api.dto.recharge;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Data
public class WalletRechargeInvoiceRefreshDto {
@NotNull(message = "发票id不能为空")
private Long id;
@NotEmpty(message = "发票图片(不带盖章)")
private String picUrl;
}
@@ -16,6 +16,7 @@ import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceApplyDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceRefreshDto;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo;
import com.bsd.pjcloud.wallet.service.WalletRechargeInvoiceService;
@@ -53,6 +54,14 @@ public class WalletRechargeInvoiceController {
}
/* ************************************* start callback start ************************************* */
@Operation(summary = "重新生成发票", description = "重新生成发票")
@SysLog("重新生成发票")
@PostMapping("/refreshInvoice")
@Idempotent(expireTime = 10, info = "正在重新生成发票中,请勿重复操作")
public R refreshInvoice(@Valid @RequestBody WalletRechargeInvoiceRefreshDto dto) {
walletRechargeInvoiceService.refreshInvoice(dto);
return R.ok(true);
}
@Operation(summary = "提交申请", description = "提交申请")
@SysLog("提交申请")
@@ -7,6 +7,7 @@ import com.bsd.pjcloud.common.security.service.PjcloudUser;
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceApplyDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceRefreshDto;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo;
import jakarta.servlet.http.HttpServletResponse;
@@ -86,4 +87,9 @@ public interface WalletRechargeInvoiceService extends IService<WalletRechargeInv
* 导出
*/
void export(HttpServletResponse response, Page page, WalletRechargeBindInvoiceDto dto, DataScope dataScope);
/**
* 重新生成发票
*/
void refreshInvoice(WalletRechargeInvoiceRefreshDto dto);
}
@@ -38,6 +38,7 @@ import com.bsd.pjcloud.wallet.api.constant.WalletBizRechargeEnum;
import com.bsd.pjcloud.wallet.api.constant.WalletRechargeInvoiceStatusEnum;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceApplyDto;
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceRefreshDto;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
@@ -476,10 +477,10 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
WriteSheet writeSheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
Map<String, Object> map = new HashMap<String, Object>();
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
if (ObjectUtil.isNotEmpty(dto.getProcessTimeList())) {
map.put("timeSpan", " 到 ");
map.put("startTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
map.put("startTime", LocalDateTimeUtil.format(dto.getProcessTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
map.put("endTime", LocalDateTimeUtil.format(dto.getProcessTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
}
if (ObjectUtil.isNotEmpty(list)) {
Long lineNumber = 1L;
@@ -526,6 +527,22 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
}
}
/**
* 重新生成发票
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void refreshInvoice(WalletRechargeInvoiceRefreshDto dto) {
// 查询发票
WalletRechargeInvoiceEntity detail = baseMapper.selectById(dto.getId());
if (ObjectUtil.isEmpty(detail)) throw new RuntimeException("发票不存在");
detail.setPicUrl(dto.getPicUrl());
String stampPicUrl = stamp(detail);
// 更新
detail.setStampPicUrl(stampPicUrl);
baseMapper.updateById(detail);
}
private void disposeList(List<WalletRechargeInvoiceVo> list, WalletRechargeBindInvoiceDto dto) {
if (ObjectUtil.isEmpty(list)) return;
// 审批流程