commit
1e86f4e18e
@ -0,0 +1,88 @@ |
|||||||
|
package com.jianshui.web.controller.platform; |
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil; |
||||||
|
import cn.hutool.json.JSONObject; |
||||||
|
import com.jianshui.common.core.controller.BaseController; |
||||||
|
import com.jianshui.common.core.domain.AjaxResult; |
||||||
|
import com.jianshui.common.core.page.TableDataInfo; |
||||||
|
import com.jianshui.invoice.domain.BillInfo; |
||||||
|
import com.jianshui.invoice.mapper.BillInfoMapper; |
||||||
|
import com.jianshui.platform.dto.DocumentListQueryPDTO; |
||||||
|
import com.jianshui.platform.dto.InvoiceAdd.BillInfoPDTO; |
||||||
|
import com.jianshui.platform.service.InvoiceAddPService; |
||||||
|
import com.jianshui.platform.vo.InvoiceListPVO; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 发票录入 |
||||||
|
* |
||||||
|
*/ |
||||||
|
@Api(tags={"单据管理"},value = "") |
||||||
|
@RestController |
||||||
|
@RequestMapping("/platForm/billInfoAdd/") |
||||||
|
public class BillInfoAddPController extends BaseController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private InvoiceAddPService addService; |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private BillInfoMapper billInfoMapper; |
||||||
|
|
||||||
|
@ApiOperation(value = "单据保存",notes = "单据保存请求(支持数电普票、数电专票)") |
||||||
|
@PostMapping( "invoiceSave") |
||||||
|
public AjaxResult invoiceSave(@RequestBody BillInfoPDTO billInfoPDTO) throws Exception { |
||||||
|
return toAjax(addService.invoiceSave(billInfoPDTO)); |
||||||
|
} |
||||||
|
|
||||||
|
@ApiOperation(value = "单据管理列表",notes = "发票管理") |
||||||
|
@GetMapping( "documentList") |
||||||
|
public TableDataInfo documentList(DocumentListQueryPDTO queryPDTO) throws Exception { |
||||||
|
|
||||||
|
startPage(); |
||||||
|
BillInfo billInfo = BeanUtil.copyProperties(queryPDTO,BillInfo.class); |
||||||
|
List<BillInfo> billInfoList = billInfoMapper.selectBillInfoList(billInfo); |
||||||
|
|
||||||
|
List<InvoiceListPVO> invoiceListPVOS = BeanUtil.copyToList(billInfoList,InvoiceListPVO.class); |
||||||
|
return getDataTable(invoiceListPVOS); |
||||||
|
} |
||||||
|
|
||||||
|
@ApiOperation(value = "税收分类编码列表",notes = "开发中") |
||||||
|
@PostMapping( "difference") |
||||||
|
public AjaxResult taxClassificationCodeList(@RequestBody JSONObject jsonObject) throws Exception { |
||||||
|
|
||||||
|
// TODO: 税收分类编码列表
|
||||||
|
|
||||||
|
return AjaxResult.error("功能开发中!"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "差额",notes = "开发中") |
||||||
|
@PostMapping( "difference1") |
||||||
|
public AjaxResult difference(@RequestBody JSONObject jsonObject) throws Exception { |
||||||
|
|
||||||
|
// TODO: 差额:
|
||||||
|
|
||||||
|
return AjaxResult.error("功能开发中!"); |
||||||
|
} |
||||||
|
|
||||||
|
@ApiOperation(value = "复制",notes = "开发中") |
||||||
|
@PostMapping( "copy") |
||||||
|
public AjaxResult copy(@RequestBody JSONObject jsonObject) throws Exception { |
||||||
|
|
||||||
|
// TODO: 复制:复制的是开票信息还是发票信息
|
||||||
|
|
||||||
|
return AjaxResult.error("功能开发中!"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
package com.jianshui.platform.dto; |
||||||
|
|
||||||
|
|
||||||
|
import com.jianshui.common.core.page.PageDomain; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.sql.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: kk |
||||||
|
* @Description: 单据管理查询 |
||||||
|
* @DateTime: 2023/6/12 10:48 |
||||||
|
* @Params: |
||||||
|
* @Return |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel("单据管理查询") |
||||||
|
public class DocumentListQueryPDTO extends PageDomain { |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据类型") |
||||||
|
private String billType; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据状态") |
||||||
|
private Integer state; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据编号") |
||||||
|
private String fpqqlsh; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据开始日期") |
||||||
|
private Date startTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据结束日期") |
||||||
|
private Date endTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户税号") |
||||||
|
private String buyerTaxnum; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户名称") |
||||||
|
private String buyerName; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,57 @@ |
|||||||
|
package com.jianshui.platform.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: kk |
||||||
|
* @Description: 发票状态枚举:BillINfo票据 Invoice发票 RedInfo红字 |
||||||
|
*/ |
||||||
|
public enum InvoiceStatus { |
||||||
|
|
||||||
|
INVOICE_NOT_INVOICED("0", "未开票"), |
||||||
|
INVOICE_INVOICING("20", "开票中"), |
||||||
|
INVOICE_COMPLETED("2", "开票完成"), |
||||||
|
INVOICE_FAILED("22", "开票失败"), |
||||||
|
INVOICE_RED_FLAGGED("99", "已冲红"), |
||||||
|
INVOICE_CANCELLED("3", "已作废"), |
||||||
|
INVOICE_MERGED("18", "已合并"), |
||||||
|
INVOICE_SIGNING("21", "开票成功签章中"), |
||||||
|
INVOICE_SIGNING_FAILED("24", "开票成功签章失败"), |
||||||
|
INVOICE_CANCELLING("31", "发票作废中"), |
||||||
|
INVOICE_RED_FLAGGING("98", "冲红中"), |
||||||
|
INVOICE_SPLIT("17", "已拆分"), |
||||||
|
INVOICE_UNSIGNED("23", "开票成功未签章"), |
||||||
|
INVOICE_PARTIAL_RED("25", "部分冲红"), |
||||||
|
|
||||||
|
// RedInfo
|
||||||
|
REDINFO_APPLICATION_PENDING("0", "申请中"), |
||||||
|
REDINFO_APPROVAL_SUCCESS("1", "审核成功"), |
||||||
|
REDINFO_APPROVAL_FAILED("2", "审核失败"), |
||||||
|
REDINFO_APPLICATION_SUCCESS("3", "申请成功"), |
||||||
|
REDINFO_APPLICATION_FAILED("4", "申请失败"); |
||||||
|
|
||||||
|
|
||||||
|
private String code; |
||||||
|
private String displayName; |
||||||
|
|
||||||
|
private InvoiceStatus(String code, String displayName) { |
||||||
|
this.code = code; |
||||||
|
this.displayName = displayName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDisplayName() { |
||||||
|
return displayName; |
||||||
|
} |
||||||
|
|
||||||
|
public static InvoiceStatus fromCode(String code) { |
||||||
|
for (InvoiceStatus type : InvoiceStatus.values()) { |
||||||
|
if (type.getCode().equals(code)) { |
||||||
|
return type; |
||||||
|
} |
||||||
|
} |
||||||
|
throw new IllegalArgumentException("Invalid InvoiceType code: " + code); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.jianshui.platform.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: kk |
||||||
|
* @Description: 开票类型枚举 |
||||||
|
*/ |
||||||
|
public enum InvoiceType { |
||||||
|
|
||||||
|
SHU_DIAN_ZHUAN_PIAO("1", "数电专票"), |
||||||
|
SHU_DIAN_PU_PIAO("2", "数电普票"); |
||||||
|
|
||||||
|
private String code; |
||||||
|
private String displayName; |
||||||
|
|
||||||
|
private InvoiceType(String code, String displayName) { |
||||||
|
this.code = code; |
||||||
|
this.displayName = displayName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDisplayName() { |
||||||
|
return displayName; |
||||||
|
} |
||||||
|
|
||||||
|
public static InvoiceType fromCode(String code) { |
||||||
|
for (InvoiceType type : InvoiceType.values()) { |
||||||
|
if (type.getCode().equals(code)) { |
||||||
|
return type; |
||||||
|
} |
||||||
|
} |
||||||
|
throw new IllegalArgumentException("Invalid InvoiceType code: " + code); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.jianshui.platform.service; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: kk |
||||||
|
* @Description: 单据管理 |
||||||
|
* @DateTime: 2023/6/26 11:57 |
||||||
|
*/ |
||||||
|
public interface BillInfoAddPService { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
package com.jianshui.platform.service.impl; |
||||||
|
|
||||||
|
import com.jianshui.invoice.mapper.BillInfoMapper; |
||||||
|
import com.jianshui.platform.service.BillInfoAddPService; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: kk |
||||||
|
* @Description: 单据管理 |
||||||
|
* @DateTime: 2023/6/26 11:58 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@Slf4j |
||||||
|
public class BillInfoAddPServiceImpl implements BillInfoAddPService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private static BillInfoMapper billInfoMapper; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,71 @@ |
|||||||
|
package com.jianshui.platform.vo; |
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import com.jianshui.common.annotation.Excel; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: kk |
||||||
|
* @Description: 单据管理列表VO |
||||||
|
* @DateTime: 2023/6/12 10:49 |
||||||
|
* @Params: |
||||||
|
* @Return |
||||||
|
*/ |
||||||
|
|
||||||
|
@Data |
||||||
|
@ApiModel("发票管理") |
||||||
|
public class DocumentListPVO { |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据编号") |
||||||
|
private String fpqqlsh; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户名称") |
||||||
|
private String buyerName; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户税号") |
||||||
|
private String buyerTaxnum; |
||||||
|
|
||||||
|
// @ApiModelProperty(value = "行数")
|
||||||
|
// private String fphm;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "未税金额") |
||||||
|
private BigDecimal taxfreeamt; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "含税金额") |
||||||
|
private BigDecimal taxamt; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||||
|
private Date invoicedTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据类型") |
||||||
|
private String billType; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户地址及电话") |
||||||
|
private String buyerAddress; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "客户银行及账号") |
||||||
|
private String buyerAccount; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注") |
||||||
|
private String message; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源") |
||||||
|
private String source; |
||||||
|
|
||||||
|
// @ApiModelProperty(value = "特殊票种")
|
||||||
|
// private String sellerTaxnum;
|
||||||
|
|
||||||
|
// @ApiModelProperty(value = "失败原因")
|
||||||
|
// private String sellerTaxnum;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
Reference in new issue