diff --git a/dxhy-common/src/main/java/com/dxhy/common/enums/FplxEnum.java b/dxhy-common/src/main/java/com/dxhy/common/enums/FplxEnum.java index 73fa5c6e..76b10874 100644 --- a/dxhy-common/src/main/java/com/dxhy/common/enums/FplxEnum.java +++ b/dxhy-common/src/main/java/com/dxhy/common/enums/FplxEnum.java @@ -4,85 +4,105 @@ package com.dxhy.common.enums; * @author jiaohongyang */ public enum FplxEnum { + /** + * 发票类型 + * 10:增值税专用发票 + * 11:增值税普通发票 + * 12:增值税电子普通发票 + * 13:增值税普通发票(卷票) + * 14:机动车销售统一发票 + * 15:二手车销售统一发票 + * 16:定额发票 + * 17:机打发票 + * 18:出租车发票 + * 19:火车票 + * 20:客运汽车 + * 21:航空运输电子客票行程单 + * 22:过路费发票 + * 24:增值税电子普通发票(通行费) + * 25:增值税电子专用发票 + * 26:电子发票《增值税专用发票) + * 27:电子发票《普通发票) + */ /** * 专票代码 */ - ZP("01", 1), + ZP("01", 1,"10"), /** * 机动车代码 */ - JDC("03", 2), + JDC("03", 2,"14"), /** * 普票代码 */ - PP("04", 3), + PP("04", 3,"11"), /** * 电子票代码 */ - DZP("10", 4), + DZP("10", 4,"12"), /** * 卷式发票代码 */ - JSP("11", 5), + JSP("11", 5,"13"), /** * 通行费发票代码 */ - TXF("14", 6), + TXF("14", 6,"24"), - ESC("15", 7), + ESC("15", 7,"15"), /** * 电子专票 */ - DZZP("08", 8), + DZZP("08", 8,"25"), /** * 海关缴款书 */ - HGJKS("17", 9), + HGJKS("17", 9,""), /** * 电子发票(增值税专用发票) */ - QDZZP("31", 10), + QDZZP("31", 10,"26"), /** * 电子发票(普通发票) */ - QDPP("32", 11), + QDPP("32", 11,"27"), /** * 机动车销售电子统一发票 */ - JDCDZ("183", 12), + JDCDZ("183", 12,"14"), /** * 二手车销售电子统一发票 */ - ESCDZ("184", 13), + ESCDZ("184", 13,"15"), /** * 纸质发票(增值税专用发票) */ - ZZDZ("185", 14), + ZZDZ("185", 14,"10"), /** * 纸质发票(普通发票) */ - ZZPP("186", 15), + ZZPP("186", 15,"11"), /** * 纸质发票(机动车销售统一发票) */ - ZZJDC("187", 16), + ZZJDC("187", 16,"14"), /** * 纸质发票(二手车销售统一发票) */ - ZZESC("188", 17), + ZZESC("188", 17,"15"), /** * 增加电子发票(铁路电子客票) */ - TLKP("283", 18), + TLKP("283", 18,"19"), /** * 电子发票(航空运输客票电子行程单) */ - HKDZFP("161", 19), + HKDZFP("161", 19,"21"), /** * 货物运输业增值税专用发票 */ - HWYH("02", 20); + HWYH("02", 20,""); private final String[] FPLXMC = {"增值税专用发票", "机动车销售统一发票", "增值税普通发票", "增值税电子普通发票", "增值税普通发票(卷票)", "增值税电子普通发票(通行费)", "二手车销售统一发票", "增值税电子专用发票", "海关缴款书", "电子发票(增值税专用发票)", "电子发票(普通发票)", "机动车销售电子统一发票", "二手车销售电子统一发票", @@ -92,9 +112,12 @@ public enum FplxEnum { private String fplxDm; private int index; - FplxEnum(String fplxDm, int index) { + private String sapFplxdm; + + FplxEnum(String fplxDm, int index,String sapFplxdm) { this.fplxDm = fplxDm; this.index = index; + this.sapFplxdm = sapFplxdm; } public String getFplxDm(int index) { @@ -106,6 +129,15 @@ public enum FplxEnum { return null; } + public static String getSapFplxdm(String fplxdm) { + for (FplxEnum fplx : FplxEnum.values()) { + if (fplx.getFplxDm().equals(fplxdm)) { + return fplx.sapFplxdm; + } + } + return null; + } + public String getFplxMc(int index) { int length = FPLXMC.length; if (index <= length) { @@ -129,4 +161,12 @@ public enum FplxEnum { public void setIndex(int index) { this.index = index; } + + public String getSapFplxdm() { + return sapFplxdm; + } + + public void setSapFplxdm(String sapFplxdm) { + this.sapFplxdm = sapFplxdm; + } } diff --git a/dxhy-common/src/main/java/com/dxhy/common/enums/ImageSubmitInvoiceTypeEnum.java b/dxhy-common/src/main/java/com/dxhy/common/enums/ImageSubmitInvoiceTypeEnum.java new file mode 100644 index 00000000..d0515f78 --- /dev/null +++ b/dxhy-common/src/main/java/com/dxhy/common/enums/ImageSubmitInvoiceTypeEnum.java @@ -0,0 +1,32 @@ +package com.dxhy.common.enums; + +public enum ImageSubmitInvoiceTypeEnum { + + X("X","销项"), + G("G","进项"); + + private String code; + + private String name; + + ImageSubmitInvoiceTypeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/dxhy-common/src/main/java/com/dxhy/common/utils/R.java b/dxhy-common/src/main/java/com/dxhy/common/utils/R.java index 00b3e3a1..32d6fcd3 100644 --- a/dxhy-common/src/main/java/com/dxhy/common/utils/R.java +++ b/dxhy-common/src/main/java/com/dxhy/common/utils/R.java @@ -53,6 +53,12 @@ public class R extends HashMap { return new R(); } + public static R success() { + R r = new R(); + r.put("code", 1000); + return r; + } + @Override public R put(String key, Object value) { super.put(key, value); diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java index 9eafc439..ff3be8ee 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java @@ -1197,6 +1197,27 @@ public class SDNYMainProcessController extends AbstractController { } + /** + * 影像系统提交销项发票 + * @param params + * @return + */ + @PostMapping("/imageSubmitSalesInvoice") + @ResponseBody + @SysLog("影像系统提交销项发票") + public ResponseEntity imageSubmitSalesInvoice(@RequestBody SNRequestObject params) { + log.info("影像系统提交销项发票 params:{}", JSONObject.toJSONString(params)); + if (params.getInvoiceInfoList() == null || params.getInvoiceInfoList().size() == 0) { + // 撤回 + } else { + // 提交 + } + + + + return ResponseEntity.ok(JSONObject.toJSONString(R.success())); + } + /** * 查验发票 diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/ImageSubmitDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/ImageSubmitDao.java new file mode 100644 index 00000000..f376b898 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/ImageSubmitDao.java @@ -0,0 +1,14 @@ +package com.dxhy.erp.dao; + +import com.dxhy.erp.entity.TdxRecordInvoice; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ImageSubmitDao { + + List queryInvoiceList(@Param("uuidList") List uuidList); + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDao.java new file mode 100644 index 00000000..26295af1 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDao.java @@ -0,0 +1,9 @@ +package com.dxhy.erp.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dxhy.erp.entity.sdny.SdnyTDxRecordInvoice; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SdnyTDxRecordInvoiceDao extends BaseMapper { +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDetailDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDetailDao.java new file mode 100644 index 00000000..d1311c01 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDetailDao.java @@ -0,0 +1,9 @@ +package com.dxhy.erp.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dxhy.erp.entity.sdny.SdnyTDxRecordInvoiceDetail; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SdnyTDxRecordInvoiceDetailDao extends BaseMapper { +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDetailSalesDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDetailSalesDao.java new file mode 100644 index 00000000..d4017404 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxRecordInvoiceDetailSalesDao.java @@ -0,0 +1,9 @@ +package com.dxhy.erp.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dxhy.erp.entity.sdny.SdnyTDxRecordInvoiceDetailSales; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SdnyTDxRecordInvoiceDetailSalesDao extends BaseMapper { +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxSaleRecordInvoiceDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxSaleRecordInvoiceDao.java new file mode 100644 index 00000000..131e93ab --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SdnyTDxSaleRecordInvoiceDao.java @@ -0,0 +1,9 @@ +package com.dxhy.erp.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dxhy.erp.entity.sdny.SdnyTDxSaleRecordInvoice; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SdnyTDxSaleRecordInvoiceDao extends BaseMapper { +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/S4Request.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/S4Request.java new file mode 100644 index 00000000..5ca78cc1 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/S4Request.java @@ -0,0 +1,117 @@ +package com.dxhy.erp.entity.sdny; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @Program:image-system + * @Description:条用S4请求体 + * @Author:LearnLi + * @Create:2021-06-26 11:21 + */ +@XmlRootElement(name = "S4Request") +@XmlAccessorType(value = XmlAccessType.FIELD) +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class S4Request { + + private String SYSID; + private String IFYWID; + private String BSKEY; + private String SAPKEY; + private String ZORG; + private String ZFILED1; + private String ZFILED2; + private String ZFILED3; + private String ZFILED4; + private String ZFILED5; + private String ZDATA; + + + public String getSYSID() { + if (SYSID == null) { + SYSID = ""; + } + return SYSID; + } + + public String getIFYWID() { + if (IFYWID == null) { + IFYWID = ""; + } + return IFYWID; + } + + public String getBSKEY() { + if (BSKEY == null) { + BSKEY = ""; + } + return BSKEY; + } + + public String getSAPKEY() { + if (SAPKEY == null) { + SAPKEY = ""; + } + return SAPKEY; + } + + public String getZORG() { + if (ZORG == null) { + ZORG = ""; + } + return ZORG; + } + + public String getZFILED1() { + if (ZFILED1 == null) { + ZFILED1 = ""; + } + return ZFILED1; + } + + public String getZFILED2() { + if (ZFILED2 == null) { + ZFILED2 = ""; + } + return ZFILED2; + } + + public String getZFILED3() { + if (ZFILED3 == null) { + ZFILED3 = ""; + } + return ZFILED3; + } + + public String getZFILED4() { + if (ZFILED4 == null) { + ZFILED4 = ""; + } + return ZFILED4; + } + + public String getZFILED5() { + if (ZFILED5 == null) { + ZFILED5 = ""; + } + return ZFILED5; + } + + public String getZDATA() { + if (ZDATA == null) { + ZDATA = ""; + } + return ZDATA; + } + + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SNRequestObject.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SNRequestObject.java index 21ff7279..2f1d9fee 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SNRequestObject.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SNRequestObject.java @@ -27,15 +27,18 @@ public class SNRequestObject { */ private String flag = "G"; - /** - * 报账单号 - */ - private String billNum; + // 客户端 + private String clientNum; - /** - * sap client - */ - private String client; + // 经办人编号 + private String jbrUserNum; + + // 经办人昵称 + private String jbrUserName; + + + // 报账单号 + private String billNum; } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoice.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoice.java new file mode 100644 index 00000000..db43151a --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoice.java @@ -0,0 +1,891 @@ +package com.dxhy.erp.entity.sdny; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName("t_dx_record_invoice") +public class SdnyTDxRecordInvoice implements Serializable { + + private static final long serialVersionUID = 6086166653761632484L; + + private Long id; + + /** + * 开票日期 + */ + private Date invoiceDate; + /** + * 发票类型 01-增值税专用发票 03-机动车销售统一发票 04-增值税普通发票 08-增值税电子专票 10-电子发票 11-卷票 14-通行费发票 + */ + private String invoiceType; + + /** + * 发票代码 + */ + private String invoiceCode; + + private String invoiceNo; + + /** + * 全电发票号码 + */ + private String eleInvoiceNo; + + /** + * 购方税号 + */ + private String gfTaxNo; + + /** + * 购方名称 + */ + private String gfName; + + /** + * 购方地址电话 + */ + private String gfAddressAndPhone; + + /** + * 购方开户行及账号 + */ + private String gfBankAndNo; + + /** + * 销方税号 + */ + private String xfTaxNo; + + /** + * 销方名称 + */ + private String xfName; + + /** + * 销方地址及电话 + */ + private String xfAddressAndPhone; + + /** + * 销方开户行及账号 + */ + private String xfBankAndNo; + + /** + * 金额 + */ + private BigDecimal invoiceAmount; + + /** + * 税额 + */ + private BigDecimal taxAmount; + + /** + * 价格合计 + */ + private BigDecimal totalAmount; + + /** + * 备注 + */ + private String remark; + + /** + * 发票状态 0-正常 1-失控 2-作废 3-红冲 4-异常 7部分冲红 8全额红冲 80-红字发票待确认 + */ + private String invoiceStatus; + + /** + * 发票状态修改时间 + */ + private Date statusUpdateDate; + + /** + * 发票状态最后修改时间 + */ + private Date lastUpdateDate; + + /** + * 认证时间 + */ + private Date rzhDate; + + /** + * 签收时间 + */ + private Date qsDate; + + /** + * 最晚认证归属期 yyyyMM + */ + private String rzhBelongDateLate; + + /** + * 实际认证归属期 yyyyMM + */ + private String rzhBelongDate; + + /** + * 认证确认时间 + */ + private Date confirmDate; + + /** + * 认证方式 1-勾选认证 2-扫描认证 + */ + private String rzhType; + + /** + * 是否认证 0-未认证 1-已认证抵扣 2-已认证不抵扣 + */ + private String rzhYesorno; + + /** + * 提交认证操作人账号 + */ + private String gxUserAccount; + + /** + * 提交认证操作人 + */ + private String gxUserName; + + /** + * 底账来源 0-采集 1-查验 2-票据采集 + */ + private String sourceSystem; + + /** + * 是否有效 1-有效 0-无效 + */ + private String valid; + + /** + * 发票代码+发票号码 唯一索引 防重复 + */ + private String uuid; + + /** + * 采集时间 + */ + private Date createDate; + + /** + * 自动查验时间使用 + */ + private Date checkDate; + + /** + * 勾选时间 + */ + private Date gxDate; + + /** + * 认证结果回传信息 + */ + private String rzhBackMsg; + + /** + * 当前税款所属期 + */ + private String dqskssq; + + /** + * 当前税款所属期勾选截止日 + */ + private String gxjzr; + + /** + * 当前税款所属期可勾选发票开票日期范围起 + */ + private String gxfwq; + + /** + * 当前税款所属期可勾选发票开票日期范围止 + */ + private String gxfwz; + + /** + * 是否已勾选 + */ + private String sfygx; + + /** + * 是否存入明细 0 无明细 1 有明细 + */ + private String detailYesorno; + + /** + * 勾选方式(0-手工勾选 1-扫码勾选 2-导入勾选 3- 智能勾选 4-手工认证 5-扫码认证 6-导入认证) + */ + private String gxType; + + /** + * 认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败 6已撤销认证 + */ + private String authStatus; + + /** + * 发送认证时间 + */ + private Date sendDate; + + /** + * 认证类型(1-抵扣 2-退税 3-代办退税 4-不抵扣 5-撤销抵扣 6-撤销不抵扣) + */ + private String rzlx; + + /** + * 是否代办退税(0:否 1:是) + */ + private String sfdbts; + + /** + * 签收方式(0-扫码签收 1-扫描仪签收 2-app签收 3-导入签收 4-手工签收5-pdf上传签收 + */ + private String qsType; + + /** + * 签收结果(0-未签收 1-已签收) + */ + private String qsStatus; + + /** + * 校验码 + */ + private String checkCode; + + /** + * 通行费标志(Y-可抵扣通行费,N-不可抵扣通行费) + */ + private String txfbz; + + /** + * 零税率标志 (空:非零税率,1:税率栏位显示“免税”,2:税率栏位显示“不征收”,3:零税率 + */ + private String lslbz; + + /** + * 转出状态 0-未转出 1-全部转出 2-部分转出 + */ + private String outStatus; + + /** + * 转出金额 + */ + private BigDecimal outInvoiceAmout; + + /** + * 转出税额 + */ + private BigDecimal outTaxAmount; + + /** + * 转出原因1-免税项目用 ;2-集体福利,个人消费;3-非正常损失;4-简易计税方法征税项目用;5-免抵退税办法不得抵扣的进项税额;6-纳税检查调减进项税额;7-红字专用发票通知单注明的进项税额;8-上期留抵税额抵减欠税 + */ + private String outReason; + + /** + * 转出备注 + */ + private String outRemark; + + /** + * 转出日期 + */ + private Date outDate; + + /** + * 转出税款所属期 + */ + private String outBelongDate; + + /** + * 转出人 + */ + private String outBy; + + /** + * 确认人 + */ + private String confirmUser; + + /** + * 机器编号 + */ + private String machinecode; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 结算单号 + */ + private String settlementNo; + + /** + * 是否结算(0未结算1已结算) + */ + private String settlementStatus; + + /** + * 结算单来源 + */ + private String settleSource; + + /** + * 付款状态(0-付款成功 1-付款失败) + */ + private String paymentStatus; + + /** + * 付款日期 + */ + private String paymentDate; + + /** + * 凭证号 + */ + private String voucherNumber; + + /** + * 付款金额 + */ + private String paymentSum; + + /** + * 签收人 + */ + private String qsName; + + /** + * 逾期申请结果 + */ + private String yqsqMsg; + + /** + * 逾期申请标志 0-未申请 1--已申请 2发送申请,4申请成功,5申请失败 默认为空 + */ + private String yqsqStatus; + + /** + * 管理状态 0正常1异常 2疑似非正常 + */ + private String glzt; + + /** + * 信息来源 0扫描认证 1系统推送 2出口转内销 + */ + private String xxly; + + /** + * 抵扣税额 + */ + private BigDecimal dkTaxAmount; + + /** + * 逾期可勾选标志 0默认值,1可勾选逾期 + */ + private String yqkgxbz; + + /** + * 异常类型 0发票状态异常1申报用途变更(抵扣变代办退税)2管理状态异常、注:发票状态为正常时为空 + */ + private String yclx; + + /** + * 逾期审核状态 0--未审核 1--已审核 默认为空 + */ + private String yqshzt; + + /** + * 签收人 + */ + private String userAccount; + + /** + * 购方税号 + */ + private String newGfTaxno; + + /** + * 撤销认证处理状态0未撤销,1申请撤销,2发送撤销,4撤销成功,5撤销失败 + */ + private String cxrzStatus; + + /** + * 撤销认证操作时间 + */ + private Date cxrzDate; + + /** + * 集团编码 + */ + private String company; + + /** + * 逾期申请属期 + */ + private String yqCurrentPeriod; + + /** + * 0-默认值 1-认证抵扣 2-认证不抵扣 3退税 + */ + private String bdkStatus; + + /** + * 不抵扣操作时间 + */ + private Date bdkDate; + + /** + * 撤销认证申请属期 + */ + private String cxrzCurrentPeriod; + + /** + * 不抵扣申请属期 + */ + private String bdkCurrentPeriod; + + /** + * 撤销不抵扣处理状态0未申请,1申请,2发送申请,4申请成功,5申请失败 + */ + private String cxbdkStatus; + + /** + * 撤销不抵扣操作时间 + */ + private Date cxbdkDate; + + /** + * 逾期申请时间 + */ + private Date yqsqDate; + + /** + * 逾期审核时间 + */ + private Date yqshDate; + + /** + * 供应商编码 + */ + private String vendorId; + + /** + * 请求id + */ + private String requestId; + + /** + * 认证同步状态0未同步1已同步 + */ + private String sendRzStatus; + + /** + * 认证同步时间 + */ + private Date sendRzDate; + + /** + * 签收同步状态0未同步1已同步 + */ + private String sendQsStatus; + + /** + * 签收同步时间 + */ + private Date sendQsDate; + + /** + * 匹配状态,发票/结算单匹配状态(0-自动 1-手工 2-强制 3-不通过 4-不需匹配 5-取消 6-待审核 7-拒绝匹配 99-初始) + */ + private String matchstatus; + + /** + * 匹配关联号 + */ + private String matchNo; + + /** + * 匹配日期 + */ + private Date matchDate; + + /** + * 匹配错误信息 + */ + private String matchErrinfo; + + /** + * 匹配用户 + */ + private String matchUser; + + /** + * 匹配金额 + */ + private BigDecimal matchCost; + + /** + * 匹配税额 + */ + private BigDecimal matchVat; + + /** + * 供应商编码 + */ + private String venderNo; + + /** + * 扫描匹配状态 0--未匹配 1--匹配成功 2--匹配失败 + */ + private String scanMatchStatus; + + /** + * 扫描匹配时间 + */ + private Date scanMatchDate; + + /** + * 订单号 + */ + private String orderNo; + + /** + * 是否可认证,0未认证,1可认证 + */ + private String isAuth; + + /** + * 出口转内销标志默认0否,1是 + */ + private String exportMark; + + /** + * 扫描id + */ + private String scanId; + + /** + * 票池采集时间 + */ + private Date collectDate; + + /** + * 票池采集来源 0-进项采集 1-票据采集 + */ + private String collectFrom; + + /** + * 票池采集状态 0-未采集 1-已采集 + */ + private String collectStatus; + + /** + * 票池入池状态 0-成功 1-失败 + */ + private String poolStatus; + + /** + * 入池失败原因 + */ + private String inPoolReason; + + /** + * 凭证号 + */ + private String voucherNo; + + /** + * 业务单据号 + */ + private String documentNumber; + + /** + * 是否末次摊销 0-否,1-是 + */ + private String amortizeStatus; + + /** + * 摊销金额 + */ + private String amortizeAmount; + + /** + * 剩余摊销金额 + */ + private String remainAmortizeAmount; + + /** + * 摊销业务单据编号 + */ + private String amortizeDocumentNumber; + + /** + * 收款人 + */ + private String payee; + + /** + * 复核人 + */ + private String reviewer; + + /** + * 开票人 + */ + private String printor; + + /** + * 是否有销货清单 0 否/1 是, 默认为 0 + */ + private String isSaleList; + + /** + * 红蓝票标识 0 蓝/1 红 + */ + private String isRed; + + /** + * 红票对应的蓝票代码 + */ + private String blueCode; + + /** + * 红票对应的蓝票号码 + */ + private String blueNo; + + private Date inAccountDate; + + private String inAccountStatus; + + /** + * 摊销人 + */ + private String amortizeUser; + + /** + * 供应商违规标志0否,1是 + */ + private String illegalSupplier; + + /** + * 密文 + */ + private String mw; + + /** + * 机打号码 -卷票字段 + */ + private String jdhm; + + /** + * 代开税号 + */ + private String dkTaxno; + + /** + * 代开名称 + */ + private String dkTaxname; + + /** + * 代开状态 0-非代开 1-代开 + */ + private String dkStatus; + + /** + * 开票人 + */ + private String invoicer; + + /** + * 报销单号(旧:关联业务单据) + */ + private String relatedBusinessDocuments; + + /** + * 普票二次查验状态 0-未查验 1-查验成功 2-查验失败 3-查验中 + */ + private String checkSign; + + /** + * 触发企业管控规则 0-否 1-是 + */ + private String illegalEnterprise; + + /** + * 发票来源 0-税控发票 1-全电发票 + */ + private String invoiceSource; + + /** + * bdk_message是5时,保存具体原因 + */ + private String bdkYy; + + /** + * 不抵扣类型,保存key。 1-用于非应税项目2-用于免税项目3-用于集体福利或者个人消费4-遭受非正常损失5-其他 + */ + private String bdkMessage; + + /** + * 通道来源:0:大企业采集,1:大企业发票下载,2:数据平台,3:乐企采集 + */ + private String tdly; + + /** + * 乐企红字锁定标识Y-锁定;N-未锁定 + */ + private String lqHzsdbs; + + /** + * 乐企入账状态:01-未入账 + 02-已入账 + 03-已入账撤销 + */ + private String lqRzzt; + + /** + * 乐企成品油异常标识:9-正常 + 1-成品油单价异常 + 2-成品油超库存异常 + */ + private String lqCpyycbs; + + /** + * 乐企出口退税类代码:01-增值税专用发票可用于代办退税标签(仅用于代办退税) + */ + private String lqCktsldm; + + /** + * 乐企出口转内销证明编号 + */ + private String lqCkznxzmbh; + + /** + * 乐企发票用途:0-未使用 + 1-已申请抵扣 + 2-已申请退税 + 3-已申请代办退税 + 4-已勾选不抵扣(历史数据) + 5-已申请代办退税(历史数据) + 6-已申请不抵扣 + 7-内销转出口 + 8-出口转内销 + 9-准予退税 + 10-不予退税 + 11-冬奥退税 + 12-农产品加计扣除 + */ + private String lqFpyt; + + /** + * 乐企特殊票种:02农产品收购;03稀土矿产品发票;04稀土产成品发票;05:石脑油; 08成品油发票;06通行费(可抵扣);07通行费(不可抵扣) + */ + private String lqTspz; + + /** + * 乐企特定要素类型代码:空:非特定要素 + 01:成品油发票 + 02:稀土发票 + 03:建筑服务发票 + 04:货物运输服务发票 + 05:不动产销售服务发票 + 06:不动产租赁服务发票 + 07:代收车船税 + 08:通行费 + 09:旅客运输服务发票 + 10:医疗服务(住院)发票 + 11:医疗服务(门诊)发票 + 12:自产农产品销售发票 + 13 拖拉机和联合收割机发票 + 14:机动车 + 15:二手车 + 16:农产品收购发票 + 17:光伏收购发票 + 18:卷烟发票 + */ + private String lqTdyslxdm; + + /** + * 凭证号 + */ + private String snVoucherNumber; + + /** + * 账期 + */ + private String accountPeriod; + + /** + * 过账时间 + */ + private Date postingTime; + + /** + * 影像号 + */ + private String imageId; + + /** + * 公司代码 + */ + private String compCode; + + /** + * 报账单号 + */ + private String bzdh; + + /** + * 入账状态 0:未入账 1:已入账 + */ + private String inaccountStatus; + + /** + * 转出来源 1:sap + */ + private String outResource; + + /** + * 是否暂挂 0--否 1--是 + */ + private String suspendStatus; + + /** + * 暂挂区间 + */ + private String suspendDate; + + /** + * 报账人 + */ + private String bzr; + + /** + * 是否为历史数据 0-不是 1-是 + */ + private String history; + + /** + * 发票税率 + */ + private String taxRate; +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoiceDetail.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoiceDetail.java new file mode 100644 index 00000000..9278d2a3 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoiceDetail.java @@ -0,0 +1,131 @@ +package com.dxhy.erp.entity.sdny; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName("t_dx_record_invoice_detail") +public class SdnyTDxRecordInvoiceDetail implements Serializable { + + 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; + + private String isDiscount; + + /** + * 商品服务简称 + */ + private String spfwjc; + + /** + * 商品和服务税收分类合并编码 + */ + private String sphfwssflhbbm; + + /** + * 扣除额 + */ + private String kce; + + private Date updateLastDate; + + /** + * 税码 + */ + private String taxCode; + + /** + * 是否为历史数据导入 0-不是 1-是 + */ + private String history; + + private static final long serialVersionUID = 1L; + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoiceDetailSales.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoiceDetailSales.java new file mode 100644 index 00000000..05f2e9b3 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxRecordInvoiceDetailSales.java @@ -0,0 +1,140 @@ +package com.dxhy.erp.entity.sdny; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * t_dx_record_invoice_detail_sales + * @author + */ +@Data +@TableName("t_dx_record_invoice_detail_sales") +public class SdnyTDxRecordInvoiceDetailSales implements Serializable { + 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; + + private String isDiscount; + + /** + * 优惠政策标识 + */ + private String incentiveFlag; + + /** + * 零税率标识 + */ + private String zeroTaxrateFlag; + + /** + * 增值税特殊管理 + */ + private String addedTaxSpecial; + + /** + * 商品服务简称 + */ + private String spfwjc; + + /** + * 商品和服务税收分类合并编码 + */ + private String sphfwssflhbbm; + + /** + * 扣除额 + */ + private String kce; + + /** + * 税码 + */ + private String taxCode; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxSaleRecordInvoice.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxSaleRecordInvoice.java new file mode 100644 index 00000000..cf49d253 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SdnyTDxSaleRecordInvoice.java @@ -0,0 +1,857 @@ +package com.dxhy.erp.entity.sdny; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * t_dx_sale_record_invoice + * @author + */ +@Data +@TableName("t_dx_sale_record_invoice") +public class SdnyTDxSaleRecordInvoice implements Serializable { + private Long id; + + /** + * 发票类型 01-增值税专用发票 03-机动车销售统一发票 04-增值税普通发票 10-电子发票 11-卷票 14-通行费发票 + */ + private String invoiceType; + + /** + * 发票代码 + */ + private String invoiceCode; + + private String invoiceNo; + + /** + * 全电发票号码 + */ + private String eleInvoiceNo; + + /** + * 开票日期 + */ + private Date invoiceDate; + + /** + * 购方税号 + */ + private String gfTaxNo; + + /** + * 购方名称 + */ + private String gfName; + + /** + * 购方地址电话 + */ + private String gfAddressAndPhone; + + /** + * 购方开户行及账号 + */ + private String gfBankAndNo; + + /** + * 销方税号 + */ + private String xfTaxNo; + + /** + * 销方名称 + */ + private String xfName; + + /** + * 销方地址及电话 + */ + private String xfAddressAndPhone; + + /** + * 销方开户行及账号 + */ + private String xfBankAndNo; + + /** + * 金额 + */ + private BigDecimal invoiceAmount; + + /** + * 税额 + */ + private BigDecimal taxAmount; + + /** + * 价格合计 + */ + private BigDecimal totalAmount; + + /** + * 备注 + */ + private String remark; + + /** + * 发票状态 0-正常 1-失控 2-作废 3-红冲 4-异常 7部分冲红 8全额红冲 80-红字发票待确认 + */ + private String invoiceStatus; + + /** + * 发票状态修改时间 + */ + private Date statusUpdateDate; + + /** + * 发票状态最后修改时间 + */ + private Date lastUpdateDate; + + /** + * 认证时间 + */ + private Date rzhDate; + + /** + * 签收时间 + */ + private Date qsDate; + + /** + * 最晚认证归属期 yyyyMM + */ + private String rzhBelongDateLate; + + /** + * 实际认证归属期 yyyyMM + */ + private String rzhBelongDate; + + /** + * 认证确认时间 + */ + private Date confirmDate; + + /** + * 认证方式 1-勾选认证 2-扫描认证 + */ + private String rzhType; + + /** + * 是否认证 0-未认证 1-已认证抵扣 2-已认证不抵扣 + */ + private String rzhYesorno; + + /** + * 提交认证操作人账号 + */ + private String gxUserAccount; + + /** + * 提交认证操作人 + */ + private String gxUserName; + + /** + * 底账来源 0-采集 1-查验 2-票据采集 + */ + private String sourceSystem; + + /** + * 是否有效 1-有效 0-无效 + */ + private String valid; + + /** + * 发票代码+发票号码 唯一索引 防重复 + */ + private String uuid; + + /** + * 采集时间 + */ + private Date createDate; + + /** + * 自动查验时间使用 + */ + private Date checkDate; + + /** + * 勾选时间 + */ + private Date gxDate; + + /** + * 认证结果回传信息 + */ + private String rzhBackMsg; + + /** + * 当前税款所属期 + */ + private String dqskssq; + + /** + * 当前税款所属期勾选截止日 + */ + private String gxjzr; + + /** + * 当前税款所属期可勾选发票开票日期范围起 + */ + private String gxfwq; + + /** + * 当前税款所属期可勾选发票开票日期范围止 + */ + private String gxfwz; + + /** + * 是否已勾选 + */ + private String sfygx; + + /** + * 是否存入明细 0 无明细 1 有明细 + */ + private String detailYesorno; + + /** + * 勾选方式(0-手工勾选 1-扫码勾选 2-导入勾选 3- 智能勾选 4-手工认证 5-扫码认证 6-导入认证) + */ + private String gxType; + + /** + * 认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败 + */ + private String authStatus; + + /** + * 发送认证时间 + */ + private Date sendDate; + + /** + * 认证类型(1-抵扣 2-退税 3-代理退税 4-不抵扣 5-逾期 发票已认证、已勾选有该标签) + */ + private String rzlx; + + /** + * 是否代办退税(0:否 1:是) + */ + private String sfdbts; + + /** + * 签收方式(0-扫码签收 1-扫描仪签收 2-app签收 3-导入签收 4-手工签收5-pdf上传签收 + */ + private String qsType; + + /** + * 签收结果(0-未签收 1-已签收) + */ + private String qsStatus; + + /** + * 校验码 + */ + private String checkCode; + + /** + * 通行费标志(Y-可抵扣通行费,N-不可抵扣通行费) + */ + private String txfbz; + + /** + * 零税率标志 (空:非零税率,1:税率栏位显示“免税”,2:税率栏位显示“不征收”,3:零税率 + */ + private String lslbz; + + /** + * 转出状态 0-未转出 1-全部转出 2-部分转出 + */ + private String outStatus; + + /** + * 转出金额 + */ + private BigDecimal outInvoiceAmout; + + /** + * 转出税额 + */ + private BigDecimal outTaxAmount; + + /** + * 转出原因1-免税项目用 ;2-集体福利,个人消费;3-非正常损失;4-简易计税方法征税项目用;5-免抵退税办法不得抵扣的进项税额;6-纳税检查调减进项税额;7-红字专用发票通知单注明的进项税额;8-上期留抵税额抵减欠税 + */ + private String outReason; + + /** + * 转出备注 + */ + private String outRemark; + + /** + * 转出日期 + */ + private Date outDate; + + /** + * 转出税款所属期 + */ + private String outBelongDate; + + /** + * 转出人 + */ + private String outBy; + + /** + * 确认人 + */ + private String confirmUser; + + /** + * 机器编号 + */ + private String machinecode; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 结算单号 + */ + private String settlementNo; + + /** + * 是否结算(0未结算1已结算) + */ + private String settlementStatus; + + /** + * 结算单来源 + */ + private String settleSource; + + /** + * 付款状态(0-付款成功 1-付款失败) + */ + private String paymentStatus; + + /** + * 付款日期 + */ + private String paymentDate; + + /** + * 凭证号 + */ + private String voucherNumber; + + /** + * 付款金额 + */ + private String paymentSum; + + /** + * 签收人 + */ + private String qsName; + + /** + * 逾期申请结果 + */ + private String yqsqMsg; + + /** + * 逾期申请标志 0-未申请 1--已申请 2发送申请,4申请成功,5申请失败 默认为空 + */ + private String yqsqStatus; + + /** + * 管理状态 0正常1异常 + */ + private String glzt; + + /** + * 信息来源 0扫描认证 1系统推送 2出口转内销 + */ + private String xxly; + + /** + * 抵扣税额 + */ + private BigDecimal dkTaxAmount; + + /** + * 逾期可勾选标志 0默认值,1可勾选逾期 + */ + private String yqkgxbz; + + /** + * 异常类型 0发票状态异常1申报用途变更(抵扣变代办退税)2管理状态异常、注:发票状态为正常时为空 + */ + private String yclx; + + /** + * 逾期审核状态 0--未审核 1--已审核 默认为空 + */ + private String yqshzt; + + /** + * 签收人 + */ + private String userAccount; + + /** + * 购方税号 + */ + private String newGfTaxno; + + /** + * 撤销认证处理状态0未撤销,1申请撤销,2发送撤销,4撤销成功,5撤销失败 + */ + private String cxrzStatus; + + /** + * 撤销认证操作时间 + */ + private Date cxrzDate; + + /** + * 集团编码 + */ + private String company; + + /** + * 逾期申请属期 + */ + private String yqCurrentPeriod; + + /** + * 0-默认值 1-认证抵扣 2-认证不抵扣 + */ + private String bdkStatus; + + /** + * 不抵扣操作时间 + */ + private Date bdkDate; + + /** + * 撤销认证申请属期 + */ + private String cxrzCurrentPeriod; + + /** + * 不抵扣申请属期 + */ + private String bdkCurrentPeriod; + + /** + * 撤销不抵扣处理状态0未申请,1申请,2发送申请,4申请成功,5申请失败 + */ + private String cxbdkStatus; + + /** + * 撤销不抵扣操作时间 + */ + private Date cxbdkDate; + + /** + * 逾期申请时间 + */ + private Date yqsqDate; + + /** + * 逾期审核时间 + */ + private Date yqshDate; + + /** + * 供应商编码 + */ + private String vendorId; + + /** + * 请求id + */ + private String requestId; + + /** + * 认证同步状态0未同步1已同步 + */ + private String sendRzStatus; + + /** + * 认证同步时间 + */ + private Date sendRzDate; + + /** + * 签收同步状态0未同步1已同步 + */ + private String sendQsStatus; + + /** + * 签收同步时间 + */ + private Date sendQsDate; + + /** + * 匹配状态,发票/结算单匹配状态(0-自动 1-手工 2-强制 3-不通过 4-不需匹配 5-取消 6-待审核 7-拒绝匹配 99-初始) + */ + private String matchstatus; + + /** + * 匹配关联号 + */ + private String matchNo; + + /** + * 匹配日期 + */ + private Date matchDate; + + /** + * 匹配错误信息 + */ + private String matchErrinfo; + + /** + * 匹配用户 + */ + private String matchUser; + + /** + * 匹配金额 + */ + private BigDecimal matchCost; + + /** + * 匹配税额 + */ + private BigDecimal matchVat; + + /** + * 供应商编码 + */ + private String venderNo; + + /** + * 扫描匹配状态 0--未匹配 1--匹配成功 2--匹配失败 + */ + private String scanMatchStatus; + + /** + * 扫描匹配时间 + */ + private Date scanMatchDate; + + /** + * 订单号 + */ + private String orderNo; + + /** + * 是否可认证,0未认证,1可认证 + */ + private String isAuth; + + /** + * 出口转内销标志默认0否,1是 + */ + private String exportMark; + + /** + * 扫描id + */ + private String scanId; + + /** + * 票池采集时间 + */ + private Date collectDate; + + /** + * 票池采集来源 0-进项采集 1-票据采集 + */ + private String collectFrom; + + /** + * 票池采集状态 0-未采集 1-已采集 + */ + private String collectStatus; + + /** + * 票池入池状态 0-成功 1-失败 + */ + private String poolStatus; + + /** + * 入池失败原因 + */ + private String inPoolReason; + + /** + * 凭证号 + */ + private String voucherNo; + + /** + * 业务单据号 + */ + private String documentNumber; + + /** + * 是否末次摊销 0-否,1-是 + */ + private String amortizeStatus; + + /** + * 摊销金额 + */ + private String amortizeAmount; + + /** + * 剩余摊销金额 + */ + private String remainAmortizeAmount; + + /** + * 摊销业务单据编号 + */ + private String amortizeDocumentNumber; + + /** + * 收款人 + */ + private String payee; + + /** + * 复核人 + */ + private String reviewer; + + /** + * 开票人 + */ + private String printor; + + /** + * 是否有销货清单 0 否/1 是, 默认为 0 + */ + private String isSaleList; + + /** + * 红蓝票标识 0 蓝/1 红 + */ + private String isRed; + + /** + * 红票对应的蓝票代码 + */ + private String blueCode; + + /** + * 红票对应的蓝票号码 + */ + private String blueNo; + + private Date inAccountDate; + + private String inAccountStatus; + + /** + * 摊销人 + */ + private String amortizeUser; + + /** + * 密文 + */ + private String mw; + + /** + * 机打号码 -卷票字段 + */ + private String jdhm; + + /** + * 代开税号 + */ + private String dkTaxno; + + /** + * 代开名称 + */ + private String dkTaxname; + + /** + * 代开状态 0-非代开 1-代开 + */ + private String dkStatus; + + /** + * 明细优惠政策汇总 + */ + private String incentiveFlag; + + /** + * 是否有清单:0无,1有 + */ + private String listStatus; + + /** + * 系统名称 + */ + private String systemName; + + private String illegalSupplier; + + /** + * 发票来源 0-税控发票 1-全电发票 + */ + private String invoiceSource; + + /** + * 通道来源:0:大企业采集,1:大企业发票下载,2:数据平台,3:乐企采集 + */ + private String tdly; + + /** + * 乐企红字锁定标识Y-锁定;N-未锁定 + */ + private String lqHzsdbs; + + /** + * 乐企入账状态:01-未入账 +02-已入账 +03-已入账撤销 + */ + private String lqRzzt; + + /** + * 乐企成品油异常标识:9-正常 +1-成品油单价异常 +2-成品油超库存异常 + */ + private String lqCpyycbs; + + /** + * 乐企出口退税类代码:01-增值税专用发票可用于代办退税标签(仅用于代办退税) + */ + private String lqCktsldm; + + /** + * 乐企出口转内销证明编号 + */ + private String lqCkznxzmbh; + + /** + * 乐企发票用途:0-未使用 +1-已申请抵扣 +2-已申请退税 +3-已申请代办退税 +4-已勾选不抵扣(历史数据) +5-已申请代办退税(历史数据) +6-已申请不抵扣 +7-内销转出口 +8-出口转内销 +9-准予退税 +10-不予退税 +11-冬奥退税 +12-农产品加计扣除 + */ + private String lqFpyt; + + /** + * 乐企特殊票种:02农产品收购;03稀土矿产品发票;04稀土产成品发票;05:石脑油; 08成品油发票;06通行费(可抵扣);07通行费(不可抵扣) + */ + private String lqTspz; + + /** + * 乐企特定要素类型代码:空:非特定要素 +01:成品油发票 +02:稀土发票 +03:建筑服务发票 +04:货物运输服务发票 +05:不动产销售服务发票 +06:不动产租赁服务发票 +07:代收车船税 +08:通行费 +09:旅客运输服务发票 +10:医疗服务(住院)发票 +11:医疗服务(门诊)发票 +12:自产农产品销售发票 +13 拖拉机和联合收割机发票 +14:机动车 +15:二手车 +16:农产品收购发票 +17:光伏收购发票 +18:卷烟发票 + */ + private String lqTdyslxdm; + + /** + * 影像号 + */ + private String imageId; + + /** + * 过账时间 + */ + private Date postingTime; + + /** + * 账期 + */ + private String accountPeriod; + + /** + * 山能凭证号 + */ + private String snVoucherNumber; + + /** + * 报账单号 + */ + private String bzdh; + + /** + * 入账状态 0:未入账 1:已入账 + */ + private String inaccountStatus; + + /** + * 组织编码 + */ + private String compCode; + + /** + * 报账人 + */ + private String bzr; + + private static final long serialVersionUID = 1L; + + @TableField(exist = false) + private List detailList; +} \ No newline at end of file diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/ZData.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/ZData.java new file mode 100644 index 00000000..0c575036 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/ZData.java @@ -0,0 +1,734 @@ +package com.dxhy.erp.entity.sdny; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.*; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + + +@Getter +@Setter +@Component +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ZData { + private String IMG_NO=""; + + private String IMG_NAME=""; + private String IMG_NUM=""; + private String JBR_ID=""; + private String JBR_NAME=""; + private String BZR_ID=""; + private String BZR_NAME=""; + private String ZBZDH=""; + private String SCAN_DATE=""; + private String SCAN_TIME=""; + private String MODI_DATE=""; + private String MODI_TIME=""; + private String ARCHIV_ID=""; + private String ARC_DOC_ID=""; + private String ACTION=""; + private String FLTYPE=""; + private String ZSMZT=""; + private String ZSFGHFP=""; + private String ZSFCH=""; + private String RESERVE1=""; + private String RESERVE2=""; + private String RESERVE3=""; + private String RESERVE4=""; + private String RESERVE5=""; + + private String BZDZT=""; + private String ZYXZT=""; + private String ATTA_TYPE_SET=""; + + private String DCTYP=""; + private String OBJECTTEXT=""; + private String BZDZTMS=""; + private String ZYXZTMS=""; + /** + * 不含税金额(SAP) + */ + private String ZBHSJE=""; + + /** + * 税额(SAP) + */ + private String ZZSE=""; + + /** + * 不含税金额(发票) + */ + private String ZBHSJE_Y=""; + + + + /** + * 发票代码 + */ + private String ZFPDM=""; + /** + * 发票明细 + */ + private List IT_ITEM=new ArrayList<>(); + /** + * 发票号码 + */ + private String ZFPHM=""; + /** + * 发票类型 + * 10:增值税专用发票 + * 11:增值税普通发票 + * 12:增值税电子普通发票 + * 13:增值税普通发票(卷票) + * 14:机动车销售统一发票 + * 15:二手车销售统一发票 + * 16:定额发票 + * 17:机打发票 + * 18:出租车发票 + * 19:火车票 + * 20:客运汽车 + * 21:航空运输电子客票行程单 + * 22:过路费发票 + * 24:增值税电子普通发票(通行费) + * 25:增值税电子专用发票 + * 26:电子发票《增值税专用发票) + * 27:电子发票《普通发票) + */ + private String ZFPLX=""; + /** + * 销方编号 + */ + private String ZXFBM=""; + /** + * 购方编号 + */ + private String ZGFBH=""; + /** + * 含税金额 + */ + private String ZHSJE=""; + /** + * 税额(发票) + */ + private String ZZSE_Y=""; + /** + * 含税金额(发票) + */ + private String ZHSJE_Y=""; + /** + * 不含税金额(差额) 传0 + */ + private String ZBHSJE_DIF="0"; + /** + * 税额(差额) 传0 + */ + private String ZZSE_DIF="0"; + /** + * 含税金额(差额) 传0 + */ + private String ZHSJE_DIF="0"; + /** + * 备注 + */ + private String ZZBZ=""; + /** + * 发票状态 0正常,1作废 + */ + private String ZFPZT=""; + /** + * 开票日期 + */ + private String ZKPRQ=""; + /** + * 集团Client + */ + private String MANDT=""; + /** + * 购方名称 + */ + private String ZGFMC=""; + + /** + * 购方税号 + */ + private String ZGFSH=""; + /** + * 销方名称 + */ + private String ZXFMC=""; + + /** + * 销方税号 + */ + private String ZXFSH=""; + /** + * ID 需要SAP给出规则(代码+号码+发票类型) + */ + private String ZTID=""; + /** + * 校验码 + */ + private String ZJYM=""; + /** + * 购⽅开户⾏账户 + */ + private String ZGFZH=""; + /** + * 购⽅地址电话 + */ + private String ZGFDH=""; + /** + * 销⽅地址电话 + */ + private String ZXFDH=""; + /** + * 销⽅开户⾏账户 + */ + private String ZXFZH=""; + /** + * 机打代码 + */ + private String ZJDDM=""; + /** + * 机打号码 + */ + private String ZJDHM=""; + /** + * 主管税务机关 + */ + private String ZSWJG=""; + /** + * 主管税务机关代码 + */ + private String ZJGDM=""; + + /** + * 票据来源 需要SAP提供(传1) + */ + private String ZPJLY="1"; + /** + * 员工Code + */ + private String ZYGC=""; + + /** + * 员工中文名称 + */ + private String ZYHM=""; + /** + * 全名 填opentext + */ + private String ZQM="opentext"; + /** + * 公司代码 + */ + private String ZGSDM=""; + /** + * 业务单据编号(报账单编号) + */ + private String ZYWDJ=""; + /** + * 业务状态 (已关联报账单:1未关联报账单:0) + */ + private String ZYWZT=""; + + /** + * 票据状态 (正常:1作废:2) + */ + private String ZPJZT=""; + + /** + * 创建时间 + */ + private String ZCJSJ=""; + /** + * 创建人 + */ + private String ZCJR=""; + /** + * 更新时间 + */ + private String ZGXSJ=""; + /** + * 更新人 (中文人名称) + */ + private String ZGXR=""; + /** + * 查验状态 0:带查验,1:查验成功,2:查验失败 + */ + private String ZCYZT=""; + /** + * 查验结果描述见群中图片 + */ + private String ZCYJG=""; + + /** + * 查验日期 + */ + private String ZCYRQ=""; + + /** + * 税率 + */ + private String ZTAX=""; + + /** + * 税码 + */ + private String ZSM=""; + + /** + * 影像ID + */ + private String FPYXBH=""; + /** + * 影像编码ID (CurrenttaskID) + */ + private String IMG_ID=""; + + + /** + * 序号 数字类型的序号 + */ + private String SORT=""; + + /** + * 发票号行 + */ + private String ZFPHH=""; + + /** + * 型号规格 + */ + private String ZGGXH=""; + /** + * 数量单位 + */ + private String ZSLDW=""; + /** + * 单价 + */ + private String ZZDJ=""; + /** + * 发票单价 + */ + private String ZZDJFP=""; + /** + * 数量 + */ + private String ZZSL=""; + + /** + * 开票日期 + */ + private String INVOICEDATE=""; + + /** + * 发票类型 + */ + private String INVOICETYPE=""; + /** + * 货物或应税劳务、服务名称 + */ + private String ZHWMC=""; + + /** + * 国税局商品编码 发票信息空则不传 + */ + private String ZGSJBM=""; + @JSONField(name = "ZBHSJE_Y") + public String getZBHSJE_Y() { + return ZBHSJE_Y; + } + + @JSONField(name = "ZBHSJE") + public String getZBHSJE() { + return ZBHSJE; + } + @JSONField(name = "ZFPDM") + public String getZFPDM() { + return ZFPDM; + } + @JSONField(name = "ZFPHM") + public String getZFPHM() { + return ZFPHM; + } + @JSONField(name = "ZFPLX") + public String getZFPLX() { + return ZFPLX; + } + @JSONField(name = "ZXFBM") + public String getZXFBM() { + return ZXFBM; + } + @JSONField(name = "ZGFBH") + public String getZGFBH() { + return ZGFBH; + } + @JSONField(name = "ZHSJE") + public String getZHSJE() { + return ZHSJE; + } + @JSONField(name = "ZZSE_Y") + public String getZZSE_Y() { + return ZZSE_Y; + } + @JSONField(name = "ZZDJFP") + public String getZZDJFP() { + return ZZDJFP; + } + + @JSONField(name = "ZHSJE_Y") + public String getZHSJE_Y() { + return ZHSJE_Y; + } + @JSONField(name = "ZBHSJE_DIF") + public String getZBHSJE_DIF() { + return ZBHSJE_DIF; + } + @JSONField(name = "ZZSE_DIF") + public String getZZSE_DIF() { + return ZZSE_DIF; + } + @JSONField(name = "ZHSJE_DIF") + public String getZHSJE_DIF() { + return ZHSJE_DIF; + } + @JSONField(name = "ZZBZ") + public String getZZBZ() { + return ZZBZ; + } + @JSONField(name = "ZFPZT") + public String getZFPZT() { + return ZFPZT; + } + @JSONField(name = "ZKPRQ") + public String getZKPRQ() { + return ZKPRQ; + } + @JSONField(name = "MANDT") + public String getMANDT() { + return MANDT; + } + @JSONField(name = "ZGFMC") + public String getZGFMC() { + return ZGFMC; + } + @JSONField(name = "ZXFMC") + + public String getZXFMC() { + return ZXFMC; + } + @JSONField(name = "ZXFSH") + + public String getZXFSH() { + return ZXFSH; + } + @JSONField(name = "ZTID") + public String getZTID() { + return ZTID; + } + @JSONField(name = "ZJYM") + public String getZJYM() { + return ZJYM; + } + @JSONField(name = "ZGFZH") + public String getZGFZH() { + return ZGFZH; + } + @JSONField(name = "ZGFDH") + public String getZGFDH() { + return ZGFDH; + } + @JSONField(name = "ZXFDH") + public String getZXFDH() { + return ZXFDH; + } + @JSONField(name = "ZXFZH") + public String getZXFZH() { + return ZXFZH; + } + @JSONField(name = "ZJDDM") + public String getZJDDM() { + return ZJDDM; + } + @JSONField(name = "ZJDHM") + public String getZJDHM() { + return ZJDHM; + } + @JSONField(name = "ZSWJG") + public String getZSWJG() { + return ZSWJG; + } + @JSONField(name = "ZJGDM") + public String getZJGDM() { + return ZJGDM; + } + @JSONField(name = "ZPJLY") + public String getZPJLY() { + return ZPJLY; + } + @JSONField(name = "ZYGC") + public String getZYGC() { + return ZYGC; + } + @JSONField(name = "ZYHM") + public String getZYHM() { + return ZYHM; + } + @JSONField(name = "ZQM") + public String getZQM() { + return ZQM; + } + @JSONField(name = "ZGSDM") + public String getZGSDM() { + return ZGSDM; + } + @JSONField(name = "ZYWDJ") + public String getZYWDJ() { + return ZYWDJ; + } + @JSONField(name = "ZYWZT") + public String getZYWZT() { + return ZYWZT; + } + @JSONField(name = "ZPJZT") + public String getZPJZT() { + return ZPJZT; + } + @JSONField(name = "ZCJSJ") + public String getZCJSJ() { + return ZCJSJ; + } + @JSONField(name = "ZCJR") + public String getZCJR() { + return ZCJR; + } + @JSONField(name = "ZGXSJ") + public String getZGXSJ() { + return ZGXSJ; + } + @JSONField(name = "ZGXR") + public String getZGXR() { + return ZGXR; + } + @JSONField(name = "ZCYZT") + public String getZCYZT() { + return ZCYZT; + } + @JSONField(name = "ZCYJG") + public String getZCYJG() { + return ZCYJG; + } + @JSONField(name = "ZCYRQ") + public String getZCYRQ() { + return ZCYRQ; + } + @JSONField(name = "ZTAX") + public String getZTAX() { + return ZTAX; + } + @JSONField(name = "ZSM") + public String getZSM() { + return ZSM; + } + @JSONField(name = "FPYXBH") + public String getFPYXBH() { + return FPYXBH; + } + @JSONField(name = "SORT") + public String getSORT() { + return SORT; + } + @JSONField(name = "ZFPHH") + public String getZFPHH() { + return ZFPHH; + } + @JSONField(name = "ZGGXH") + public String getZGGXH() { + return ZGGXH; + } + @JSONField(name = "ZSLDW") + public String getZSLDW() { + return ZSLDW; + } + @JSONField(name = "ZZDJ") + public String getZZDJ() { + return ZZDJ; + } + @JSONField(name = "ZZSL") + public String getZZSL() { + return ZZSL; + } + @JSONField(name = "INVOICEDATE") + public String getINVOICEDATE() { + return INVOICEDATE; + } + @JSONField(name = "INVOICETYPE") + public String getINVOICETYPE() { + return INVOICETYPE; + } + @JSONField(name = "ZHWMC") + public String getZHWMC() { + return ZHWMC; + } + @JSONField(name = "ZGSJBM") + public String getZGSJBM() { + return ZGSJBM; + } + + @JSONField(name = "ATTA_TYPE_SET") + public String getATTA_TYPE_SET() { + return ATTA_TYPE_SET; + } + + @JSONField(name = "BZDZTMS") + public String getBZDZTMS() { + return BZDZTMS; + } + @JSONField(name = "ZYXZTMS") + public String getZYXZTMS() { + return ZYXZTMS; + } + + @JSONField(name = "ZGFSH") + public String getZGFSH() { + return ZGFSH; + } + + + @JSONField(name = "DCTYP") + public String getDCTYP() { + return DCTYP; + } + @JSONField(name = "OBJECTTEXT") + public String getOBJECTTEXT() { + return OBJECTTEXT; + } + + + + @JSONField(name = "BZDZT") + public String getBZDZT() { + return BZDZT; + } + @JSONField(name = "ZYXZT") + public String getZYXZT() { + return ZYXZT; + } + + + @JSONField(name = "IMG_ID") + public String getIMG_ID() { + return IMG_ID; + } + @JSONField(name = "IMG_NO") + public String getIMG_NO() { + return IMG_NO; + } + @JSONField(name = "IMG_NAME") + public String getIMG_NAME() { + return IMG_NAME; + } + @JSONField(name = "IMG_NUM") + + public String getIMG_NUM() { + return IMG_NUM; + } + @JSONField(name = "JBR_ID") + public String getJBR_ID() { + return JBR_ID; + } + @JSONField(name = "JBR_NAME") + public String getJBR_NAME() { + return JBR_NAME; + } + @JSONField(name = "BZR_ID") + public String getBZR_ID() { + return BZR_ID; + } + @JSONField(name = "BZR_NAME") + public String getBZR_NAME() { + return BZR_NAME; + } + @JSONField(name = "ZBZDH") + public String getZBZDH() { + return ZBZDH; + } + @JSONField(name = "SCAN_DATE") + public String getSCAN_DATE() { + return SCAN_DATE; + } + @JSONField(name = "SCAN_TIME") + public String getSCAN_TIME() { + return SCAN_TIME; + } + @JSONField(name = "MODI_DATE") + public String getMODI_DATE() { + return MODI_DATE; + } + @JSONField(name = "MODI_TIME") + public String getMODI_TIME() { + return MODI_TIME; + } + @JSONField(name = "ARCHIV_ID") + public String getARCHIV_ID() { + return ARCHIV_ID; + } + @JSONField(name = "ARC_DOC_ID") + public String getARC_DOC_ID() { + return ARC_DOC_ID; + } + @JSONField(name = "ACTION") + public String getACTION() { + return ACTION; + } + @JSONField(name = "FLTYPE") + public String getFLTYPE() { + return FLTYPE; + } + @JSONField(name = "ZSMZT") + public String getZSMZT() { + return ZSMZT; + } + @JSONField(name = "ZSFGHFP") + public String getZSFGHFP() { + return ZSFGHFP; + } + @JSONField(name = "ZSFCH") + public String getZSFCH() { + return ZSFCH; + } + @JSONField(name = "RESERVE1") + public String getRESERVE1() { + return RESERVE1; + } + @JSONField(name = "RESERVE2") + public String getRESERVE2() { + return RESERVE2; + } + @JSONField(name = "IT_ITEM") + public List getIT_ITEM() { + return IT_ITEM; + } + + @JSONField(name = "RESERVE3") + public String getRESERVE3() { + return RESERVE3; + } + @JSONField(name = "RESERVE4") + public String getRESERVE4() { + return RESERVE4; + } + @JSONField(name = "RESERVE5") + public String getRESERVE5() { + return RESERVE5; + } + + + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/ImageSubmitService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/ImageSubmitService.java new file mode 100644 index 00000000..d644401d --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/ImageSubmitService.java @@ -0,0 +1,23 @@ +package com.dxhy.erp.service; + +import com.dxhy.common.utils.R; +import com.dxhy.erp.entity.sdny.SNRequestObject; + +public interface ImageSubmitService { + + /** + * 提交 + * @param params + * @return + */ + R salesInvoiceSubmit(SNRequestObject params); + + /** + * 撤回 + * @param params + * @return + */ + R salesInvoiceRollback(SNRequestObject params); + + +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SdnyTDxRecordInvoiceDetailSalesService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SdnyTDxRecordInvoiceDetailSalesService.java new file mode 100644 index 00000000..9b15bb2d --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SdnyTDxRecordInvoiceDetailSalesService.java @@ -0,0 +1,7 @@ +package com.dxhy.erp.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dxhy.erp.entity.sdny.SdnyTDxRecordInvoiceDetailSales; + +public interface SdnyTDxRecordInvoiceDetailSalesService extends IService { +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/GatherServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/GatherServiceImpl.java index 62ce4fd5..3f42dd0b 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/GatherServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/GatherServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.dxhy.common.constant.DbConstant; import com.dxhy.common.datasource.config.DynamicContextHolder; +import com.dxhy.common.enums.ImageSubmitInvoiceTypeEnum; import com.dxhy.common.enums.ReturnCodeEnum; import com.dxhy.common.service.impl.MpBaseServiceImpl; import com.dxhy.common.util.pojo.Authorize; @@ -842,7 +843,12 @@ public class GatherServiceImpl extends MpBaseServiceImpl responseEntity = mainService.syncInvoiceInfo(snRequestObject); + ResponseEntity responseEntity = null; + if (ImageSubmitInvoiceTypeEnum.G.getCode().equals(snRequestObject.getFlag())) { + responseEntity = mainService.syncInvoiceInfo(snRequestObject); + } else if (ImageSubmitInvoiceTypeEnum.X.getCode().equals(snRequestObject.getFlag())) { + responseEntity = mainService.imageSubmitSalesInvoice(snRequestObject); + } String body = responseEntity.getBody().toString(); body = body.replaceAll("=",":"); String result = ""; diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ImageSubmitServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ImageSubmitServiceImpl.java new file mode 100644 index 00000000..660a3ffb --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ImageSubmitServiceImpl.java @@ -0,0 +1,147 @@ +package com.dxhy.erp.service.impl; + +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.utils.R; +import com.dxhy.erp.dao.*; +import com.dxhy.erp.entity.sdny.*; +import com.dxhy.erp.service.ImageSubmitService; +import com.dxhy.erp.service.SdnyTDxRecordInvoiceDetailSalesService; +import com.dxhy.erp.utils.JsonUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +@Transactional(rollbackFor = Exception.class) +public class ImageSubmitServiceImpl implements ImageSubmitService { + + @Autowired + private ImageSubmitDao imageSubmitDao; + + @Autowired + private SdnyTDxRecordInvoiceDao tdxRecordInvoiceDao; + + @Autowired + private SdnyTDxRecordInvoiceDetailDao detailDao; + + + @Autowired + private SdnyTDxSaleRecordInvoiceDao sdnyTDxSaleRecordInvoiceDao; + + @Autowired + private SdnyTDxRecordInvoiceDetailSalesService sdnyTDxRecordInvoiceDetailSalesService; + + @Override + public R salesInvoiceSubmit(SNRequestObject params) { + List uuidList = new ArrayList<>(); + Map paramsInvoiceMap = new HashMap<>(); + params.getInvoiceInfoList().stream().forEach(item->{ + String uuid = (StringUtils.isBlank(item.getInvoiceCode()) ? "" : item.getInvoiceCode()) + item.getInvoiceNumber(); + uuidList.add(uuid); + paramsInvoiceMap.put(uuid, item); + }); + DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("uuid", uuidList); + List invoicesList = tdxRecordInvoiceDao.selectList(queryWrapper); + if (invoicesList == null || invoicesList.size() == 0) { + return R.error(500, "未查询到发票信息,请重新查验"); + } + if (invoicesList.size() != uuidList.size()) { + StringBuffer msg = new StringBuffer(); + Map invoiceMap = invoicesList.stream().collect(Collectors.toMap(SdnyTDxRecordInvoice::getUuid, v->v)); + uuidList.stream().forEach(uuid->{ + if (!invoiceMap.containsKey(uuid)) { + SNInvoice invoice = paramsInvoiceMap.get(uuid); + String errorMsg = "发票代码:"+invoice.getInvoiceCode()+",发票号码:"+invoice.getInvoiceNumber()+";"; + msg.append(errorMsg); + } + }); + String errorMsg = msg.toString(); + return R.error(500, "未查询到如下发票,请重新查验"+errorMsg); + } + + DynamicContextHolder.push(DbConstant.DETAIL_WRITE); + QueryWrapper detailQueryWrapper = new QueryWrapper<>(); + detailQueryWrapper.in("uuid", uuidList); + List detailList = detailDao.selectList(detailQueryWrapper); + Map> detailiMap = new HashMap<>(); + detailList.stream().forEach(item->{ + List list = null; + if (detailiMap.containsKey(item.getUuid())) { + list = detailiMap.get(item.getUuid()); + list.add(item); + detailiMap.put(item.getUuid(), list); + } else { + list = new ArrayList<>(); + list.add(item); + detailiMap.put(item.getUuid(), list); + } + }); + invoicesList.stream().forEach(item->{ + item.setImageId(params.getImageId()); + item.setBzdh(params.getBillNum()); + item.setBzr(params.getJbrUserName()); + }); + List salesInvoiceList = new ArrayList<>(); + invoicesList.stream().forEach(invoice->{ + + + DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); + SdnyTDxSaleRecordInvoice saleRecordInvoice = sdnyTDxSaleRecordInvoiceDao.selectOne(new QueryWrapper().eq("uuid", invoice.getUuid())); + List salesDetailList = new ArrayList<>(); + detailiMap.get(invoice.getUuid()).stream().forEach(item->{ + SdnyTDxRecordInvoiceDetailSales salesDetail = JsonUtils.getInstance().parseObject(JSONObject.toJSONString(item), SdnyTDxRecordInvoiceDetailSales.class); + salesDetail.setId(null); + salesDetailList.add(salesDetail); + }); + if (saleRecordInvoice == null) { + // 新增 + saleRecordInvoice = JsonUtils.getInstance().parseObject(JSONObject.toJSONString(invoice), SdnyTDxSaleRecordInvoice.class); + saleRecordInvoice.setId(null); + DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); + sdnyTDxSaleRecordInvoiceDao.insert(saleRecordInvoice); + DynamicContextHolder.push(DbConstant.DETAIL_WRITE); + sdnyTDxRecordInvoiceDetailSalesService.getBaseMapper().delete(new UpdateWrapper().eq("uuid", invoice.getUuid())); + sdnyTDxRecordInvoiceDetailSalesService.saveBatch(salesDetailList); + } else { + // 修改 + saleRecordInvoice.setImageId(invoice.getImageId()); + saleRecordInvoice.setBzdh(invoice.getBzdh()); + saleRecordInvoice.setBzr(invoice.getBzr()); + DynamicContextHolder.push(DbConstant.BUSINESS_WRITE); + sdnyTDxSaleRecordInvoiceDao.updateById(saleRecordInvoice); + } + saleRecordInvoice.setDetailList(salesDetailList); + salesInvoiceList.add(saleRecordInvoice); + }); + + return R.success(); + } + + @Override + public R salesInvoiceRollback(SNRequestObject params) { + return null; + } + + /** + * 推送SAP + * @param invoiceList + * @param flag true提交 false撤回 + * @return + */ + public R pushSap(List invoiceList, Boolean flag) { + + + + return R.success(); + } +} diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SdnyTDxRecordInvoiceDetailSalesServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SdnyTDxRecordInvoiceDetailSalesServiceImpl.java new file mode 100644 index 00000000..77a338e9 --- /dev/null +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SdnyTDxRecordInvoiceDetailSalesServiceImpl.java @@ -0,0 +1,11 @@ +package com.dxhy.erp.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dxhy.erp.dao.SdnyTDxRecordInvoiceDetailSalesDao; +import com.dxhy.erp.entity.sdny.SdnyTDxRecordInvoiceDetailSales; +import com.dxhy.erp.service.SdnyTDxRecordInvoiceDetailSalesService; +import org.springframework.stereotype.Service; + +@Service +public class SdnyTDxRecordInvoiceDetailSalesServiceImpl extends ServiceImpl implements SdnyTDxRecordInvoiceDetailSalesService { +} diff --git a/dxhy-erp/src/main/resources/mapper/ImageSubmitDao.xml b/dxhy-erp/src/main/resources/mapper/ImageSubmitDao.xml new file mode 100644 index 00000000..344a8b41 --- /dev/null +++ b/dxhy-erp/src/main/resources/mapper/ImageSubmitDao.xml @@ -0,0 +1,152 @@ + + + + + \ No newline at end of file