parent
38d3257df9
commit
718837bd25
@ -0,0 +1,97 @@ |
||||
package com.dxhy.erp.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.dxhy.erp.entity.TDxInvoice; |
||||
import com.dxhy.erp.entity.TdxRecordInvoice; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* |
||||
* 发票信息dao |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@Mapper |
||||
public interface SignRecordInvoiceDao extends BaseMapper<TdxRecordInvoice> { |
||||
|
||||
/** |
||||
* 未签收发票查询接口 |
||||
* |
||||
* @param pramsMap |
||||
* 请求参数 |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
List<TdxRecordInvoice> selectWqsfp(Map<String, Object> pramsMap); |
||||
|
||||
/** |
||||
* 未签收发票合计信息查询接口 |
||||
* |
||||
* @param pramsMap |
||||
* 请求参数 |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
List<TdxRecordInvoice> selectWqsfpHj(Map<String, Object> pramsMap); |
||||
|
||||
/** |
||||
* 批量删除发票 |
||||
* |
||||
* @param scanId |
||||
* 请求参数 |
||||
* |
||||
*/ |
||||
void deleteBatchInvoice(@Param("scanId") String scanId); |
||||
|
||||
/** |
||||
* 批量删除图片 |
||||
* |
||||
* @param scanId |
||||
* 请求参数 |
||||
* |
||||
*/ |
||||
void deleteBatchImg(@Param("scanId") String scanId); |
||||
|
||||
/** |
||||
* 取消签收 |
||||
* |
||||
* @param uuid |
||||
* 请求参数 |
||||
*/ |
||||
void updateQsxx(@Param("uuid") String uuid); |
||||
|
||||
/** |
||||
* 获取本机构用户 |
||||
* |
||||
* @param company |
||||
* 公司代码 |
||||
* @return 返回结果 |
||||
*/ |
||||
List<Map<String, String>> getUser(@Param("company") String company); |
||||
|
||||
/** |
||||
* 未签收发票合计信息查询接口 |
||||
* |
||||
* @param pramsMap |
||||
* 请求参数 |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
List<TdxRecordInvoice> selectYlqsfpHj(Map<String, Object> pramsMap); |
||||
|
||||
/** |
||||
* 批量删除发票 |
||||
* |
||||
* @param id |
||||
* 请求参数 |
||||
* |
||||
*/ |
||||
void deleteInvoiceByid(@Param("Id") String id); |
||||
|
||||
TDxInvoice selectInvoice(@Param("Id") String id); |
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.dxhy.erp.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.dxhy.erp.entity.TDxRecordInvoiceDetail; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* |
||||
* 底账明细表dao |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@Mapper |
||||
public interface SignRecordInvoiceDetailDao extends BaseMapper<TDxRecordInvoiceDetail> { |
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
package com.dxhy.erp.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.dxhy.erp.entity.TdxRecordInvoiceStatistics; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* |
||||
* 税率统计表dao |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@Mapper |
||||
public interface SignRecordInvoiceStatisticsDao extends BaseMapper<TdxRecordInvoiceStatistics> { |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.dxhy.erp.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.dxhy.erp.entity.TDxVehicleSaleInvoice; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* 机动车明细表dao |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@Mapper |
||||
public interface SignVehicleSaleInvoiceDao extends BaseMapper<TDxVehicleSaleInvoice> { |
||||
|
||||
} |
@ -0,0 +1,84 @@ |
||||
package com.dxhy.erp.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* |
||||
* 查验表明细表返回页面信息对象 |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@Data |
||||
public class CheckRecordInvoiceDetailVO { |
||||
|
||||
/** |
||||
* 明细序号 |
||||
*/ |
||||
private String detailNo; |
||||
|
||||
/** |
||||
* 货物或应税劳务名称 |
||||
*/ |
||||
private String goodsName; |
||||
|
||||
/** |
||||
* 规格型号 |
||||
*/ |
||||
private String model; |
||||
|
||||
/** |
||||
* 单位 |
||||
*/ |
||||
private String unit; |
||||
|
||||
/** |
||||
* 数量 |
||||
*/ |
||||
private String num; |
||||
|
||||
/** |
||||
* 单价 |
||||
*/ |
||||
private String unitPrice; |
||||
|
||||
/** |
||||
* 金额 |
||||
*/ |
||||
private String detailAmount; |
||||
|
||||
/** |
||||
* 税率 |
||||
*/ |
||||
private String taxRate; |
||||
|
||||
/** |
||||
* 税额 |
||||
*/ |
||||
private String taxAmount; |
||||
|
||||
/** |
||||
* 车牌号 |
||||
*/ |
||||
private String cph; |
||||
|
||||
/** |
||||
* 类型 |
||||
*/ |
||||
private String lx; |
||||
|
||||
/** |
||||
* 通行日期起 |
||||
*/ |
||||
private String txrqq; |
||||
|
||||
/** |
||||
* 通行日期止 |
||||
*/ |
||||
private String txrqz; |
||||
|
||||
/** |
||||
* 商品编码 |
||||
*/ |
||||
private String goodsNum; |
||||
} |
@ -0,0 +1,150 @@ |
||||
package com.dxhy.erp.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* |
||||
* 机动车查验表返回页面信息对象 |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@Data |
||||
public class CheckVehicleSaleVO implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 7871647630415127944L; |
||||
|
||||
/** |
||||
* 购方身份证号码 组织 机构代码 |
||||
*/ |
||||
private String buyerIdNum; |
||||
|
||||
/** |
||||
* 车辆类型 |
||||
*/ |
||||
private String vehicleType; |
||||
|
||||
/** |
||||
* 厂牌型号 |
||||
*/ |
||||
private String factoryModel; |
||||
|
||||
/** |
||||
* 产地 |
||||
*/ |
||||
private String productPlace; |
||||
|
||||
/** |
||||
* 合格证书 |
||||
*/ |
||||
private String certificate; |
||||
|
||||
/** |
||||
* 进口证明书号 |
||||
*/ |
||||
private String certificateImport; |
||||
|
||||
/** |
||||
* 商检单号 |
||||
*/ |
||||
private String inspectionNum; |
||||
|
||||
/** |
||||
* 发动机号 |
||||
*/ |
||||
private String engineNo; |
||||
|
||||
/** |
||||
* 车架号码 车辆识别码 |
||||
*/ |
||||
private String vehicleNo; |
||||
|
||||
/** |
||||
* 电话 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 开户银行 |
||||
*/ |
||||
private String buyerBank; |
||||
|
||||
/** |
||||
* 税率 |
||||
*/ |
||||
private String taxRate; |
||||
|
||||
/** |
||||
* 主管税务机关名称 |
||||
*/ |
||||
private String taxBureauName; |
||||
|
||||
/** |
||||
* 主管税务机关代码 |
||||
*/ |
||||
private String taxBureauCode; |
||||
|
||||
/** |
||||
* 完税凭证号码 |
||||
*/ |
||||
private String taxRecords; |
||||
|
||||
/** |
||||
* 限乘人数 |
||||
*/ |
||||
private String limitPeople; |
||||
|
||||
/** |
||||
* 吨位 |
||||
*/ |
||||
private String tonnage; |
||||
//新增二手车信息
|
||||
//车牌照号码
|
||||
private String licensePlate; |
||||
//登记证号
|
||||
private String registrationNo; |
||||
//转入地车辆管理所名称
|
||||
private String vehicleAdminOffice; |
||||
//经营、拍卖单位
|
||||
private String auctionUnit; |
||||
//经营、拍卖单位地址
|
||||
private String auctionAddress; |
||||
//经营、拍卖单位纳税人识别号
|
||||
private String auctionTaxNo; |
||||
//开户银行及账号
|
||||
private String auctionBank; |
||||
//经营、拍卖单位电话
|
||||
private String auctionPhone; |
||||
//二手车市场
|
||||
private String carMarket; |
||||
//二手车市场纳税人识别号
|
||||
private String carMarketTaxNo; |
||||
//二手车市场地址
|
||||
private String carMarketAddress; |
||||
//二手车市场开户银行及账号
|
||||
private String carMarketBank; |
||||
//二手车市场电话
|
||||
private String carMarketPhone; |
||||
//车价合计
|
||||
private String carPrice; |
||||
//买方单位 /个人
|
||||
private String buyerUnitOrIndividual; |
||||
//买方单位代码 /身份证号
|
||||
private String buyerUnitCodeOrIdNo; |
||||
//买方单位 /个人住址
|
||||
private String buyerUnitOrIndividualAddress; |
||||
//买方电话
|
||||
private String buyerPhone; |
||||
//卖方单位/个人
|
||||
private String sellerUnitOrIndividual; |
||||
//卖方单位代码/身份证
|
||||
private String sellerUnitCodeOrIdNo; |
||||
//卖方单位/个人住址
|
||||
private String sellerUnitOrIndividualAddress; |
||||
//卖方电话
|
||||
private String sellerPhone; |
||||
//开票人
|
||||
private String invoicer; |
||||
} |
@ -0,0 +1,190 @@ |
||||
package com.dxhy.erp.entity; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* |
||||
* 统一签收明细返回的数据格式 |
||||
* |
||||
* @author peipei.li |
||||
* @date 2019-04-29 |
||||
*/ |
||||
@Data |
||||
public class InvoiceSubjectVO implements Serializable { |
||||
|
||||
private static final long serialVersionUID = -2910283488341255855L; |
||||
|
||||
/** |
||||
* 税款所属期 |
||||
*/ |
||||
private String dqskssq; |
||||
|
||||
/** |
||||
* 采集日期 |
||||
*/ |
||||
private String createDate; |
||||
|
||||
/** |
||||
* 购方地址电话 |
||||
*/ |
||||
private String gfAddressAndPhone; |
||||
|
||||
/** |
||||
* 购方银行账号 |
||||
*/ |
||||
private String gfBankAndNo; |
||||
|
||||
/** |
||||
* 购方名称 |
||||
*/ |
||||
private String gfName; |
||||
|
||||
/** |
||||
* 购方税号 |
||||
*/ |
||||
private String gfTaxNo; |
||||
|
||||
/** |
||||
* 勾选人账号 |
||||
*/ |
||||
private String gxUserName; |
||||
|
||||
private String id; |
||||
|
||||
/** |
||||
* 发票金额 |
||||
*/ |
||||
private String invoiceAmount; |
||||
|
||||
/** |
||||
* 发票代码 |
||||
*/ |
||||
private String invoiceCode; |
||||
|
||||
/** |
||||
* 开票日期 |
||||
*/ |
||||
private String invoiceDate; |
||||
|
||||
/** |
||||
* 发票代码 |
||||
*/ |
||||
private String invoiceNo; |
||||
|
||||
/** |
||||
* 发票状态 |
||||
*/ |
||||
private String invoiceStatus; |
||||
|
||||
/** |
||||
* 发票类型名称 |
||||
*/ |
||||
private String invoiceString; |
||||
|
||||
/** |
||||
* 发票类型 |
||||
*/ |
||||
private String invoiceType; |
||||
|
||||
/** |
||||
* 签收日期 |
||||
*/ |
||||
private String qsDate; |
||||
|
||||
/** |
||||
* 签收人 |
||||
*/ |
||||
private String qsName; |
||||
|
||||
/** |
||||
* 签收状态 |
||||
*/ |
||||
private String qsStatus; |
||||
|
||||
/** |
||||
* 签收方式 |
||||
*/ |
||||
private String qsType; |
||||
|
||||
/** |
||||
* 认证时间 |
||||
*/ |
||||
private String rzhDate; |
||||
|
||||
/** |
||||
* 认证方式 |
||||
*/ |
||||
private String rzhType; |
||||
|
||||
/** |
||||
* 是否已认证 |
||||
*/ |
||||
private String rzhYesorno; |
||||
|
||||
/** |
||||
* 认证类型 |
||||
*/ |
||||
private String rzlx; |
||||
|
||||
/** |
||||
* 数据来源 |
||||
*/ |
||||
private String sourceSystem; |
||||
|
||||
/** |
||||
* 税额 |
||||
*/ |
||||
private String taxAmount; |
||||
|
||||
/** |
||||
* 税率 |
||||
*/ |
||||
private String taxRate; |
||||
|
||||
/** |
||||
* 价税合计 |
||||
*/ |
||||
private String totalAmount; |
||||
|
||||
/** |
||||
* 发票唯一标识 |
||||
*/ |
||||
private String uuid; |
||||
|
||||
/** |
||||
* 销方地址电话 |
||||
*/ |
||||
private String xfAddressAndPhone; |
||||
|
||||
/** |
||||
* 销方银行账号 |
||||
*/ |
||||
private String xfBankAndNo; |
||||
|
||||
/** |
||||
* 销方名称 |
||||
*/ |
||||
private String xfName; |
||||
|
||||
/** |
||||
* 销方税号 |
||||
*/ |
||||
private String xfTaxNo; |
||||
|
||||
/** |
||||
* 认证流程状态 |
||||
*/ |
||||
private String authStatus; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
private String remark; |
||||
/** |
||||
* 校验码 |
||||
*/ |
||||
private String checkCode; |
||||
|
||||
} |
@ -0,0 +1,204 @@ |
||||
package com.dxhy.erp.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* |
||||
* 发票扫描表 |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@SuppressWarnings("AlibabaClassNamingShouldBeCamel") |
||||
@Data |
||||
public class TDxInvoice implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 7993748954465023806L; |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 发票类型(01-增值税专用发票 03-机动车销售统一发票 04-增值税普通发票 10-电子发票 11-卷票 14-通行费发票) |
||||
*/ |
||||
private String invoiceType; |
||||
|
||||
/** |
||||
* 发票代码 |
||||
*/ |
||||
private String invoiceCode; |
||||
|
||||
/** |
||||
* 发票号码 |
||||
*/ |
||||
private String invoiceNo; |
||||
|
||||
/** |
||||
* 扫描流水号 |
||||
*/ |
||||
private Long invoiceSerialNo; |
||||
|
||||
/** |
||||
* 购方税号 |
||||
*/ |
||||
private String gfTaxNo; |
||||
|
||||
/** |
||||
* 购方名称 |
||||
*/ |
||||
private String gfName; |
||||
|
||||
/** |
||||
* 销方税号 |
||||
*/ |
||||
private String xfTaxNo; |
||||
|
||||
/** |
||||
* 销方名称 |
||||
*/ |
||||
private String xfName; |
||||
|
||||
/** |
||||
* 金额 |
||||
*/ |
||||
private BigDecimal invoiceAmount; |
||||
|
||||
/** |
||||
* 税额 |
||||
*/ |
||||
private BigDecimal taxAmount; |
||||
|
||||
/** |
||||
* 价税合计 |
||||
*/ |
||||
private BigDecimal totalAmount; |
||||
|
||||
/** |
||||
* 开票时间 |
||||
*/ |
||||
private Date invoiceDate; |
||||
|
||||
/** |
||||
* 扫描账号 |
||||
*/ |
||||
private String userAccount; |
||||
|
||||
/** |
||||
* 扫描人 |
||||
*/ |
||||
private String userName; |
||||
|
||||
/** |
||||
* 签收方式(0-扫码签收 1-扫描仪签收 2-app签收 3-导入签收 4-手工签收,5-pdf上传) |
||||
*/ |
||||
private String qsType; |
||||
|
||||
/** |
||||
* 签收结果(0-签收失败 1-签收成功) |
||||
*/ |
||||
private String qsStatus; |
||||
|
||||
/** |
||||
* 是否有效(1-有效 0-无效) |
||||
*/ |
||||
private String valid; |
||||
|
||||
/** |
||||
* 发票唯一标识 组成:发票代码+发票号码 |
||||
*/ |
||||
private String uuid; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createDate; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateDate; |
||||
|
||||
/** |
||||
* 签收时间 |
||||
*/ |
||||
private Date qsDate; |
||||
|
||||
/** |
||||
* 扫描图片唯一识别码 |
||||
*/ |
||||
private String scanId; |
||||
|
||||
/** |
||||
* 扫描备注 |
||||
*/ |
||||
private String notes; |
||||
|
||||
/** |
||||
* 部门id |
||||
*/ |
||||
private String deptId; |
||||
|
||||
/** |
||||
* 校验码 |
||||
*/ |
||||
private String checkCode; |
||||
|
||||
/** |
||||
* 部门名称 collate utf8mb4_general_ci |
||||
*/ |
||||
private String deptName; |
||||
|
||||
/** |
||||
* 结算单号 |
||||
*/ |
||||
private String settlementNo; |
||||
|
||||
/** |
||||
* 是否结算(0未结算,1已结算) |
||||
*/ |
||||
private String settlementStatus; |
||||
|
||||
/** |
||||
* 结算单来源 |
||||
*/ |
||||
private String settleSource; |
||||
|
||||
/** |
||||
* 发票状态 |
||||
*/ |
||||
private String invoiceStatus; |
||||
|
||||
private String qsName; |
||||
|
||||
private String company; |
||||
|
||||
/** |
||||
* 编辑修改按scanId标志 |
||||
*/ |
||||
@TableField(exist = false) |
||||
private Boolean updateByScanId = false; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
private String remark; |
||||
/** |
||||
* 强制签收标志 |
||||
*/ |
||||
private String forceSign; |
||||
|
||||
private String invoiceRemark; |
||||
|
||||
@TableField(exist = false) |
||||
private String authStatus; |
||||
@TableField(exist = false) |
||||
private String imagePath; |
||||
private String voucherNumber; |
||||
private String invoiceSource; |
||||
} |
@ -0,0 +1,112 @@ |
||||
package com.dxhy.erp.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* |
||||
* 底账明细表 |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@SuppressWarnings("AlibabaClassNamingShouldBeCamel") |
||||
@Data |
||||
@TableName("t_dx_record_invoice_detail") |
||||
public class TDxRecordInvoiceDetail implements Serializable { |
||||
|
||||
private static final long serialVersionUID = -6703830991573450761L; |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 唯一标识(发票代码+发票号码) |
||||
*/ |
||||
private String uuid; |
||||
|
||||
/** |
||||
* 发票代码 |
||||
*/ |
||||
private String invoiceCode; |
||||
|
||||
/** |
||||
* 发票号码 |
||||
*/ |
||||
private String invoiceNo; |
||||
|
||||
/** |
||||
* 明细序号 |
||||
*/ |
||||
private String detailNo; |
||||
|
||||
/** |
||||
* 货物或应税劳务名称 |
||||
*/ |
||||
private String goodsName; |
||||
|
||||
/** |
||||
* 规格型号 |
||||
*/ |
||||
private String model; |
||||
|
||||
/** |
||||
* 单位 |
||||
*/ |
||||
private String unit; |
||||
|
||||
/** |
||||
* 数量 |
||||
*/ |
||||
private String num; |
||||
|
||||
/** |
||||
* 单价 |
||||
*/ |
||||
private String unitPrice; |
||||
|
||||
/** |
||||
* 金额 |
||||
*/ |
||||
private String detailAmount; |
||||
|
||||
/** |
||||
* 税率 |
||||
*/ |
||||
private String taxRate; |
||||
|
||||
/** |
||||
* 税额 |
||||
*/ |
||||
private String taxAmount; |
||||
|
||||
/** |
||||
* 车牌号 |
||||
*/ |
||||
private String cph; |
||||
|
||||
/** |
||||
* 类型 |
||||
*/ |
||||
private String lx; |
||||
|
||||
/** |
||||
* 通行日期起 |
||||
*/ |
||||
private String txrqq; |
||||
|
||||
/** |
||||
* 通行日期止 |
||||
*/ |
||||
private String txrqz; |
||||
|
||||
/** |
||||
* 商品编码 |
||||
*/ |
||||
private String goodsNum; |
||||
|
||||
} |
@ -0,0 +1,179 @@ |
||||
package com.dxhy.erp.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* |
||||
* 机动车明细表 |
||||
* |
||||
* @author jiaohongyang |
||||
* @date 2019年3月26日 下午6:02:48 |
||||
*/ |
||||
@SuppressWarnings("AlibabaClassNamingShouldBeCamel") |
||||
@Data |
||||
@TableName("t_dx_vehicle_sale_invoice") |
||||
public class TDxVehicleSaleInvoice implements Serializable { |
||||
|
||||
private static final long serialVersionUID = -8976275814832604786L; |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* uuid |
||||
*/ |
||||
private String uuid; |
||||
|
||||
/** |
||||
* 购方身份证号码 组织 机构代码 |
||||
*/ |
||||
private String buyerIdNum; |
||||
|
||||
/** |
||||
* 车辆类型 |
||||
*/ |
||||
private String vehicleType; |
||||
|
||||
/** |
||||
* 厂牌型号 |
||||
*/ |
||||
private String factoryModel; |
||||
|
||||
/** |
||||
* 产地 |
||||
*/ |
||||
private String productPlace; |
||||
|
||||
/** |
||||
* 合格证书 |
||||
*/ |
||||
private String certificate; |
||||
|
||||
/** |
||||
* 进口证明书号 |
||||
*/ |
||||
private String certificateImport; |
||||
|
||||
/** |
||||
* 商检单号 |
||||
*/ |
||||
private String inspectionNum; |
||||
|
||||
/** |
||||
* 发动机号 |
||||
*/ |
||||
private String engineNo; |
||||
|
||||
/** |
||||
* 车架号码 车辆识别码 |
||||
*/ |
||||
private String vehicleNo; |
||||
|
||||
/** |
||||
* 电话 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 开户银行 |
||||
*/ |
||||
private String buyerBank; |
||||
|
||||
/** |
||||
* 税率 |
||||
*/ |
||||
private String taxRate; |
||||
|
||||
/** |
||||
* 主管税务机关名称 |
||||
*/ |
||||
private String taxBureauName; |
||||
|
||||
/** |
||||
* 主管税务机关代码 |
||||
*/ |
||||
private String taxBureauCode; |
||||
|
||||
/** |
||||
* 完税凭证号码 |
||||
*/ |
||||
private String taxRecords; |
||||
|
||||
/** |
||||
* 限乘人数 |
||||
*/ |
||||
private String limitPeople; |
||||
|
||||
/** |
||||
* 是否已勾选 0-未勾选 1-已勾选 |
||||
*/ |
||||
private String checkStatus; |
||||
|
||||
/** |
||||
* 吨位 |
||||
*/ |
||||
private String tonnage; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createDate; |
||||
|
||||
private String company; |
||||
|
||||
//新增二手车信息
|
||||
//车牌照号码
|
||||
private String plateNo; |
||||
//登记证号
|
||||
private String registrationNo; |
||||
//转入地车辆管理所名称
|
||||
private String vehicleAdminOffice; |
||||
//经营、拍卖单位
|
||||
private String auctionUnit; |
||||
//经营、拍卖单位地址
|
||||
private String auctionAddress; |
||||
//经营、拍卖单位纳税人识别号
|
||||
private String auctionTaxNo; |
||||
//开户银行及账号
|
||||
private String auctionBank; |
||||
//经营、拍卖单位电话
|
||||
private String auctionPhone; |
||||
//二手车市场
|
||||
private String carMarket; |
||||
//二手车市场纳税人识别号
|
||||
private String carMarketTaxNo; |
||||
//二手车市场地址
|
||||
private String carMarketAddress; |
||||
//二手车市场开户银行及账号
|
||||
private String carMarketBank; |
||||
//二手车市场电话
|
||||
private String carMarketPhone; |
||||
|
||||
|
||||
//车价合计
|
||||
private String carPrice; |
||||
//买方单位 /个人
|
||||
private String buyerUnit; |
||||
//买方单位代码 /身份证号
|
||||
private String buyerUnitCode; |
||||
//买方单位 /个人住址
|
||||
private String buyerUnitAddress; |
||||
//买方电话
|
||||
private String buyerPhone; |
||||
//卖方单位/个人
|
||||
private String sellerUnit; |
||||
//卖方单位代码/身份证
|
||||
private String sellerUnitCode; |
||||
//卖方单位/个人住址
|
||||
private String sellerUnitAddress; |
||||
//卖方电话
|
||||
private String sellerPhone; |
||||
|
||||
|
||||
} |
@ -0,0 +1,32 @@ |
||||
package com.dxhy.erp.service; |
||||
|
||||
import com.alibaba.fastjson.JSONArray; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.dxhy.common.service.MpBaseService; |
||||
import com.dxhy.common.vo.UserInfo; |
||||
import com.dxhy.erp.entity.QsExcelEntity; |
||||
import com.dxhy.erp.entity.TdxRecordInvoiceStatistics; |
||||
import com.dxhy.erp.entity.TdxRecordInvoice; |
||||
|
||||
import java.text.ParseException; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* |
||||
* 发票签收业务处理接口 |
||||
* |
||||
* @author peipei.li |
||||
* @date 2019-05-09 |
||||
*/ |
||||
public interface SignFpqsService extends MpBaseService<TdxRecordInvoice> { |
||||
|
||||
/** |
||||
* 税率统计信息 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 发票信息 |
||||
* @return 税率统计信息 |
||||
*/ |
||||
List<TdxRecordInvoiceStatistics> buildRecordInvoiceStatisticsList(JSONObject queryInvoiceResult); |
||||
} |
@ -0,0 +1,38 @@ |
||||
package com.dxhy.erp.service; |
||||
|
||||
import com.dxhy.common.service.MpBaseService; |
||||
import com.dxhy.erp.entity.TDxRecordInvoiceDetail; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* 底账明细表的业务操作接口 |
||||
* |
||||
* @author peipei.li |
||||
* @date 2019-05-09 |
||||
*/ |
||||
public interface SignInvoiceDetailService extends MpBaseService<TDxRecordInvoiceDetail> { |
||||
|
||||
/** |
||||
* 保存发票明细 |
||||
* |
||||
* @param details |
||||
* 明细 |
||||
* @param dbName |
||||
* 数据源 |
||||
*/ |
||||
void saveInvoiceDetail(List<TDxRecordInvoiceDetail> details, String dbName); |
||||
|
||||
/** |
||||
* 删除明细 |
||||
* |
||||
* @param uuid |
||||
* uuid |
||||
* @param dbName |
||||
* 数据源 |
||||
* @return 返回结果 |
||||
*/ |
||||
boolean deleteDetail(String uuid, String dbName); |
||||
|
||||
} |
@ -0,0 +1,38 @@ |
||||
package com.dxhy.erp.service; |
||||
|
||||
import com.dxhy.common.service.MpBaseService; |
||||
import com.dxhy.erp.entity.TdxRecordInvoiceStatistics; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* 税率统计表业务处理接口 |
||||
* |
||||
* @author peipei.li |
||||
* @date 2019-05-09 |
||||
*/ |
||||
public interface SignInvoiceStatisticsService extends MpBaseService<TdxRecordInvoiceStatistics> { |
||||
/** |
||||
* 保存税率统计 |
||||
* |
||||
* @param statisticsList |
||||
* 请求参数 |
||||
* @param dbName |
||||
* 数据源 |
||||
*/ |
||||
void saveInvoiceStatistics(List<TdxRecordInvoiceStatistics> statisticsList, String dbName); |
||||
|
||||
/** |
||||
* 删除税率统计 |
||||
* |
||||
* @param invoiceCode |
||||
* 发票代码 |
||||
* @param invoiceNo |
||||
* 发票号码 |
||||
* @param dbName |
||||
* 数据源 |
||||
* @return 返回结果 |
||||
*/ |
||||
boolean deleteStatistics(String invoiceCode, String invoiceNo, String dbName); |
||||
} |
@ -0,0 +1,31 @@ |
||||
package com.dxhy.erp.service; |
||||
|
||||
import com.dxhy.common.service.MpBaseService; |
||||
import com.dxhy.erp.entity.TDxVehicleSaleInvoice; |
||||
|
||||
/** |
||||
* |
||||
* 机动车明细表业务处理接口 * @author peipei.li * @date 2019-05-09 |
||||
*/ |
||||
public interface SignJdcService extends MpBaseService<TDxVehicleSaleInvoice> { |
||||
/** |
||||
* 删除机动车发票 |
||||
* |
||||
* @param uuid |
||||
* uuid |
||||
* @param dbName |
||||
* 数据源 |
||||
* @return 返回结果 |
||||
*/ |
||||
boolean deleteVehicleSaleInvoice(String uuid, String dbName); |
||||
|
||||
/** |
||||
* 保存机动车发票 |
||||
* |
||||
* @param tDxVehicleSaleInvoice |
||||
* 请求参数 |
||||
* @param dbName |
||||
* 数据源 |
||||
*/ |
||||
void saveVehicleSaleInvoice(TDxVehicleSaleInvoice tDxVehicleSaleInvoice, String dbName); |
||||
} |
@ -0,0 +1,91 @@ |
||||
package com.dxhy.erp.service; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.dxhy.common.service.MpBaseService; |
||||
import com.dxhy.erp.entity.TDxRecordInvoiceDetail; |
||||
import com.dxhy.erp.entity.TDxVehicleSaleInvoice; |
||||
import com.dxhy.erp.entity.TdxRecordInvoice; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* 保存发票查验结果业务处理接口 |
||||
* |
||||
* @author peipei.li |
||||
* @date 2019-05-09 |
||||
*/ |
||||
public interface SignSaveInvoiceInfoService extends MpBaseService<TdxRecordInvoice> { |
||||
|
||||
/** |
||||
* 保存查验返回的发票信息 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 查验结果 |
||||
* @param qsType |
||||
* 签收方式 |
||||
* @param userId |
||||
* 签收人账号 |
||||
* @param dbName |
||||
* 数据库名称 |
||||
* @since 1.0 |
||||
*/ |
||||
void saveQueryInvoiceResult(JSONObject queryInvoiceResult, String userId, String qsType, String dbName); |
||||
|
||||
/** |
||||
* 根据查验结果获取底账明细表数据 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 请求参数 |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
List<TDxRecordInvoiceDetail> getRecordInvoiceDetail(JSONObject queryInvoiceResult); |
||||
|
||||
/** |
||||
* 根据查验结果获取机动车表数据 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 请求参数 |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
TDxVehicleSaleInvoice getVehicleSaleInvoice(JSONObject queryInvoiceResult); |
||||
|
||||
/** |
||||
* 根据查验结果获取底账表数据 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 请求参数 |
||||
* @param qsType |
||||
* 签收方式 |
||||
* @param userId |
||||
* 签收人账号 |
||||
* |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
TdxRecordInvoice getRecordInvoice(JSONObject queryInvoiceResult, String userId, String qsType); |
||||
|
||||
/** |
||||
* 根据底账表返回发票明细信息 |
||||
* |
||||
* @param invoiceRecord |
||||
* 请求参数 |
||||
* @param dbName |
||||
* 数据库名称 |
||||
* @return 返回结果 |
||||
* @since 1.0 |
||||
*/ |
||||
JSONObject createInvoiceInfo(TdxRecordInvoice invoiceRecord, String dbName); |
||||
|
||||
/** |
||||
* 根据查验结果获取二手车表数据 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* @return |
||||
* |
||||
*/ |
||||
TDxVehicleSaleInvoice vehicleInvoice(JSONObject queryInvoiceResult); |
||||
|
||||
} |
@ -0,0 +1,155 @@ |
||||
package com.dxhy.erp.service.impl; |
||||
|
||||
import com.alibaba.fastjson.JSONArray; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.dxhy.common.enums.FplxEnum; |
||||
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
||||
import com.dxhy.erp.dao.SignRecordInvoiceDao; |
||||
import com.dxhy.erp.entity.TDxRecordInvoiceDetail; |
||||
import com.dxhy.erp.entity.TdxRecordInvoiceStatistics; |
||||
import com.dxhy.erp.entity.TdxRecordInvoice; |
||||
import com.dxhy.erp.service.SignFpqsService; |
||||
import com.dxhy.erp.service.SignSaveInvoiceInfoService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* 发票签收业务逻辑处理实现类 |
||||
* |
||||
* @author jiaohongyang |
||||
*/ |
||||
@Service("signFpqsService") |
||||
@Slf4j |
||||
@SuppressWarnings({"AlibabaUndefineMagicConstant", "AlibabaMethodTooLong", "AlibabaCollectionInitShouldAssignCapacity", |
||||
"AlibabaStringConcat", "AlibabaCollectionInitShouldAssignCapacity"}) |
||||
public class SignFpqsServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao, TdxRecordInvoice> |
||||
implements SignFpqsService { |
||||
|
||||
/** |
||||
* 构建统计实体集 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 响应实体 |
||||
* @return 抵账统计实体 |
||||
*/ |
||||
@Override |
||||
public List<TdxRecordInvoiceStatistics> buildRecordInvoiceStatisticsList(JSONObject queryInvoiceResult) { |
||||
List<TDxRecordInvoiceDetail> recordInvoiceDetail = getRecordInvoiceDetail(queryInvoiceResult); |
||||
// 定义返回值
|
||||
final List<TdxRecordInvoiceStatistics> recordInvoiceStatisticsList = new ArrayList<>(); |
||||
// 最终要的结果
|
||||
final Map<String, List<TDxRecordInvoiceDetail>> resultMap = new HashMap<>(); |
||||
// 按税率分组
|
||||
recordInvoiceDetail.forEach(dataItem -> { |
||||
if (!"原价合计".equals(dataItem.getGoodsName().trim()) && !"折扣额合计".equals(dataItem.getGoodsName().trim()) |
||||
&& !"(详见销货清单)".equals(dataItem.getGoodsName().trim()) |
||||
&& !"(详见销货清单)".equals(dataItem.getGoodsName().trim()) |
||||
&& org.apache.commons.lang.StringUtils.isNotEmpty(dataItem.getTaxRate())) { |
||||
if (resultMap.containsKey(dataItem.getTaxRate())) { |
||||
resultMap.get(dataItem.getTaxRate()).add(dataItem); |
||||
} else { |
||||
final List<TDxRecordInvoiceDetail> list = new ArrayList<>(); |
||||
list.add(dataItem); |
||||
resultMap.put(dataItem.getTaxRate(), list); |
||||
} |
||||
} |
||||
}); |
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
// 循环遍历map获取每组明细,并循环遍历每组里的明细组装抵账统计数据
|
||||
for (Map.Entry<String, List<TDxRecordInvoiceDetail>> entry : resultMap.entrySet()) { |
||||
// 获取每组明细
|
||||
final List<TDxRecordInvoiceDetail> detailList = entry.getValue(); |
||||
// 定义抵账统计实体
|
||||
final TdxRecordInvoiceStatistics recordInvoiceStatistics = new TdxRecordInvoiceStatistics(); |
||||
// 税额
|
||||
BigDecimal taxAmount = new BigDecimal("0.0"); |
||||
// 金额
|
||||
BigDecimal detailAmount = new BigDecimal("0.0"); |
||||
// 循环赋值
|
||||
for (TDxRecordInvoiceDetail invoiceDetail : detailList) { |
||||
BigDecimal bigDecimal; |
||||
try { |
||||
bigDecimal = new BigDecimal(invoiceDetail.getTaxAmount()); |
||||
} catch (Exception e) { |
||||
bigDecimal = new BigDecimal("0"); |
||||
} |
||||
taxAmount = taxAmount.add(bigDecimal); |
||||
detailAmount = detailAmount.add(new BigDecimal(invoiceDetail.getDetailAmount())); |
||||
|
||||
} |
||||
// 价税合计
|
||||
final BigDecimal totalAmount = taxAmount.add(detailAmount); |
||||
// 税率
|
||||
recordInvoiceStatistics.setTaxRate(entry.getKey()); |
||||
if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){ |
||||
// 发票号码
|
||||
recordInvoiceStatistics.setInvoiceNo(queryInvoiceResult.getString("invoiceCode")+queryInvoiceResult.getString("invoiceNo")); |
||||
}else { |
||||
// 发票号码
|
||||
recordInvoiceStatistics.setInvoiceNo(queryInvoiceResult.getString("invoiceNo")); |
||||
// 发票代码
|
||||
recordInvoiceStatistics.setInvoiceCode(queryInvoiceResult.getString("invoiceCode")); |
||||
} |
||||
// 税额
|
||||
recordInvoiceStatistics.setTaxAmount(taxAmount.toString()); |
||||
// 金额
|
||||
recordInvoiceStatistics.setDetailAmount(detailAmount); |
||||
// 价税合计
|
||||
recordInvoiceStatistics.setTotalAmount(totalAmount); |
||||
// 放入集合
|
||||
recordInvoiceStatisticsList.add(recordInvoiceStatistics); |
||||
} |
||||
// 返回
|
||||
return recordInvoiceStatisticsList; |
||||
} |
||||
|
||||
public List<TDxRecordInvoiceDetail> getRecordInvoiceDetail(JSONObject queryInvoiceResult) { |
||||
if (queryInvoiceResult.containsKey("detailList")) { |
||||
JSONArray dataArray = queryInvoiceResult.getJSONArray("detailList"); |
||||
if (dataArray != null && dataArray.size() > 0) { |
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
String invoiceCode = queryInvoiceResult.getString("invoiceCode"); |
||||
String invoiceNo = queryInvoiceResult.getString("invoiceNo"); |
||||
String uuid = invoiceCode + invoiceNo; |
||||
List<TDxRecordInvoiceDetail> invoiceDetailList = new ArrayList<>(dataArray.size()); |
||||
for (int i = 0; i < dataArray.size(); i++) { |
||||
JSONObject invoiceDetailQuery = dataArray.getJSONObject(i); |
||||
TDxRecordInvoiceDetail invoiceDetail = new TDxRecordInvoiceDetail(); |
||||
invoiceDetail.setUuid(uuid); |
||||
if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){ |
||||
invoiceDetail.setInvoiceNo(uuid); |
||||
}else { |
||||
invoiceDetail.setInvoiceCode(invoiceCode); |
||||
invoiceDetail.setInvoiceNo(invoiceNo); |
||||
} |
||||
invoiceDetail.setDetailNo(invoiceDetailQuery.getString("detailNo")); |
||||
invoiceDetail.setGoodsName(invoiceDetailQuery.getString("goodsName")); |
||||
invoiceDetail.setModel(invoiceDetailQuery.getString("specificationModel")); |
||||
invoiceDetail.setUnit(invoiceDetailQuery.getString("unit")); |
||||
invoiceDetail.setNum(invoiceDetailQuery.getString("num")); |
||||
invoiceDetail.setUnitPrice(invoiceDetailQuery.getString("unitPrice")); |
||||
invoiceDetail.setDetailAmount(invoiceDetailQuery.getString("detailAmount")); |
||||
invoiceDetail.setTaxRate(invoiceDetailQuery.getString("taxRate")); |
||||
invoiceDetail.setTaxAmount(invoiceDetailQuery.getString("taxAmount")); |
||||
if (FplxEnum.TXF.getFplxDm().equals(invoiceType)) { |
||||
// 通行费发票
|
||||
invoiceDetail.setCph(invoiceDetailQuery.getString("cph")); |
||||
invoiceDetail.setLx(invoiceDetailQuery.getString("lx")); |
||||
invoiceDetail.setTxrqq(invoiceDetailQuery.getString("txrqq")); |
||||
invoiceDetail.setTxrqz(invoiceDetailQuery.getString("txrqz")); |
||||
} |
||||
invoiceDetailList.add(invoiceDetail); |
||||
} |
||||
return invoiceDetailList; |
||||
} else { |
||||
return null; |
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,64 @@ |
||||
package com.dxhy.erp.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dxhy.common.constant.DbConstant; |
||||
import com.dxhy.common.datasource.config.DynamicContextHolder; |
||||
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
||||
import com.dxhy.erp.dao.SignRecordInvoiceDetailDao; |
||||
import com.dxhy.erp.entity.TDxRecordInvoiceDetail; |
||||
import com.dxhy.erp.service.SignInvoiceDetailService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* 底账明细表业务实现类 |
||||
* |
||||
* @author ld |
||||
* |
||||
* |
||||
*/ |
||||
@Service("signInvoiceDetailService") |
||||
@Slf4j |
||||
|
||||
public class SignInvoiceDetailServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDetailDao, TDxRecordInvoiceDetail> |
||||
implements SignInvoiceDetailService { |
||||
|
||||
@Override |
||||
public void saveInvoiceDetail(List<TDxRecordInvoiceDetail> details, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.DETAIL_WRITE); |
||||
this.insertDetail(details); |
||||
|
||||
} |
||||
|
||||
@Transactional(rollbackFor = Exception.class) |
||||
public void insertDetail(List<TDxRecordInvoiceDetail> details) { |
||||
/* |
||||
批量操作的大小 |
||||
*/ |
||||
int batchSize = 500; |
||||
this.saveBatch(details, batchSize); |
||||
} |
||||
|
||||
@Override |
||||
public boolean deleteDetail(String uuid, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.DETAIL_WRITE); |
||||
return this.removeDetail(uuid); |
||||
} |
||||
|
||||
@Transactional(rollbackFor = Exception.class) |
||||
public boolean removeDetail(String uuid) { |
||||
try { |
||||
baseMapper.delete(new QueryWrapper<TDxRecordInvoiceDetail>().eq("uuid", uuid)); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,61 @@ |
||||
package com.dxhy.erp.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dxhy.common.constant.DbConstant; |
||||
import com.dxhy.common.datasource.config.DynamicContextHolder; |
||||
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
||||
import com.dxhy.erp.dao.SignRecordInvoiceStatisticsDao; |
||||
import com.dxhy.erp.entity.TdxRecordInvoiceStatistics; |
||||
import com.dxhy.erp.service.SignInvoiceStatisticsService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* 税率统计表业务处理实现类 |
||||
* |
||||
* @author ld |
||||
*/ |
||||
@Service("signInvoiceStatisticsService") |
||||
@Slf4j |
||||
|
||||
public class SignInvoiceStatisticsServiceImpl |
||||
extends MpBaseServiceImpl<SignRecordInvoiceStatisticsDao, TdxRecordInvoiceStatistics> |
||||
implements SignInvoiceStatisticsService { |
||||
|
||||
@Override |
||||
public void saveInvoiceStatistics(List<TdxRecordInvoiceStatistics> statisticsList, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
this.insertStatistics(statisticsList); |
||||
} |
||||
|
||||
@Transactional(rollbackFor = Exception.class) |
||||
public void insertStatistics(List<TdxRecordInvoiceStatistics> statisticsList) { |
||||
this.saveBatch(statisticsList); |
||||
} |
||||
|
||||
@Override |
||||
public boolean deleteStatistics(String invoiceCode, String invoiceNo, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
|
||||
return this.removeStatistics(invoiceCode, invoiceNo); |
||||
} |
||||
|
||||
@Transactional(rollbackFor = Exception.class) |
||||
public boolean removeStatistics(String invoiceCode, String invoiceNo) { |
||||
try { |
||||
|
||||
int delete = baseMapper.delete(new QueryWrapper<TdxRecordInvoiceStatistics>() |
||||
.eq("invoice_code", invoiceCode).eq("invoice_no", invoiceNo)); |
||||
return delete > 0; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,55 @@ |
||||
package com.dxhy.erp.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dxhy.common.constant.DbConstant; |
||||
import com.dxhy.common.datasource.config.DynamicContextHolder; |
||||
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
||||
import com.dxhy.erp.dao.SignVehicleSaleInvoiceDao; |
||||
import com.dxhy.erp.entity.TDxVehicleSaleInvoice; |
||||
import com.dxhy.erp.service.SignJdcService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
/** |
||||
* |
||||
* 机动车明细表业务操作实现 |
||||
* |
||||
* @author ld |
||||
*/ |
||||
@Service("signJdcService") |
||||
@Slf4j |
||||
|
||||
public class SignJdcServiceImpl extends MpBaseServiceImpl<SignVehicleSaleInvoiceDao, TDxVehicleSaleInvoice> |
||||
implements SignJdcService { |
||||
|
||||
@Override |
||||
public boolean deleteVehicleSaleInvoice(String uuid, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
return this.removeVechicleSale(uuid); |
||||
} |
||||
|
||||
@Transactional(rollbackFor = Exception.class) |
||||
public boolean removeVechicleSale(String uuid) { |
||||
// 删除已存在的数据,防止数据重复
|
||||
try { |
||||
baseMapper.delete(new QueryWrapper<TDxVehicleSaleInvoice>().eq("uuid", uuid)); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void saveVehicleSaleInvoice(TDxVehicleSaleInvoice tDxVehicleSaleInvoice, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
this.insertInvoice(tDxVehicleSaleInvoice); |
||||
|
||||
} |
||||
|
||||
@Transactional(rollbackFor = Exception.class) |
||||
public void insertInvoice(TDxVehicleSaleInvoice tDxVehicleSaleInvoice) { |
||||
baseMapper.insert(tDxVehicleSaleInvoice); |
||||
} |
||||
} |
@ -0,0 +1,850 @@ |
||||
package com.dxhy.erp.service.impl; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.alibaba.fastjson.JSONArray; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
||||
import com.dxhy.common.constant.DbConstant; |
||||
import com.dxhy.common.datasource.config.DynamicContextHolder; |
||||
import com.dxhy.common.enums.*; |
||||
import com.dxhy.common.service.impl.MpBaseServiceImpl; |
||||
import com.dxhy.common.util.MathUtil; |
||||
import com.dxhy.common.util.NumberToCN; |
||||
import com.dxhy.common.util.StringHelper; |
||||
import com.dxhy.common.utils.Aops; |
||||
import com.dxhy.common.utils.DateUtils; |
||||
import com.dxhy.erp.dao.SignRecordInvoiceDao; |
||||
import com.dxhy.erp.entity.*; |
||||
import com.dxhy.erp.service.*; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.scheduling.annotation.Async; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.text.SimpleDateFormat; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* |
||||
* 保存发票查验结果业务处理实现类 |
||||
* |
||||
* @author ld |
||||
*/ |
||||
@SuppressWarnings("AlibabaUndefineMagicConstant") |
||||
@Service("signSaveInvoiceInfoService") |
||||
@Slf4j |
||||
|
||||
public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl<SignRecordInvoiceDao, TdxRecordInvoice> |
||||
implements SignSaveInvoiceInfoService { |
||||
|
||||
@Resource |
||||
private SignJdcService signJdcService; |
||||
|
||||
@Resource |
||||
private SignInvoiceDetailService signInvoiceDetailService; |
||||
|
||||
@Resource |
||||
private SignInvoiceStatisticsService signInvoiceStatisticsService; |
||||
@Resource |
||||
private SignFpqsService signFpqsService; |
||||
|
||||
@Override |
||||
@Async |
||||
public void saveQueryInvoiceResult(JSONObject queryInvoiceResult, String userName, String qsType, String dbName) { |
||||
|
||||
// 获取底账表信息
|
||||
TdxRecordInvoice recordInvoice = getRecordInvoice(queryInvoiceResult, userName, qsType); |
||||
// 获取机动车表信息
|
||||
TDxVehicleSaleInvoice vehicleSaleInvoice = getVehicleSaleInvoice(queryInvoiceResult); |
||||
// 底账明细表
|
||||
List<TDxRecordInvoiceDetail> recordInvoiceDetail = getRecordInvoiceDetail(queryInvoiceResult); |
||||
// 税率统计表
|
||||
List<TdxRecordInvoiceStatistics> invoiceStatistics = getInvoiceStatistics(queryInvoiceResult); |
||||
|
||||
//获取二手车明细信息
|
||||
TDxVehicleSaleInvoice vehicleInvoice = vehicleInvoice(queryInvoiceResult); |
||||
|
||||
// 保存前先查询底账数据是否已存在,已存在则不用重复保存
|
||||
TdxRecordInvoice recordInvoiceExit = queryInvoice(recordInvoice.getUuid(), dbName); |
||||
if (recordInvoiceExit == null) { |
||||
// 机动车票
|
||||
if (vehicleSaleInvoice != null) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
boolean saveVehicleSaleInvoice = |
||||
this.saveVehicleSaleInvoice(recordInvoice, vehicleSaleInvoice, invoiceStatistics); |
||||
if (saveVehicleSaleInvoice) { |
||||
boolean deleteVehicleSaleInvoice = |
||||
signJdcService.deleteVehicleSaleInvoice(recordInvoice.getUuid(), dbName); |
||||
if (deleteVehicleSaleInvoice) { |
||||
signJdcService.saveVehicleSaleInvoice(vehicleSaleInvoice, dbName); |
||||
} |
||||
// 保存税率统计表
|
||||
if (invoiceStatistics.size() > 0) { |
||||
boolean deleteStatistics = signInvoiceStatisticsService |
||||
.deleteStatistics(recordInvoice.getInvoiceCode(), recordInvoice.getInvoiceNo(), dbName); |
||||
if (deleteStatistics) { |
||||
signInvoiceStatisticsService.saveInvoiceStatistics(invoiceStatistics, dbName); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
// 二手车
|
||||
if (vehicleInvoice != null) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
boolean saveVehicleSaleInvoice = |
||||
this.saveVehicleSaleInvoice(recordInvoice, vehicleInvoice, invoiceStatistics); |
||||
if (saveVehicleSaleInvoice) { |
||||
if (vehicleInvoice != null) { |
||||
boolean deleteVehicleSaleInvoice = |
||||
signJdcService.deleteVehicleSaleInvoice(recordInvoice.getUuid(), dbName); |
||||
if (deleteVehicleSaleInvoice) { |
||||
signJdcService.saveVehicleSaleInvoice(vehicleInvoice, dbName); |
||||
} |
||||
} |
||||
// 保存税率统计表
|
||||
if (invoiceStatistics.size() > 0) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
signInvoiceStatisticsService.remove(new UpdateWrapper<TdxRecordInvoiceStatistics>() |
||||
.eq("invoice_code", recordInvoice.getInvoiceCode()).eq("invoice_no", recordInvoice.getInvoiceNo())); |
||||
signInvoiceStatisticsService.saveBatch(invoiceStatistics); |
||||
} |
||||
} |
||||
} |
||||
// 其它票,保存底账明细表数据
|
||||
if (recordInvoiceDetail != null && recordInvoiceDetail.size() > 0) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
// 保存底账表数据
|
||||
boolean insertRecordInvoice = Aops.getSelf(this).insertRecordInvoice(recordInvoice); |
||||
if (insertRecordInvoice) { |
||||
// 保存底账明细表数据
|
||||
try { |
||||
// 删除已存在的数据,防止数据重复
|
||||
if (recordInvoiceDetail.size() > 0) { |
||||
boolean deleteDetail = |
||||
signInvoiceDetailService.deleteDetail(recordInvoice.getUuid(), dbName); |
||||
if (deleteDetail) { |
||||
signInvoiceDetailService.saveInvoiceDetail(recordInvoiceDetail, dbName); |
||||
} |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
// 保存明细表异常,设置底账表的明细标志为0,detail_yesorno=0
|
||||
TdxRecordInvoice invoice = new TdxRecordInvoice(); |
||||
invoice.setDetailYesorno("0"); |
||||
this.updateInvoice(invoice); |
||||
} |
||||
|
||||
// 保存税率统计表
|
||||
if (invoiceStatistics.size() > 0) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
if(StringUtils.isNotBlank(recordInvoice.getInvoiceCode())){ |
||||
signInvoiceStatisticsService.remove(new UpdateWrapper<TdxRecordInvoiceStatistics>() |
||||
.eq("invoice_code", recordInvoice.getInvoiceCode()).eq("invoice_no", recordInvoice.getInvoiceNo())); |
||||
}else { |
||||
signInvoiceStatisticsService.remove(new UpdateWrapper<TdxRecordInvoiceStatistics>() |
||||
.eq("invoice_no", recordInvoice.getInvoiceNo())); |
||||
} |
||||
|
||||
signInvoiceStatisticsService.saveBatch(invoiceStatistics); |
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_WRITE); |
||||
TdxRecordInvoice recordInvoiceUpdate = new TdxRecordInvoice(); |
||||
recordInvoiceUpdate.setQsDate(DateUtils.getSqlDateLong()); |
||||
recordInvoiceUpdate.setQsName(userName); |
||||
recordInvoiceUpdate.setQsStatus(FpqsjgEnum.YQS.getQsjgDm()); |
||||
recordInvoiceUpdate.setQsType(qsType); |
||||
recordInvoiceUpdate.setUuid(recordInvoice.getUuid()); |
||||
if (recordInvoice.getDeptId() != null) { |
||||
recordInvoiceUpdate.setDeptId(recordInvoice.getDeptId()); |
||||
recordInvoiceUpdate.setDeptName(recordInvoice.getDeptName()); |
||||
} |
||||
this.updateInvoice(recordInvoiceUpdate); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 查看抵账表数据是否存在 |
||||
* |
||||
* @param uuid |
||||
* uuid |
||||
* @param dbName |
||||
* 数据源 |
||||
* @return 返回结果 |
||||
*/ |
||||
public TdxRecordInvoice queryInvoice(String uuid, String dbName) { |
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_READ); |
||||
return baseMapper.selectOne(new QueryWrapper<TdxRecordInvoice>().eq("uuid", uuid)); |
||||
} |
||||
|
||||
/** |
||||
* 修改抵账表数据 |
||||
* |
||||
* @param recordInvoiceUpdate |
||||
* 请求参数 |
||||
*/ |
||||
@Transactional(rollbackFor = Exception.class) |
||||
public void updateInvoice(TdxRecordInvoice recordInvoiceUpdate) { |
||||
try { |
||||
baseMapper.update(recordInvoiceUpdate, |
||||
new QueryWrapper<TdxRecordInvoice>().eq("uuid", recordInvoiceUpdate.getUuid())); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 保存抵账表数据 |
||||
* |
||||
* @param recordInvoice |
||||
* 请求参数 |
||||
* @return 返回结果 |
||||
*/ |
||||
@Transactional(rollbackFor = Exception.class) |
||||
public boolean insertRecordInvoice(TdxRecordInvoice recordInvoice) { |
||||
try { |
||||
baseMapper.insert(recordInvoice); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 根据查验结果获取税率统计表对象 |
||||
* |
||||
* @param queryInvoiceResult |
||||
* 请求参数 |
||||
* |
||||
* @return 返回结果 |
||||
* |
||||
*/ |
||||
private List<TdxRecordInvoiceStatistics> getInvoiceStatistics(JSONObject queryInvoiceResult) { |
||||
List<TdxRecordInvoiceStatistics> invoiceStatisticsList = new ArrayList<>(); |
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) { |
||||
TdxRecordInvoiceStatistics invoiceStatistics = new TdxRecordInvoiceStatistics(); |
||||
invoiceStatistics.setCreateDate(DateUtils.getSqlDateLong()); |
||||
invoiceStatistics.setInvoiceCode(queryInvoiceResult.getString("invoiceCode")); |
||||
invoiceStatistics.setInvoiceNo(queryInvoiceResult.getString("invoiceNo")); |
||||
invoiceStatistics.setDetailAmount(queryInvoiceResult.getBigDecimal("invoiceAmount")); |
||||
invoiceStatistics.setTaxRate(queryInvoiceResult.getString("taxRate")); |
||||
invoiceStatistics.setTaxAmount(queryInvoiceResult.getBigDecimal("taxAmount").toString()); |
||||
invoiceStatistics.setTotalAmount(queryInvoiceResult.getBigDecimal("totalAmount")); |
||||
invoiceStatisticsList.add(invoiceStatistics); |
||||
} else if(FplxEnum.ESC.getFplxDm().equals(invoiceType)){ |
||||
TdxRecordInvoiceStatistics invoiceStatistics = new TdxRecordInvoiceStatistics(); |
||||
invoiceStatistics.setCreateDate(DateUtils.getSqlDateLong()); |
||||
invoiceStatistics.setInvoiceCode(queryInvoiceResult.getString("invoiceCode")); |
||||
invoiceStatistics.setInvoiceNo(queryInvoiceResult.getString("invoiceNo")); |
||||
invoiceStatistics.setDetailAmount(queryInvoiceResult.getBigDecimal("carPrice")); |
||||
invoiceStatistics.setTotalAmount(queryInvoiceResult.getBigDecimal("carPrice")); |
||||
invoiceStatisticsList.add(invoiceStatistics); |
||||
} else{ |
||||
if (queryInvoiceResult.containsKey("detailList")) { |
||||
invoiceStatisticsList = signFpqsService.buildRecordInvoiceStatisticsList(queryInvoiceResult); |
||||
} |
||||
} |
||||
|
||||
return invoiceStatisticsList; |
||||
} |
||||
|
||||
/** |
||||
* 保存机动车 |
||||
* |
||||
* @param recordInvoice |
||||
* 请求参数 |
||||
* @param vehicleSaleInvoice |
||||
* 请求参数 |
||||
* @param invoiceStatistics |
||||
* 请求参数 |
||||
* |
||||
*/ |
||||
@Transactional(rollbackFor = Exception.class) |
||||
public boolean saveVehicleSaleInvoice(TdxRecordInvoice recordInvoice, TDxVehicleSaleInvoice vehicleSaleInvoice, |
||||
List<TdxRecordInvoiceStatistics> invoiceStatistics) { |
||||
// 保存底账表数据
|
||||
try { |
||||
baseMapper.insert(recordInvoice); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<TDxRecordInvoiceDetail> getRecordInvoiceDetail(JSONObject queryInvoiceResult) { |
||||
if (queryInvoiceResult.containsKey("detailList")) { |
||||
JSONArray dataArray = queryInvoiceResult.getJSONArray("detailList"); |
||||
if (dataArray != null && dataArray.size() > 0) { |
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
String invoiceCode = queryInvoiceResult.getString("invoiceCode"); |
||||
String invoiceNo = queryInvoiceResult.getString("invoiceNo"); |
||||
String uuid = invoiceCode + invoiceNo; |
||||
List<TDxRecordInvoiceDetail> invoiceDetailList = new ArrayList<>(dataArray.size()); |
||||
for (int i = 0; i < dataArray.size(); i++) { |
||||
JSONObject invoiceDetailQuery = dataArray.getJSONObject(i); |
||||
TDxRecordInvoiceDetail invoiceDetail = new TDxRecordInvoiceDetail(); |
||||
invoiceDetail.setUuid(uuid); |
||||
if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){ |
||||
invoiceDetail.setInvoiceNo(uuid); |
||||
}else { |
||||
invoiceDetail.setInvoiceCode(invoiceCode); |
||||
invoiceDetail.setInvoiceNo(invoiceNo); |
||||
} |
||||
invoiceDetail.setDetailNo(invoiceDetailQuery.getString("detailNo")); |
||||
invoiceDetail.setGoodsName(invoiceDetailQuery.getString("goodsName")); |
||||
invoiceDetail.setModel(invoiceDetailQuery.getString("specificationModel")); |
||||
invoiceDetail.setUnit(invoiceDetailQuery.getString("unit")); |
||||
invoiceDetail.setNum(invoiceDetailQuery.getString("num")); |
||||
invoiceDetail.setUnitPrice(invoiceDetailQuery.getString("unitPrice")); |
||||
invoiceDetail.setDetailAmount(invoiceDetailQuery.getString("detailAmount")); |
||||
invoiceDetail.setTaxRate(invoiceDetailQuery.getString("taxRate")); |
||||
invoiceDetail.setTaxAmount(invoiceDetailQuery.getString("taxAmount")); |
||||
if (FplxEnum.TXF.getFplxDm().equals(invoiceType)) { |
||||
// 通行费发票
|
||||
invoiceDetail.setCph(invoiceDetailQuery.getString("cph")); |
||||
invoiceDetail.setLx(invoiceDetailQuery.getString("lx")); |
||||
invoiceDetail.setTxrqq(invoiceDetailQuery.getString("txrqq")); |
||||
invoiceDetail.setTxrqz(invoiceDetailQuery.getString("txrqz")); |
||||
} |
||||
invoiceDetailList.add(invoiceDetail); |
||||
} |
||||
return invoiceDetailList; |
||||
} else { |
||||
return null; |
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public TDxVehicleSaleInvoice getVehicleSaleInvoice(JSONObject queryInvoiceResult) { |
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) { |
||||
String invoiceCode = queryInvoiceResult.getString("invoiceCode"); |
||||
String invoiceNo = queryInvoiceResult.getString("invoiceNo"); |
||||
String uuid = invoiceCode + invoiceNo; |
||||
|
||||
TDxVehicleSaleInvoice vehicleSaleInvoice = new TDxVehicleSaleInvoice(); |
||||
vehicleSaleInvoice.setUuid(uuid); |
||||
vehicleSaleInvoice.setBuyerIdNum(queryInvoiceResult.getString("buyerIDNum")); |
||||
vehicleSaleInvoice.setVehicleType(queryInvoiceResult.getString("vehicleType")); |
||||
vehicleSaleInvoice.setFactoryModel(queryInvoiceResult.getString("factoryModel")); |
||||
vehicleSaleInvoice.setProductPlace(queryInvoiceResult.getString("productPlace")); |
||||
vehicleSaleInvoice.setCertificate(queryInvoiceResult.getString("certificate")); |
||||
vehicleSaleInvoice.setCertificateImport(queryInvoiceResult.getString("certificateImport")); |
||||
vehicleSaleInvoice.setInspectionNum(queryInvoiceResult.getString("inspectionNum")); |
||||
vehicleSaleInvoice.setEngineNo(queryInvoiceResult.getString("engineNo")); |
||||
vehicleSaleInvoice.setVehicleNo(queryInvoiceResult.getString("vehicleNo")); |
||||
vehicleSaleInvoice.setTaxBureauCode(queryInvoiceResult.getString("taxBureauCode")); |
||||
vehicleSaleInvoice.setTaxBureauName(queryInvoiceResult.getString("taxBureauName")); |
||||
vehicleSaleInvoice.setTaxRecords(queryInvoiceResult.getString("taxRecords")); |
||||
vehicleSaleInvoice.setTonnage(queryInvoiceResult.getString("tonnage")); |
||||
vehicleSaleInvoice.setLimitPeople(queryInvoiceResult.getString("limitPeople")); |
||||
vehicleSaleInvoice.setTaxRate(queryInvoiceResult.getString("taxRate")); |
||||
vehicleSaleInvoice.setCompany(queryInvoiceResult.getString("company")); |
||||
return vehicleSaleInvoice; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public TdxRecordInvoice getRecordInvoice(JSONObject queryInvoiceResult, String userName, String qsType) { |
||||
TdxRecordInvoice invoice = new TdxRecordInvoice(); |
||||
|
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
String invoiceCode = queryInvoiceResult.getString("invoiceCode"); |
||||
String invoiceNo = queryInvoiceResult.getString("invoiceNo"); |
||||
String uuid = invoiceCode + invoiceNo; |
||||
|
||||
invoice.setInvoiceType(invoiceType); |
||||
if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){ |
||||
invoice.setInvoiceNo(uuid); |
||||
}else { |
||||
invoice.setInvoiceCode(invoiceCode); |
||||
invoice.setInvoiceNo(invoiceNo); |
||||
} |
||||
invoice.setUuid(uuid); |
||||
if ("Y".equals(queryInvoiceResult.getString("isCancelled"))) { |
||||
invoice.setInvoiceStatus(FpztEnum.ZF.getFpztDm(FpztEnum.ZF.getIndex())); |
||||
} else if ("N".equals(queryInvoiceResult.getString("isCancelled"))) { |
||||
invoice.setInvoiceStatus(FpztEnum.ZC.getFpztDm(FpztEnum.ZC.getIndex())); |
||||
} else { |
||||
invoice.setInvoiceStatus(queryInvoiceResult.getString("isCancelled")); |
||||
} |
||||
invoice.setInvoiceAmount(queryInvoiceResult.getBigDecimal("invoiceAmount")); |
||||
invoice.setTaxAmount(queryInvoiceResult.getBigDecimal("taxAmount")); |
||||
invoice.setTotalAmount(queryInvoiceResult.getBigDecimal("totalAmount")); |
||||
invoice.setInvoiceDate(queryInvoiceResult.getDate("invoiceDate")); |
||||
invoice.setGfAddressAndPhone(queryInvoiceResult.getString("buyerAddressPhone")); |
||||
invoice.setGfBankAndNo(queryInvoiceResult.getString("buyerAccount")); |
||||
invoice.setGfName(queryInvoiceResult.getString("buyerName")); |
||||
invoice.setGfTaxNo(queryInvoiceResult.getString("buyerTaxNo")); |
||||
invoice.setXfAddressAndPhone(queryInvoiceResult.getString("salerAddressPhone")); |
||||
invoice.setXfBankAndNo(queryInvoiceResult.getString("salerAccount")); |
||||
invoice.setXfName(queryInvoiceResult.getString("salerName")); |
||||
invoice.setXfTaxNo(queryInvoiceResult.getString("salerTaxNo")); |
||||
if(FplxEnum.ESC.getFplxDm().equals(invoiceType)){ |
||||
invoice.setInvoiceAmount(queryInvoiceResult.getBigDecimal("carPrice")); |
||||
invoice.setTotalAmount(queryInvoiceResult.getBigDecimal("carPrice")); |
||||
invoice.setGfName(queryInvoiceResult.getString("buyerUnitOrIndividual")); |
||||
invoice.setGfTaxNo(queryInvoiceResult.getString("buyerUnitCodeOrIdNo")); |
||||
invoice.setGfAddressAndPhone(queryInvoiceResult.getString("buyerUnitOrIndividualAddress")); |
||||
invoice.setXfName(queryInvoiceResult.getString("sellerUnitOrIndividual")); |
||||
invoice.setXfTaxNo(queryInvoiceResult.getString("sellerUnitCodeOrIdNo")); |
||||
invoice.setXfAddressAndPhone(queryInvoiceResult.getString("sellerUnitOrIndividualAddress")); |
||||
} |
||||
invoice.setMachinecode(queryInvoiceResult.getString("machineNo")); |
||||
invoice.setRemark(queryInvoiceResult.getString("remark")); |
||||
invoice.setCheckCode(queryInvoiceResult.getString("checkCode")); |
||||
invoice.setTxfbz(queryInvoiceResult.getString("txfbz")); |
||||
invoice.setSourceSystem("1"); |
||||
invoice.setCompany(queryInvoiceResult.getString("company")); |
||||
if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) { |
||||
invoice.setDetailYesorno("0"); |
||||
} else { |
||||
if (queryInvoiceResult.containsKey("detailList")) { |
||||
JSONArray dataArray = queryInvoiceResult.getJSONArray("detailList"); |
||||
if (dataArray != null && dataArray.size() > 0) { |
||||
invoice.setDetailYesorno("1"); |
||||
|
||||
} else { |
||||
invoice.setDetailYesorno("0"); |
||||
} |
||||
} else { |
||||
invoice.setDetailYesorno("0"); |
||||
} |
||||
} |
||||
invoice.setCreateDate(new Date()); |
||||
invoice.setLastUpdateDate(new Date()); |
||||
invoice.setQsDate(DateUtils.getSqlDateLong()); |
||||
invoice.setQsStatus(FpqsjgEnum.YQS.getQsjgDm()); |
||||
invoice.setQsType(qsType); |
||||
invoice.setValid("1"); |
||||
invoice.setDeptName(queryInvoiceResult.getString("deptName")); |
||||
invoice.setDeptId(queryInvoiceResult.getString("deptId")); |
||||
invoice.setQsName(userName); |
||||
invoice.setRzhYesorno("0"); |
||||
invoice.setAuthStatus("0"); |
||||
// if(QsfsEnum.PDFQS.getQsfsDm().equals(qsType) || QsfsEnum.SMYQS.getQsfsDm().equals(qsType)){
|
||||
// invoice.setScanId(queryInvoiceResult.getString("scanId"));
|
||||
// }
|
||||
if( FplxEnum.QDPP.getFplxDm().equals(invoiceType) || FplxEnum.QDZZP.getFplxDm().equals(invoiceType)){ |
||||
invoice.setInvoiceSource("1"); |
||||
}else { |
||||
invoice.setInvoiceSource("0"); |
||||
} |
||||
invoice.setScanId(queryInvoiceResult.getString("scanId")); |
||||
return invoice; |
||||
} |
||||
|
||||
@Override |
||||
public JSONObject createInvoiceInfo(TdxRecordInvoice invoiceRecord, String dbName) { |
||||
String uuid = invoiceRecord.getUuid(); |
||||
String invoiceType = invoiceRecord.getInvoiceType(); |
||||
|
||||
TDxVehicleSaleInvoice vehicleSaleInfo = null; |
||||
List<TDxRecordInvoiceDetail> invoiceDetailList = null; |
||||
|
||||
DynamicContextHolder.push(dbName + DbConstant.BUSINESS_READ); |
||||
if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) { |
||||
QueryWrapper<TDxVehicleSaleInvoice> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("uuid", uuid); |
||||
vehicleSaleInfo = signJdcService.getOne(queryWrapper); |
||||
} else { |
||||
DynamicContextHolder.push(dbName + DbConstant.DETAIL_READ); |
||||
QueryWrapper<TDxRecordInvoiceDetail> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("uuid", uuid); |
||||
queryWrapper.orderByAsc("detail_no"); |
||||
invoiceDetailList = signInvoiceDetailService.list(queryWrapper); |
||||
} |
||||
return this.createCheckInfo(invoiceRecord, vehicleSaleInfo, invoiceDetailList); |
||||
} |
||||
|
||||
/** |
||||
* 根据数据拼接需要返回的报文 |
||||
* |
||||
* @param invoiceRecord |
||||
* 底账表信息 |
||||
* @param vehicleSaleInfo |
||||
* 机动车表信息 |
||||
* @param invoiceDetailList |
||||
* 底账明细表信息 |
||||
* @return 返回结果 |
||||
* |
||||
*/ |
||||
private JSONObject createCheckInfo(TdxRecordInvoice invoiceRecord, TDxVehicleSaleInvoice vehicleSaleInfo, |
||||
List<TDxRecordInvoiceDetail> invoiceDetailList) { |
||||
|
||||
JSONObject checkInfo = new JSONObject(); |
||||
InvoiceSubjectVO checkRecordVo = this.convertToCheckRecordVo(invoiceRecord); |
||||
|
||||
// 取发票上的价税合计
|
||||
String totalAmount = checkRecordVo.getTotalAmount(); |
||||
// 价税合计小写
|
||||
checkInfo.put("detailAmountTotal", totalAmount); |
||||
// 价税合计大写
|
||||
checkInfo.put("stringTotalAmount", NumberToCN.number2CNMontrayUnit(new BigDecimal(totalAmount))); |
||||
// 发票票面信息
|
||||
checkInfo.put("invoiceSubjectList", JSON.toJSON(checkRecordVo)); |
||||
// 机动车部分信息
|
||||
if (vehicleSaleInfo != null) { |
||||
CheckVehicleSaleVO checkVehicleSaleVo = this.convertToVehicleSaleVo(vehicleSaleInfo); |
||||
checkInfo.put("vehicle", JSON.toJSON(checkVehicleSaleVo)); |
||||
} else { |
||||
checkInfo.put("vehicle", new JSONObject()); |
||||
} |
||||
String se = ""; |
||||
// 发票明细
|
||||
if (invoiceDetailList != null && invoiceDetailList.size() > 0) { |
||||
int count = invoiceDetailList.size(); |
||||
|
||||
JSONArray detail = new JSONArray(count); |
||||
for (TDxRecordInvoiceDetail tDxRecordInvoiceDetail : invoiceDetailList) { |
||||
CheckRecordInvoiceDetailVO checkRecordDetailVo = this.convertToRecordDetailVo(tDxRecordInvoiceDetail); |
||||
// 明细框 税额合计
|
||||
detail.add(JSON.toJSON(checkRecordDetailVo)); |
||||
try { |
||||
Double.parseDouble(checkRecordDetailVo.getTaxAmount()); |
||||
} catch (Exception e) { |
||||
se = checkRecordDetailVo.getTaxAmount(); |
||||
} |
||||
} |
||||
checkInfo.put("invoiceDetails", detail); |
||||
checkInfo.put("detailAmountSum", MathUtil.round(invoiceRecord.getInvoiceAmount().toPlainString())); |
||||
if (StringUtils.isNotBlank(se)) { |
||||
checkInfo.put("taxAmountSum", se); |
||||
} else { |
||||
checkInfo.put("taxAmountSum", MathUtil.round(invoiceRecord.getTaxAmount().toPlainString())); |
||||
} |
||||
} else { |
||||
checkInfo.put("invoiceDetails", new JSONArray()); |
||||
checkInfo.put("detailAmountSum", "0"); |
||||
checkInfo.put("taxAmountSum", "0"); |
||||
} |
||||
|
||||
return checkInfo; |
||||
} |
||||
|
||||
private InvoiceSubjectVO convertToCheckRecordVo(TdxRecordInvoice invoiceRecord) { |
||||
InvoiceSubjectVO checkRecordVo = new InvoiceSubjectVO(); |
||||
String fpzt = this.getFpzt(invoiceRecord.getInvoiceStatus()); |
||||
String rzzt = this.getRzzt(invoiceRecord.getAuthStatus()); |
||||
String fpzlMc = this.getFpzlMc(invoiceRecord.getInvoiceType()); |
||||
String rzType = this.getRztype(invoiceRecord.getRzhType()); |
||||
String qsStatus = this.getQsStatus(invoiceRecord.getQsStatus()); |
||||
String qsType = this.getQsType(invoiceRecord.getQsType()); |
||||
String rzlx = this.getRzlx(invoiceRecord.getRzlx()); |
||||
String rzhYesorno = this.getRzhYesorno(invoiceRecord.getRzhYesorno()); |
||||
String gxUserName = invoiceRecord.getConfirmUser(); |
||||
String dqskssq = invoiceRecord.getRzhBelongDate(); |
||||
checkRecordVo.setInvoiceStatus(fpzt); |
||||
checkRecordVo.setSourceSystem( |
||||
(StringUtils.isNotBlank(invoiceRecord.getSourceSystem()) && "1".equals(invoiceRecord.getSourceSystem())) |
||||
? "查验" : "采集"); |
||||
if (invoiceRecord.getCreateDate() != null) { |
||||
checkRecordVo.setCreateDate(DateUtils.dateToStrLong(invoiceRecord.getCreateDate())); |
||||
} else { |
||||
checkRecordVo.setCreateDate(""); |
||||
} |
||||
checkRecordVo.setGxUserName(StringHelper.trimEnter(invoiceRecord.getGxUserName())); |
||||
checkRecordVo.setRzhType(StringHelper.trimEnter(rzType)); |
||||
checkRecordVo.setInvoiceType(StringHelper.trimEnter(invoiceRecord.getInvoiceType())); |
||||
checkRecordVo.setInvoiceString(StringHelper.trimEnter(fpzlMc)); |
||||
checkRecordVo.setInvoiceCode(invoiceRecord.getInvoiceCode()); |
||||
checkRecordVo.setInvoiceNo(invoiceRecord.getInvoiceNo()); |
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); |
||||
checkRecordVo.setInvoiceDate(sdf.format(invoiceRecord.getInvoiceDate())); |
||||
checkRecordVo.setInvoiceAmount(invoiceRecord.getInvoiceAmount() == null ? "" |
||||
: MathUtil.round(invoiceRecord.getInvoiceAmount().toPlainString())); |
||||
checkRecordVo.setTaxAmount( |
||||
invoiceRecord.getTaxAmount() == null ? "" : MathUtil.round(invoiceRecord.getTaxAmount().toPlainString())); |
||||
if (invoiceRecord.getTotalAmount() == null) { |
||||
BigDecimal add = invoiceRecord.getInvoiceAmount().add(invoiceRecord.getTaxAmount()); |
||||
checkRecordVo.setTotalAmount(MathUtil.round(add.toPlainString())); |
||||
} else { |
||||
checkRecordVo.setTotalAmount(invoiceRecord.getTotalAmount() == null ? "" |
||||
: MathUtil.round(invoiceRecord.getTotalAmount().toPlainString())); |
||||
} |
||||
checkRecordVo.setGfTaxNo(StringHelper.trimEnter(invoiceRecord.getGfTaxNo())); |
||||
checkRecordVo.setGfName(StringHelper.trimEnter(invoiceRecord.getGfName())); |
||||
checkRecordVo.setGfAddressAndPhone(StringHelper.trimEnter(invoiceRecord.getGfAddressAndPhone())); |
||||
checkRecordVo.setGfBankAndNo(StringHelper.trimEnter(invoiceRecord.getGfBankAndNo())); |
||||
checkRecordVo.setXfTaxNo(StringHelper.trimEnter(invoiceRecord.getXfTaxNo())); |
||||
checkRecordVo.setXfName(StringHelper.trimEnter(invoiceRecord.getXfName())); |
||||
checkRecordVo.setXfAddressAndPhone(StringHelper.trimEnter(invoiceRecord.getXfAddressAndPhone())); |
||||
checkRecordVo.setXfBankAndNo(StringHelper.trimEnter(invoiceRecord.getXfBankAndNo())); |
||||
checkRecordVo.setDqskssq(StringHelper.trimEnter(invoiceRecord.getDqskssq())); |
||||
checkRecordVo.setId(String.valueOf(invoiceRecord.getId())); |
||||
checkRecordVo.setUuid(invoiceRecord.getUuid()); |
||||
checkRecordVo |
||||
.setQsDate((invoiceRecord.getQsDate() == null) ? "" : DateUtils.dateToStrLong(invoiceRecord.getQsDate())); |
||||
checkRecordVo.setQsName(StringHelper.trimEnter(invoiceRecord.getQsName())); |
||||
checkRecordVo.setQsStatus(qsStatus); |
||||
checkRecordVo.setQsType(qsType); |
||||
checkRecordVo.setRzhDate( |
||||
(invoiceRecord.getRzhDate() == null) ? "" : DateUtils.dateToStrLong(invoiceRecord.getRzhDate())); |
||||
checkRecordVo.setRzlx(rzlx); |
||||
checkRecordVo.setRemark(invoiceRecord.getRemark()); |
||||
checkRecordVo.setRzhYesorno(rzhYesorno); |
||||
checkRecordVo.setAuthStatus(rzzt); |
||||
checkRecordVo.setCheckCode(invoiceRecord.getCheckCode()); |
||||
checkRecordVo.setDqskssq(dqskssq); |
||||
checkRecordVo.setGxUserName(gxUserName); |
||||
return checkRecordVo; |
||||
} |
||||
|
||||
private String getRzhYesorno(String rzhYesorno) { |
||||
String rzh; |
||||
if ("1".equals(rzhYesorno)) { |
||||
rzh = "已认证"; |
||||
} else { |
||||
rzh = "未认证"; |
||||
} |
||||
return rzh; |
||||
} |
||||
|
||||
/** |
||||
* 转义认证类型 |
||||
* |
||||
* @param rzlx |
||||
* 认证类型 |
||||
* @return 返回结果 |
||||
* |
||||
*/ |
||||
private String getRzlx(String rzlx) { |
||||
String rzlxmc = ""; |
||||
if ("1".equals(rzlx)) { |
||||
rzlxmc = "抵扣认证"; |
||||
} else if ("2".equals(rzlx)) { |
||||
rzlxmc = "退税认证"; |
||||
} else if ("3".equals(rzlx)) { |
||||
rzlxmc = "代办退税认证"; |
||||
} |
||||
return rzlxmc; |
||||
} |
||||
|
||||
/** |
||||
* 转义签收方式 |
||||
* |
||||
* @param qsType |
||||
* 签收方式 |
||||
* @return 返回结果 |
||||
* |
||||
*/ |
||||
private String getQsType(String qsType) { |
||||
String qsfs = ""; |
||||
if (QsfsEnum.DRQS.getQsfsDm().equals(qsType)) { |
||||
qsfs = QsfsEnum.DRQS.getQsfsMc(QsfsEnum.DRQS.getIndex()); |
||||
} else if (QsfsEnum.APPQS.getQsfsDm().equals(qsType)) { |
||||
qsfs = QsfsEnum.APPQS.getQsfsMc(QsfsEnum.APPQS.getIndex()); |
||||
} else if (QsfsEnum.PDFQS.getQsfsDm().equals(qsType)) { |
||||
qsfs = QsfsEnum.PDFQS.getQsfsMc(QsfsEnum.PDFQS.getIndex()); |
||||
} else if (QsfsEnum.SGQS.getQsfsDm().equals(qsType)) { |
||||
qsfs = QsfsEnum.SGQS.getQsfsMc(QsfsEnum.SGQS.getIndex()); |
||||
} else if (QsfsEnum.SMQS.getQsfsDm().equals(qsType)) { |
||||
qsfs = QsfsEnum.SMQS.getQsfsMc(QsfsEnum.SMQS.getIndex()); |
||||
} else if (QsfsEnum.SMYQS.getQsfsDm().equals(qsType)) { |
||||
qsfs = QsfsEnum.SMYQS.getQsfsMc(QsfsEnum.SMYQS.getIndex()); |
||||
} |
||||
return qsfs; |
||||
} |
||||
|
||||
/** |
||||
* 转义签收状态 |
||||
* |
||||
* @param qsStatus |
||||
* 签收状态 |
||||
* @return 返回结果 |
||||
* |
||||
*/ |
||||
private String getQsStatus(String qsStatus) { |
||||
String qszt = ""; |
||||
if (FpqsjgEnum.YQS.getQsjgDm().equals(qsStatus)) { |
||||
qszt = FpqsjgEnum.YQS.getQsjgMc(FpqsjgEnum.YQS.getIndex()); |
||||
} else if (FpqsjgEnum.WQS.getQsjgDm().equals(qsStatus)) { |
||||
qszt = FpqsjgEnum.WQS.getQsjgMc(FpqsjgEnum.WQS.getIndex()); |
||||
} |
||||
return qszt; |
||||
} |
||||
|
||||
/** |
||||
* 转义认证方式 |
||||
* |
||||
* @param rzhType |
||||
* 认证方式 |
||||
* @return 返回结果 |
||||
* |
||||
*/ |
||||
private String getRztype(String rzhType) { |
||||
String rzType = ""; |
||||
if (RzfsEnum.GXRZ.getRzfsDm().equals(rzhType)) { |
||||
rzType = RzfsEnum.GXRZ.getRzfsMc(RzfsEnum.GXRZ.getIndex()); |
||||
} else if (RzfsEnum.SMRZ.getRzfsDm().equals(rzhType)) { |
||||
rzType = RzfsEnum.SMRZ.getRzfsMc(RzfsEnum.SMRZ.getIndex()); |
||||
} |
||||
return rzType; |
||||
} |
||||
|
||||
private String getFpzlMc(String invoiceType) { |
||||
String fplx = ""; |
||||
if (FplxEnum.DZP.getFplxDm().equals(invoiceType)) { |
||||
fplx = FplxEnum.DZP.getFplxMc(FplxEnum.DZP.getIndex()); |
||||
} else if (FplxEnum.JDC.getFplxDm().equals(invoiceType)) { |
||||
fplx = FplxEnum.JDC.getFplxMc(FplxEnum.JDC.getIndex()); |
||||
} else if (FplxEnum.JSP.getFplxDm().equals(invoiceType)) { |
||||
fplx = FplxEnum.JSP.getFplxMc(FplxEnum.JSP.getIndex()); |
||||
} else if (FplxEnum.PP.getFplxDm().equals(invoiceType)) { |
||||
fplx = FplxEnum.PP.getFplxMc(FplxEnum.PP.getIndex()); |
||||
} else if (FplxEnum.TXF.getFplxDm().equals(invoiceType)) { |
||||
fplx = FplxEnum.TXF.getFplxMc(FplxEnum.TXF.getIndex()); |
||||
} else if (FplxEnum.ZP.getFplxDm().equals(invoiceType)) { |
||||
fplx = FplxEnum.ZP.getFplxMc(FplxEnum.ZP.getIndex()); |
||||
} |
||||
return fplx; |
||||
} |
||||
|
||||
private String getRzzt(String authStatus) { |
||||
String rzzt = ""; |
||||
if (RzclztEnum.RZCG.getRzclztDm().equals(authStatus)) { |
||||
rzzt = RzclztEnum.RZCG.getRzclztMc(RzclztEnum.RZCG.getIndex()); |
||||
} else if (RzclztEnum.RZSB.getRzclztDm().equals(authStatus)) { |
||||
rzzt = RzclztEnum.RZSB.getRzclztMc(RzclztEnum.RZSB.getIndex()); |
||||
} else if (RzclztEnum.WRZ.getRzclztDm().equals(authStatus)) { |
||||
rzzt = RzclztEnum.WRZ.getRzclztMc(RzclztEnum.WRZ.getIndex()); |
||||
} else if (RzclztEnum.YFSRZ.getRzclztDm().equals(authStatus)) { |
||||
rzzt = RzclztEnum.YFSRZ.getRzclztMc(RzclztEnum.YFSRZ.getIndex()); |
||||
} else if (RzclztEnum.YGXWQR.getRzclztDm().equals(authStatus)) { |
||||
rzzt = RzclztEnum.YGXWQR.getRzclztMc(RzclztEnum.YGXWQR.getIndex()); |
||||
} else if (RzclztEnum.YQR.getRzclztDm().equals(authStatus)) { |
||||
rzzt = RzclztEnum.YQR.getRzclztMc(RzclztEnum.YQR.getIndex()); |
||||
} |
||||
return rzzt; |
||||
} |
||||
|
||||
private String getFpzt(String invoiceStatus) { |
||||
String fpztMc = ""; |
||||
if (FpztEnum.HC.getFpztDm().equals(invoiceStatus)) { |
||||
fpztMc = FpztEnum.HC.getFpztMc(FpztEnum.HC.getIndex()); |
||||
} else if (FpztEnum.SK.getFpztDm().equals(invoiceStatus)) { |
||||
fpztMc = FpztEnum.SK.getFpztMc(FpztEnum.SK.getIndex()); |
||||
} else if (FpztEnum.YC.getFpztDm().equals(invoiceStatus)) { |
||||
fpztMc = FpztEnum.YC.getFpztMc(FpztEnum.YC.getIndex()); |
||||
} else if (FpztEnum.ZC.getFpztDm().equals(invoiceStatus)) { |
||||
fpztMc = FpztEnum.ZC.getFpztMc(FpztEnum.ZC.getIndex()); |
||||
} else if (FpztEnum.ZF.getFpztDm().equals(invoiceStatus)) { |
||||
fpztMc = FpztEnum.ZF.getFpztMc(FpztEnum.ZF.getIndex()); |
||||
} |
||||
return fpztMc; |
||||
} |
||||
|
||||
private CheckVehicleSaleVO convertToVehicleSaleVo(TDxVehicleSaleInvoice vehicleSaleInfo) { |
||||
String taxRate = StringHelper.trimEnter(vehicleSaleInfo.getTaxRate()); |
||||
CheckVehicleSaleVO checkVehicleSaleVo = new CheckVehicleSaleVO(); |
||||
checkVehicleSaleVo.setBuyerBank(StringHelper.trimEnter(vehicleSaleInfo.getBuyerBank())); |
||||
checkVehicleSaleVo.setBuyerIdNum(StringHelper.trimEnter(vehicleSaleInfo.getBuyerIdNum())); |
||||
checkVehicleSaleVo.setCertificate(StringHelper.trimEnter(vehicleSaleInfo.getCertificate())); |
||||
checkVehicleSaleVo.setCertificateImport(StringHelper.trimEnter(vehicleSaleInfo.getCertificateImport())); |
||||
checkVehicleSaleVo.setEngineNo(StringHelper.trimEnter(vehicleSaleInfo.getEngineNo())); |
||||
checkVehicleSaleVo.setFactoryModel(StringHelper.trimEnter(vehicleSaleInfo.getFactoryModel())); |
||||
checkVehicleSaleVo.setInspectionNum(StringHelper.trimEnter(vehicleSaleInfo.getInspectionNum())); |
||||
checkVehicleSaleVo.setLimitPeople(StringHelper.trimEnter(vehicleSaleInfo.getLimitPeople())); |
||||
checkVehicleSaleVo.setPhone(StringHelper.trimEnter(vehicleSaleInfo.getPhone())); |
||||
checkVehicleSaleVo.setProductPlace(StringHelper.trimEnter(vehicleSaleInfo.getProductPlace())); |
||||
checkVehicleSaleVo.setTaxBureauCode(StringHelper.trimEnter(vehicleSaleInfo.getTaxBureauCode())); |
||||
checkVehicleSaleVo.setTaxBureauName(StringHelper.trimEnter(vehicleSaleInfo.getTaxBureauName())); |
||||
checkVehicleSaleVo.setTaxRate(taxRate); |
||||
checkVehicleSaleVo.setTaxRecords(StringHelper.trimEnter(vehicleSaleInfo.getTaxRecords())); |
||||
checkVehicleSaleVo.setTonnage(StringHelper.trimEnter(vehicleSaleInfo.getTonnage())); |
||||
checkVehicleSaleVo.setVehicleNo(StringHelper.trimEnter(vehicleSaleInfo.getVehicleNo())); |
||||
checkVehicleSaleVo.setVehicleType(StringHelper.trimEnter(vehicleSaleInfo.getVehicleType())); |
||||
return checkVehicleSaleVo; |
||||
} |
||||
|
||||
private CheckRecordInvoiceDetailVO convertToRecordDetailVo(TDxRecordInvoiceDetail tDxRecordInvoiceDetail) { |
||||
CheckRecordInvoiceDetailVO checkRecordDetailVo = new CheckRecordInvoiceDetailVO(); |
||||
if (StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()).matches("[0-9]{1,}")) { |
||||
checkRecordDetailVo.setTaxRate(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()) + "%"); |
||||
} else { |
||||
checkRecordDetailVo.setTaxRate(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate())); |
||||
} |
||||
checkRecordDetailVo.setCph(StringHelper.trimEnter(tDxRecordInvoiceDetail.getCph())); |
||||
checkRecordDetailVo.setDetailAmount(StringHelper.trimEnter(tDxRecordInvoiceDetail.getDetailAmount())); |
||||
checkRecordDetailVo.setDetailNo(StringHelper.trimEnter(tDxRecordInvoiceDetail.getDetailNo())); |
||||
checkRecordDetailVo.setGoodsName(StringHelper.trimEnter(tDxRecordInvoiceDetail.getGoodsName())); |
||||
checkRecordDetailVo.setGoodsNum(StringHelper.trimEnter(tDxRecordInvoiceDetail.getGoodsNum())); |
||||
checkRecordDetailVo.setLx(StringHelper.trimEnter(tDxRecordInvoiceDetail.getLx())); |
||||
checkRecordDetailVo.setModel(StringHelper.trimEnter(tDxRecordInvoiceDetail.getModel())); |
||||
checkRecordDetailVo.setNum(StringHelper.trimEnter(tDxRecordInvoiceDetail.getNum())); |
||||
checkRecordDetailVo.setTaxAmount(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxAmount())); |
||||
|
||||
checkRecordDetailVo.setTxrqq(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTxrqq())); |
||||
checkRecordDetailVo.setTxrqz(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTxrqz())); |
||||
checkRecordDetailVo.setUnit(StringHelper.trimEnter(tDxRecordInvoiceDetail.getUnit())); |
||||
checkRecordDetailVo.setUnitPrice(StringHelper.trimEnter(tDxRecordInvoiceDetail.getUnitPrice())); |
||||
return checkRecordDetailVo; |
||||
} |
||||
|
||||
@Override |
||||
public TDxVehicleSaleInvoice vehicleInvoice(JSONObject queryInvoiceResult) { |
||||
String invoiceType = queryInvoiceResult.getString("invoiceType"); |
||||
if (FplxEnum.ESC.getFplxDm().equals(invoiceType)) { |
||||
String invoiceCode = queryInvoiceResult.getString("invoiceCode"); |
||||
String invoiceNo = queryInvoiceResult.getString("invoiceNo"); |
||||
String uuid = invoiceCode + invoiceNo; |
||||
|
||||
TDxVehicleSaleInvoice vehicleSaleInvoice = new TDxVehicleSaleInvoice(); |
||||
vehicleSaleInvoice.setUuid(uuid); |
||||
vehicleSaleInvoice.setPlateNo(queryInvoiceResult.getString("licensePlate")); |
||||
vehicleSaleInvoice.setRegistrationNo(queryInvoiceResult.getString("registrationNo")); |
||||
if(StringUtils.isNotBlank(queryInvoiceResult.getString("vehicleType"))){ |
||||
vehicleSaleInvoice.setVehicleType(queryInvoiceResult.getString("vehicleType")); |
||||
} |
||||
if(StringUtils.isNotBlank(queryInvoiceResult.getString("bandModel"))){ |
||||
vehicleSaleInvoice.setFactoryModel(queryInvoiceResult.getString("bandModel")); |
||||
} |
||||
if(StringUtils.isNotBlank(queryInvoiceResult.getString("vehicleIdentificationNo"))){ |
||||
vehicleSaleInvoice.setVehicleNo(queryInvoiceResult.getString("vehicleIdentificationNo")); |
||||
} |
||||
vehicleSaleInvoice.setCarPrice(queryInvoiceResult.getString("carPrice")); |
||||
vehicleSaleInvoice.setVehicleAdminOffice(queryInvoiceResult.getString("vehicleAdminOffice")); |
||||
vehicleSaleInvoice.setBuyerUnit(queryInvoiceResult.getString("buyerUnitOrIndividual")); |
||||
vehicleSaleInvoice.setBuyerUnitCode(queryInvoiceResult.getString("buyerUnitCodeOrIdNo")); |
||||
vehicleSaleInvoice.setBuyerUnitAddress(queryInvoiceResult.getString("buyerUnitOrIndividualAddress")); |
||||
vehicleSaleInvoice.setBuyerPhone(queryInvoiceResult.getString("buyerPhone")); |
||||
vehicleSaleInvoice.setSellerUnit(queryInvoiceResult.getString("sellerUnitOrIndividual")); |
||||
vehicleSaleInvoice.setSellerUnitCode(queryInvoiceResult.getString("sellerUnitCodeOrIdNo")); |
||||
vehicleSaleInvoice.setSellerUnitAddress(queryInvoiceResult.getString("sellerUnitOrIndividualAddress")); |
||||
vehicleSaleInvoice.setSellerPhone(queryInvoiceResult.getString("sellerPhone")); |
||||
vehicleSaleInvoice.setAuctionUnit(queryInvoiceResult.getString("businessUnit")); |
||||
vehicleSaleInvoice.setAuctionAddress(queryInvoiceResult.getString("businessUnitAddress")); |
||||
vehicleSaleInvoice.setAuctionTaxNo(queryInvoiceResult.getString("businessUnitTaxNo")); |
||||
vehicleSaleInvoice.setAuctionBank(queryInvoiceResult.getString("businessUnitBankAndAccount")); |
||||
vehicleSaleInvoice.setAuctionPhone(queryInvoiceResult.getString("businessUnitPhone")); |
||||
vehicleSaleInvoice.setCarMarket(queryInvoiceResult.getString("lemonMarket")); |
||||
vehicleSaleInvoice.setCarMarketTaxNo(queryInvoiceResult.getString("lemonMarketTaxNo")); |
||||
vehicleSaleInvoice.setCarMarketAddress(queryInvoiceResult.getString("lemonMarketAddress")); |
||||
vehicleSaleInvoice.setCarMarketBank(queryInvoiceResult.getString("lemonMarketBankAndAccount")); |
||||
vehicleSaleInvoice.setCarMarketPhone(queryInvoiceResult.getString("lemonMarketPhone")); |
||||
vehicleSaleInvoice.setCompany(queryInvoiceResult.getString("company")); |
||||
return vehicleSaleInvoice; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue