@@ -0,0 +1,67 @@ | |||
package cn.com.taiji.core.entity.issue; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.persistence.Column; | |||
import javax.persistence.Entity; | |||
import javax.persistence.Table; | |||
import java.time.LocalDateTime; | |||
/** 发票订单推送记录表*/ | |||
@Getter | |||
@Setter | |||
@Entity | |||
@Table(name = "ISSUE_INVOICE_ORDER_PUSH_LOG") | |||
public class IssueInvoiceOrderPushLog extends StringPropertyUUIDEntity { | |||
/** 入库时间*/ | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime; | |||
/** 更新时间 */ | |||
@Column(name = "UPDATE_TIME") | |||
private LocalDateTime updateTime; | |||
/** 订单编号 */ | |||
@Column(name = "ORDER_NO") | |||
private String orderNo; | |||
/** 激活时间 */ | |||
@Column(name = "ACTIVE_TIME") | |||
private LocalDateTime activeTime; | |||
/** 证件号码 */ | |||
@Column(name = "IDENT_NO") | |||
private String identNo; | |||
/** 车牌号 */ | |||
@Column(name = "VEHICLE_PLATE") | |||
private String vehiclePlate; | |||
/** 车牌颜色 */ | |||
@Column(name = "VEHICLE_PLATE_COLOR") | |||
private Integer vehiclePlateColor; | |||
/** 订单金额 */ | |||
@Column(name = "INVOICE_AMOUNT") | |||
private String invoiceAmount; | |||
/** 推送时间 */ | |||
@Column(name = "PUSH_TIME") | |||
private LocalDateTime pushTime; | |||
/** 状态;1-成功,2-失败 */ | |||
@Column(name = "STATUS") | |||
private String status; | |||
/** 失败原因 */ | |||
@Column(name = "FAIL_MSG") | |||
private String failMsg; | |||
/** 手机号 */ | |||
@Column(name = "USER_MOBILE") | |||
private String userMobile; | |||
/** 收费车型 */ | |||
@Column(name = "TYPE") | |||
private String type; | |||
/** 产品编号 */ | |||
@Column(name = "PRODUCT_MODEL") | |||
private String productModel; | |||
/** 产品类型 */ | |||
@Column(name = "PRODUCT_TYPE") | |||
private String productType; | |||
/** 订单类型 */ | |||
@Column(name = "ORDER_TYPE") | |||
private String orderType; | |||
} |
@@ -14,7 +14,7 @@ import java.util.List; | |||
@Setter | |||
public class BillMergeInvoicingRequest extends AbstractIasRequest<BillMergeInvoicingResponse> { | |||
public BillMergeInvoicingRequest() { | |||
super(BillServiceCmd.BILLMERGEINVOICING); | |||
super(BillServiceCmd.MERGEINVOICING); | |||
} | |||
/** | |||
* ETC产品订单号 |
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; | |||
@Setter | |||
public class BillOrderPushLogRequest extends AbstractIasRequest<BillOrderPushLogResponse> { | |||
public BillOrderPushLogRequest() { | |||
super(BillServiceCmd.BILLORDERPUSH); | |||
super(BillServiceCmd.ORDERPUSH); | |||
} | |||
/** 订单号*/ | |||
@JsonProperty(value = "OrderNo") |
@@ -1,5 +1,6 @@ | |||
package cn.com.taiji.core.model.comm.protocol.ias.bill; | |||
import cn.com.taiji.core.model.comm.protocol.ias.AbstractIasResponse; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -7,7 +8,7 @@ import lombok.Setter; | |||
/** 发票订单补推响应*/ | |||
@Setter | |||
@Getter | |||
public class BillOrderPushLogResponse extends BillCommonResponse { | |||
public class BillOrderPushLogResponse extends AbstractIasResponse { | |||
/** 返回码*/ | |||
@JsonProperty(value = "Rc") |
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; | |||
@Setter | |||
public class BillRaiseDeleteRequest extends AbstractIasRequest<BillRaiseDeleteResponse> { | |||
public BillRaiseDeleteRequest() { | |||
super(BillServiceCmd.BILLRAISEDELETE); | |||
super(BillServiceCmd.RAISEDELETE); | |||
} | |||
/** 抬头记录id*/ |
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; | |||
@Setter | |||
public class BillRaiseInsertRequest extends AbstractIasRequest<BillRaiseInsertResponse> { | |||
public BillRaiseInsertRequest() { | |||
super(BillServiceCmd.BILLRAISEINSERT); | |||
super(BillServiceCmd.RAISEINSERT); | |||
} | |||
/** |
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; | |||
@Setter | |||
public class BillRaiseUpdateRequest extends AbstractIasRequest<BillRaiseUpdateResponse> { | |||
public BillRaiseUpdateRequest() { | |||
super(BillServiceCmd.BILLRAISEUPDATE); | |||
super(BillServiceCmd.RAISEUPDATE); | |||
} | |||
/** |
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank; | |||
@Setter | |||
public class BillRecordRequest extends AbstractIasRequest<BillRecordResponse> { | |||
public BillRecordRequest() { | |||
super(BillServiceCmd.BILLRECORD); | |||
super(BillServiceCmd.RECORD); | |||
} | |||
/** 状态 正常_1,红冲_-1*/ | |||
@JsonProperty(value = "Status") |
@@ -12,15 +12,15 @@ import javax.validation.constraints.NotBlank; | |||
@Setter | |||
public class BillReversalRequest extends AbstractIasRequest<BillReversalResponse> { | |||
public BillReversalRequest() { | |||
super(BillServiceCmd.BILLREVERSAL); | |||
super(BillServiceCmd.REVERSAL); | |||
} | |||
/** 开票流水号*/ | |||
@JsonProperty(value = "SerialNo") | |||
@NotBlank | |||
@NotBlank(message = "开票流水号不能为空") | |||
private String serialNo; | |||
/** 红冲原因*/ | |||
@JsonProperty(value = "ReversalReason") | |||
@NotBlank | |||
@NotBlank(message = "红冲原因不能为空") | |||
private String reversalReason; | |||
} |
@@ -6,13 +6,13 @@ import cn.com.taiji.core.model.comm.protocol.SignServiceType; | |||
import cn.com.taiji.core.model.comm.protocol.ias.IasServiceType; | |||
public enum BillServiceCmd implements SignServiceCommand { | |||
BILLRAISEINSERT("发票抬头添加","/qtzlinvoice/addInvoiceTitle", BillRaiseInsertRequest.class), | |||
BILLRAISEDELETE("发票抬头删除","/qtzlinvoice/deleteInvoiceTitle", BillRaiseDeleteRequest.class), | |||
BILLRAISEUPDATE("发票抬头修改","/qtzlinvoice/editInvoiceTitle", BillRaiseUpdateRequest.class), | |||
BILLRECORD("发票开票记录","/qtzlinvoice/queryInvoice", BillRecordRequest.class), | |||
BILLREVERSAL("发票红冲","/qtzlinvoice/invocieReversal", BillReversalRequest.class), | |||
BILLMERGEINVOICING("ETC产品合并开票","/qtzlinvoice/batchOpenEtcProductInvoice", BillMergeInvoicingRequest.class), | |||
BILLORDERPUSH("发票订单补推","billOrderPush", BillOrderPushLogRequest.class), | |||
RAISEINSERT("发票抬头添加","/qtzlinvoice/addInvoiceTitle", BillRaiseInsertRequest.class), | |||
RAISEDELETE("发票抬头删除","/qtzlinvoice/deleteInvoiceTitle", BillRaiseDeleteRequest.class), | |||
RAISEUPDATE("发票抬头修改","/qtzlinvoice/editInvoiceTitle", BillRaiseUpdateRequest.class), | |||
RECORD("发票开票记录","/qtzlinvoice/queryInvoice", BillRecordRequest.class), | |||
REVERSAL("发票红冲","/qtzlinvoice/invocieReversal", BillReversalRequest.class), | |||
MERGEINVOICING("ETC产品合并开票","/qtzlinvoice/batchOpenEtcProductInvoice", BillMergeInvoicingRequest.class), | |||
ORDERPUSH("发票订单补推","billOrderPush", BillOrderPushLogRequest.class), | |||
; | |||
@@ -0,0 +1,8 @@ | |||
package cn.com.taiji.core.repo.jpa.issue; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.issue.IssueInvoiceOrderPushLog; | |||
public interface IssueInvoiceOrderPushLogRepo extends AbstractJpaRepo<IssueInvoiceOrderPushLog, String>{ | |||
} |
@@ -0,0 +1,32 @@ | |||
package cn.com.taiji.core.repo.request.issue; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaDateTimePageableDataRequest; | |||
import cn.com.taiji.core.entity.issue.IssueInvoiceOrderPushLog; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Getter | |||
@Setter | |||
public class IssueInvoiceOrderPushLogPageRequest extends JpaDateTimePageableDataRequest<IssueInvoiceOrderPushLog> { | |||
/** 订单编号 */ | |||
private String orderNo; | |||
/** 订单类型 */ | |||
private String orderType; | |||
/** 状态;1-成功,2-失败 */ | |||
private String status; | |||
public IssueInvoiceOrderPushLogPageRequest() { | |||
this.orderBy = "updateTime"; | |||
this.desc = true; | |||
} | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder("from " + IssueInvoiceOrderPushLog.class.getName() + " where 1=1"); | |||
hql.append(" and orderNo =:orderNo ", orderNo); | |||
hql.append(" and orderType =:orderType ", orderType); | |||
hql.append(" and status =:status ", status); | |||
return hql; | |||
} | |||
} |
@@ -34,7 +34,7 @@ public class InvwQryCardBatchController extends MyValidController { | |||
@ApiOperation(value = "02-卡片发行批次导出") | |||
@PostMapping("/export") | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryCardBatchPageRequestDTO req) throws ManagerException, IOException { | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryCardBatchPageRequestDTO req) throws ManagerException { | |||
return ApiResponse.of(manager.export(req)); | |||
} | |||
} |
@@ -34,7 +34,7 @@ public class InvwQryCardsController extends MyValidController { | |||
@ApiOperation(value = "02-卡片一发导出") | |||
@PostMapping("/export") | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryCardsPageRequestDTO req) throws ManagerException, IOException { | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryCardsPageRequestDTO req) throws ManagerException{ | |||
return ApiResponse.of(manager.export(req)); | |||
} | |||
} |
@@ -34,7 +34,7 @@ public class InvwQryObuBatchController extends MyValidController { | |||
@ApiOperation(value = "02-OBU发行批次导出") | |||
@PostMapping("/export") | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryObuBatchPageRequestDTO req) throws ManagerException, IOException { | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryObuBatchPageRequestDTO req) throws ManagerException { | |||
return ApiResponse.of(manager.export(req)); | |||
} | |||
} |
@@ -34,7 +34,7 @@ public class InvwQryObusController extends MyValidController { | |||
@ApiOperation(value = "02-OBU一发导出") | |||
@PostMapping("/export") | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryObusPageRequestDTO req) throws ManagerException, IOException { | |||
public ApiResponse<CommExcelFileResponseDTO> export(@Valid @RequestBody InvwQryObusPageRequestDTO req) throws ManagerException { | |||
return ApiResponse.of(manager.export(req)); | |||
} | |||
} |
@@ -8,7 +8,6 @@ import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import javax.validation.constraints.NotBlank; | |||
import java.util.List; | |||
@ApiModel(description = "库存盘存请求") |
@@ -1,7 +1,6 @@ | |||
package cn.com.taiji.invw.dto.transfer; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; |
@@ -3,12 +3,12 @@ package cn.com.taiji.invw.dto.warehouse; | |||
import cn.com.taiji.invw.model.warehouse.InvwWarehouseIdNameModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import java.util.List; | |||
@ApiModel(description = "仓库ID名称集合") | |||
@Getter | |||
@Setter |
@@ -1,6 +1,5 @@ | |||
package cn.com.taiji.invw.dto.warehouse; | |||
import cn.com.taiji.common.model.finals.SysFinals; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; |
@@ -10,5 +10,5 @@ import java.io.IOException; | |||
public interface InvwQryCardBatchManager { | |||
Pagination page(InvwQryCardBatchPageRequestDTO request); | |||
CommExcelFileResponseDTO export(InvwQryCardBatchPageRequestDTO request) throws ManagerException, IOException; | |||
CommExcelFileResponseDTO export(InvwQryCardBatchPageRequestDTO request) throws ManagerException; | |||
} |
@@ -37,15 +37,15 @@ public class InvwQryCardBatchManagerImpl extends AbstractCommManager implements | |||
} | |||
@Override | |||
public CommExcelFileResponseDTO export(InvwQryCardBatchPageRequestDTO request) throws ManagerException, IOException { | |||
public CommExcelFileResponseDTO export(InvwQryCardBatchPageRequestDTO request) throws ManagerException { | |||
InvwQryCardBatchPageRequest req = new InvwQryCardBatchPageRequest(); | |||
BeanUtils.copyProperties(request, req); | |||
List<InvwQryCardBatch> list = invwQryCardBatchRepo.list(req); | |||
if (list.size() > 10000) { | |||
throw new RuntimeException("导出数据超过10000条,请缩小范围"); | |||
throw new ManagerException("导出数据超过10000条,请缩小范围"); | |||
} | |||
if (list.size() == 0) { | |||
throw new RuntimeException("所选导出数据为空"); | |||
throw new ManagerException("所选导出数据为空"); | |||
} | |||
// 转换成excelModel | |||
@@ -58,7 +58,13 @@ public class InvwQryCardBatchManagerImpl extends AbstractCommManager implements | |||
// 生成excel文件 | |||
String excelName = "卡片发行批次"; | |||
File file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
File file = null; | |||
try { | |||
file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
} catch (IOException e) { | |||
logger.error("生成excel文件失败", e); | |||
throw new ManagerException("生成excel文件失败"); | |||
} | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryCardBatchExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 |
@@ -10,5 +10,5 @@ import java.io.IOException; | |||
public interface InvwQryCardsManager { | |||
Pagination page(InvwQryCardsPageRequestDTO request); | |||
CommExcelFileResponseDTO export(InvwQryCardsPageRequestDTO req) throws ManagerException, IOException; | |||
CommExcelFileResponseDTO export(InvwQryCardsPageRequestDTO req) throws ManagerException; | |||
} |
@@ -37,15 +37,15 @@ public class InvwQryCardsManagerImpl extends AbstractCommManager implements Invw | |||
} | |||
@Override | |||
public CommExcelFileResponseDTO export(InvwQryCardsPageRequestDTO request) throws ManagerException, IOException { | |||
public CommExcelFileResponseDTO export(InvwQryCardsPageRequestDTO request) throws ManagerException { | |||
InvwQryCardsPageRequest req = new InvwQryCardsPageRequest(); | |||
BeanUtils.copyProperties(request, req); | |||
List<InvwQryCards> list = invwQryCardsRepo.list(req); | |||
if (list.size() > 10000) { | |||
throw new RuntimeException("导出数据超过10000条,请缩小范围"); | |||
throw new ManagerException("导出数据超过10000条,请缩小范围"); | |||
} | |||
if (list.size() == 0) { | |||
throw new RuntimeException("所选导出数据为空"); | |||
throw new ManagerException("所选导出数据为空"); | |||
} | |||
// 转换成excelModel | |||
@@ -58,7 +58,13 @@ public class InvwQryCardsManagerImpl extends AbstractCommManager implements Invw | |||
// 生成excel文件 | |||
String excelName = "卡片一行"; | |||
File file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
File file = null; | |||
try { | |||
file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
} catch (IOException e) { | |||
logger.error("生成excel文件失败", e); | |||
throw new ManagerException("生成excel文件失败"); | |||
} | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryCardsExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 |
@@ -10,5 +10,5 @@ import java.io.IOException; | |||
public interface InvwQryObuBatchManager { | |||
Pagination page(InvwQryObuBatchPageRequestDTO request); | |||
CommExcelFileResponseDTO export(InvwQryObuBatchPageRequestDTO req) throws ManagerException, IOException; | |||
CommExcelFileResponseDTO export(InvwQryObuBatchPageRequestDTO req) throws ManagerException; | |||
} |
@@ -37,15 +37,15 @@ public class InvwQryObuBatchManagerImpl extends AbstractCommManager implements I | |||
} | |||
@Override | |||
public CommExcelFileResponseDTO export(InvwQryObuBatchPageRequestDTO request) throws ManagerException, IOException { | |||
public CommExcelFileResponseDTO export(InvwQryObuBatchPageRequestDTO request) throws ManagerException { | |||
InvwQryObuBatchPageRequest req = new InvwQryObuBatchPageRequest(); | |||
BeanUtils.copyProperties(request, req); | |||
List<InvwQryObuBatch> list = invwQryObuBatchRepo.list(req); | |||
if (list.size() > 10000) { | |||
throw new RuntimeException("导出数据超过10000条,请缩小范围"); | |||
throw new ManagerException("导出数据超过10000条,请缩小范围"); | |||
} | |||
if (list.size() == 0) { | |||
throw new RuntimeException("所选导出数据为空"); | |||
throw new ManagerException("所选导出数据为空"); | |||
} | |||
// 转换成excelModel | |||
@@ -58,7 +58,13 @@ public class InvwQryObuBatchManagerImpl extends AbstractCommManager implements I | |||
// 生成excel文件 | |||
String excelName = "OBU发行批次"; | |||
File file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
File file = null; | |||
try { | |||
file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
} catch (IOException e) { | |||
logger.error("生成excel文件失败", e); | |||
throw new ManagerException("生成excel文件失败"); | |||
} | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryObuBatchExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 |
@@ -10,5 +10,5 @@ import java.io.IOException; | |||
public interface InvwQryObusManager { | |||
Pagination page(InvwQryObusPageRequestDTO request); | |||
CommExcelFileResponseDTO export(InvwQryObusPageRequestDTO req) throws ManagerException, IOException; | |||
CommExcelFileResponseDTO export(InvwQryObusPageRequestDTO req) throws ManagerException; | |||
} |
@@ -37,15 +37,15 @@ public class InvwQryObusManagerImpl extends AbstractCommManager implements InvwQ | |||
} | |||
@Override | |||
public CommExcelFileResponseDTO export(InvwQryObusPageRequestDTO request) throws ManagerException, IOException { | |||
public CommExcelFileResponseDTO export(InvwQryObusPageRequestDTO request) throws ManagerException { | |||
InvwQryObusPageRequest req = new InvwQryObusPageRequest(); | |||
BeanUtils.copyProperties(request, req); | |||
List<InvwQryObus> list = invwQryObusRepo.list(req); | |||
if (list.size() > 10000) { | |||
throw new RuntimeException("导出数据超过10000条,请缩小范围"); | |||
throw new ManagerException("导出数据超过10000条,请缩小范围"); | |||
} | |||
if (list.size() == 0) { | |||
throw new RuntimeException("所选导出数据为空"); | |||
throw new ManagerException("所选导出数据为空"); | |||
} | |||
// 转换成excelModel | |||
@@ -58,7 +58,13 @@ public class InvwQryObusManagerImpl extends AbstractCommManager implements InvwQ | |||
// 生成excel文件 | |||
String excelName = "OBU一发"; | |||
File file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
File file = null; | |||
try { | |||
file = File.createTempFile("temp_"+excelName, ".xlsx"); | |||
} catch (IOException e) { | |||
logger.error("生成excel文件失败", e); | |||
throw new ManagerException("生成excel文件失败"); | |||
} | |||
// 写入数据 | |||
EasyExcel.write(file, InvwQryObusExcelModel.class).sheet(excelName).doWrite(excelModels); | |||
// 上传文件 |
@@ -11,6 +11,7 @@ dependencies { | |||
implementation "${groupname}:sample-protocol:1.0.0-SNAPSHOT" | |||
implementation "${groupname}:ats-protocol:1.0.0-SNAPSHOT" | |||
implementation "${groupname}:bls-protocol:1.0.0-SNAPSHOT" | |||
implementation "${groupname}:ias-protocol:1.0.0-SNAPSHOT" | |||
implementation('cn.com.taiji.common:sso-client:2.3.10.7') | |||
implementation "org.springframework.boot:spring-boot-starter-security" | |||
implementation "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery" |
@@ -0,0 +1,53 @@ | |||
package cn.com.taiji.managew.api.bill; | |||
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.managew.api.MyValidController; | |||
import cn.com.taiji.managew.dto.bill.*; | |||
import cn.com.taiji.managew.manager.bill.BillRecordManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import javax.validation.Valid; | |||
@Api(tags = {"发票管理"}) | |||
@RestController | |||
@RequestMapping("/api/bill") | |||
public class BillRecordController extends MyValidController { | |||
@Autowired | |||
private BillRecordManager manager; | |||
@ApiOperation("发票开票记录") | |||
@PostMapping("/query") | |||
public ApiResponse<BillRecordResponseDTO> query(@Valid @RequestBody BillRecordRequestDTO req) throws ManagerException { | |||
return ApiResponse.of(manager.query(req)); | |||
} | |||
@ApiOperation("发票红冲") | |||
@PostMapping("/reversal") | |||
public ApiResponse reversal(@Valid @RequestBody BillReversalRequestDTO req) throws ManagerException { | |||
manager.reversal(req); | |||
return ApiResponse.success().setMessage("操作成功"); | |||
} | |||
@ApiOperation("发票订单推送记录查询") | |||
@PostMapping("/pushLogQuery") | |||
public ApiResponse<Pagination> queryPushLog(@Valid @RequestBody BillOrderPushLogPageRequestDTO req) { | |||
return ApiResponse.of(manager.pushLogQuery(req)); | |||
} | |||
@ApiOperation("发票订单推送记录补推") | |||
@PostMapping("/repush") | |||
public ApiResponse repush(@Valid @RequestBody BillOrderPushLogRequestDTO req) throws ManagerException { | |||
manager.repush(req); | |||
return ApiResponse.success().setMessage("操作成功"); | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
package cn.com.taiji.managew.dto.bill; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "发票订单推送记录查询请求") | |||
public class BillOrderPushLogPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||
/** 订单编号 */ | |||
@ApiModelProperty(value = "订单编号") | |||
private String orderNo; | |||
/** 订单类型 */ | |||
@ApiModelProperty(value = "订单类型") | |||
private String orderType; | |||
/** 状态;1-成功,2-失败 */ | |||
@ApiModelProperty(value = "状态;1-成功,2-失败") | |||
private String status; | |||
} |
@@ -0,0 +1,75 @@ | |||
package cn.com.taiji.managew.dto.bill; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "发票订单推送记录补推请求") | |||
public class BillOrderPushLogRequestDTO extends AbstractStaffBizRequestDTO { | |||
/** 订单号*/ | |||
@ApiModelProperty(value = "订单号", required = true) | |||
@NotBlank(message = "订单号不能为空") | |||
private String orderNo; | |||
/** 车牌号*/ | |||
@ApiModelProperty(value = "车牌号", required = true) | |||
@NotBlank(message = "车牌号不能为空") | |||
private String vehiclePlate; | |||
/** 车牌颜色*/ | |||
@ApiModelProperty(value = "车牌颜色", required = true) | |||
@NotBlank(message = "车牌颜色不能为空") | |||
private Integer vehiclePlateColor; | |||
/** 激活时间不能为空*/ | |||
@ApiModelProperty(value = "激活时间", required = true) | |||
@NotBlank(message = "激活时间不能为空") | |||
private String activeTime; | |||
/** 身份证后6位*/ | |||
@ApiModelProperty(value = "身份证后6位", required = true) | |||
@NotBlank(message = "身份证后6位不能为空") | |||
private String identNo; | |||
/** 订单类型*/ | |||
@ApiModelProperty(value = "订单类型", required = true) | |||
@NotBlank(message = "收费车型不能为空") | |||
private Integer type; | |||
/** 手机号*/ | |||
@ApiModelProperty(value = "手机号", required = true) | |||
@NotBlank(message = "手机号不能为空") | |||
private String userMobile; | |||
/** 创建时间*/ | |||
@ApiModelProperty(value = "创建时间", required = true) | |||
@NotBlank(message = "创建时间不能为空") | |||
private String createTime; | |||
/** 产品型号*/ | |||
@ApiModelProperty(value = "产品型号", required = true) | |||
@NotBlank(message = "产品编码不能为空") | |||
private String productModel; | |||
/** 产品类型*/ | |||
@ApiModelProperty(value = "产品类型", required = true) | |||
@NotBlank(message = "产品类型不能为空") | |||
private String productType; | |||
/** 订单类型*/ | |||
@ApiModelProperty(value = "订单类型", required = true) | |||
@NotBlank(message = "订单类型不能为空") | |||
private Integer orderType; | |||
/** 发票金额*/ | |||
@ApiModelProperty(value = "发票金额", required = true) | |||
@NotBlank(message = "发票金额不能为空") | |||
private Integer invoiceAmount; | |||
} |
@@ -0,0 +1,44 @@ | |||
package cn.com.taiji.managew.dto.bill; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "发票记录请求") | |||
public class BillRecordRequestDTO extends AbstractStaffBizRequestDTO { | |||
/** 状态 正常_1,红冲_-1*/ | |||
@ApiModelProperty(value = "状态 正常_1,红冲_-1") | |||
private Integer status; | |||
/** 订单类型 ETC产品_1,通行服务费_2*/ | |||
@ApiModelProperty(value = "订单类型 ETC产品_1,通行服务费_2") | |||
private Integer orderType; | |||
/** 开票开始日期*/ | |||
@ApiModelProperty(value = "开票开始日期") | |||
private String startDate; | |||
/** 开票结束日期*/ | |||
@ApiModelProperty(value = "开票结束日期") | |||
private String endDate; | |||
/** 页码*/ | |||
@ApiModelProperty(value = "页码") | |||
private Integer pageNumber; | |||
/** 每页大小*/ | |||
@ApiModelProperty(value = "每页大小") | |||
private Integer pageSize; | |||
/** 手机号*/ | |||
@ApiModelProperty(value = "手机号" ) | |||
@NotBlank(message = "手机号不能为空") | |||
private String userMobile; | |||
} |
@@ -0,0 +1,17 @@ | |||
package cn.com.taiji.managew.dto.bill; | |||
import cn.com.taiji.managew.model.bill.BillRecordModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.util.List; | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "发票记录响应") | |||
public class BillRecordResponseDTO { | |||
@ApiModelProperty(value = "发票记录") | |||
List<BillRecordModel> billRecords; | |||
} |
@@ -0,0 +1,25 @@ | |||
package cn.com.taiji.managew.dto.bill; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "发票红冲") | |||
public class BillReversalRequestDTO extends AbstractStaffBizRequestDTO { | |||
/** 开票流水号*/ | |||
@ApiModelProperty(value = "开票流水号") | |||
@NotBlank(message = "开票流水号不能为空") | |||
private String serialNo; | |||
/** 红冲原因*/ | |||
@ApiModelProperty(value = "红冲原因") | |||
@NotBlank(message = "红冲原因不能为空") | |||
private String reversalReason; | |||
} |
@@ -0,0 +1,15 @@ | |||
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.managew.dto.bill.*; | |||
public interface BillRecordManager { | |||
BillRecordResponseDTO query(BillRecordRequestDTO req) throws ManagerException; | |||
void reversal(BillReversalRequestDTO req) throws ManagerException; | |||
Pagination pushLogQuery(BillOrderPushLogPageRequestDTO req); | |||
void repush(BillOrderPushLogRequestDTO req) throws ManagerException; | |||
} |
@@ -0,0 +1,56 @@ | |||
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.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 org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@Service | |||
public class BillRecordManagerImpl extends AbstractCommManager implements BillRecordManager { | |||
@Autowired | |||
private IssueInvoiceOrderPushLogRepo pushLogRepo; | |||
@Override | |||
public BillRecordResponseDTO query(BillRecordRequestDTO req) throws ManagerException { | |||
BillRecordRequest request = new BillRecordRequest(); | |||
BeanUtils.copyProperties(req, request); | |||
BillRecordResponse response = jsonPostRepeat(request); | |||
BillRecordResponseDTO res = new BillRecordResponseDTO(); | |||
BeanUtils.copyProperties(response, res); | |||
return res; | |||
} | |||
@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())) { | |||
throw new ManagerException(response.getMessage()); | |||
} | |||
} | |||
@Override | |||
public Pagination pushLogQuery(BillOrderPushLogPageRequestDTO req) { | |||
IssueInvoiceOrderPushLogPageRequest request = new IssueInvoiceOrderPushLogPageRequest(); | |||
BeanUtils.copyProperties(req, request); | |||
return pushLogRepo.page(request); | |||
} | |||
@Override | |||
public void repush(BillOrderPushLogRequestDTO req) throws ManagerException { | |||
BillOrderPushLogRequest request = new BillOrderPushLogRequest(); | |||
BeanUtils.copyProperties(req, request); | |||
BillOrderPushLogResponse response = jsonPostRepeat(request); | |||
if (200 != response.getRc()) { | |||
throw new ManagerException(response.getRmsg()); | |||
} | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
package cn.com.taiji.managew.model.bill; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | |||
import com.alibaba.excel.annotation.ExcelProperty; | |||
import com.alibaba.excel.annotation.write.style.ContentFontStyle; | |||
import com.alibaba.excel.annotation.write.style.ContentStyle; | |||
import com.alibaba.excel.annotation.write.style.HeadFontStyle; | |||
import com.alibaba.excel.annotation.write.style.HeadStyle; | |||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) | |||
@HeadFontStyle(fontHeightInPoints = 12) | |||
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT) | |||
@ContentFontStyle(fontHeightInPoints = 10, fontName = "宋体") | |||
@ExcelIgnoreUnannotated | |||
@Getter | |||
@Setter | |||
public class BillRecordExcelModel extends BaseModel { | |||
/** 开票流水号 */ | |||
@ExcelProperty(value = "开票流水号") | |||
private String serialNo; | |||
/** 外部订单号 */ | |||
@ExcelProperty(value = "外部订单号") | |||
private String outOrderNo; | |||
/** 发票类型名称 */ | |||
@ExcelProperty(value = "发票类型名称") | |||
private String invoiceTypeName; | |||
/** 商品名称 */ | |||
@ExcelProperty(value = "商品名称") | |||
private String goodsName; | |||
/** 税率 */ | |||
@ExcelProperty(value = "税率") | |||
private Double taxRate; | |||
/** 发票抬头 */ | |||
@ExcelProperty(value = "发票抬头") | |||
private String buyerName; | |||
/** 购方税号 */ | |||
@ExcelProperty(value = "购方税号") | |||
private String buyerTaxNo; | |||
/** 含税价 */ | |||
@ExcelProperty(value = "含税价") | |||
private Double totalAmount; | |||
/** 商品价(不含税) */ | |||
@ExcelProperty(value = "商品价(不含税)") | |||
private Double goodsAmount; | |||
/** 税额 */ | |||
@ExcelProperty(value = "税额") | |||
private Double taxAmount; | |||
/** 发票代码 */ | |||
@ExcelProperty(value = "发票代码") | |||
private String invoiceCode; | |||
/** 发票号码 */ | |||
@ExcelProperty(value = "发票号码") | |||
private String invoiceNo; | |||
/** 开票日期 */ | |||
@ExcelProperty(value = "开票日期") | |||
private String invoiceDate; | |||
/** 发票开具时间 yyyy-MM-dd HH:mm:ss格式 */ | |||
@ExcelProperty(value = "发票开具时间") | |||
private String invoiceOpenTime; | |||
/** 发票板式文件下载链路 */ | |||
@ExcelProperty(value = "发票文件下载链路") | |||
private String fileUrl; | |||
/** 状态 1:正常;-1:已红冲; */ | |||
@ExcelProperty(value = "状态 1:正常;-1:已红冲") | |||
private Integer status; | |||
/** 备注 */ | |||
@ExcelProperty(value = "备注") | |||
private String remarks; | |||
} |
@@ -0,0 +1,79 @@ | |||
package cn.com.taiji.managew.model.bill; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Setter | |||
@Getter | |||
public class BillRecordModel extends BaseModel { | |||
/** 开票流水号 */ | |||
@ApiModelProperty(value = "开票流水号") | |||
private String serialNo; | |||
/** 外部订单号 */ | |||
@ApiModelProperty(value = "外部订单号") | |||
private String outOrderNo; | |||
/** 发票类型名称 */ | |||
@ApiModelProperty(value = "发票类型名称") | |||
private String invoiceTypeName; | |||
/** 商品名称 */ | |||
@ApiModelProperty(value = "商品名称") | |||
private String goodsName; | |||
/** 税率 */ | |||
@ApiModelProperty(value = "税率") | |||
private Double taxRate; | |||
/** 发票抬头 */ | |||
@ApiModelProperty(value = "发票抬头") | |||
private String buyerName; | |||
/** 购方税号 */ | |||
@ApiModelProperty(value = "购方税号") | |||
private String buyerTaxNo; | |||
/** 含税价 */ | |||
@ApiModelProperty(value = "含税价") | |||
private Double totalAmount; | |||
/** 商品价(不含税) */ | |||
@ApiModelProperty(value = "商品价(不含税)") | |||
private Double goodsAmount; | |||
/** 税额 */ | |||
@ApiModelProperty(value = "税额") | |||
private Double taxAmount; | |||
/** 发票代码 */ | |||
@ApiModelProperty(value = "发票代码") | |||
private String invoiceCode; | |||
/** 发票号码 */ | |||
@ApiModelProperty(value = "发票号码") | |||
private String invoiceNo; | |||
/** 开票日期 */ | |||
@ApiModelProperty(value = "开票日期") | |||
private String invoiceDate; | |||
/** 发票开具时间 yyyy-MM-dd HH:mm:ss格式 */ | |||
@ApiModelProperty(value = "发票开具时间") | |||
private String invoiceOpenTime; | |||
/** 发票板式文件下载链路 */ | |||
@ApiModelProperty(value = "发票文件下载链路") | |||
private String fileUrl; | |||
/** 状态 1:正常;-1:已红冲; */ | |||
@ApiModelProperty(value = "状态 1:正常;-1:已红冲") | |||
private Integer status; | |||
/** 备注 */ | |||
@ApiModelProperty(value = "备注") | |||
private String remarks; | |||
} |
@@ -8,9 +8,7 @@ import cn.com.taiji.core.model.comm.protocol.SignJsonRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ias.IasServiceType; | |||
import cn.com.taiji.core.model.comm.protocol.ias.bill.*; | |||
import cn.com.taiji.ias.manager.bill.BillBusinessManager; | |||
import cn.com.taiji.ias.manager.handler.AbstractIasServiceHandler; | |||
import com.zgglyun.common.model.AbstractHttpRequestInfo; | |||
import lombok.SneakyThrows; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -27,19 +25,19 @@ public class BillServiceHandler extends AbstractIasServiceHandler<BillServiceCmd | |||
protected <T extends AbstractSignTypeRequest<?>> AbstractSignTypeResponse handleInternal(T request, SignJsonRequest jsonReq, AbstractHttpRequestInfo reqInfo) throws ServiceHandleException { | |||
BillServiceCmd cmd = BillServiceCmd.fromIfCode(jsonReq.getIfCode()); | |||
switch (cmd) { | |||
case BILLRAISEINSERT: | |||
case RAISEINSERT: | |||
return billBusinessManager.billRaiseInsert((BillRaiseInsertRequest) request,cmd.getTxCode()); | |||
case BILLRAISEDELETE: | |||
case RAISEDELETE: | |||
return billBusinessManager.billRaiseDelete((BillRaiseDeleteRequest) request,cmd.getTxCode()); | |||
case BILLRAISEUPDATE: | |||
case RAISEUPDATE: | |||
return billBusinessManager.billRaiseUpdate((BillRaiseUpdateRequest) request,cmd.getTxCode()); | |||
case BILLRECORD: | |||
case RECORD: | |||
return billBusinessManager.billRecord((BillRecordRequest) request,cmd.getTxCode()); | |||
case BILLREVERSAL: | |||
case REVERSAL: | |||
return billBusinessManager.billReversal((BillReversalRequest) request,cmd.getTxCode()); | |||
case BILLMERGEINVOICING: | |||
case MERGEINVOICING: | |||
return billBusinessManager.billMergeInvoicing((BillMergeInvoicingRequest) request,cmd.getTxCode()); | |||
case BILLORDERPUSH: | |||
case ORDERPUSH: | |||
return billBusinessManager.billOrderPush((BillOrderPushLogRequest) request); | |||
default: | |||
throw FileProtocolSystemError.NOT_SUPPORT.toHandleException(jsonReq.getIfCode()); |