@@ -0,0 +1,111 @@ | |||
package cn.com.taiji.core.entity.bill; | |||
import cn.com.taiji.core.entity.AbstractStringPropertyUUIDEntity; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.persistence.Column; | |||
import javax.persistence.Entity; | |||
import javax.persistence.Table; | |||
import javax.validation.constraints.NotNull; | |||
import java.time.LocalDateTime; | |||
/** 开票记录表 */ | |||
@Entity | |||
@Getter | |||
@Setter | |||
@Table(name = "BILL_RECORD_INFO") | |||
public class BillRecordInfo extends AbstractStringPropertyUUIDEntity { | |||
/** 创建时间 */ | |||
@NotNull | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime; | |||
/** 更新时间 */ | |||
@NotNull | |||
@Column(name = "UPDATE_TIME") | |||
private LocalDateTime updateTime; | |||
/** 开票流水号 */ | |||
@Column(name = "SERIAL_NO") | |||
private String serialNo; | |||
/** 发票订单号 */ | |||
@Column(name = "OUT_ORDER_NO") | |||
private String outOrderNo; | |||
/** 发票类型名称 */ | |||
@Column(name = "INVOICE_TYPE_NAME") | |||
private String invoiceTypeName; | |||
/** 商品名称 */ | |||
@Column(name = "GOODS_NAME") | |||
private String goodsName; | |||
/** 税率 */ | |||
@Column(name = "TAX_RATE") | |||
private String taxRate; | |||
/** 发票抬头 */ | |||
@Column(name = "BUYER_NAME") | |||
private String buyerName; | |||
/** 购方税号 */ | |||
@Column(name = "BUYER_TAX_NO") | |||
private String buyerTaxNo; | |||
/** 含税价 */ | |||
@Column(name = "TOTAL_AMOUNT") | |||
private String totalAmount; | |||
/** 商品价(不含税) */ | |||
@Column(name = "GOODS_AMOUNT") | |||
private String goodsAmount; | |||
/** 税额 */ | |||
@Column(name = "TAX_AMOUNT") | |||
private String taxAmount; | |||
/** 发票代码 */ | |||
@Column(name = "INVOICE_CODE") | |||
private String invoiceCode; | |||
/** 发票号码 */ | |||
@Column(name = "INVOICE_NO") | |||
private String invoiceNo; | |||
/** 开票日期 */ | |||
@Column(name = "INVOICE_DATE") | |||
private String invoiceDate; | |||
/** 发票具体时间 */ | |||
@Column(name = "INVOICE_OPEN_TIME") | |||
private String invoiceOpenTime; | |||
/** 发票板式文件下载链路 */ | |||
@Column(name = "FILE_URL") | |||
private String fileUrl; | |||
/** 状态;1-正常,-1-已红冲 */ | |||
@Column(name = "STATUS") | |||
private Integer status; | |||
/** 备注 */ | |||
@Column(name = "REMARKS") | |||
private String remarks; | |||
/** 开票来源 */ | |||
@Column(name = "OPERATION_SOURCE") | |||
private String operationSource; | |||
/** 开票操作人 */ | |||
@Column(name = "OPERATION_USER_ID") | |||
private String operationUserId; | |||
/** 手机号 */ | |||
@Column(name = "USER_MOBILE") | |||
private String userMobile; | |||
} | |||
@@ -0,0 +1,7 @@ | |||
package cn.com.taiji.core.repo.jpa.bill; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.bill.BillRecordInfo; | |||
public interface BillRecordInfoRepo extends AbstractJpaRepo<BillRecordInfo, String> { | |||
} |
@@ -27,7 +27,7 @@ public class BillRecordController extends MyValidController { | |||
@ApiOperation("发票开票记录") | |||
@PostMapping("/query") | |||
public ApiResponse<BillRecordResponseDTO> query(@Valid @RequestBody BillRecordRequestDTO req) throws ManagerException { | |||
public ApiResponse<Pagination> query(@Valid @RequestBody BillRecordRequestDTO req) throws ManagerException { | |||
return ApiResponse.of(manager.query(req)); | |||
} | |||
@@ -5,7 +5,7 @@ import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.managew.dto.bill.*; | |||
public interface BillRecordManager { | |||
BillRecordResponseDTO query(BillRecordRequestDTO req) throws ManagerException; | |||
Pagination query(BillRecordRequestDTO req) throws ManagerException; | |||
void reversal(BillReversalRequestDTO req) throws ManagerException; | |||
@@ -2,11 +2,16 @@ package cn.com.taiji.managew.manager.bill; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.model.comm.protocol.ias.bill.*; | |||
import cn.com.taiji.core.model.comm.protocol.ats.bill.BillCommResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ats.bill.BillOrderPushLogRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.bill.BillOrderPushLogResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ats.bill.BillReversalRequest; | |||
import cn.com.taiji.core.repo.jpa.bill.BillRecordInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueInvoiceOrderPushLogRepo; | |||
import cn.com.taiji.core.repo.request.issue.IssueInvoiceOrderPushLogPageRequest; | |||
import cn.com.taiji.managew.dto.bill.*; | |||
import cn.com.taiji.managew.manager.AbstractCommManager; | |||
import cn.com.taiji.managew.repo.jpa.request.bill.BillRecordInfoPageRequest; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -16,23 +21,22 @@ public class BillRecordManagerImpl extends AbstractCommManager implements BillRe | |||
@Autowired | |||
private IssueInvoiceOrderPushLogRepo pushLogRepo; | |||
@Autowired | |||
private BillRecordInfoRepo recordInfoRepo; | |||
@Override | |||
public BillRecordResponseDTO query(BillRecordRequestDTO req) throws ManagerException { | |||
BillRecordRequest request = new BillRecordRequest(); | |||
public Pagination query(BillRecordRequestDTO req) throws ManagerException { | |||
BillRecordInfoPageRequest request = new BillRecordInfoPageRequest(); | |||
BeanUtils.copyProperties(req, request); | |||
BillRecordResponse response = jsonPostRepeat(request); | |||
BillRecordResponseDTO res = new BillRecordResponseDTO(); | |||
BeanUtils.copyProperties(response, res); | |||
return res; | |||
return recordInfoRepo.page(request); | |||
} | |||
@Override | |||
public void reversal(BillReversalRequestDTO req) throws ManagerException { | |||
BillReversalRequest request = new BillReversalRequest(); | |||
BeanUtils.copyProperties(req, request); | |||
BillReversalResponse response = jsonPostRepeat(request); | |||
if (!"true".equals(response.getSuccess())) { | |||
BillCommResponse response = jsonPostRepeat(request); | |||
if (response.getSuccess()) { | |||
throw new ManagerException(response.getMessage()); | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
package cn.com.taiji.managew.repo.jpa.request.bill; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaDateTimePageableDataRequest; | |||
import cn.com.taiji.core.entity.bill.BillRecordInfo; | |||
import lombok.Data; | |||
@Data | |||
public class BillRecordInfoPageRequest extends JpaDateTimePageableDataRequest<BillRecordInfo> { | |||
public BillRecordInfoPageRequest() { | |||
this.orderBy = "updateTime"; | |||
this.desc = true; | |||
} | |||
private String billId; | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder("from " + BillRecordInfo.class.getName() + " where 1=1 "); | |||
hql.append(" and billId=:billId", billId); | |||
return hql; | |||
} | |||
} |
@@ -107,16 +107,4 @@ refund: | |||
orderPushAsyncUrl: /api/NewRefund/OrderPushAsync | |||
queryNewRefundAsyncUrl: /api/NewRefund/QueryNewRefundAsync | |||
getHandleRecordsUrl: /api/NewRefund/GetHandleRecords | |||
orderSaveAsyncUrl: /api/NewRefund/OrderSaveAsync | |||
# 汇联通相关配置 | |||
hlt: | |||
# url: http://www.hltgz.com:4010/api/v2/execute.json | |||
url: http://100.64.2.99:8099/hltStandardapiPlus | |||
appId: ifzt | |||
signCode: 6D532026 | |||
accessCode: E90D91AD8B574273840CC4C4CC869082 | |||
# 申办/售后服务订单通知 | |||
orderNotice: | |||
url: http://192.168.101.70:8080/orderNotice/v1/activeNotice.json | |||
orderSaveAsyncUrl: /api/NewRefund/OrderSaveAsync |