Sfoglia il codice sorgente

更新申请开票接口

DESKTOP-VAEGFGM\zqc 10 mesi fa
parent
commit
c08b31ff87

+ 1 - 1
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/controller/app/invoice/InvoiceListController.java

@@ -67,7 +67,7 @@ public class InvoiceListController {
     @Operation(summary = "获得发票清单")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
     @PreAuthorize("@ss.hasPermission('member:invoice-list:query')")
-    public CommonResult<InvoiceListRespVO> getInvoiceList(@RequestParam("id") String id) {
+    public CommonResult<InvoiceListRespVO> getInvoiceList(@RequestParam("id") Long id) {
         InvoiceListDO invoiceList = invoiceListService.getInvoiceList(id);
         return success(BeanUtils.toBean(invoiceList, InvoiceListRespVO.class));
     }

+ 1 - 1
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/controller/app/invoice/InvoiceTitleController.java

@@ -57,7 +57,7 @@ public class InvoiceTitleController {
     @DeleteMapping("/delete")
     @Operation(summary = "删除发票抬头")
     @Parameter(name = "id", description = "编号", required = true)
-    @PreAuthorize("@ss.hasPermission('member:invoice-title:delete')")
+//    @PreAuthorize("@ss.hasPermission('member:invoice-title:delete')")
     public CommonResult<Boolean> deleteInvoiceTitle(@RequestParam("id") Long id) {
         invoiceTitleService.deleteInvoiceTitle(id);
         return success(true);

+ 1 - 1
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/controller/app/invoice/vo/InvoiceListRespVO.java

@@ -41,7 +41,7 @@ public class InvoiceListRespVO {
 
     @Schema(description = "发票状态 0.待开票  1.已开票  2.拒绝开票")
     @ExcelProperty("发票状态 0.待开票  1.已开票  2.拒绝开票")
-    private Integer statue;
+    private Integer status;
 
     @Schema(description = "支付订单id", example = "32484")
     @ExcelProperty("支付订单id")

+ 6 - 6
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/controller/app/invoice/vo/InvoiceListSaveReqVO.java

@@ -10,7 +10,7 @@ import javax.validation.constraints.*;
 public class InvoiceListSaveReqVO {
 
     @Schema(description = "主键", example = "14860")
-    private String id;
+    private Long id;
 
     @Schema(description = "0.个人  1.企业")
     private Integer category;
@@ -27,14 +27,14 @@ public class InvoiceListSaveReqVO {
     @Schema(description = "身份证号  或者 企业统一信用代码")
     private String code;
 
-    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10764")
-    @NotNull(message = "用户编号不能为空")
-    private Long userId;
+//    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10764")
+//    @NotNull(message = "用户编号不能为空")
+//    private Long userId;
 
     @Schema(description = "发票状态 0.待开票  1.已开票  2.拒绝开票")
-    private Integer statue;
+    private Integer status;
 
     @Schema(description = "支付订单id", example = "32484")
-    private Integer payOrderId;
+    private Long payOrderId;
 
 }

+ 1 - 1
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/dal/dataobject/invoice/InvoiceListDO.java

@@ -52,7 +52,7 @@ public class InvoiceListDO extends BaseDO {
     /**
      * 发票状态 0.待开票  1.已开票  2.拒绝开票
      */
-    private Integer statue;
+    private Integer status;
     /**
      * 支付订单id
      */

+ 1 - 1
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/dal/mysql/invoice/InvoiceListMapper.java

@@ -26,7 +26,7 @@ public interface InvoiceListMapper extends BaseMapperX<InvoiceListDO> {
                 .eqIfPresent(InvoiceListDO::getTitle, reqVO.getTitle())
                 .eqIfPresent(InvoiceListDO::getCode, reqVO.getCode())
                 .eqIfPresent(InvoiceListDO::getUserId, reqVO.getUserId())
-                .eqIfPresent(InvoiceListDO::getStatue, reqVO.getStatue())
+                .eqIfPresent(InvoiceListDO::getStatus, reqVO.getStatue())
                 .eqIfPresent(InvoiceListDO::getPayOrderId, reqVO.getPayOrderId())
                 .orderByDesc(InvoiceListDO::getId));
     }

+ 2 - 2
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/service/invoice/InvoiceListService.java

@@ -36,7 +36,7 @@ public interface InvoiceListService {
      *
      * @param id 编号
      */
-    void deleteInvoiceList(String id);
+    void deleteInvoiceList(Long id);
 
     /**
      * 获得发票清单
@@ -44,7 +44,7 @@ public interface InvoiceListService {
      * @param id 编号
      * @return 发票清单
      */
-    InvoiceListDO getInvoiceList(String id);
+    InvoiceListDO getInvoiceList(Long id);
 
     /**
      * 获得发票清单分页

+ 8 - 6
citu-module-member/citu-module-member-biz/src/main/java/com/citu/module/member/service/invoice/InvoiceListServiceImpl.java

@@ -42,13 +42,13 @@ public class InvoiceListServiceImpl implements InvoiceListService {
 
     @Override
     public Long createInvoiceList(InvoiceListSaveReqVO createReqVO) {
-
-        PayOrderBaseRespDTO data = payOrderApi.getOrder2(Long.valueOf(createReqVO.getPayOrderId())).getData();
+        Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
+        PayOrderBaseRespDTO data = payOrderApi.getOrder2(createReqVO.getPayOrderId()).getData();
         if(null==data){
             throw   exception(INVOICE_LIST_ORDER_NOT_EXISTS);
         }
         // 非本人订单
-        if(!SecurityFrameworkUtils.getLoginUserId().toString().equals( data.getChannelUserId())){
+        if(!loginUserId.toString().equals( data.getChannelUserId())){
             throw   exception(INVOICE_LIST_ORDER_NOT_EXISTS);
         }
 
@@ -62,6 +62,8 @@ public class InvoiceListServiceImpl implements InvoiceListService {
 
         // 插入
         InvoiceListDO invoiceList = BeanUtils.toBean(createReqVO, InvoiceListDO.class);
+        invoiceList.setUserId(loginUserId);
+        invoiceList.setStatus(0);
         invoiceListMapper.insert(invoiceList);
         // 返回
         return invoiceList.getId();
@@ -77,21 +79,21 @@ public class InvoiceListServiceImpl implements InvoiceListService {
     }
 
     @Override
-    public void deleteInvoiceList(String id) {
+    public void deleteInvoiceList(Long id) {
         // 校验存在
         validateInvoiceListExists(id);
         // 删除
         invoiceListMapper.deleteById(id);
     }
 
-    private void validateInvoiceListExists(String id) {
+    private void validateInvoiceListExists(Long id) {
         if (invoiceListMapper.selectById(id) == null) {
             throw exception(INVOICE_LIST_NOT_EXISTS);
         }
     }
 
     @Override
-    public InvoiceListDO getInvoiceList(String id) {
+    public InvoiceListDO getInvoiceList(Long id) {
         return invoiceListMapper.selectById(id);
     }