diff --git a/imag/src/private/nc/impl/imag/taxfactory/apply/einvoice/ApplyRequest.java b/imag/src/private/nc/impl/imag/taxfactory/apply/einvoice/ApplyRequest.java new file mode 100644 index 0000000..5b0e8cc --- /dev/null +++ b/imag/src/private/nc/impl/imag/taxfactory/apply/einvoice/ApplyRequest.java @@ -0,0 +1,1813 @@ +package nc.impl.imag.taxfactory.apply.einvoice; + +import nc.bs.framework.common.NCLocator; +import nc.dto.imag.boot.RequestInfo; +import nc.dto.imag.invoice.PInvoice; +import nc.dto.imag.invoice.PInvoiceCepz; +import nc.dto.imag.invoice.PInvoiceDetail; +import nc.dto.imag.invoice.PInvoiceSDetail; +import nc.dto.imag.invoice.PInvoiceTspz; +import nc.dto.imag.invoice.tax.apply.InvoiceApplyCommonRequest; +import nc.imag.basefactory.router.Sm4Util; +import nc.imag.common.util.IJsonUtil; +import nc.impl.imag.taxfactory.einvoice.EInvoiceRequest; +import nc.itf.imag.basefactory.IFactoryRequest; +import nc.itf.uap.cil.ICilService; +import nc.vo.imag.verify.InvoiceTypeEnum; +import nc.vo.pub.BusinessException; +import nc.vo.pub.BusinessRuntimeException; +import nccloud.commons.collections.MapUtils; +import ssc.mq.util.Logger; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.UUID; + +class ApplyRequest extends EInvoiceRequest implements IFactoryRequest { + + // 开票申请发票信息,包含发票头、发票明细 + private String requestdatas; + + // 邮件推送配置(可选) + private String email; + + // 短信推送配置(可选) + private String sms; + + // ncc友企联回调参数 + private List nc6x_ubl; + + // 是否自动审核(可选) + private boolean autoAudit; + + @SuppressWarnings("unchecked") + @Override + public E buildContent(RequestInfo p) throws BusinessException { + + initRequest(p); + + Map params = new HashMap(); + params.put("requestdatas", this.requestdatas); + params.put("email", this.email); + params.put("sms", this.sms); + params.put("autoAudit", this.autoAudit + ""); + params.put("nc6x-ubl", IJsonUtil.toJson(this.nc6x_ubl)); + return (E) params; + } + + @Override + public Map buildHeaderParams(RequestInfo p) throws BusinessException { + + initRequest(p); + Map header = new HashMap(); + try { + header.put("requestdatas", getMD5(this.requestdatas)); + } catch (Exception e) { + throw new BusinessException(e.getMessage(),e); + } + return header; + } + + @Override + public void checkParamsBeforeDoRequest() throws BusinessException { + //接口方法,不用实现 + } + + @Override + public RequestTypeEnum requestType() { + + return RequestTypeEnum.POSTFORM; + } + + /** + * initRequest 初始化请求参数 + * + * @param p + */ + private void initRequest(RequestInfo p) { + + if (this.requestdatas != null) { + return; + } + InvoiceApplyCommonRequest r = (InvoiceApplyCommonRequest) p.getData(); + this.requestdatas = IJsonUtil.toJson(buildApplyInvoice(r.getInvoices())); + this.email = IJsonUtil.toJson(buildNotify(r.getEmail())); + this.sms = IJsonUtil.toJson(buildNotify(r.getSms())); + this.autoAudit = r.isAutoAudit(); + } + + /** + * buildApplyInvoice 原始参数请求转换 + * + * @param pInvoices + * @return + */ + private ApplyInvoice[] buildApplyInvoice(PInvoice[] pInvoices) { + + ApplyInvoice[] invoices = new ApplyInvoice[pInvoices.length]; + + for (int i = 0; i < invoices.length; i++) { + PInvoice p = pInvoices[i]; + ApplyInvoice a = new ApplyInvoice(); + a.setBZ(p.getBz()); + a.setFPQQLSH(p.getApplyNumber()); + a.setFHR(p.getFhr()); + a.setFPLX(imagToEInvoice(p.getFplx())); + a.setGMF_DZDH(p.getGmfDzdh()); + a.setGMF_MC(p.getGmfMc()); + a.setGMF_NSRSBH(p.getGmfNsrsbh()); + a.setGMF_YHZH(p.getGmfYhzh()); + a.setHJJE(getUFDoubleValue(p.getHjje())); + a.setHJSE(getUFDoubleValue(p.getHjse())); + a.setJSHJ(getUFDoubleValue(p.getJshj())); + a.setKPR(p.getKpr()); + a.setORGCODE(p.getOrgcode()); + a.setORGTYPE("billingstation"); + a.setSGBZ(p.getSgbz()); + a.setSKR(p.getSkr()); + a.setXSF_DZDH(p.getXsfDzdh()); + a.setXSF_MC(p.getXsfMc()); + a.setXSF_NSRSBH(p.getXsfNsrsbh()); + a.setXSF_YHZH(p.getXsfYhzh()); + a.setLYID(p.getLyid()); + a.setSLSM(p.getSlsm()); + a.setLylx("n");// 税务云约定来源系统传n代表ncc + a.setALLELCUSERNAME(decode(p.getXsfNsrsbh(),p.getAllelcusername())); + a.setALLELCPASSWORD(decode(p.getXsfNsrsbh(),p.getAllelcpassword())); + a.setXSF_DZ(p.getXsf_dz()); + a.setXSF_DH(p.getXsf_dh()); + a.setXSF_YH(p.getXsf_yh()); + a.setXSF_ZH(p.getXsf_zh()); + a.setGMF_DZ(p.getGmf_dz()); + a.setGMF_DH(p.getGmf_dh()); + a.setGMF_YH(p.getGmf_yh()); + a.setGMF_ZH(p.getGmf_zh()); + a.setSLSM(p.getSlsm()); + a.setTSPZ(p.getTspz()); + a.setZDYBZ(p.getZdybz()); + a.setZSFS(p.getZsfs()); + a.setBDCDZ(p.getBdcdz()); + a.setZLQQ(p.getZlqq()); + a.setZLQZ(p.getZlqz()); + a.setKDSBZ(p.getKdsbz()); + a.setTDZZSXMBH(p.getTdzzsxmbh()); + a.setWQHTBABH(p.getWqhtbabh()); + a.setBDCDWDM(p.getBdcdwdm()); + a.setHDJSJG(getUFDoubleValue(p.getHdjsjg())); + a.setSJCJHSJE(getUFDoubleValue(p.getSjcjhsje())); + a.setBXDH(p.getBxdh()); + a.setCPHCBDJH(p.getCphcbdjh()); + a.setSKSSQ(p.getSkssq()); + a.setDSCCSJE(getUFDoubleValue(p.getDsccsje())); + a.setZNJ(getUFDoubleValue(p.getZnj())); + a.setJEHJ(getUFDoubleValue(p.getJehj())); + a.setCJH(p.getCjh()); + a.setKQYSSSXBGGLBM(p.getKqysssxbgglbm()); + if(("31".equals(a.getFPLX()) || "32".equals(a.getFPLX())) && a.getTSPZ() != null){ + if (!check()){ + throw new BusinessRuntimeException("未购买发票统一入口授权!"); + } + } + //@特殊票种电子凭证@ end + //机动车专票特殊处理 + if(String.valueOf(InvoiceTypeEnum.JDCZYFP.getTypeCode()).equals(p.getFplx())){ + a.setFPLX(imagToEInvoice(String.valueOf(InvoiceTypeEnum.ZZSZYFP.getTypeCode()))); + a.setTSPZ("12"); + } + + + ApplyInvoiceDetail[] details = new ApplyInvoiceDetail[p.getItems().length]; + for (int j = 0; j < details.length; j++) { + PInvoiceDetail pd = p.getItems()[j]; + ApplyInvoiceDetail ad = new ApplyInvoiceDetail(); + ad.setDW(pd.getDw()); + ad.setGGXH(pd.getGgxh()); + ad.setLSLBS(pd.getLslbs()); + ad.setSE(getUFDoubleValue(pd.getSe())); + ad.setSL(getUFDoubleValue(pd.getSl())); + ad.setSPBM(pd.getSpbm()); + ad.setXMDJ(getUFDoubleValue(pd.getXmdj())); + ad.setXMJE(getUFDoubleValue(pd.getXmje())); + ad.setXMJSHJ(getUFDoubleValue(pd.getXmjshj())); + ad.setXMMC(pd.getXmmc()); + ad.setXMBM(pd.getXmbm()); + ad.setXMSL(changeZeroToNull(pd.getXmsl()));// 税务云规范:项目数量字段如果是0则传空 + ad.setFPHXZ(pd.getFphxz()); + ad.setHH(pd.getHh()); + ad.setZKHHH(pd.getZkhhh()); + ad.setZXBM(pd.getZxbm()); + ad.setYHZCBS(pd.getYhzcbs()); + ad.setZZSTSGL(pd.getZzstsgl()); + ad.setKCE(getUFDoubleValue(pd.getKce())); + + PInvoiceSDetail psd = pd.getDetailMotor(); + if(psd != null){ + ApplyInvoiceMotor motor = new ApplyInvoiceMotor(); + motor.setCQZSBH(psd.getCqzsbh()); + motor.setJZFWFSD(psd.getJzfwfsd()); + motor.setJZXMMC(psd.getJzxmmc()); +// **************************************2024-07-11 新增 (增加数电纸质发票(机动车销售统一发票)) + motor.setCD(psd.getCd()); + motor.setCJHM(psd.getCjhm()); + motor.setCLLX(psd.getCllx()); + motor.setCPXH(psd.getCpxh()); + motor.setSCQYMC(psd.getScqymc()); + motor.setXCRS(psd.getXcrs()); + + motor.setHGZH(psd.getHgzh()); + motor.setFDJHM(psd.getFdjhm()); + motor.setDUWEI(psd.getDunwei()); +// *********************************************************************** + ad.setDetailMotor(motor); + } + details[j] = ad; + } + a.setItems(details); + + if (p.getTspzs() != null && p.getTspzs().length > 0){ + PInvoiceTspz[] ptspzs = p.getTspzs(); + ApplyInvoiceTspz[] tspzs = new ApplyInvoiceTspz[ptspzs.length]; + for (int j = 0;j < ptspzs.length;j++){ + PInvoiceTspz ptspz = ptspzs[j]; + ApplyInvoiceTspz tspz = new ApplyInvoiceTspz(); + tspz.setYSMXXH(ptspz.getYsmxxh()); + tspz.setYSGJZL(ptspz.getYsgjzl()); + tspz.setYSGJPH(ptspz.getYsgjph()); + tspz.setQYD(ptspz.getQyd()); + tspz.setDDD(ptspz.getDdd()); + tspz.setYSHWMC(ptspz.getYshwmc()); + tspz.setCXRXH(ptspz.getCxrxh()); + tspz.setCXR(ptspz.getCxr()); + tspz.setCHUXRQ(ptspz.getChuxrq()); + tspz.setCXRZJLXDM(ptspz.getCxrzjlxDm()); + tspz.setSFZJHM(ptspz.getSfzjhm()); + tspz.setCFD(ptspz.getCfd()); + tspz.setLKDDD(ptspz.getLkddd()); + tspz.setZWDJ(ptspz.getZwdj()); + tspz.setJTGJLXDM(ptspz.getJtgjlxDm()); + tspzs[j] = tspz; + } + a.setTspzs(tspzs); + } + + if (p.getCepzs() != null && p.getCepzs().length > 0){ + PInvoiceCepz[] pcepzs = p.getCepzs(); + ApplyInvoiceCepz[] cepzs = new ApplyInvoiceCepz[pcepzs.length]; + for (int j = 0;j < pcepzs.length;j++){ + PInvoiceCepz pcepz = pcepzs[j]; + ApplyInvoiceCepz cepz = new ApplyInvoiceCepz(); + cepz.setXH(pcepz.getXh()); + cepz.setPZLX(pcepz.getPzlx()); + cepz.setFPHM(pcepz.getFphm()); + cepz.setFPDM(pcepz.getFpdm()); + cepz.setZZFPHM(pcepz.getZzfphm()); + cepz.setPZHM(pcepz.getPzhm()); + cepz.setKJRQ(pcepz.getKjrq()); + cepz.setHJJE(getUFDoubleValue(pcepz.getHjje())); + cepz.setKCE(getUFDoubleValue(pcepz.getKce())); + cepz.setBZ(pcepz.getBz()); + cepz.setLY(pcepz.getLy()); + cepz.setBCKCJE(getUFDoubleValue(pcepz.getBckcje())); + cepz.setPZHJJE(getUFDoubleValue(pcepz.getPzhjje())); + cepzs[j] = cepz; + } + a.setCepzs(cepzs); + } + + invoices[i] = a; + // 添加回调信息 + addCallBackInfo(p.getApplyNumber()); + } + + return invoices; + } + + /** + * 用户名秘密加密 + * @param xsfnsrsbh 销售方纳税人识别号 + * @param usernameOrPassword 用户名或密码 + * @return + */ + private String decode(String xsfnsrsbh, String usernameOrPassword){ + if (xsfnsrsbh == null){ + throw new BusinessRuntimeException("销售方纳税人识别号不能为空"); + } + if (usernameOrPassword == null){ + return null; + } + String key = UUID.nameUUIDFromBytes(xsfnsrsbh.getBytes()).toString().replaceAll("-",""); + //国密四加密用户名 + try { + return Sm4Util.encryptEcb(key,usernameOrPassword);//sm4加密 + } catch (Exception e) { + Logger.error(e.getMessage()); + throw new BusinessRuntimeException(e.getMessage(),e); + } + } + private boolean check(){ + String code ="1" + "0" + "5" + "8" + "T" + "Y" + "R" + "K"; + ICilService service = NCLocator.getInstance().lookup(ICilService.class); + int licenseauth = service.getLicenseCount(code); + if (licenseauth <= 0 && !service.isNCDEMO()) { + return false; + } + + return true; + } + /** + * 设置税务云回调信息 + * + * @param applyNumber + */ + private void addCallBackInfo(String applyNumber) { + + if (this.nc6x_ubl == null) { + this.nc6x_ubl = new ArrayList(); + } + this.nc6x_ubl.add( + new CallBackInfo(applyNumber, "nccloud.itf.imag.invoice.IBlueInvoiceApplyCallBack", "callBack")); + } + + private Double getUFDoubleValue(BigDecimal d) { + + return d == null ? null : d.doubleValue(); + } + + private Double changeZeroToNull(BigDecimal d) { + + return (d == null || d.doubleValue() == 0) ? null : d.doubleValue(); + } + + /** + * buildNotify + * + * @param notifys + * @return + */ + private List buildNotify(Map notifys) { + + if (MapUtils.isEmpty(notifys)) { + return null; + } + + List notify = new ArrayList(); + + for (Entry entry : notifys.entrySet()) { + + if (entry.getValue().isEmpty()) { + continue; + } + + Notify n = new Notify(); + n.setFpqqlsh(entry.getKey()); + Set values = entry.getValue().address; + StringBuilder address = new StringBuilder(); + + for (String value : values) { + address.append(value + ","); + } + n.setAddress(address.deleteCharAt(address.length() - 1).toString()); + n.setTitle(entry.getValue().title); + n.setContent(entry.getValue().content); + notify.add(n); + } + + return notify; + } + + class ApplyInvoice { + + // 发票申请流水号 + private String FPQQLSH; + + // 来源类型 + private String LYLX; + + // 请求来源唯一标识 + private String LYID; + + // 备注 + private String BZ; + + // 复核人 + private String FHR; + + // 发票类型 + private String FPLX; + + // 购买方地址电话 + private String GMF_DZDH; + + // 购买方名称 + private String GMF_MC; + + // 购买方纳税人识别号 + private String GMF_NSRSBH; + + // 购买方银行账号 + private String GMF_YHZH; + + // 合计金额 + private Double HJJE; + + // 合计税额 + private Double HJSE; + + // 价税合计 + private Double JSHJ; + + // 开票人 + private String KPR; + + // 收款人 + private String SKR; + + // 销售方地址电话 + private String XSF_DZDH; + + // 销售方名称 + private String XSF_MC; + + // 销售方纳税人识别号 + private String XSF_NSRSBH; + + // 销售方银行账号 + private String XSF_YHZH; + + // 开票点编码 + private String ORGCODE; + + // 开票来源组织类型 会计主体(财务组织):financeorg;销售组织:salesorg;采购组织:purchaseorg;库存组织:inventoryorg;工厂组织:factoryorg;资产组织:assetsorg + private String ORGTYPE; + + // 收购标志 + private String SGBZ; + + //机动车专票特殊参数 + private String TSPZ; + + //电子税局用户名 + private String ALLELCUSERNAME; + + //电子税局密码 + private String ALLELCPASSWORD; + + //销售方地址 + private String XSF_DZ; + + //销售方电话 + private String XSF_DH; + + //销售方银行 + private String XSF_YH; + + //销售方账号 + private String XSF_ZH; + + //购买方地址 + private String GMF_DZ; + + //购买方电话 + private String GMF_DH; + + //购买方银行 + private String GMF_YH; + + //购买方账号 + private String GMF_ZH; + + //税率说明 + private String SLSM; + + //自定义备注 + private String ZDYBZ; + + //征税方式 + private String ZSFS; + + //不动产租赁地址 + private String BDCDZ; + + //租赁日期起 + private String ZLQQ; + + //租赁日期止 + private String ZLQZ; + + //是否跨地址标志 + private String KDSBZ; + + //土地增值税项目编号 + private String TDZZSXMBH; + + //网签合同备案编号 + private String WQHTBABH; + + //不动产单元代码 + private String BDCDWDM; + + //核定计税价格 + private Double HDJSJG; + + //实际成交含税金额 + private Double SJCJHSJE; + + //保险单号 + private String BXDH; + + //车牌号/船舶登记号 + private String CPHCBDJH; + + //税款所属期yyyy-MM+空格+yyyy-MM + private String SKSSQ; + + //代收车船税金额 + private Double DSCCSJE; + + //滞纳金 + private Double ZNJ; + + //金额合计 + private Double JEHJ; + + //车辆识别代码/车架号码 + private String CJH; + + //货物运输 + private ApplyInvoiceTspz[] tspzs; + + //差额开票 + private ApplyInvoiceCepz[] cepzs; + //跨区域涉税事项报验管理编号 + private String KQYSSSXBGGLBM; + public String getZSFS() { + return ZSFS; + } + + public void setZSFS(String zSFS) { + ZSFS = zSFS; + } + + public String getLYID() { + + return LYID; + } + + public void setLYID(String lYID) { + + LYID = lYID; + } + + private ApplyInvoiceDetail[] items; + + public String getFPQQLSH() { + + return FPQQLSH; + } + + public void setFPQQLSH(String fPQQLSH) { + + FPQQLSH = fPQQLSH; + } + + public String getLylx() { + return LYLX; + } + + public void setLylx(String lylx) { + this.LYLX = lylx; + } + + public String getBZ() { + + return BZ; + } + + public void setBZ(String bZ) { + + BZ = bZ; + } + + public String getFHR() { + + return FHR; + } + + public void setFHR(String fHR) { + + FHR = fHR; + } + + public String getFPLX() { + + return FPLX; + } + + public void setFPLX(String fPLX) { + + FPLX = fPLX; + } + + public String getGMF_DZDH() { + + return GMF_DZDH; + } + + public void setGMF_DZDH(String gMF_DZDH) { + + GMF_DZDH = gMF_DZDH; + } + + public String getGMF_MC() { + + return GMF_MC; + } + + public void setGMF_MC(String gMF_MC) { + + GMF_MC = gMF_MC; + } + + public String getGMF_NSRSBH() { + + return GMF_NSRSBH; + } + + public void setGMF_NSRSBH(String gMF_NSRSBH) { + + GMF_NSRSBH = gMF_NSRSBH; + } + + public String getGMF_YHZH() { + + return GMF_YHZH; + } + + public void setGMF_YHZH(String gMF_YHZH) { + + GMF_YHZH = gMF_YHZH; + } + + public Double getHJJE() { + + return HJJE; + } + + public void setHJJE(Double hJJE) { + + HJJE = hJJE; + } + + public Double getHJSE() { + + return HJSE; + } + + public void setHJSE(Double hJSE) { + + HJSE = hJSE; + } + + public Double getJSHJ() { + + return JSHJ; + } + + public void setJSHJ(Double jSHJ) { + + JSHJ = jSHJ; + } + + public String getKPR() { + + return KPR; + } + + public void setKPR(String kPR) { + + KPR = kPR; + } + + public String getSKR() { + + return SKR; + } + + public void setSKR(String sKR) { + + SKR = sKR; + } + + public String getXSF_DZDH() { + + return XSF_DZDH; + } + + public void setXSF_DZDH(String xSF_DZDH) { + + XSF_DZDH = xSF_DZDH; + } + + public String getXSF_MC() { + + return XSF_MC; + } + + public void setXSF_MC(String xSF_MC) { + + XSF_MC = xSF_MC; + } + + public String getXSF_NSRSBH() { + + return XSF_NSRSBH; + } + + public void setXSF_NSRSBH(String xSF_NSRSBH) { + + XSF_NSRSBH = xSF_NSRSBH; + } + + public String getORGTYPE() { + + return ORGTYPE; + } + + public void setORGTYPE(String oRGTYPE) { + + ORGTYPE = oRGTYPE; + } + + public String getXSF_YHZH() { + + return XSF_YHZH; + } + + public void setXSF_YHZH(String xSF_YHZH) { + + XSF_YHZH = xSF_YHZH; + } + + public String getORGCODE() { + + return ORGCODE; + } + + public void setORGCODE(String oRGCODE) { + + ORGCODE = oRGCODE; + } + + public String getSGBZ() { + + return SGBZ; + } + + public void setSGBZ(String sGBZ) { + + SGBZ = sGBZ; + } + + public String getBDCDZ() { + return BDCDZ; + } + + public void setBDCDZ(String BDCDZ) { + this.BDCDZ = BDCDZ; + } + + public String getZLQQ() { + return ZLQQ; + } + + public void setZLQQ(String ZLQQ) { + this.ZLQQ = ZLQQ; + } + + public String getZLQZ() { + return ZLQZ; + } + + public void setZLQZ(String ZLQZ) { + this.ZLQZ = ZLQZ; + } + + public String getKDSBZ() { + return KDSBZ; + } + + public void setKDSBZ(String KDSBZ) { + this.KDSBZ = KDSBZ; + } + + public ApplyInvoiceDetail[] getItems() { + + return items; + } + + public void setItems(ApplyInvoiceDetail[] items) { + + this.items = items; + } + + public String getTSPZ() { + return TSPZ; + } + + public void setTSPZ(String tSPZ) { + TSPZ = tSPZ; + } + + public String getALLELCPASSWORD() { + return ALLELCPASSWORD; + } + + public void setALLELCPASSWORD(String aLLELCPASSWORD) { + ALLELCPASSWORD = aLLELCPASSWORD; + } + + public String getXSF_DZ() { + return XSF_DZ; + } + + public void setXSF_DZ(String xSF_DZ) { + XSF_DZ = xSF_DZ; + } + + public String getXSF_DH() { + return XSF_DH; + } + + public void setXSF_DH(String xSF_DH) { + XSF_DH = xSF_DH; + } + + public String getXSF_YH() { + return XSF_YH; + } + + public void setXSF_YH(String xSF_YH) { + XSF_YH = xSF_YH; + } + + public String getXSF_ZH() { + return XSF_ZH; + } + + public void setXSF_ZH(String xSF_ZH) { + XSF_ZH = xSF_ZH; + } + + public String getGMF_DZ() { + return GMF_DZ; + } + + public void setGMF_DZ(String gMF_DZ) { + GMF_DZ = gMF_DZ; + } + + public String getGMF_DH() { + return GMF_DH; + } + + public void setGMF_DH(String gMF_DH) { + GMF_DH = gMF_DH; + } + + public String getGMF_YH() { + return GMF_YH; + } + + public void setGMF_YH(String gMF_YH) { + GMF_YH = gMF_YH; + } + + public String getGMF_ZH() { + return GMF_ZH; + } + + public void setGMF_ZH(String gMF_ZH) { + GMF_ZH = gMF_ZH; + } + + public String getALLELCUSERNAME() { + return ALLELCUSERNAME; + } + + public void setALLELCUSERNAME(String aLLELCUSERNAME) { + ALLELCUSERNAME = aLLELCUSERNAME; + } + + public String getLYLX() { + return LYLX; + } + + public void setLYLX(String lYLX) { + LYLX = lYLX; + } + + public String getSLSM() { + return SLSM; + } + + public void setSLSM(String sLSM) { + SLSM = sLSM; + } + + public String getZDYBZ() { + return ZDYBZ; + } + + public void setZDYBZ(String zDYBZ) { + ZDYBZ = zDYBZ; + } + + public String getTDZZSXMBH() { + return TDZZSXMBH; + } + + public void setTDZZSXMBH(String TDZZSXMBH) { + this.TDZZSXMBH = TDZZSXMBH; + } + + public ApplyInvoiceTspz[] getTspzs() { + return tspzs; + } + + public void setTspzs(ApplyInvoiceTspz[] tspzs) { + this.tspzs = tspzs; + } + + public String getWQHTBABH() { + return WQHTBABH; + } + + public void setWQHTBABH(String WQHTBABH) { + this.WQHTBABH = WQHTBABH; + } + + public String getBDCDWDM() { + return BDCDWDM; + } + + public void setBDCDWDM(String BDCDWDM) { + this.BDCDWDM = BDCDWDM; + } + + public Double getHDJSJG() { + return HDJSJG; + } + + public void setHDJSJG(Double HDJSJG) { + this.HDJSJG = HDJSJG; + } + + public Double getSJCJHSJE() { + return SJCJHSJE; + } + + public void setSJCJHSJE(Double SJCJHSJE) { + this.SJCJHSJE = SJCJHSJE; + } + + public String getBXDH() { + return BXDH; + } + + public void setBXDH(String BXDH) { + this.BXDH = BXDH; + } + + public String getCPHCBDJH() { + return CPHCBDJH; + } + + public void setCPHCBDJH(String CPHCBDJH) { + this.CPHCBDJH = CPHCBDJH; + } + + public String getSKSSQ() { + return SKSSQ; + } + + public void setSKSSQ(String SKSSQ) { + this.SKSSQ = SKSSQ; + } + + public Double getDSCCSJE() { + return DSCCSJE; + } + + public void setDSCCSJE(Double DSCCSJE) { + this.DSCCSJE = DSCCSJE; + } + + public Double getZNJ() { + return ZNJ; + } + + public void setZNJ(Double ZNJ) { + this.ZNJ = ZNJ; + } + + public Double getJEHJ() { + return JEHJ; + } + + public void setJEHJ(Double JEHJ) { + this.JEHJ = JEHJ; + } + + public String getCJH() { + return CJH; + } + + public void setCJH(String CJH) { + this.CJH = CJH; + } + + public ApplyInvoiceCepz[] getCepzs() { + return cepzs; + } + + public void setCepzs(ApplyInvoiceCepz[] cepzs) { + this.cepzs = cepzs; + } + public String getKQYSSSXBGGLBM() { + return KQYSSSXBGGLBM; + } + + public void setKQYSSSXBGGLBM(String kQYSSSXBGGLBM) { + KQYSSSXBGGLBM = kQYSSSXBGGLBM; + } + } + + class ApplyInvoiceDetail { + + // 单位 + private int FPHXZ; + + // 单位 + private String DW; + + // 项目名称 + private String XMMC; + + // 项目名称 + private String XMBM; + + // 规格型号 + private String GGXH; + + // 项目数量 + private Double XMSL; + + // 项目单价 + private Double XMDJ; + + // 项目金额 + private Double XMJE; + + // 税率 + private Double SL; + + // 税额 + private Double SE; + + // 项目价税合计 + private Double XMJSHJ; + + // 商品编码 + private String SPBM; + + // 零税率标识 + private String LSLBS; + + // 行号 + private String HH; + + // 折扣行行号 + private String ZKHHH; + + // 商品自行编码 + private String ZXBM; + + // 销售优惠标识 + private int YHZCBS; + + // 优惠政策说明 + private String ZZSTSGL; + + // 扣除额 + private Double KCE; + + private ApplyInvoiceMotor detailMotor; + + public String getDW() { + + return DW; + } + + public void setDW(String dW) { + + DW = dW; + } + + public String getXMMC() { + + return XMMC; + } + + public void setXMMC(String xMMC) { + + XMMC = xMMC; + } + + public String getGGXH() { + + return GGXH; + } + + public void setGGXH(String gGXH) { + + GGXH = gGXH; + } + + public int getFPHXZ() { + + return FPHXZ; + } + + public void setFPHXZ(int fPHXZ) { + + FPHXZ = fPHXZ; + } + + public Double getXMSL() { + + return XMSL; + } + + public void setXMSL(Double xMSL) { + + XMSL = xMSL; + } + + public Double getXMDJ() { + + return XMDJ; + } + + public void setXMDJ(Double xMDJ) { + + XMDJ = xMDJ; + } + + public Double getXMJE() { + + return XMJE; + } + + public void setXMJE(Double xMJE) { + + XMJE = xMJE; + } + + public Double getSL() { + + return SL; + } + + public void setSL(Double sL) { + + SL = sL; + } + + public Double getSE() { + + return SE; + } + + public void setSE(Double sE) { + + SE = sE; + } + + public Double getXMJSHJ() { + + return XMJSHJ; + } + + public void setXMJSHJ(Double xMJSHJ) { + + XMJSHJ = xMJSHJ; + } + + public String getSPBM() { + + return SPBM; + } + + public void setSPBM(String sPBM) { + + SPBM = sPBM; + } + + public String getLSLBS() { + + return LSLBS; + } + + public void setLSLBS(String lSLBS) { + + LSLBS = lSLBS; + } + + public String getHH() { + + return HH; + } + + public void setHH(String hH) { + + HH = hH; + } + + public String getZKHHH() { + + return ZKHHH; + } + + public void setZKHHH(String zKHHH) { + + ZKHHH = zKHHH; + } + + public String getZXBM() { + + return ZXBM; + } + + public void setZXBM(String zXBM) { + + ZXBM = zXBM; + } + + public int getYHZCBS() { + + return YHZCBS; + } + + public void setYHZCBS(int yHZCBS) { + + YHZCBS = yHZCBS; + } + + public String getZZSTSGL() { + + return ZZSTSGL; + } + + public void setZZSTSGL(String zZSTSGL) { + + ZZSTSGL = zZSTSGL; + } + + public Double getKCE() { + + return KCE; + } + + public void setKCE(Double kCE) { + + KCE = kCE; + } + + public String getXMBM() { + + return XMBM; + } + + public void setXMBM(String xMBM) { + + XMBM = xMBM; + } + + public ApplyInvoiceMotor getDetailMotor() { + return detailMotor; + } + + public void setDetailMotor(ApplyInvoiceMotor detailMotor) { + this.detailMotor = detailMotor; + } + } + + class Notify { + + private String fpqqlsh; + private String address; + private String title; + private String content; + + public String getFpqqlsh() { + + return fpqqlsh; + } + + public void setFpqqlsh(String fpqqlsh) { + + this.fpqqlsh = fpqqlsh; + } + + public String getAddress() { + + return address; + } + + public void setAddress(String address) { + + this.address = address; + } + + public String getTitle() { + + return title; + } + + public void setTitle(String title) { + + this.title = title; + } + + public String getContent() { + + return content; + } + + public void setContent(String content) { + + this.content = content; + } + } + + class ApplyInvoiceMotor{ + + //产权证书编号 + private String CQZSBH; + + //建筑项目名称 + private String JZXMMC; + + //建筑服务发生地 + private String JZFWFSD; + // 产地 + private String CD; + + // 车架号码 + private String CJHM; + + // 车辆类型 + private String CLLX; + + // 产牌型号 + private String CPXH; + + // 生产企业名称 + private String SCQYMC; + + // 限乘人数 + private String XCRS; + + //合格证号 + private String HGZH; + + + //发动机号码 + private String FDJHM; + + + //吨位 + private String DUWEI; + + public String getHGZH() { + return HGZH; + } + + public void setHGZH(String HGZH) { + this.HGZH = HGZH; + } + + public String getFDJHM() { + return FDJHM; + } + + public void setFDJHM(String FDJHM) { + this.FDJHM = FDJHM; + } + + public String getDUWEI() { + return DUWEI; + } + + public void setDUWEI(String DUWEI) { + this.DUWEI = DUWEI; + } + + + + public String getCD() { + return CD; + } + + public void setCD(String CD) { + this.CD = CD; + } + + public String getCJHM() { + return CJHM; + } + + public void setCJHM(String CJHM) { + this.CJHM = CJHM; + } + + public String getCLLX() { + return CLLX; + } + + public void setCLLX(String CLLX) { + this.CLLX = CLLX; + } + + public String getCPXH() { + return CPXH; + } + + public void setCPXH(String CPXH) { + this.CPXH = CPXH; + } + + + public String getSCQYMC() { + return SCQYMC; + } + + public void setSCQYMC(String SCQYMC) { + this.SCQYMC = SCQYMC; + } + + public String getXCRS() { + return XCRS; + } + + public void setXCRS(String XCRS) { + this.XCRS = XCRS; + } + + public String getCQZSBH() { + return CQZSBH; + } + + public void setCQZSBH(String CQZSBH) { + this.CQZSBH = CQZSBH; + } + + public String getJZXMMC() { + return JZXMMC; + } + + public void setJZXMMC(String JZXMMC) { + this.JZXMMC = JZXMMC; + } + + public String getJZFWFSD() { + return JZFWFSD; + } + + public void setJZFWFSD(String JZFWFSD) { + this.JZFWFSD = JZFWFSD; + } + } + + class ApplyInvoiceTspz{ + + //运输明细序号 + private String YSMXXH; + + //运输工具种类 + private String YSGJZL; + + //运输工具牌号 + private String YSGJPH; + + //起运地 + private String QYD; + + //到达地 + private String DDD; + + //货物运输名称 + private String YSHWMC; + + //出行人序号 + private String CXRXH; + + //出行人 + private String CXR; + + //出行日期 + private String CHUXRQ; + + //出行人证件类型代码 + private String CXRZJLXDM; + + //身份证件号码 + private String SFZJHM; + + //出发地 + private String CFD; + + //到达地 + private String LKDDD; + + //座位等级若交通工具为火车、飞机、船舶,则该要素为必填,其他选项选填; + //---交通工具为火车:一等座、二等座、软席(软座、软卧)、硬席(硬座、硬卧) + // ---交通工作为飞机: 经济舱、头等舱、公务舱 + //---交通工具为船舶: 一等舱、二等舱 、三等舱 + private String ZWDJ; + + //交通工具类型代码 + private String JTGJLXDM; + + public String getYSMXXH() { + return YSMXXH; + } + + public void setYSMXXH(String YSMXXH) { + this.YSMXXH = YSMXXH; + } + + public String getYSGJZL() { + return YSGJZL; + } + + public void setYSGJZL(String YSGJZL) { + this.YSGJZL = YSGJZL; + } + + public String getYSGJPH() { + return YSGJPH; + } + + public void setYSGJPH(String YSGJPH) { + this.YSGJPH = YSGJPH; + } + + public String getQYD() { + return QYD; + } + + public void setQYD(String QYD) { + this.QYD = QYD; + } + + public String getDDD() { + return DDD; + } + + public void setDDD(String DDD) { + this.DDD = DDD; + } + + public String getYSHWMC() { + return YSHWMC; + } + + public void setYSHWMC(String YSHWMC) { + this.YSHWMC = YSHWMC; + } + + public String getCXRXH() { + return CXRXH; + } + + public void setCXRXH(String CXRXH) { + this.CXRXH = CXRXH; + } + + public String getCXR() { + return CXR; + } + + public void setCXR(String CXR) { + this.CXR = CXR; + } + + public String getCHUXRQ() { + return CHUXRQ; + } + + public void setCHUXRQ(String CHUXRQ) { + this.CHUXRQ = CHUXRQ; + } + + public String getCXRZJLXDM() { + return CXRZJLXDM; + } + + public void setCXRZJLXDM(String CXRZJLXDM) { + this.CXRZJLXDM = CXRZJLXDM; + } + + public String getSFZJHM() { + return SFZJHM; + } + + public void setSFZJHM(String SFZJHM) { + this.SFZJHM = SFZJHM; + } + + public String getCFD() { + return CFD; + } + + public void setCFD(String CFD) { + this.CFD = CFD; + } + + public String getLKDDD() { + return LKDDD; + } + + public void setLKDDD(String LKDDD) { + this.LKDDD = LKDDD; + } + + public String getZWDJ() { + return ZWDJ; + } + + public void setZWDJ(String ZWDJ) { + this.ZWDJ = ZWDJ; + } + + public String getJTGJLXDM() { + return JTGJLXDM; + } + + public void setJTGJLXDM(String JTGJLXDM) { + this.JTGJLXDM = JTGJLXDM; + } + } + + class ApplyInvoiceCepz{ + + //序号 + private String XH; + + //凭证类型 + private String PZLX; + + //全电发票号码 + private String FPHM; + + //非全电发票代码 + private String FPDM; + + //非全电发票号码 + private String ZZFPHM; + + //凭证号码 + private String PZHM; + + //开票日期 + private String KJRQ; + + //合计金额 + private Double HJJE; + + //扣除额 + private Double KCE; + + //备注 + private String BZ; + + //录入方式 + private String LY; + + //本次扣除金额 + private Double BCKCJE; + + //凭证合计金额 + private Double PZHJJE; + + public String getXH() { + return XH; + } + + public void setXH(String XH) { + this.XH = XH; + } + + public String getPZLX() { + return PZLX; + } + + public void setPZLX(String PZLX) { + this.PZLX = PZLX; + } + + public String getFPHM() { + return FPHM; + } + + public void setFPHM(String FPHM) { + this.FPHM = FPHM; + } + + public String getFPDM() { + return FPDM; + } + + public void setFPDM(String FPDM) { + this.FPDM = FPDM; + } + + public String getZZFPHM() { + return ZZFPHM; + } + + public void setZZFPHM(String ZZFPHM) { + this.ZZFPHM = ZZFPHM; + } + + public String getPZHM() { + return PZHM; + } + + public void setPZHM(String PZHM) { + this.PZHM = PZHM; + } + + public String getKJRQ() { + return KJRQ; + } + + public void setKJRQ(String KJRQ) { + this.KJRQ = KJRQ; + } + + public Double getHJJE() { + return HJJE; + } + + public void setHJJE(Double HJJE) { + this.HJJE = HJJE; + } + + public Double getKCE() { + return KCE; + } + + public void setKCE(Double KCE) { + this.KCE = KCE; + } + + public String getBZ() { + return BZ; + } + + public void setBZ(String BZ) { + this.BZ = BZ; + } + + public String getLY() { + return LY; + } + + public void setLY(String LY) { + this.LY = LY; + } + + public Double getBCKCJE() { + return BCKCJE; + } + + public void setBCKCJE(Double BCKCJE) { + this.BCKCJE = BCKCJE; + } + + public Double getPZHJJE() { + return PZHJJE; + } + + public void setPZHJJE(Double PZHJJE) { + this.PZHJJE = PZHJJE; + } + } + +} diff --git a/imag/src/public/nc/dto/imag/invoice/PInvoice.java b/imag/src/public/nc/dto/imag/invoice/PInvoice.java new file mode 100644 index 0000000..c02241f --- /dev/null +++ b/imag/src/public/nc/dto/imag/invoice/PInvoice.java @@ -0,0 +1,975 @@ +package nc.dto.imag.invoice; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Arrays; + +import nc.dto.imag.boot.IEncode; +import nc.vo.pub.SuperVO; + +/** + * 增值税普通发票 + * + * @author gaozhdf@yonyou.com + * + */ +public class PInvoice extends SuperVO implements Serializable ,IEncode{ + + private static final long serialVersionUID = 1L; + + // 发票申请流水号 + private String applyNumber; + + // 采集方式 1、电子发票 2、ocr方式发票 3、excel + private int cjfs; + + // 来源ID + private String lyid; + + // 来源NO + private String srcBillNo; + + // 红字信息表编号 + private String hzxxbbh; + + // 备注 + private String bz; + + // 复核人 + private String fhr; + + // 发票代码 + private String fpDm; + + // 发票号码 + private String fpHm; + + // 发票明文 + private String fpMw; + + // 发票类型 + private String fplx; + + // 发票介质 + private String fpjz; + + // 作废标志 + private String zfbz; + + // 购买方地址电话 + private String gmfDzdh; + + // 购买方名称 + private String gmfMc; + + // 购买方纳税人识别号 + private String gmfNsrsbh; + + // 购买方银行账号 + private String gmfYhzh; + + // 合计金额 + private BigDecimal hjje; + + // 合计税额 + private BigDecimal hjse; + + // 税控设备编号 + private String jqbh; + + // 价税合计 + private BigDecimal jshj; + + // 校验码 + private String jym; + + // 开票类型 + private String kplx; + + // 开票人 + private String kpr; + + // 开票日期 + private String kprq; + + // 收款人 + private String skr; + + // 销售方地址电话 + private String xsfDzdh; + + // 销售方名称 + private String xsfMc; + + // 销售方纳税人识别号 + private String xsfNsrsbh; + + // 销售方银行账号 + private String xsfYhzh; + + // 二维码 + private String ewm; + + // 编码版本号 + private String bmbBbh; + + // 开票点编码 + private String orgcode; + + // 收购标志 + private String sgbz; + + // 原发票代码 + private String yfpDm; + + // 原发票号码 + private String yfpHm; + + // 来源类型 + private String lylx; + + //税务机关代码 + private String swjgdm; + + //税务机关名称 + private String swjgmc; + + //完税凭证号码 + private String wspzh; + + //机动车专票特殊参数 + private String tspz; + + //发票下载地址 + private String shareurl; + + //发票下载提取码 + private String sharecode; + + //税率说明 + private String slsm; + + //红冲原因 + private String hcyy; + + //电子税务局用户名 + private String allelcusername; + + //电子税务局密码 + private String allelcpassword; + + //销售方地址 + private String xsf_dz; + + //销售方电话 + private String xsf_dh; + + //销售方开户行 + private String xsf_yh; + + //销售方银行账号 + private String xsf_zh; + + //购买方地址 + private String gmf_dz; + + //购买方电话 + private String gmf_dh; + + //购买方开户行 + private String gmf_yh; + + //购买方银行账号 + private String gmf_zh; + + //是否被红冲: Y-已红冲,N-未红冲 + private String bred; + + //自定义备注 + private String zdybz; + + //征税方式 + private String zsfs; + + //不动产租赁地址 + private String bdcdz; + + //租赁日期止 + private String zlqz; + + //是否跨地址标志 + private String kdsbz; + + //租赁日期起 + private String zlqq; + + //土地增值税项目编号 + private String tdzzsxmbh; + + //网签合同备案编号 + private String wqhtbabh; + + //不动产单元代码 + private String bdcdwdm; + + //核定计税价格 + private BigDecimal hdjsjg; + + //实际成交含税金额 + private BigDecimal sjcjhsje; + + //保险单号 + private String bxdh; + + //车牌号/船舶登记号 + private String cphcbdjh; + + //税款所属期yyyy-MM+空格+yyyy-MM + private String skssq; + + //代收车船税金额 + private BigDecimal dsccsje; + + //滞纳金 + private BigDecimal znj; + + //金额合计 + private BigDecimal jehj; + + //车辆识别代码/车架号码 + private String cjh; + + // 发票明细 + private PInvoiceDetail[] items; + //跨区域涉税事项报验管理编号 + private String kqysssxbgglbm; + + //差额开票 + private PInvoiceCepz[] cepzs; + + private PInvoiceTspz[] tspzs; + + public String getApplyNumber() { + + return applyNumber; + } + + public void setApplyNumber(String applyNumber) { + + this.applyNumber = applyNumber; + } + + public String getLyid() { + + return lyid; + } + + public void setLyid(String lyid) { + + this.lyid = lyid; + } + + public String getBz() { + + return bz; + } + + public void setBz(String bz) { + + this.bz = bz; + } + + public String getFhr() { + + return fhr; + } + + public void setFhr(String fhr) { + + this.fhr = fhr; + } + + public String getFpDm() { + + return fpDm; + } + + public void setFpDm(String fpDm) { + + this.fpDm = fpDm; + } + + public String getFpHm() { + + return fpHm; + } + + public void setFpHm(String fpHm) { + + this.fpHm = fpHm; + } + + public String getFpMw() { + + return fpMw; + } + + public void setFpMw(String fpMw) { + + this.fpMw = fpMw; + } + + public String getFplx() { + + return fplx; + } + + public void setFplx(String fplx) { + + this.fplx = fplx; + } + + public String getFpjz() { + + return fpjz; + } + + public void setFpjz(String fpjz) { + + this.fpjz = fpjz; + } + + public String getZfbz() { + + return zfbz; + } + + public void setZfbz(String zfbz) { + + this.zfbz = zfbz; + } + + public String getGmfDzdh() { + + return gmfDzdh; + } + + public void setGmfDzdh(String gmfDzdh) { + + this.gmfDzdh = gmfDzdh; + } + + public String getGmfMc() { + + return gmfMc; + } + + public void setGmfMc(String gmfMc) { + + this.gmfMc = gmfMc; + } + + public String getGmfNsrsbh() { + + return gmfNsrsbh; + } + + public void setGmfNsrsbh(String gmfNsrsbh) { + + this.gmfNsrsbh = gmfNsrsbh; + } + + public String getGmfYhzh() { + + return gmfYhzh; + } + + public void setGmfYhzh(String gmfYhzh) { + + this.gmfYhzh = gmfYhzh; + } + + public BigDecimal getHjje() { + + return hjje; + } + + public void setHjje(BigDecimal hjje) { + + this.hjje = hjje; + } + + public BigDecimal getHjse() { + + return hjse; + } + + public void setHjse(BigDecimal hjse) { + + this.hjse = hjse; + } + + public String getJqbh() { + + return jqbh; + } + + public void setJqbh(String jqbh) { + + this.jqbh = jqbh; + } + + public BigDecimal getJshj() { + + return jshj; + } + + public void setJshj(BigDecimal jshj) { + + this.jshj = jshj; + } + + public String getJym() { + + return jym; + } + + public void setJym(String jym) { + + this.jym = jym; + } + + public String getKplx() { + + return kplx; + } + + public void setKplx(String kplx) { + + this.kplx = kplx; + } + + public String getKpr() { + + return kpr; + } + + public void setKpr(String kpr) { + + this.kpr = kpr; + } + + public String getKprq() { + + return kprq; + } + + public void setKprq(String kprq) { + + this.kprq = kprq; + } + + public String getSkr() { + + return skr; + } + + public void setSkr(String skr) { + + this.skr = skr; + } + + public String getXsfDzdh() { + + return xsfDzdh; + } + + public void setXsfDzdh(String xsfDzdh) { + + this.xsfDzdh = xsfDzdh; + } + + public String getXsfMc() { + + return xsfMc; + } + + public void setXsfMc(String xsfMc) { + + this.xsfMc = xsfMc; + } + + public String getXsfNsrsbh() { + + return xsfNsrsbh; + } + + public void setXsfNsrsbh(String xsfNsrsbh) { + + this.xsfNsrsbh = xsfNsrsbh; + } + + public String getXsfYhzh() { + + return xsfYhzh; + } + + public void setXsfYhzh(String xsfYhzh) { + + this.xsfYhzh = xsfYhzh; + } + + public String getEwm() { + + return ewm; + } + + public void setEwm(String ewm) { + + this.ewm = ewm; + } + + public String getBmbBbh() { + + return bmbBbh; + } + + public void setBmbBbh(String bmbBbh) { + + this.bmbBbh = bmbBbh; + } + + public String getOrgcode() { + + return orgcode; + } + + public void setOrgcode(String orgcode) { + + this.orgcode = orgcode; + } + + public String getSgbz() { + + return sgbz; + } + + public void setSgbz(String sgbz) { + + this.sgbz = sgbz; + } + + public String getYfpDm() { + return yfpDm; + } + + public void setYfpDm(String yfpDm) { + this.yfpDm = yfpDm; + } + + public String getYfpHm() { + return yfpHm; + } + + public void setYfpHm(String yfpHm) { + this.yfpHm = yfpHm; + } + + public String getLylx() { + return lylx; + } + + public void setLylx(String lylx) { + this.lylx = lylx; + } + + public PInvoiceDetail[] getItems() { + + return items; + } + + public void setItems(PInvoiceDetail[] items) { + + this.items = items; + } + + public String getSrcBillNo() { + + return srcBillNo; + } + + public void setSrcBillNo(String srcBillNo) { + + this.srcBillNo = srcBillNo; + } + + public String getHzxxbbh() { + + return hzxxbbh; + } + + public void setHzxxbbh(String hzxxbbh) { + + this.hzxxbbh = hzxxbbh; + } + + public int getCjfs() { + + return cjfs; + } + + public void setCjfs(int cjfs) { + + this.cjfs = cjfs; + } + + public String getSwjgdm() { + return swjgdm; + } + + public void setSwjgdm(String swjgdm) { + this.swjgdm = swjgdm; + } + + public String getSwjgmc() { + return swjgmc; + } + + public void setSwjgmc(String swjgmc) { + this.swjgmc = swjgmc; + } + + public String getWspzh() { + return wspzh; + } + + public void setWspzh(String wspzh) { + this.wspzh = wspzh; + } + + public String getTspz() { + return tspz; + } + + public void setTspz(String tspz) { + this.tspz = tspz; + } + + + public String getShareurl() { + return shareurl; + } + + public void setShareurl(String shareurl) { + this.shareurl = shareurl; + } + + public String getSharecode() { + return sharecode; + } + + public void setSharecode(String sharecode) { + this.sharecode = sharecode; + } + + + public String getSlsm() { + return slsm; + } + + public void setSlsm(String slsm) { + this.slsm = slsm; + } + + public String getHcyy() { + return hcyy; + } + + public void setHcyy(String hcyy) { + this.hcyy = hcyy; + } + + public String getAllelcusername() { + return allelcusername; + } + + public void setAllelcusername(String allelcusername) { + this.allelcusername = allelcusername; + } + + public String getAllelcpassword() { + return allelcpassword; + } + + public void setAllelcpassword(String allelcpassword) { + this.allelcpassword = allelcpassword; + } + + public String getXsf_dz() { + return xsf_dz; + } + + public void setXsf_dz(String xsf_dz) { + this.xsf_dz = xsf_dz; + } + + public String getXsf_dh() { + return xsf_dh; + } + + public void setXsf_dh(String xsf_dh) { + this.xsf_dh = xsf_dh; + } + + public String getXsf_yh() { + return xsf_yh; + } + + public void setXsf_yh(String xsf_yh) { + this.xsf_yh = xsf_yh; + } + + public String getXsf_zh() { + return xsf_zh; + } + + public void setXsf_zh(String xsf_zh) { + this.xsf_zh = xsf_zh; + } + + public String getGmf_dz() { + return gmf_dz; + } + + public void setGmf_dz(String gmf_dz) { + this.gmf_dz = gmf_dz; + } + + public String getGmf_dh() { + return gmf_dh; + } + + public void setGmf_dh(String gmf_dh) { + this.gmf_dh = gmf_dh; + } + + public String getGmf_yh() { + return gmf_yh; + } + + public void setGmf_yh(String gmf_yh) { + this.gmf_yh = gmf_yh; + } + + public String getGmf_zh() { + return gmf_zh; + } + + public void setGmf_zh(String gmf_zh) { + this.gmf_zh = gmf_zh; + } + + public String getBred() { + return bred; + } + + public void setBred(String bred) { + this.bred = bred; + } + + public String getZdybz() { + return zdybz; + } + + public void setZdybz(String zdybz) { + this.zdybz = zdybz; + } + + + public String getZsfs() { + return zsfs; + } + + public void setZsfs(String zsfs) { + this.zsfs = zsfs; + } + + public String getBdcdz() { + return bdcdz; + } + + public void setBdcdz(String bdcdz) { + this.bdcdz = bdcdz; + } + + public String getZlqz() { + return zlqz; + } + + public void setZlqz(String zlqz) { + this.zlqz = zlqz; + } + + public String getKdsbz() { + return kdsbz; + } + + public void setKdsbz(String kdsbz) { + this.kdsbz = kdsbz; + } + + public String getZlqq() { + return zlqq; + } + + public void setZlqq(String zlqq) { + this.zlqq = zlqq; + } + + public String getTdzzsxmbh() { + return tdzzsxmbh; + } + + public void setTdzzsxmbh(String tdzzsxmbh) { + this.tdzzsxmbh = tdzzsxmbh; + } + + public String getWqhtbabh() { + return wqhtbabh; + } + + public void setWqhtbabh(String wqhtbabh) { + this.wqhtbabh = wqhtbabh; + } + + public String getBdcdwdm() { + return bdcdwdm; + } + + public void setBdcdwdm(String bdcdwdm) { + this.bdcdwdm = bdcdwdm; + } + + public BigDecimal getHdjsjg() { + return hdjsjg; + } + + public void setHdjsjg(BigDecimal hdjsjg) { + this.hdjsjg = hdjsjg; + } + + public BigDecimal getSjcjhsje() { + return sjcjhsje; + } + + public void setSjcjhsje(BigDecimal sjcjhsje) { + this.sjcjhsje = sjcjhsje; + } + + public String getBxdh() { + return bxdh; + } + + public void setBxdh(String bxdh) { + this.bxdh = bxdh; + } + + public String getCphcbdjh() { + return cphcbdjh; + } + + public void setCphcbdjh(String cphcbdjh) { + this.cphcbdjh = cphcbdjh; + } + + public String getSkssq() { + return skssq; + } + + public void setSkssq(String skssq) { + this.skssq = skssq; + } + + public BigDecimal getDsccsje() { + return dsccsje; + } + + public void setDsccsje(BigDecimal dsccsje) { + this.dsccsje = dsccsje; + } + + public BigDecimal getZnj() { + return znj; + } + + public void setZnj(BigDecimal znj) { + this.znj = znj; + } + + public BigDecimal getJehj() { + return jehj; + } + + public void setJehj(BigDecimal jehj) { + this.jehj = jehj; + } + + public String getCjh() { + return cjh; + } + + public void setCjh(String cjh) { + this.cjh = cjh; + } + + public PInvoiceCepz[] getCepzs() { + return cepzs; + } + + public void setCepzs(PInvoiceCepz[] cepzs) { + this.cepzs = cepzs; + } + + public PInvoiceTspz[] getTspzs() { + return tspzs; + } + + public void setTspzs(PInvoiceTspz[] tspzs) { + this.tspzs = tspzs; + } + public String getKqysssxbgglbm() { + return kqysssxbgglbm; + } + + public void setKqysssxbgglbm(String kqysssxbgglbm) { + this.kqysssxbgglbm = kqysssxbgglbm; + } + + @Override + public String toString() { + + return "PInvoice [applyNumber=" + applyNumber + ", cjfs=" + cjfs + ", lyid=" + lyid + ", srcBillNo=" + srcBillNo + + ", hzxxbbh=" + hzxxbbh + ", bz=" + bz + ", fhr=" + fhr + ", fpDm=" + fpDm + ", fpHm=" + fpHm + + ", fpMw=" + fpMw + ", fplx=" + fplx + ", fpjz=" + fpjz + ", zfbz=" + zfbz + ", gmfDzdh=" + gmfDzdh + + ", gmfMc=" + gmfMc + ", gmfNsrsbh=" + gmfNsrsbh + ", gmfYhzh=" + gmfYhzh + ", hjje=" + hjje + + ", hjse=" + hjse + ", jqbh=" + jqbh + ", jshj=" + jshj + ", jym=" + jym + ", kplx=" + kplx + ", kpr=" + + kpr + ", kprq=" + kprq + ", skr=" + skr + ", xsfDzdh=" + xsfDzdh + ", xsfMc=" + xsfMc + ", xsfNsrsbh=" + + xsfNsrsbh + ", xsfYhzh=" + xsfYhzh + ", ewm=" + ewm + ", bmbBbh=" + bmbBbh + ", orgcode=" + orgcode + + ", sgbz=" + sgbz + ", swjgdm=" + swjgdm + ",swjgmc=" + swjgmc + ",wspzh =" + wspzh + ",shareurl=" +shareurl + + ",sharecode=" + sharecode + ",slsm=" + slsm + ",hcyy=" + hcyy + ",zsfs=" + zsfs+ ",bred=" + bred + ",items=" + Arrays.toString(items) + "]"; + } + + /** + * getDecimalValue + * + * @param value + * @return + */ + public String getDecimalValue(BigDecimal value) { + + if (value != null) { + return value.toString(); + } + return null; + } +} diff --git a/imag/src/public/nc/vo/imag/verify/InvoiceTypeEnum.java b/imag/src/public/nc/vo/imag/verify/InvoiceTypeEnum.java new file mode 100644 index 0000000..be1b36f --- /dev/null +++ b/imag/src/public/nc/vo/imag/verify/InvoiceTypeEnum.java @@ -0,0 +1,192 @@ +package nc.vo.imag.verify; + +import nc.dto.imag.invoice.PInvoice; + +/** + * 发票类型枚举 + * + * @author gaozhdf@yonyou.com + * + */ +public enum InvoiceTypeEnum { + + /** + * 增值税电子普通发票 + */ + ZZSDZPTFP(1, PInvoice.class), + /** + * 增值税电子专用发票 + */ + ZZSDZZYFP(2, PInvoice.class), + /** + * 增值税普通发票 + */ + ZZSPTFP(3, PInvoice.class), + /** + * 增值税专用发票 + */ + ZZSZYFP(4, PInvoice.class), + /** + * 增值税电子普通发票(成品油) + */ + ZZSDZPTFP_CPY(8, PInvoice.class), + /** + * 成品油普通发票(卷式) + */ + CPYPTFP_JS(9, PInvoice.class), + /** + * 成品油普通发票 + */ + CPYPTFP(10, PInvoice.class), + /** + * 成品油专用发票 + */ + CPYZYFP(11, PInvoice.class), + /** + * 增值税普通发票(卷式) + */ + ZZSPTFP_JS(12, PInvoice.class), + /** + * 通行费增值税电子普通发票 + */ + TXFZZSDZPTFP(14, PInvoice.class), + /** + * 机打发票 + */ + JDFP(15, null), + /** + * 火车票 + */ + HCP(16, null), + + /** + * 航空客票 + */ + HKKP(17, null), + /** + * 客运汽车票 + */ + KYQCP(18, null), + + /** + * 出租车票 + */ + CZCP(19, null), + + /** + * 过路费票 + */ + GLFP(20, null), + + /** + * 定额发票 + */ + DEFP(21, null), + //@全电发票@@特殊票种电子凭证@begin + /** + * 电子发票-增值税专用发票 + */ + DZFP_ZZSZYFP(31, null), + + /** + * 电子发票-增值税普通发票 + */ + DZFP_ZZSPTFP(32, null), + /** + * 纸质发票(增值税专用发票) + */ + ZZFP_ZZSZYFP(33, null), + + /** + * 纸质发票(普通发票) + */ + ZZFP_ZZSPTFP(34, null), + //@全电发票@@特殊票种电子凭证@end + /** + * 增值税专用发票(机动车) + */ + JDCZYFP(99,PInvoice.class); + + /** + * 类型编码 + */ + private int typeCode; + private Class clazz; + + private InvoiceTypeEnum(int typeCode, Class clazz) { + + this.typeCode = typeCode; + this.clazz = clazz; + } + + public int getTypeCode() { + + return typeCode; + } + + public Class getClazz() { + + return clazz; + } + + /** + * getTypeEnumByTypeCode 根据类型编码获取当前类型 + * + * @param typeCode + * @return + */ + public static InvoiceTypeEnum getTypeEnumByTypeCode(int typeCode) { + + InvoiceTypeEnum[] items = InvoiceTypeEnum.values(); + for (int i = 0; i < items.length; i++) { + if (items[i].getTypeCode() == typeCode) { + return items[i]; + } + } + return null; + } + + /** + * + * @Description 判断是否是纸质发票 + * + * @param typeCode + * @return + */ + public static boolean isPaperInvoice(int typeCode) { + + if (InvoiceTypeEnum.ZZSPTFP.getTypeCode() == typeCode || InvoiceTypeEnum.ZZSZYFP.getTypeCode() == typeCode + || InvoiceTypeEnum.CPYPTFP_JS.getTypeCode() == typeCode + || InvoiceTypeEnum.CPYPTFP.getTypeCode() == typeCode + || InvoiceTypeEnum.CPYZYFP.getTypeCode() == typeCode + || InvoiceTypeEnum.ZZSPTFP_JS.getTypeCode() == typeCode + //@全电发票@@特殊票种电子凭证@begin + || InvoiceTypeEnum.ZZFP_ZZSZYFP.getTypeCode() == typeCode + || InvoiceTypeEnum.ZZFP_ZZSPTFP.getTypeCode() == typeCode) + //@全电发票@@特殊票种电子凭证@end + { + return true; + } + + return false; + } + + /** + * + * @Description 判断是否是电子发票 + * + * @param typeCode + * @return + */ + public static boolean isEInvoice(int typeCode) { + + if (InvoiceTypeEnum.ZZSDZPTFP.getTypeCode() == typeCode || InvoiceTypeEnum.ZZSDZZYFP.getTypeCode() == typeCode + || InvoiceTypeEnum.ZZSDZPTFP_CPY.getTypeCode() == typeCode + || InvoiceTypeEnum.TXFZZSDZPTFP.getTypeCode() == typeCode) + { + return true; + } + + return false; + } +} diff --git a/sscivm/METADATA/sscivm_ivapplication.bmf b/sscivm/METADATA/sscivm_ivapplication.bmf new file mode 100644 index 0000000..4a1383c --- /dev/null +++ b/sscivm/METADATA/sscivm_ivapplication.bmf @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6c8722b9-911a-489b-8d0d-18bd3734fcf6 + 5205ef20-5eae-4c75-bad8-16639152e622 + 1265ec85-b87b-4158-8851-0fb0e85526ee + 25011443-1caf-4779-9357-3122495a4d79 + 60bdf1fb-95e3-43dc-8feb-f874de9293eb + 2b226ae1-aad9-4abe-a405-36bcacaa94a8 + 2fd714f0-b6b0-4aeb-906e-ead92767ce32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ca510be7-0329-4e1f-9ca9-b9d0a6d71ede + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sscivm/src/public/nc/bs/sscivm/ivsale/util/InvoiceTransferUtil.java b/sscivm/src/public/nc/bs/sscivm/ivsale/util/InvoiceTransferUtil.java new file mode 100644 index 0000000..e110011 --- /dev/null +++ b/sscivm/src/public/nc/bs/sscivm/ivsale/util/InvoiceTransferUtil.java @@ -0,0 +1,1692 @@ +package nc.bs.sscivm.ivsale.util; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import nc.bs.dao.BaseDAO; +import nc.bs.framework.common.InvocationInfoProxy; +import nc.bs.framework.common.NCLocator; +import nc.bs.sscivm.ivsale.ivaconst.IVAWebConst; +import nc.bs.sscivm.ivsale.relation.bp.IVApplicationRelationVODeleteBP; +import nc.bs.sscivm.ivsale.relation.bp.IVApplicationRelationVOInsertBP; +import nc.bs.sscivm.ivsale.splitmerge.util.TransSpiltMergePksUtil; +import nc.bs.sscivm.logger.SSCIVMLogger; +import nc.dto.imag.boot.RequestInfo; +import nc.dto.imag.boot.ResponseInfo; +import nc.dto.imag.invoice.PInvoice; +import nc.dto.imag.invoice.PInvoiceCepz; +import nc.dto.imag.invoice.PInvoiceDetail; +import nc.dto.imag.invoice.PInvoiceSDetail; +import nc.dto.imag.invoice.PInvoiceTspz; +import nc.dto.imag.invoice.tax.InvalidCommonRequest; +import nc.dto.imag.invoice.tax.InvalidCommonResponse; +import nc.dto.imag.invoice.tax.TaxCommonResponse; +import nc.dto.imag.invoice.tax.apply.InvoiceApplyCommonRequest; +import nc.dto.imag.invoice.tax.apply.InvoiceApplyCommonResponse; +import nc.dto.imag.invoice.tax.apply.InvoiceApplyStatusCallBackRequest; +import nc.dto.imag.invoice.tax.apply.InvoiceApplyStatusCommonRequest; +import nc.dto.imag.invoice.tax.invoicebill.InvoiceBillStatusCommonRequest; +import nc.dto.imag.invoice.tax.invoicebill.InvoiceBillStatusCommonResponse.InvoiceBillInfo; +import nc.dto.imag.invoice.tax.red.InvoiceRedApplyCommonRequest; +import nc.itf.sscivm.service.IVMInvoiceQueryService; +import nc.itf.uap.IUAPQueryBS; +import nc.jdbc.framework.generator.SequenceGenerator; +import nc.jdbc.framework.processor.BeanListProcessor; +import nc.vo.bd.defdoc.DefdocVO; +import nc.vo.pub.BusinessException; +import nc.vo.pub.VOStatus; +import nc.vo.pub.billtype.BilltypeVO; +import nc.vo.pub.lang.UFBoolean; +import nc.vo.pub.lang.UFDate; +import nc.vo.pub.lang.UFDateTime; +import nc.vo.pub.lang.UFDouble; +import nc.vo.sscivm.invoice.IVMInvoiceAggVO; +import nc.vo.sscivm.invoice.IVMInvoiceConstant; +import nc.vo.sscivm.invoice.IVMInvoiceDetailVO; +import nc.vo.sscivm.invoice.IVMInvoiceHeadVO; +import nc.vo.sscivm.invoice.IVMInvoiceRelationVO; +import nc.vo.sscivm.invoice.IVMInvoiceTspzDetailVO; +import nc.vo.sscivm.ivmpub.ClassTypeEnum; +import nc.vo.sscivm.ivmpub.IVAplocationFPXZ; +import nc.vo.sscivm.ivmpub.IVAplocationKPFS; +import nc.vo.sscivm.ivmpub.IVAplocationLSLBS; +import nc.vo.sscivm.ivmpub.IVAplocationZSFS; +import nc.vo.sscivm.ivmpub.InvoiceStatus; +import nc.vo.sscivm.ivmpub.InvoiceTypeEnum; +import nc.vo.sscivm.ivmpub.IsHzfp; +import nc.vo.sscivm.ivmpub.KpztEnum; +import nc.vo.sscivm.ivsale.IVApplicationAggVO; +import nc.vo.sscivm.ivsale.IVApplicationBodyVO; +import nc.vo.sscivm.ivsale.IVApplicationHeadVO; +import nc.vo.sscivm.ivsale.IVApplicationRelationVO; +import nc.vo.sscivm.ivsale.IVApplogVO; +import nc.vo.sscivm.ivsale.IVTspzsBodyVO; +import nc.vo.trade.pub.IBillStatus; +import nccloud.commons.lang.StringUtils; +import nccloud.itf.sscivm.ivsale.service.ApplicationLogService; +import nccloud.itf.sscivm.ivsale.splitmerge.service.InvoiceSplitMergeService; +import nccloud.putitf.riart.billtype.IBilltypeService; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class InvoiceTransferUtil { + + /** + * 根据开票申请单转换开票请求 + * + * @param vos + * @return + */ + public static RequestInfo getRequestInfo4BlueInvoiceApply(IVApplicationAggVO[] vos, + int isSpit) { + + RequestInfo requet = new RequestInfo(); + // 对于收票由于税务云入台账的接口不同需要再额外制定纳税人识别号、组织等信息,对于开票指定下面这些字段只是为了记录日志更清晰 + requet.setUserCode(InvocationInfoProxy.getInstance().getUserCode()); + requet.setUserid(InvocationInfoProxy.getInstance().getUserId()); + requet.setBilltype(IVAWebConst.IVA_DJLXBM); + requet.setBillid(vos[0].getParentVO().getPk_ivapplication()); + InvoiceApplyCommonRequest applyRequest = new InvoiceApplyCommonRequest(); + if (IVAWebConst.IVA_KP_SSCIVA01_1.equals(String.valueOf(isSpit))) { + applyRequest.setAutoAudit(UFBoolean.TRUE.booleanValue());// 是自动审核 + } else if (IVAWebConst.IVA_KP_SSCIVA01_2.equals(String.valueOf(isSpit))) { + applyRequest.setAutoAudit(UFBoolean.FALSE.booleanValue());// 否自动审核 + } + + List invoices = new ArrayList(); + for (IVApplicationAggVO vo : vos) { + + applyRequest.addEmail(vo.getParentVO().getPk_ivapplication(), null, null, new String[] {vo.getParentVO().getEmail()}); + applyRequest.addSMS(vo.getParentVO().getPk_ivapplication(), null, null, new String[] {vo.getParentVO().getSms()}); + + requet.setPk_org(vo.getParentVO().getPk_org()); + PInvoice invoice = getPInvoiceByApplyHead(vo.getParentVO()); + BigDecimal bodyMoneyTotal = new BigDecimal(0.00); + + List details = new ArrayList(); + for (IVApplicationBodyVO detailvo : vo.getBodyVOs()) { + if(detailvo.getCaninvoice_xmjshj().compareTo(UFDouble.ZERO_DBL)==0){ + continue; + } + PInvoiceDetail detail = getPInvoiceByApplyHead(vo.getParentVO(), detailvo); + details.add(detail); + bodyMoneyTotal = bodyMoneyTotal.add(detail.getXmjshj()); + } + invoice.setJshj(bodyMoneyTotal); + invoice.setItems(details.toArray(new PInvoiceDetail[0])); + + + //数电票特殊票种 + IVTspzsBodyVO[] tspzVOs = vo.getIvTspzsBodyVO(); + if (tspzVOs != null && tspzVOs.length > 0){ + invoice = getPInvoiceByApplyTspz(tspzVOs, invoice); + } + invoices.add(invoice); + } + + applyRequest.setInvoices(invoices.toArray(new PInvoice[0])); + requet.setData(applyRequest); + + return requet; + } + + /** + * 开票信息查询请求参数转换 + * + * @param logvo + * @return + * @throws BusinessException + */ + public static RequestInfo getRequestInfo4Refresh(IVApplogVO logvo, + IVApplicationAggVO applyVO) throws BusinessException { + + RequestInfo request = new RequestInfo(); + + request.setUserCode(InvocationInfoProxy.getInstance().getUserCode()); + request.setUserid(InvocationInfoProxy.getInstance().getUserId()); + request.setBilltype(IVAWebConst.IVA_DJLXBM); + request.setPk_org(applyVO.getParentVO().getPk_org()); + request.setBillid(applyVO.getParentVO().getPk_ivapplication()); + InvoiceApplyStatusCommonRequest statusR = new InvoiceApplyStatusCommonRequest(); + if (logvo.getKpzt() == KpztEnum.ZFING.intValue() || logvo.getKpzt() == KpztEnum.ZFERR.intValue()) { + // 查询原蓝字发票(红冲)的日志信息 + String condition = " ( " + IVMInvoiceHeadVO.FPDM + " = '" + logvo.getFpdm() + "' and " + IVMInvoiceHeadVO.FPHM + + " = '" + logvo.getFphm() + "' ) " + " and (" + IVApplogVO.KPZT + " =" + KpztEnum.ZFING + + " or " + IVApplogVO.KPZT + " =" + KpztEnum.ZFERR + + " )" + " and " + IVApplogVO.ISSYNC + " ='Y' "; + if (logvo.getFpdm() == null){ + condition = " ( " + IVMInvoiceHeadVO.FPHM + + " = '" + logvo.getFphm() + "' ) " + " and (" + IVApplogVO.KPZT + " =" + KpztEnum.ZFING + + " or " + IVApplogVO.KPZT + " =" + KpztEnum.ZFERR + + " )" + " and " + IVApplogVO.ISSYNC + " ='Y' "; + } + List buleIVApplogVOS = + NCLocator + .getInstance() + .lookup(ApplicationLogService.class) + .queryApplicationLogByCondion(condition); + if (buleIVApplogVOS != null && buleIVApplogVOS.size() > 0) { + statusR.setApplyNumber(buleIVApplogVOS.get(0).getFpqqlsh());// 需要历史的发票流水号去刷新数据 + } + } else { + statusR.setApplyNumber(logvo.getFpqqlsh()); + } + request.setData(statusR); + + return request; + } + + /** + * 发票单信息查询请求参数转换 + * + * @param logvo + * @return + */ + public static RequestInfo getRequestInfo4Refresh4Bill(IVApplogVO logvo, + IVApplicationAggVO applyVO) { + + RequestInfo request = new RequestInfo(); + + request.setUserCode(InvocationInfoProxy.getInstance().getUserCode()); + request.setUserid(InvocationInfoProxy.getInstance().getUserId()); + request.setBilltype(IVAWebConst.IVA_DJLXBM); + request.setPk_org(applyVO.getParentVO().getPk_org()); + + InvoiceBillStatusCommonRequest statusR = new InvoiceBillStatusCommonRequest(); + statusR.setLyid(logvo.getLyid()); + if (logvo.getKpzt() == KpztEnum.ZFING.intValue()) { + // 查询原蓝字发票(红冲)的日志信息 + List buleIVApplogVOS; + try { + String condition = " ( " + IVMInvoiceHeadVO.FPDM + " = '" + logvo.getFpdm() + "' and " + IVMInvoiceHeadVO.FPHM + + " = '" + logvo.getFphm() + "' ) " + " and " + IVApplogVO.KPZT + " =" + KpztEnum.ZFING + + " " + " and " + IVApplogVO.ISSYNC + " ='Y' "; + if ( logvo.getFpdm() == null){ + condition = " ( " + IVMInvoiceHeadVO.FPHM + + " = '" + logvo.getFphm() + "' ) " + " and " + IVApplogVO.KPZT + " =" + KpztEnum.ZFING + + " " + " and " + IVApplogVO.ISSYNC + " ='Y' "; + } + buleIVApplogVOS = NCLocator + .getInstance() + .lookup(ApplicationLogService.class) + .queryApplicationLogByCondion(condition); + if (buleIVApplogVOS != null && buleIVApplogVOS.size() > 0) { + statusR.setLyid(buleIVApplogVOS.get(0).getLyid()); + } + } catch (BusinessException e) { + SSCIVMLogger.error(e.getMessage(), e); + } + } + request.setData(statusR); + return request; + } + + /** + * 根据开票申请转换成红冲请求 + * + * @param vos + * @return + */ + public static RequestInfo getRequestInfo4InvoiceRed(IVApplicationAggVO[] vos) { + + RequestInfo requet = new RequestInfo(); + // 对于收票由于税务云入台账的接口不同需要再额外制定纳税人识别号、组织等信息,对于开票指定下面这些字段只是为了记录日志更清晰 + requet.setUserCode(InvocationInfoProxy.getInstance().getUserCode()); + requet.setUserid(InvocationInfoProxy.getInstance().getUserId()); + requet.setBilltype(IVAWebConst.IVA_DJLXBM); + requet.setBillid(vos[0].getParentVO().getPk_ivapplication()); + InvoiceRedApplyCommonRequest redRequest = new InvoiceRedApplyCommonRequest(); + int isSpit = Integer.parseInt(IVAWebConst.IVA_KP_SSCIVA01_1); + if (vos != null && vos.length > 0) { + isSpit = vos[0].getParentVO().getKpfs(); + if (IVAWebConst.IVA_KP_SSCIVA01_1.equals(String.valueOf(isSpit))) { + redRequest.setAutoAudit(UFBoolean.TRUE.booleanValue());// 是自动审核 + } else if (IVAWebConst.IVA_KP_SSCIVA01_2.equals(String.valueOf(isSpit))) { + redRequest.setAutoAudit(UFBoolean.FALSE.booleanValue());// 否自动审核 + } + } + + List invoices = new ArrayList(); + for (IVApplicationAggVO vo : vos) { + requet.setPk_org(vo.getParentVO().getPk_org()); + redRequest.addEmail(vo.getParentVO().getPk_ivapplication(), new String[] {vo.getParentVO().getEmail()}); + redRequest.addSMS(vo.getParentVO().getPk_ivapplication(), new String[] {vo.getParentVO().getSms()}); + + PInvoice invoice = getPInvoiceByApplyHead4Red(vo.getParentVO()); + + List details = new ArrayList(); + for (IVApplicationBodyVO detailvo : vo.getBodyVOs()) { + if(detailvo.getCaninvoice_xmjshj().compareTo(UFDouble.ZERO_DBL)==0){ + continue; + } + PInvoiceDetail detail = getPInvoiceByApplybody4Red(detailvo); + if (vo.getParentVO().getSgbz().booleanValue()) { + detailvo.setLslbs(IVAplocationLSLBS.LSLBS_MS.toStringValue()); + } + details.add(detail); + } + invoice.setItems(details.toArray(new PInvoiceDetail[0])); + invoices.add(invoice); + + } + + redRequest.setInvoices(invoices.toArray(new PInvoice[0])); + requet.setData(redRequest); + + return requet; + } + + /** + * 根据发票转换作废请求参数 + * + * @param vos + * @return + */ + public static RequestInfo getRequestInfo4InvoiceInvalid(IVApplicationAggVO apply) { + + RequestInfo requet = new RequestInfo(); + requet.setUserCode(InvocationInfoProxy.getInstance().getUserCode()); + requet.setUserid(InvocationInfoProxy.getInstance().getUserId()); + requet.setBilltype(IVAWebConst.IVA_DJLXBM); + requet.setPk_org(apply.getParentVO().getPk_org()); + requet.setBillid(apply.getHeadVO().getPk_ivapplication()); + + IVApplicationHeadVO invoice = apply.getParentVO(); + + InvalidCommonRequest cr = new InvalidCommonRequest(); + cr.setFpHm(invoice.getFphm()); + cr.setFpDm(invoice.getFpdm()); + cr.setZfr(invoice.getKpr());//获取开票人原始逻辑,为空则为当前操作人 + requet.setData(cr); + + return requet; + } + + /** + * 根据作废的请求解决作废对应的开票日志 + * + * @param response + * @param invoice + * @param lyid + * @return + * @throws BusinessException + */ + public static IVApplogVO getResult4InvoiceInvalid(ResponseInfo response, + IVApplicationAggVO apply) throws BusinessException { + + if (!IVMInvoiceConstant.SUCCESS_CODE.equals(response.getCode())) { + throw new BusinessException(response.getMessage()); + } + + IVApplogVO logvo = new IVApplogVO(); + + String condition = " " + IVMInvoiceHeadVO.FPDM + " = '" + apply.getParentVO().getFpdm() + "' and " + + IVMInvoiceHeadVO.FPHM + " = '" + apply.getParentVO().getFphm() + "' and dr=0 and " + + IVMInvoiceHeadVO.BILLTYPECODE + "='" + IVAWebConst.IVA_XXFP_JYLXBM +"' "; + if (apply.getParentVO().getFpdm() == null){ + condition = " " + IVMInvoiceHeadVO.FPHM + " = '" + apply.getParentVO().getFphm() + "' and dr=0 and " + + IVMInvoiceHeadVO.BILLTYPECODE + "='" + IVAWebConst.IVA_XXFP_JYLXBM +"' "; + } + IVMInvoiceAggVO[] ivMInvoiceAggVOS = + NCLocator + .getInstance() + .lookup(IVMInvoiceQueryService.class) + .queryAggVOsByCondition(condition); + + logvo.setCode(IVMInvoiceConstant.SUCCESS_CODE); + logvo.setKpzt(KpztEnum.ZFING); + logvo.setIsremake(UFBoolean.TRUE);// 当前作废的单据不允许重开,原作废单据允许重开 + logvo.setLyid(apply.getParentVO().getPk_ivapplication()); + logvo.setFpqqlsh(apply.getParentVO().getPk_ivapplication()); + logvo.setFpdm(apply.getParentVO().getFpdm()); + logvo.setFphm(apply.getParentVO().getFphm()); + logvo.setKpr(apply.getParentVO().getKpr()); + logvo.setKprq(apply.getParentVO().getPreparedate().toLocalString()); + if (ivMInvoiceAggVOS != null && ivMInvoiceAggVOS.length > 0) { + IVMInvoiceAggVO invoice = ivMInvoiceAggVOS[0]; + logvo.setInvoice_type(String.valueOf(invoice.getParentVO().getInvoice_type())); + logvo.setGmfmc(invoice.getParentVO().getGmfmc()); + logvo.setXsfmc(invoice.getParentVO().getXsfmc()); + logvo.setJshj(invoice.getParentVO().getJshj()); + logvo.setHjje(invoice.getParentVO().getHjje()); + logvo.setHjse(invoice.getParentVO().getHjse()); + + List> zfingStrMapList = new ArrayList>();// 原蓝字发票的作废查询条件 + Map zfingStrMap = new HashMap(); + zfingStrMap.put(IVMInvoiceHeadVO.FPDM, apply.getParentVO().getFpdm()); + zfingStrMap.put(IVMInvoiceHeadVO.FPHM, apply.getParentVO().getFphm()); + zfingStrMapList.add(zfingStrMap); + InvoiceTransferUtil.modifyZfingStrMap(zfingStrMapList); + } + + return logvo; + } + + public static void modifyZfingStrMap(List> zfingStrMapList) throws BusinessException { + // StringBuilder fpxxs = new StringBuilder(); + // for (int i = 0; i < zfingStrMapList.size(); i++) { + // Map vomap = zfingStrMapList.get(i); + // fpxxs.append(" ( " + IVMInvoiceHeadVO.FPDM + " = '" + // + vomap.get(IVMInvoiceHeadVO.FPDM) + "' and " + // + IVMInvoiceHeadVO.FPHM + " = '" + // + vomap.get(IVMInvoiceHeadVO.FPHM) + "' ) "); + // if (i != zfingStrMapList.size() - 1) { + // fpxxs.append(" or "); + // } + // } + // IVMInvoiceAggVO[] ivmVos = NCLocator.getInstance() + // .lookup(IVMInvoiceQueryService.class) + // .queryAggVOsByCondition(fpxxs.toString()); + // for (IVMInvoiceAggVO ivmVo : ivmVos) { + // IVMInvoiceHeadVO ivMInvoiceHeadVO = ivmVo.getParentVO(); + // ivMInvoiceHeadVO.setFpzt(InvoiceStatus.InvoiceStatus_2 + // .toIntValue());// 作废 + // ivMInvoiceHeadVO.setStatus(VOStatus.UPDATED); + // } + // IVMInvoiceAggVO[] oldivmVos = NCLocator.getInstance() + // .lookup(IVMInvoiceQueryService.class) + // .queryAggVOsByCondition(fpxxs.toString()); + // // 2、更新原被红冲蓝票为红冲,并补全红字发票信息 + // NCLocator.getInstance().lookup(IVMInvoiceService.class).updateBatch(ivmVos, oldivmVos); + // + // + // // 3、查询原蓝字发票(红冲)的日志信息 + // List buleIVApplogVOS = + // NCLocator.getInstance().lookup(ApplicationLogService.class).queryApplicationLogByCondion(fpxxs.toString()+" and "+IVApplogVO.KPZT + // +" ="+KpztEnum.ZFING+" "); + // + // // 4、更新原蓝字发票为红冲成功 + // if(buleIVApplogVOS!=null && buleIVApplogVOS.size()>0){ + // for(IVApplogVO buleIVApplogVO:buleIVApplogVOS){ + // buleIVApplogVO.setKpzt(KpztEnum.ZF); + // if(buleIVApplogVO.getJshj().compareTo(new UFDouble(0.0))<0){ + // buleIVApplogVO.setIsremake(UFBoolean.TRUE);//如果为红字发票,则不允许重开 + // } + // buleIVApplogVO.setStatus(VOStatus.UPDATED); + // } + // new BaseDAO().updateVOList(buleIVApplogVOS); + // + // // 5、确定当前作废动作对应的原发票为红字发票,则需要更新原红票对应的原蓝票的状态为开票成功 + // if(ivmVos!=null && ivmVos.length>0){ + // StringBuilder hzfpxxs = new StringBuilder(); + // hzfpxxs.append(" ( "); + // for(IVMInvoiceAggVO hcivmVo:ivmVos){ + // //根据红冲信息联查红字申请单 + // if(hcivmVo.getParentVO().getYlzfpdm()!=null && hcivmVo.getParentVO().getYlzfphm()!=null){ + // hzfpxxs.append(" ( " + IVMInvoiceHeadVO.FPDM + " = '" + // + hcivmVo.getParentVO().getYlzfpdm()+ "' and " + // + IVMInvoiceHeadVO.FPHM + " = '" + // + hcivmVo.getParentVO().getYlzfphm()+ "' ) or "); + // } + // } + // + // hzfpxxs.append(" 1=2 ) "); + // + // // 6、根据红冲的日志信息反查原蓝票信息 + // List hcIVAplicationVOS = + // NCLocator.getInstance().lookup(ApplicationLogService.class).queryApplicationLogByCondion(hzfpxxs.toString()+" and "+IVApplogVO.KPZT + // +" ="+KpztEnum.HC+" "); + // if(hcIVAplicationVOS!=null && hcIVAplicationVOS.size()>0){ + // for(IVApplogVO hcIVAplicationVO:hcIVAplicationVOS){ + // hcIVAplicationVO.setKpzt(KpztEnum.KP);//如果作废的是红字发票,则需要更新红字发票对应的蓝字发票状态为开票成功 + // hcIVAplicationVO.setStatus(VOStatus.UPDATED); + // } + // new BaseDAO().updateVOList(hcIVAplicationVOS); + // + // IVMInvoiceAggVO[] newivmVos = + // NCLocator.getInstance().lookup(IVMInvoiceQueryService.class).queryAggVOsByCondition(hzfpxxs.toString()); + // if(newivmVos!=null && newivmVos.length>0){ + // for(IVMInvoiceAggVO newivmVo:newivmVos){ + // IVMInvoiceHeadVO ivMInvoiceHeadVO = newivmVo.getParentVO(); + // ivMInvoiceHeadVO.setFpzt(InvoiceStatus.InvoiceStatus_0 + // .toIntValue());// 改原蓝字发票为正常 + // ivMInvoiceHeadVO.setStatus(VOStatus.UPDATED); + // + // } + // IVMInvoiceAggVO[] oldfirstivmVos = + // NCLocator.getInstance().lookup(IVMInvoiceQueryService.class).queryAggVOsByCondition(hzfpxxs.toString()); + // // 7、更新原被红冲蓝票为红冲,并补全红字发票信息 + // NCLocator.getInstance().lookup(IVMInvoiceService.class).updateBatch(newivmVos, oldfirstivmVos); + // } + // } + // } + // } + } + + /** + * 将开票请求结果(传税务云发票)转换成开票情况 + * + * @param response + * @return + * @throws BusinessException + */ + public static List getResult4BlueInvoiceApply(IVApplicationAggVO[] ivApplicationVOs,ResponseInfo response) + throws BusinessException { + + if (!IVMInvoiceConstant.SUCCESS_CODE.equals(response.getCode())) { + throw new BusinessException(response.getMessage()); + } + //是否NCC拆分合并 + boolean splitMerge =true; + if(ivApplicationVOs[0]!=null && ivApplicationVOs[0].getBodyVOs()[0].getPk_ivappdetail().length() == 20){ + splitMerge = false; + } + + List logs = new ArrayList(); + //1、 平台处理后只有返回成功的数据,如果税务云返回失败会直接抛出异常 + PInvoice[] invoices = response.getData().getInvoices(); + + if (invoices != null) { + for (PInvoice invoice : invoices) { + IVApplogVO logvo = getIVApplogVOFromPInvoice(invoice); + logs.add(logvo); + } + } + + //2、记录发票与开票申请行关联关系,并再次更新 + if(ivApplicationVOs.length > 0 ){ + Set addApplicationRelationVO =new HashSet();//汇总需要更新的内容 + Set deleteApplicationRelationVO =new HashSet();//汇总需要删除的内容 + //判断返回的每条开票申请对应的数据,如果出现下游税务云返回票据多于上游记录关系,或者上游无关系。(说明下游税务云存在自动拆分,或纯手工开票场景。也使用NCC的拆分合并关联关系表管理) + for (IVApplicationAggVO aggVOOld : ivApplicationVOs) { + IVApplicationAggVO aggVO = aggVOOld.clone();//避免污染原始VO + String pk_ivapplication = aggVO.getParentVO().getPk_ivapplication(); + boolean zffp = aggVO.getParentVO().getZffp() == null ? false : aggVO.getParentVO().getZffp().booleanValue();// 是否作废开票申请单 + boolean hzfp = aggVO.getParentVO().getHzfp() == null ? false : aggVO.getParentVO().getHzfp().booleanValue();// 是否红字开票申请单 + IVApplicationBodyVO[] iVApplicationBodyVOS= aggVO.getBodyVOs(); + Set childIVApplogVOS =new HashSet(); + //2.1当前开票申请与开票情况的关系合集 + if(logs.size()>0){ + for (IVApplogVO log:logs) { + if(Arrays.asList(TransSpiltMergePksUtil.transIvapplicationToLyid(new String[]{pk_ivapplication})).contains(log.getLyid())){ + childIVApplogVOS.add(log); + } + } + } + //2.2蓝票或者重开场景重新设置值 + // 非作废申请,红冲申请 + if(!zffp&&!hzfp&&childIVApplogVOS.size()>0){ + //匹配到生成的开票情况有内容 + for (IVApplogVO childIVApplogVO:childIVApplogVOS) { + PInvoiceDetail[] invoicedetails = childIVApplogVO.getItems(); + if(invoicedetails.length>0){ + for(PInvoiceDetail invoicedetail:invoicedetails){ + for(IVApplicationBodyVO iVApplicationBodyVO:iVApplicationBodyVOS){ + if(iVApplicationBodyVO.getHh().equals(invoicedetail.getHh())){ + UFDouble invoice_xmsl = new UFDouble(invoicedetail.getXmsl()==null?new BigDecimal(0):invoicedetail.getXmsl()); + UFDouble invoice_xmje = new UFDouble(invoicedetail.getXmje()==null?new BigDecimal(0):invoicedetail.getXmje()); + UFDouble invoice_xmjshj = new UFDouble(invoicedetail.getXmjshj()==null?new BigDecimal(0):invoicedetail.getXmjshj()); + boolean zkh = invoice_xmjshj.compareTo(UFDouble.ZERO_DBL) < 0; + if(splitMerge){//判断NCC拆分合并场景 + JSONArray arr = JSONArray.parseArray(iVApplicationBodyVO.getPk_ivappdetail()); + //对arr进行排序 + List arrList = JSONArray.parseArray(arr.toJSONString(), JSONObject.class); + Collections.sort(arrList, new Comparator() { + @Override + public int compare(JSONObject o1, JSONObject o2) { + UFDouble jshj1 = new UFDouble(o1.getBigDecimal(IVApplicationBodyVO.XMJSHJ)); + UFDouble jshj2 = new UFDouble(o2.getBigDecimal(IVApplicationBodyVO.XMJSHJ)); + return jshj1.compareTo(jshj2); + } + }); + arr = JSONArray.parseArray(arrList.toString()); + + JSONArray update_arr = new JSONArray(); + //获取剩余的拆合列表,并还原到PK_IVAPPDETAIL中 + for(int i = 0;i < arr.size();i++) { + String pk_ivapplication_split = arr.getJSONObject(i).getString(IVApplicationBodyVO.PK_IVAPPLICATION); + String pk_ivappdetail = arr.getJSONObject(i).getString(IVApplicationBodyVO.PK_IVAPPDETAIL); + UFDouble split_xmsl = new UFDouble(arr.getJSONObject(i).getBigDecimal(IVApplicationBodyVO.XMSL)); + UFDouble split_xmje = new UFDouble(arr.getJSONObject(i).getBigDecimal(IVApplicationBodyVO.XMJE)); + UFDouble split_xmjshj = new UFDouble(arr.getJSONObject(i).getBigDecimal(IVApplicationBodyVO.XMJSHJ)); + //按金额回写 + if(invoice_xmjshj.compareTo(UFDouble.ZERO_DBL)==0){ + //当前发票金额已用完 + break; + } + else if((split_xmjshj.compareTo(invoice_xmjshj)<=0 && !zkh) || (split_xmjshj.compareTo(invoice_xmjshj)>=0 && zkh)){ + //当前拆分金额已用完 + invoice_xmjshj = invoice_xmjshj.sub(split_xmjshj); + invoice_xmje = invoice_xmje.sub(split_xmje); + invoice_xmsl = invoice_xmsl.sub(split_xmsl); + if(split_xmjshj.compareTo(UFDouble.ZERO_DBL)!=0) { + addApplicationRelationVO.add(getApplicationRelationVO(aggVO, childIVApplogVO, pk_ivapplication_split, pk_ivappdetail, iVApplicationBodyVO.getHh(), split_xmsl, split_xmje, split_xmjshj, splitMerge));//需要重新赋值的部分 + } + arr.getJSONObject(i).put(IVApplicationBodyVO.XMSL,UFDouble.ZERO_DBL.toBigDecimal()); + arr.getJSONObject(i).put(IVApplicationBodyVO.XMJE,UFDouble.ZERO_DBL.toBigDecimal()); + arr.getJSONObject(i).put(IVApplicationBodyVO.XMJSHJ,UFDouble.ZERO_DBL.toBigDecimal()); + arr.getJSONObject(i).put(IVApplicationBodyVO.SE,UFDouble.ZERO_DBL.toBigDecimal()); + split_xmjshj = UFDouble.ZERO_DBL; + split_xmje = UFDouble.ZERO_DBL; + split_xmsl = UFDouble.ZERO_DBL; + update_arr.add(arr.getJSONObject(i)); + }else{ + //当前拆分金额部分用完 + split_xmjshj = split_xmjshj.sub(invoice_xmjshj); + split_xmje = split_xmje.sub(invoice_xmje); + split_xmsl = split_xmsl.sub(invoice_xmsl); + arr.getJSONObject(i).put(IVApplicationBodyVO.XMSL,split_xmsl.toBigDecimal()); + arr.getJSONObject(i).put(IVApplicationBodyVO.XMJE,split_xmje.toBigDecimal()); + arr.getJSONObject(i).put(IVApplicationBodyVO.XMJSHJ,split_xmjshj.toBigDecimal()); + arr.getJSONObject(i).put(IVApplicationBodyVO.SE,tranZeroAmount(split_xmjshj.sub(split_xmje)).toBigDecimal()); + update_arr.add(arr.getJSONObject(i)); + if(invoice_xmjshj.compareTo(UFDouble.ZERO_DBL)!=0) { + addApplicationRelationVO.add(getApplicationRelationVO(aggVO, childIVApplogVO, pk_ivapplication_split, pk_ivappdetail, iVApplicationBodyVO.getHh(), invoice_xmsl, invoice_xmje, invoice_xmjshj, splitMerge));//需要重新赋值的部分 + } + invoice_xmjshj = UFDouble.ZERO_DBL; + invoice_xmje = UFDouble.ZERO_DBL; + invoice_xmsl = UFDouble.ZERO_DBL; + } + } + iVApplicationBodyVO.setPk_ivappdetail(arr.toJSONString()); + }else{//非NCC拆分合并场景 + if(invoice_xmjshj.compareTo(UFDouble.ZERO_DBL)!=0) { + addApplicationRelationVO.add(getApplicationRelationVO(aggVO, childIVApplogVO, iVApplicationBodyVO.getPk_ivapplication(), iVApplicationBodyVO.getPk_ivappdetail(), iVApplicationBodyVO.getHh(), invoice_xmsl, invoice_xmje, invoice_xmjshj, splitMerge));//需要重新赋值的部分 + } + } + } + } + } + } + } + } + } + + IVApplicationRelationVO[] oldApplicationRelationVO = NCLocator.getInstance().lookup(InvoiceSplitMergeService.class).saveSpiltAndMergeRelation(ivApplicationVOs,splitMerge,addApplicationRelationVO); + //2.3当前开票申请的票据与申请关联关系合集 + Set childApplicationRelationVOS =new HashSet(); + if(oldApplicationRelationVO!=null && oldApplicationRelationVO.length>0){ + for(IVApplicationRelationVO applicationRelationVO:oldApplicationRelationVO) { + for (IVApplogVO childIVApplogVO : logs) { + if (applicationRelationVO.getFpqqlsh().equals(childIVApplogVO.getLyid())) { + deleteApplicationRelationVO.add(applicationRelationVO);//需要清空删除的关联关系部分 + break; + } + } + } + } + //删除关联关系 + if(deleteApplicationRelationVO.size()>0){ + new IVApplicationRelationVODeleteBP().delete(deleteApplicationRelationVO.toArray(new IVApplicationRelationVO[deleteApplicationRelationVO.size()])); + } + //更新关联关系 + if(addApplicationRelationVO.size()>0){ + new IVApplicationRelationVOInsertBP().insert(addApplicationRelationVO.toArray(new IVApplicationRelationVO[addApplicationRelationVO.size()])); + } + } + return logs; + } + + public static IVApplicationRelationVO getApplicationRelationVO(IVApplicationAggVO aggVO, IVApplogVO childIVApplogVO,String pk_ivapplication, String pk_ivappdetail, String hh, UFDouble invoice_xmsl, UFDouble invoice_xmje, UFDouble invoice_xmjshj, boolean splitMerge) { + String kpfs = String.valueOf(aggVO.getParentVO().getKpfs());// 开票方式 1/直联开票、2/手工开票、3/发票拆分合并开票 + IVApplicationRelationVO vo = new IVApplicationRelationVO(); + vo.setPk_ivapplication(pk_ivapplication); + vo.setPk_ivappdetail(pk_ivappdetail); + vo.setIsplitmerge(splitMerge?UFBoolean.TRUE:UFBoolean.FALSE); + vo.setXmsl(invoice_xmsl); + vo.setXmje(invoice_xmje); + vo.setXmjshj(invoice_xmjshj); + vo.setRowno(hh); + vo.setFpqqlsh(childIVApplogVO.getLyid());//税务云拆分的关联关系存储的是来源ID + vo.setPk_ivapplog(childIVApplogVO.getPk_ivapplog());//替换关联关系的生成,下游生成的部分会替换并按行赋值。便于找到回退的数据 + if(IVAWebConst.IVA_KP_SSCIVA01_1.equals(kpfs) || splitMerge) { + vo.setKpfs(IVAplocationKPFS.ZLKP.toIntValue());//直连开票 + }else{ + vo.setKpfs(IVAplocationKPFS.SGKP.toIntValue());//手工开票 + } + return vo; + } + + /** + * 将红冲结果转换成开票日志 + * + * @param response + * @return + * @throws BusinessException + */ + public static List getResult4InvoiceRed(ResponseInfo response, + IVApplicationAggVO[] ivApplicationVOs) throws BusinessException { + + if (!IVMInvoiceConstant.SUCCESS_CODE.equals(response.getCode())) { + throw new BusinessException(response.getMessage()); + } + + List logs = new ArrayList(); + for (IVApplicationAggVO applyvo : ivApplicationVOs) { + + // IVMInvoiceAggVO invoice = applyvo.getInvoiceAggVO(); + IVApplogVO logvo = new IVApplogVO(); + + logvo.setCode(IVMInvoiceConstant.SUCCESS_CODE); + logvo.setKpzt(KpztEnum.KPING); + logvo.setFpqqlsh(applyvo.getParentVO().getPk_ivapplication()); + logvo.setLyid(applyvo.getParentVO().getPk_ivapplication()); + logvo.setKpr(applyvo.getParentVO().getKpr()); + logvo.setJshj(applyvo.getParentVO().getJshj()); + logvo.setHjje(applyvo.getParentVO().getHjje()); + logvo.setHjse(applyvo.getParentVO().getHjse()); + logvo.setInvoice_type(String.valueOf(applyvo.getParentVO().getFplx())); + logvo.setGmfmc(applyvo.getParentVO().getGmf_mc()); + logvo.setXsfmc(applyvo.getParentVO().getXsf_mc()); + if (applyvo.getHeadVO().getSgbz()!=null && applyvo.getHeadVO().getSgbz().booleanValue()) { + logvo.setGmfmc(applyvo.getParentVO().getXsf_mc()); + logvo.setXsfmc(applyvo.getParentVO().getGmf_mc()); + } + + // logvo.setGmfmc(invoice.getParentVO().getGmfmc()); + // logvo.setFpdm(invoice.getParentVO().getFpdm()); + // logvo.setFphm(invoice.getParentVO().getFphm()); + // logvo.setKprq(invoice.getParentVO().getKprq() == null ? "" : + // invoice.getParentVO().getKprq().toStdString()); + // logvo.setInvoice_type(String.valueOf(invoice.getParentVO().getInvoice_type())); + + logs.add(logvo); + } + + return logs; + } + + /** + * 根据开票结果转换发票,只有开票中和红冲中的日志需要转换 + * + * @param pinvoice + * @return + * @throws BusinessException + */ + public static IVMInvoiceAggVO getInvoiceAggVOFromPInvoice(IVApplicationHeadVO ivApplicationHeadVO, + PInvoice pinvoice, IVApplogVO logvo) throws BusinessException { + IVMInvoiceAggVO aggvo = new IVMInvoiceAggVO(); + IVMInvoiceHeadVO head = new IVMInvoiceHeadVO(); + + SequenceGenerator generator = new SequenceGenerator(); + String pk_invoice = generator.generate(); + head.setStatus(VOStatus.NEW); + head.setPk_invoice(pk_invoice); + + // 票面信息 + head.setFphm(pinvoice.getFpHm()); + head.setFpdm(pinvoice.getFpDm()); + head.setJjm(pinvoice.getJqbh()); + head.setKprq(getUFDate(pinvoice.getKprq()));// pinvoice.getKprq(),待解析,20190525152311 + head.setFpmw(pinvoice.getFpMw()); + head.setJym(pinvoice.getJym()); + head.setJshj(getBigDecimalToUFDouble(pinvoice.getJshj())); + head.setHjje(getBigDecimalToUFDouble(pinvoice.getHjje())); + head.setHjse(getBigDecimalToUFDouble(pinvoice.getHjse())); + head.setBz(pinvoice.getBz()); + head.setKpr(pinvoice.getKpr()); + head.setSkr(pinvoice.getSkr()); + head.setFhr(pinvoice.getFhr()); + head.setFilename(null); + head.setViewurl(null); + head.setBillstatus(IBillStatus.CHECKPASS); + + //数电特殊票种 + head.setZsfs(pinvoice.getZsfs()); + head.setTspz(IVApplicationTspzUtil.getTspzPk(pinvoice.getTspz())); + head.setTspzdef99(head.getTspz()); + head.setKdsbz(pinvoice.getKdsbz()); + head.setBdcdz(pinvoice.getBdcdz()); + head.setZlqq(pinvoice.getZlqq() == null ? null : getUFDate(pinvoice.getZlqq())); + head.setZlqz(pinvoice.getZlqz() == null ? null : getUFDate(pinvoice.getZlqz())); + head.setTdzzsxmbh(pinvoice.getTdzzsxmbh()); + head.setWqhtbabh(pinvoice.getWqhtbabh()); + head.setBdcdwdm(pinvoice.getBdcdwdm()); + head.setHdjsjg(getBigDecimalToUFDouble(pinvoice.getHdjsjg())); + head.setSjcjhsje(getBigDecimalToUFDouble(pinvoice.getSjcjhsje())); + head.setBxdh(pinvoice.getBxdh()); + head.setCphcbdjh(pinvoice.getCphcbdjh()); + head.setSkssq(pinvoice.getSkssq()); + head.setCjh(pinvoice.getCjh()); + head.setDsccsje(getBigDecimalToUFDouble(pinvoice.getDsccsje())); + head.setZnj(getBigDecimalToUFDouble(pinvoice.getZnj())); + head.setJehj(getBigDecimalToUFDouble(pinvoice.getJehj())); + + // 根据开票申请来源交易类型,获取来源系统,为销项发票来源系统赋值。 + String src_billtype = ivApplicationHeadVO.getSrc_billtype(); + BilltypeVO billtypeVO = NCLocator.getInstance().lookup(IBilltypeService.class).getBilltypeByid(src_billtype); + if (billtypeVO != null) { + src_billtype = billtypeVO.getPk_billtypecode(); + } + if (src_billtype != null && !"".equals(src_billtype)) { + String lyxt = + NCLocator.getInstance().lookup(IVMInvoiceQueryService.class).getLyxtBybilltypecode(src_billtype); + head.setLyxt(lyxt);// 开票单来源单据 + } + + // NC辅助信息 + if (KpztEnum.KPING.intValue() == logvo.getKpzt() || KpztEnum.DKP.intValue() == logvo.getKpzt() || KpztEnum.KP.intValue() == logvo.getKpzt()) { + if (ivApplicationHeadVO.getHzfp().booleanValue() == UFBoolean.TRUE.booleanValue()) { + head.setFpzt(InvoiceStatus.InvoiceStatus_0.toIntValue()); + head.setRed_flag(IsHzfp.IsHzfp_1.toIntValue()); + head.setYlzfpdm(ivApplicationHeadVO.getFpdm()); + head.setYlzfphm(ivApplicationHeadVO.getFphm()); + } else { + head.setFpzt(InvoiceStatus.InvoiceStatus_0.toIntValue()); + head.setRed_flag(IsHzfp.IsHzfp_0.toIntValue()); + } + } else if (KpztEnum.HCING.intValue() == logvo.getKpzt() || KpztEnum.HC.intValue() == logvo.getKpzt()) { + head.setFpzt(InvoiceStatus.InvoiceStatus_0.toIntValue()); + head.setRed_flag(IsHzfp.IsHzfp_1.toIntValue()); + head.setYlzfpdm(ivApplicationHeadVO.getFpdm()); + head.setYlzfphm(ivApplicationHeadVO.getFphm()); + } + // 重新查询交易类型 + IUAPQueryBS iUAPQueryBS = (IUAPQueryBS)NCLocator.getInstance().lookup(IUAPQueryBS.class.getName()); + if (ivApplicationHeadVO.getSgbz()!=null && ivApplicationHeadVO.getSgbz().booleanValue()) { + @SuppressWarnings("unchecked") + List vos = + (List)iUAPQueryBS.retrieveByClause(BilltypeVO.class, BilltypeVO.PK_BILLTYPECODE + + "='SSIV-Cxx-rec' " + " AND " + " pk_group ='" + ivApplicationHeadVO.getPk_group() + "' "); + if (vos != null && vos.size() > 0) { + String pk_billtypeid = vos.get(0).getPk_billtypeid(); + head.setPk_billtype(pk_billtypeid);// 交易类型主键 + head.setBilltypecode(vos.get(0).getPk_billtypecode()); + } else { + head.setPk_billtype(IVAWebConst.IVA_JXFP_JYLXPK);// 交易类型主键 + head.setBilltypecode(IVAWebConst.IVA_JXFP_JYLXBM); + } + //收票日期 NC系统日期 + head.setSprq(new UFDate()); + //收票人取开票申请修改人 + head.setSpr(ivApplicationHeadVO.getModifier()); + //收购标志 + head.setSgbz(UFBoolean.TRUE); + //默认为采购类发票 + head.setClasstype(ClassTypeEnum.ClassType_CGL.toIntValue()); + + //收购发票,购销信息对调 + head.setXsfmc(pinvoice.getGmfMc()); + head.setXsfnsrsbh(pinvoice.getGmfNsrsbh()); + head.setXsfdzdh(pinvoice.getGmfDzdh()); + head.setXsfyhzh(pinvoice.getGmfYhzh()); + head.setGmfmc(pinvoice.getXsfMc()); + head.setGmfnsrsbh(pinvoice.getXsfNsrsbh()); + head.setGmfdzdh(pinvoice.getXsfDzdh()); + head.setGmfyhzh(pinvoice.getXsfYhzh()); + } else { + @SuppressWarnings("unchecked") + List vos = + (List)iUAPQueryBS.retrieveByClause(BilltypeVO.class, BilltypeVO.PK_BILLTYPECODE + + "='SSIV-Cxx-sale' " + " AND " + " pk_group ='" + ivApplicationHeadVO.getPk_group() + "' "); + if (vos != null && vos.size() > 0) { + String pk_billtypeid = vos.get(0).getPk_billtypeid(); + head.setPk_billtype(pk_billtypeid);// 交易类型主键 + head.setBilltypecode(vos.get(0).getPk_billtypecode()); + } else { + head.setPk_billtype(IVAWebConst.IVA_XXFP_JYLXPK);// 交易类型主键 + head.setBilltypecode(IVAWebConst.IVA_XXFP_JYLXBM); + } + //非收购发票,购销信息直传 + head.setXsfmc(pinvoice.getXsfMc()); + head.setXsfnsrsbh(pinvoice.getXsfNsrsbh()); + head.setXsfdzdh(pinvoice.getXsfDzdh()); + head.setXsfyhzh(pinvoice.getXsfYhzh()); + head.setGmfmc(pinvoice.getGmfMc()); + head.setGmfnsrsbh(pinvoice.getGmfNsrsbh()); + head.setGmfdzdh(pinvoice.getGmfDzdh()); + head.setGmfyhzh(pinvoice.getGmfYhzh()); + } + + + head.setInvoice_type(logvo.getInvoice_type() == null ? null : Integer.valueOf(logvo.getInvoice_type())); + head.setBillno(null);// NC系统单据编号,发票单的单据编号 + head.setPk_customer(null);// 来源于开票申请 + head.setBilldate(new UFDate());// NC系统日期 + head.setDjdl(IVMInvoiceConstant.IVREC_SP_BILLTYPEID);// 单据类型主键 + head.setDjdlbm(IVMInvoiceConstant.IVREC_SP_BILLTYPECODE);// 单据类型编码 + head.setPk_org(ivApplicationHeadVO.getPk_org());// 来源于开票申请 + head.setPk_group(ivApplicationHeadVO.getPk_group());// 来源于开票申请 + + List details = new ArrayList(); + if (pinvoice.getItems() != null) { + for (int i = 0; i < pinvoice.getItems().length; i++) { + PInvoiceDetail item = pinvoice.getItems()[i]; + + IVMInvoiceDetailVO detail = new IVMInvoiceDetailVO(); + // detail.setPk_invoice(pk_invoice); + // detail.setPk_invoicedetail(generator.generate()); + detail.setStatus(VOStatus.NEW); + detail.setRowno(item.getHh()); + detail.setXmmc(item.getXmmc()); + detail.setGgxh(item.getGgxh()); + detail.setDw(item.getDw()); + detail.setXmsl(getBigDecimalToUFDouble(item.getXmsl()));// 需要改成UFDouble + detail.setXmdj(getBigDecimalToUFDouble(item.getXmdj())); + detail.setXmje(getBigDecimalToUFDouble(item.getXmje())); + detail.setSl(item.getSl() == null ? "" : item.getSl().toString()); + detail.setSe(getBigDecimalToUFDouble(item.getSe())); + detail.setXmjshj(getBigDecimalToUFDouble(item.getXmjshj())); + detail.setSpbm(item.getSpbm()); + detail.setIsfee(UFBoolean.FALSE); + detail.setFphxz(Integer.valueOf(item.getFphxz())); + detail.setZkhhh(item.getZkhhh()); + //数电特殊票种 + PInvoiceSDetail motor = item.getDetailMotor(); + if(motor != null){ + detail.setJzfwfsd(motor.getJzfwfsd()); + detail.setJzxmmc(motor.getJzxmmc()); + detail.setCqzsbh(motor.getCqzsbh()); + } + details.add(detail); + } + } + + //特殊票种 + List tspzDetails = new ArrayList(); + if (pinvoice.getTspzs() != null && pinvoice.getTspzs().length > 0){ + for (PInvoiceTspz ptspz : pinvoice.getTspzs()){ + IVMInvoiceTspzDetailVO tspz = new IVMInvoiceTspzDetailVO(); + + //货运 + tspz.setYsmxxh(ptspz.getYsmxxh()); + tspz.setYsgjzl(ptspz.getYsgjzl()); + tspz.setYsgjph(ptspz.getYsgjph()); + tspz.setQyd(ptspz.getQyd()); + tspz.setDdd(ptspz.getDdd()); + tspz.setYshwmc(ptspz.getYshwmc()); + + //客运 + tspz.setCxrxh(ptspz.getCxrxh()); + tspz.setCxr(ptspz.getCxr()); + tspz.setChuxrq(ptspz.getChuxrq() == null ? null : getUFDate(ptspz.getChuxrq())); + tspz.setCxrzjlxdm(ptspz.getCxrzjlxDm()); + tspz.setSfzjhm(ptspz.getSfzjhm()); + tspz.setCfd(ptspz.getCfd()); + tspz.setLkddd(ptspz.getLkddd()); + tspz.setZwdj(ptspz.getZwdj()); + tspz.setJtgjlxdm(ptspz.getJtgjlxDm()); + + tspzDetails.add(tspz); + } + } + + if (pinvoice.getCepzs() != null && pinvoice.getCepzs().length > 0){ + for (PInvoiceCepz pcepz : pinvoice.getCepzs()){ + IVMInvoiceTspzDetailVO cepz = new IVMInvoiceTspzDetailVO(); + cepz.setXh(pcepz.getXh()); + cepz.setPzlx(pcepz.getPzlx()); + cepz.setFphm(pcepz.getFphm()); + cepz.setFpdm(pcepz.getFpdm()); + cepz.setZzfphm(pcepz.getZzfphm()); + cepz.setPzhm(pcepz.getPzhm()); + cepz.setKjrq(pcepz.getKjrq() == null ? null : getUFDate(pcepz.getKjrq())); + cepz.setHjje(getBigDecimalToUFDouble(pcepz.getHjje())); + cepz.setKce(getBigDecimalToUFDouble(pcepz.getKce())); + cepz.setBz(pcepz.getBz()); + cepz.setLy(pcepz.getLy()); + cepz.setBckcje(getBigDecimalToUFDouble(pcepz.getBckcje())); + cepz.setPzhjje(getBigDecimalToUFDouble(pcepz.getPzhjje())); + + tspzDetails.add(cepz); + } + } + + + aggvo.setParentVO(head); + aggvo.setChildrenVO(details.toArray(new IVMInvoiceDetailVO[0])); + if (tspzDetails.size() > 0){ + aggvo.setIvmInvoiceTspzDetailVO(tspzDetails.toArray(new IVMInvoiceTspzDetailVO[0])); + } + + initKhcje(aggvo);// 初始化可红冲金额 + return aggvo; + } + + private static void initKhcje(IVMInvoiceAggVO aggvo) { + IVMInvoiceHeadVO head = aggvo.getParentVO(); + if(head.getRed_flag() != null && head.getRed_flag().intValue() != IsHzfp.IsHzfp_0.toIntValue()){ + return; + } + // 1. 初始化表头可红冲金额等于价税合计金额 + head.setKhcje(head.getJshj()); + head.setZthcje(UFDouble.ZERO_DBL); + head.setYhcje(UFDouble.ZERO_DBL); + + // 2. 初始化表体可红冲金额 + IVMInvoiceDetailVO[] detailVOs = (IVMInvoiceDetailVO[])aggvo.getChildrenVO(); + Map rowNumAndJshjMap = new HashMap<>(); + for (IVMInvoiceDetailVO detail : detailVOs) { + rowNumAndJshjMap.put(detail.getRowno(), detail.getXmjshj()); + } + + for (IVMInvoiceDetailVO detail : detailVOs) { + detail.setYhcje(UFDouble.ZERO_DBL); + detail.setZthcje(UFDouble.ZERO_DBL); + int fphxz = detail.getFphxz().intValue(); + if (IVAplocationFPXZ.FPXZ_ZCH.toIntValue() == fphxz) { + detail.setKhcje(detail.getXmjshj());// 正常行 可红冲金额等于价税合计 + } else if (IVAplocationFPXZ.PFPXZ_BZKH.toIntValue() == fphxz) { + UFDouble zkhJshj = rowNumAndJshjMap.get(detail.getZkhhh()); + detail.setKhcje(detail.getXmjshj().add(zkhJshj));// 被折扣行 可红冲金额等于 价税合计减去折扣行价税合计 + } else { + detail.setKhcje(UFDouble.ZERO_DBL); + } + } + } + + /** + * 根据开票结果转换生成发票关联关系 + * + * @param pinvoice + * @return + * @throws BusinessException + */ + public static HashSet getIVMInvoiceRelationVOFromInvoice(IVMInvoiceAggVO pinvoice, + IVApplicationAggVO[] ivApplicationHeadVOS, String lyids) throws BusinessException { + HashSet heads = new HashSet(); + Set pk_ivapplicationSet = new HashSet(); + if (lyids != null) { + List bhcInvoiceRelations = new ArrayList(); + Map billRelationMap = new HashMap(); + //红字发票,根据原蓝票回写金额需要提前 + boolean hzfp = "1".equals(String.valueOf(pinvoice.getParentVO().getRed_flag())); + if(hzfp) { + //查询被红冲的发票的发票单据关联关系,丢失的关系直接从其中补 + StringBuilder queryReSql = new StringBuilder(""); + queryReSql.append(" select ion.* from sscivm_invoice_relation ion "); + queryReSql.append(" left join sscivm_invoice ice on ion.pk_invoice = ice.pk_invoice "); + queryReSql.append(" where ion.fphm = '"+pinvoice.getParentVO().getYlzfphm()+"' "); + if (pinvoice.getParentVO().getYlzfpdm() != null){ + queryReSql.append(" and ion.fpdm = '"+pinvoice.getParentVO().getYlzfpdm()+"' "); + } + queryReSql.append(" and ice.dr = 0 "); + queryReSql.append(" and (ice.billtypecode ='SSIV-Cxx-sale' or (ice.billtypecode ='SSIV-Cxx-rec' and ice.invoice_type in (109,309))) "); + bhcInvoiceRelations = (List) new BaseDAO().executeQuery(queryReSql.toString(), new BeanListProcessor(IVMInvoiceRelationVO.class)); + if(bhcInvoiceRelations.size()>0) { + for (IVMInvoiceRelationVO bhcInvoiceRelation : bhcInvoiceRelations) { + billRelationMap.put(bhcInvoiceRelation.getBillid(), bhcInvoiceRelation); + } + + //业务单据红冲不记录关联关系 + boolean ywdjhc = true; + for (IVApplicationAggVO ivApplicationHeadVO : ivApplicationHeadVOS){ + if (billRelationMap.containsKey(ivApplicationHeadVO.getParentVO().getSrc_pkbusibill())){ + ywdjhc = false; + } + } + if (ywdjhc){ + billRelationMap = new HashMap(); + bhcInvoiceRelations = new ArrayList(); + } + } + + } + + List ivApplicationHeadVOList = new ArrayList(); + for (IVApplicationAggVO ivApplicationHeadVO : ivApplicationHeadVOS) { + ivApplicationHeadVOList.add(ivApplicationHeadVO); + // 处理批量红冲后重开的原始数据,需要增加关联关系 + if (ivApplicationHeadVO.getParentVO().getCkfp() != null + && ivApplicationHeadVO.getParentVO().getCkfp().booleanValue()) { + + //查找原发票的发票单据关联关系,从中补关系 + StringBuilder queryReSql = new StringBuilder(""); + queryReSql.append(" select rel.* from sscivm_invoice_relation rel "); + queryReSql.append(" left join sscivm_invoice ice on rel.pk_invoice = ice.pk_invoice "); + queryReSql.append(" left join sscivm_ivapplication iva on (iva.pk_ivapplication ='"); + queryReSql.append(ivApplicationHeadVO.getParentVO().getPk_ivapplication()); + queryReSql.append("') "); + queryReSql.append(" where iva.fpdm = rel.fpdm "); + queryReSql.append(" and iva.fphm = rel.fphm "); + queryReSql.append(" and rel.dr = 0 "); + queryReSql.append(" and (ice.billtypecode ='SSIV-Cxx-sale' or (ice.billtypecode ='SSIV-Cxx-rec' and ice.invoice_type in (109,309))) "); + + @SuppressWarnings("unchecked") + List yInvoiceRelations = (List) new BaseDAO() + .executeQuery(queryReSql.toString(), new BeanListProcessor(IVMInvoiceRelationVO.class)); + + //根据原发票的发票关联关系,生成 发票关联关系 + if(yInvoiceRelations.size()>0) { + for (IVMInvoiceRelationVO bhcInvoiceRelation : yInvoiceRelations) { + billRelationMap.put(bhcInvoiceRelation.getBillid(), bhcInvoiceRelation); + if(StringUtils.isBlank(bhcInvoiceRelation.getBillid()) || bhcInvoiceRelation.getBillid().equals(ivApplicationHeadVO.getParentVO().getSrc_pkbusibill())){ + continue; + } + IVMInvoiceRelationVO head = new IVMInvoiceRelationVO(); + head.setStatus(VOStatus.NEW); + // 票面信息 + head.setFphm(pinvoice.getParentVO().getFphm()); + head.setFpdm(pinvoice.getParentVO().getFpdm()); + head.setBillid(bhcInvoiceRelation.getBillid()); + head.setBillno(bhcInvoiceRelation.getBillno()); + head.setBilltype(bhcInvoiceRelation.getBilltype()); + head.setTradetype(bhcInvoiceRelation.getTradetype()); + head.setInvoiceamount(pinvoice.getParentVO().getJshj()); + head.setPk_invoice(pinvoice.getParentVO().getPk_invoice()); + head.setAmount(bhcInvoiceRelation.getAmount()); + head.setJe(bhcInvoiceRelation.getJe()); + head.setSe(bhcInvoiceRelation.getSe()); + heads.add(head); + } + } + + } + } + + + String[] lyidarr = lyids.split(IVAWebConst.IVA_LYID_SPLIT); + Map map = TransSpiltMergePksUtil + .transLyidToIvapplicationStrMap(lyidarr); + for (String lyidstr : lyidarr) { + for (IVApplicationAggVO ivApplicationHeadVO : ivApplicationHeadVOList) { + + if (lyidstr != null && map.get(lyidstr).contains(ivApplicationHeadVO.getParentVO().getPk_ivapplication())) { + IVMInvoiceRelationVO head = new IVMInvoiceRelationVO(); + head.setStatus(VOStatus.NEW); + if(StringUtils.isBlank(ivApplicationHeadVO.getParentVO().getSrc_pkbusibill())){ + continue; + } + // 票面信息 + head.setFphm(pinvoice.getParentVO().getFphm()); + head.setFpdm(pinvoice.getParentVO().getFpdm()); + head.setBillid(ivApplicationHeadVO.getParentVO().getSrc_pkbusibill()); + head.setBillno(ivApplicationHeadVO.getParentVO().getSrc_billno()); + head.setBilltype(ivApplicationHeadVO.getParentVO().getSrc_billtype()); + head.setTradetype(ivApplicationHeadVO.getParentVO().getSrc_tradetype()); + head.setInvoiceamount(pinvoice.getParentVO().getJshj()); + head.setPk_invoice(pinvoice.getParentVO().getPk_invoice()); + IVMInvoiceRelationVO oldvo = billRelationMap.get(head.getBillid()); + if(oldvo != null){ + if(hzfp){ + if(oldvo.getAmount() != null){ + head.setAmount(oldvo.getAmount().multiply(-1)); + } + if(oldvo.getJe() != null){ + head.setJe(oldvo.getJe().multiply(-1)); + } + if(oldvo.getSe() != null){ + head.setSe(oldvo.getSe().multiply(-1)); + } + } else { + head.setAmount(oldvo.getAmount()); + head.setJe(oldvo.getJe()); + head.setSe(oldvo.getSe()); + } + } + heads.add(head); + if(ivApplicationHeadVO.getParentVO().getSrc_pkbusibill()!=null && ivApplicationHeadVO.getParentVO().getSrc_pkbusibill().length()>0) { + pk_ivapplicationSet.add(ivApplicationHeadVO.getParentVO().getSrc_pkbusibill());} + } + } + + } + + //合并场景联查对应的红字发票相关单据 + if(hzfp && pk_ivapplicationSet.size()>0) { + //根据被红冲发票关联关系,生成 发票关联关系 + if(bhcInvoiceRelations.size()>0) { + for (IVMInvoiceRelationVO bhcInvoiceRelation : bhcInvoiceRelations) { + IVMInvoiceRelationVO head = new IVMInvoiceRelationVO(); + boolean continueAdd = true; + for(IVMInvoiceRelationVO headin:heads) { + if(headin.getBillid() != null && bhcInvoiceRelation.getBillid() != null && headin.getBillid().equals(bhcInvoiceRelation.getBillid())) { + continueAdd =false; + } + } + if(!continueAdd) { continue;} + head.setStatus(VOStatus.NEW); + // 票面信息 + head.setFphm(pinvoice.getParentVO().getFphm()); + head.setFpdm(pinvoice.getParentVO().getFpdm()); + head.setBillid(bhcInvoiceRelation.getBillid()); + head.setBillno(bhcInvoiceRelation.getBillno()); + head.setBilltype(bhcInvoiceRelation.getBilltype()); + head.setTradetype(bhcInvoiceRelation.getTradetype()); + head.setInvoiceamount(pinvoice.getParentVO().getJshj()); + head.setPk_invoice(pinvoice.getParentVO().getPk_invoice()); + if (bhcInvoiceRelation.getAmount() != null) { + head.setAmount(bhcInvoiceRelation.getAmount().multiply(-1)); + } + if (bhcInvoiceRelation.getJe() != null) { + head.setJe(bhcInvoiceRelation.getJe().multiply(-1)); + } + if (bhcInvoiceRelation.getSe() != null) { + head.setSe(bhcInvoiceRelation.getSe().multiply(-1)); + } + heads.add(head); + } + } + } + } + return heads; + } + + /** + * 根据平台发票申请返回结果(传税务云发票)转换开票日志 + * + * @param pinvoice + * @return + * @throws BusinessException + */ + public static IVApplogVO getIVApplogVOFromPInvoice(PInvoice pinvoice) throws BusinessException { + + return getIVApplogVOFromPInvoice(pinvoice, KpztEnum.KPING); + } + + /** + * 根据平台发票申请返回结果(传税务云发票单)转换开票日志 + * + * @param pinvoice + * @return + * @throws BusinessException + */ + public static IVApplogVO getIVApplogVOFromPInvoiceBill(PInvoice pinvoice) throws BusinessException { + + return getIVApplogVOFromPInvoice(pinvoice, KpztEnum.DKP); + } + + /** + * 根据发票生成开票日志 + * @param pinvoice + * @param kpzt + * @return + * @throws BusinessException + */ + public static IVApplogVO getIVApplogVOFromPInvoice(PInvoice pinvoice, int kpzt) throws BusinessException{ + SequenceGenerator generator = new SequenceGenerator(); + IVApplogVO logvo = new IVApplogVO(); + logvo.setCode(IVMInvoiceConstant.SUCCESS_CODE); + logvo.setKpzt(kpzt);// 待开票 + logvo.setLyid(pinvoice.getLyid()); + logvo.setStatus(VOStatus.NEW); + logvo.setFpqqlsh(pinvoice.getApplyNumber()); + logvo.setInvoice_type(InvoiceTypeToTspzUtil.getInvoicetypeByFplxAndTspz(pinvoice.getFplx(), pinvoice.getTspz())); + logvo.setKprq(pinvoice.getKprq()); + logvo.setGmfmc(pinvoice.getGmfMc()); + logvo.setXsfmc(pinvoice.getXsfMc()); + if (InvoiceTypeEnum.getSGFP().contains(Integer.parseInt(logvo.getInvoice_type())) || (pinvoice.getSgbz() != null && "2".equals(pinvoice.getSgbz()))) { + logvo.setGmfmc(pinvoice.getXsfMc()); + logvo.setXsfmc(pinvoice.getGmfMc()); + } + logvo.setJshj(getBigDecimalToUFDouble(pinvoice.getJshj())); + logvo.setHjje(getBigDecimalToUFDouble(pinvoice.getHjje())); + logvo.setHjse(getBigDecimalToUFDouble(pinvoice.getHjse())); + logvo.setKpr(pinvoice.getKpr()); + logvo.setPk_ivapplog(generator.generate()); + logvo.setItems(pinvoice.getItems()); + return logvo; + } + + public static IVApplogVO getIVApplogVOFromInvoiceBillInfo(InvoiceBillInfo billinfo) throws BusinessException { + IVApplogVO logvo = new IVApplogVO(); + + PInvoice pinvoice = billinfo.getInvoice(); + + logvo.setCode(IVMInvoiceConstant.SUCCESS_CODE); + if ("4".equals(billinfo.getStatuscode())) { + // 开票成功 + logvo.setKpzt(KpztEnum.KP); + } else if ("2".equals(billinfo.getStatuscode())) { + // 开票中 + logvo.setKpzt(KpztEnum.KPING);// 开票中 + } else if ("3".equals(billinfo.getStatuscode())) { + logvo.setKpzt(KpztEnum.KPERR);// 开票失败 + logvo.setErrmsg(billinfo.getErrmsg()); + } + if (pinvoice != null) { + // Statuscode=1的时候pinvoice为空 + logvo.setLyid(pinvoice.getLyid()); + logvo.setFpqqlsh(pinvoice.getApplyNumber()); + logvo.setInvoice_type(InvoiceTypeToTspzUtil.getInvoicetypeByFplxAndTspz(pinvoice.getFplx(), pinvoice.getTspz())); + logvo.setKprq(pinvoice.getKprq()); + logvo.setGmfmc(pinvoice.getGmfMc()); + logvo.setXsfmc(pinvoice.getXsfMc()); + if (InvoiceTypeEnum.getSGFP().contains(Integer.parseInt(logvo.getInvoice_type())) || (pinvoice.getSgbz() != null && "2".equals(pinvoice.getSgbz()))) { + logvo.setGmfmc(pinvoice.getXsfMc()); + logvo.setXsfmc(pinvoice.getGmfMc()); + } + logvo.setJshj(getBigDecimalToUFDouble(pinvoice.getJshj())); + logvo.setHjje(getBigDecimalToUFDouble(pinvoice.getHjje())); + logvo.setHjse(getBigDecimalToUFDouble(pinvoice.getHjse())); + logvo.setKpr(pinvoice.getKpr()); + + logvo.setFphm(pinvoice.getFpHm()); + logvo.setFpdm(pinvoice.getFpDm()); + } + logvo.setStatus(VOStatus.NEW); + + return logvo; + } + + /** + * 根据开票申请转换成发票平台VO + * + * @return + */ + private static PInvoice getPInvoiceByApplyHead(IVApplicationHeadVO headvo) { + + PInvoice pinvoice = new PInvoice(); + + pinvoice.setApplyNumber(headvo.getPk_ivapplication()); + pinvoice.setLyid(headvo.getPk_ivapplication()); + pinvoice.setFplx(InvoiceTypeToTspzUtil.getRealInvoicetype(headvo.getFplx())); + String tspz = InvoiceTypeToTspzUtil.getTspz(headvo.getFplx()); + if(StringUtils.isEmpty(tspz) && StringUtils.isNotEmpty(headvo.getTspz())){ + try { + Collection defdocVOS = ((IUAPQueryBS)NCLocator.getInstance().lookup(IUAPQueryBS.class.getName())).retrieveByClause(DefdocVO.class, " "+DefdocVO.PK_DEFDOC+"='"+headvo.getTspz()+"' "); + if(defdocVOS!=null && defdocVOS.size()>0){ + for(DefdocVO DefdocVO:defdocVOS){ + tspz = DefdocVO.getCode(); + break; + } + } + } catch (BusinessException e) { + SSCIVMLogger.error(e.getMessage(), e); + } + } + + pinvoice.setTspz(tspz); + // 目前传值,后续应该不传,税务云都通过组织编码解析,销售方的其他信息不需要传值 + if (headvo.getSgbz()!=null && headvo.getSgbz().booleanValue()) {//收购销方转购方 + pinvoice.setGmf_dz(headvo.getXsf_dz()); + pinvoice.setGmf_dh(headvo.getXsf_dh()); + pinvoice.setGmf_yh(headvo.getXsf_yh()); + pinvoice.setGmf_zh(headvo.getXsf_zhh()); + pinvoice.setGmfNsrsbh(headvo.getXsf_nsrsbh()); + pinvoice.setGmfMc(headvo.getXsf_mc()); + pinvoice.setGmfDzdh(headvo.getXsf_dzdh()); + pinvoice.setGmfYhzh(headvo.getXsf_yhzh()); + pinvoice.setXsfNsrsbh(headvo.getGmf_nsrsbh()); + } else { + pinvoice.setXsfYhzh((headvo.getXsf_yhzh()==null?"":headvo.getXsf_yhzh())); + pinvoice.setXsfNsrsbh(headvo.getXsf_nsrsbh()); + pinvoice.setXsf_dz(headvo.getXsf_dz()); + pinvoice.setXsf_dh(headvo.getXsf_dh()); + pinvoice.setXsf_yh(headvo.getXsf_yh()); + pinvoice.setXsf_zh(headvo.getXsf_zhh()); + pinvoice.setGmf_dz(headvo.getGmf_dz()); + pinvoice.setGmf_dh(headvo.getGmf_dh()); + pinvoice.setGmf_yh(headvo.getGmf_yh()); + pinvoice.setGmf_zh(headvo.getGmf_zhh()); + pinvoice.setGmfNsrsbh(headvo.getGmf_nsrsbh()); + pinvoice.setGmfMc(headvo.getGmf_mc()); + pinvoice.setGmfDzdh(headvo.getGmf_dzdh()); + pinvoice.setGmfYhzh(headvo.getGmf_yhzh()); + } + + //收购标志处理 + if (headvo.getSgbz().booleanValue()) { + pinvoice.setSgbz("2"); + } + + pinvoice.setKpr(headvo.getKpr()); + pinvoice.setSkr(headvo.getSkr()); + pinvoice.setFhr(headvo.getFhr()); + pinvoice.setJshj(getUFDoubleToBigDecimal(headvo.getCaninvoice_jshj()).setScale(2, UFDouble.ROUND_HALF_UP)); + + pinvoice.setSrcBillNo(headvo.getSrc_billno()); + // pinvoice.setHjje(getUFDoubleToBigDecimal(headvo.getHjje()).setScale(2, + // UFDouble.ROUND_HALF_UP));//存在含税和不含税单价,统一交由税务云反算 + // pinvoice.setHjse(getUFDoubleToBigDecimal(headvo.getHjse()).setScale(2, + // UFDouble.ROUND_HALF_UP));//存在含税和不含税单价,统一交由税务云反算 + pinvoice.setBz(headvo.getBz()); + pinvoice.setZdybz(headvo.getZdybz()); + pinvoice.setOrgcode(headvo.getOrgcode()); + + //税率说明 + pinvoice.setSlsm(headvo.getSlsm()); + + pinvoice.setAllelcusername(headvo.getAllelcusername()); + pinvoice.setAllelcpassword(headvo.getAllelcpassword()); + + pinvoice.setZsfs(headvo.getZsfs()==null?"":headvo.getZsfs()); + + //数电特殊票种字段 + pinvoice.setBdcdz(headvo.getBdcdz()); + pinvoice.setZlqq(getFormatDate(headvo.getZlqq())); + pinvoice.setZlqz(getFormatDate(headvo.getZlqz())); + pinvoice.setKdsbz(headvo.getKdsbz()); + pinvoice.setTdzzsxmbh(headvo.getTdzzsxmbh()); + pinvoice.setWqhtbabh(headvo.getWqhtbabh()); + pinvoice.setBdcdwdm(headvo.getBdcdwdm()); + pinvoice.setHdjsjg(headvo.getHdjsjg() == null ? null : getUFDoubleToBigDecimal(headvo.getHdjsjg()).setScale(2, UFDouble.ROUND_HALF_UP)); + pinvoice.setSjcjhsje(headvo.getSjcjhsje() == null ? null : getUFDoubleToBigDecimal(headvo.getSjcjhsje()).setScale(2, UFDouble.ROUND_HALF_UP)); + pinvoice.setBxdh(headvo.getBxdh()); + pinvoice.setCphcbdjh(headvo.getCphcbdjh()); + pinvoice.setSkssq(headvo.getSkssq()); + pinvoice.setDsccsje(headvo.getDsccsje() == null ? null : getUFDoubleToBigDecimal(headvo.getDsccsje()).setScale(2, UFDouble.ROUND_HALF_UP)); + pinvoice.setZnj(headvo.getZnj() == null ? null : getUFDoubleToBigDecimal(headvo.getZnj()).setScale(2, UFDouble.ROUND_HALF_UP)); + pinvoice.setJehj(headvo.getJehj() == null ? null : getUFDoubleToBigDecimal(headvo.getJehj()).setScale(2, UFDouble.ROUND_HALF_UP)); + pinvoice.setCjh(headvo.getCjh()); + pinvoice.setKqysssxbgglbm(headvo.getKqysssxbgglbm()); + return pinvoice; + } + + /** + * 根据红冲申请转换成发票平台VO + * + * @return + */ + private static PInvoice getPInvoiceByApplyHead4Red(IVApplicationHeadVO headvo) { + + PInvoice pinvoice = new PInvoice(); + pinvoice.setApplyNumber(headvo.getPk_ivapplication()); + pinvoice.setLyid(headvo.getPk_ivapplication()); + pinvoice.setFplx(String.valueOf(headvo.getFplx())); + pinvoice.setXsfNsrsbh(headvo.getXsf_nsrsbh()); + pinvoice.setFpHm(headvo.getFphm()); + pinvoice.setFpDm(headvo.getFpdm()); + pinvoice.setKpr(headvo.getKpr()); + pinvoice.setJshj(getUFDoubleToBigDecimal(headvo.getCaninvoice_jshj()).setScale(2, UFDouble.ROUND_HALF_UP)); + pinvoice.setXsfYhzh((headvo.getXsf_yhzh()==null?"":headvo.getXsf_yhzh())); + pinvoice.setHzxxbbh(headvo.getHzxxsqb()); + // pinvoice.setHjje(getUFDoubleToBigDecimal(headvo.getHjje()).setScale(2, + // UFDouble.ROUND_HALF_UP));//存在含税和不含税单价,统一交由税务云反算 + // pinvoice.setHjse(getUFDoubleToBigDecimal(headvo.getHjse()).setScale(2, + // UFDouble.ROUND_HALF_UP));//存在含税和不含税单价,统一交由税务云反算 + pinvoice.setOrgcode(headvo.getOrgcode()); + + //税率说明红冲原因 + pinvoice.setSlsm(headvo.getSlsm()); + pinvoice.setHcyy(headvo.getHcyy()); + + pinvoice.setAllelcusername(headvo.getAllelcusername()); + pinvoice.setAllelcpassword(headvo.getAllelcpassword()); + pinvoice.setXsf_dz(headvo.getXsf_dz()); + pinvoice.setXsf_dh(headvo.getXsf_dh()); + pinvoice.setXsf_yh(headvo.getXsf_yh()); + pinvoice.setXsf_zh(headvo.getXsf_zhh()); + return pinvoice; + } + + /** + * 根据开票申请明细转成成发票平台明细VO + * + * @param body + * @return + */ + private static PInvoiceDetail getPInvoiceByApplyHead(IVApplicationHeadVO headvo, IVApplicationBodyVO body) { + + PInvoiceDetail detailvo = new PInvoiceDetail(); + //开票神申请规格型号自动截取40位长度 + detailvo.setGgxh((body.getGgxh()!=null&&body.getGgxh().length()>40)?body.getGgxh().substring(0, 40):body.getGgxh()); + detailvo.setDw(body.getDw()); + detailvo.setXmsl(getUFDoubleToBigDecimal(body.getCaninvoice_xmsl())); + detailvo.setZkhhh(body.getZkhhh()); + detailvo.setFphxz(body.getFphxz() == null ? IVAplocationFPXZ.FPXZ_ZCH.toIntValue() : body.getFphxz()); + detailvo.setHh(body.getHh()); + // detailvo.setXmdj(getUFDoubleToBigDecimal(body.getXmdj())); //存在含税和不含税单价,统一交由税务云反算 + // detailvo.setXmje(getUFDoubleToBigDecimal(body.getCaninvoice_xmje()).setScale(2, UFDouble.ROUND_HALF_UP)); //税务云反算 + detailvo.setXmjshj(getUFDoubleToBigDecimal(body.getCaninvoice_xmjshj()).setScale(2, UFDouble.ROUND_HALF_UP)); + detailvo.setSl(getUFDoubleToBigDecimal(body.getSl()).multiply(new BigDecimal(0.01))); + // detailvo.setSe(detailvo.getXmjshj().subtract(detailvo.getXmje())); //税务云反算 + if(body.getSsflbm()!=null && body.getSsflbm().length()>0){ + // 传税收分类编码的开票 + detailvo.setSpbm(body.getSsflbm()); + detailvo.setXmmc(body.getXmmc()); + }else if ((body.getPk_materiel() == null || body.getPk_materiel().length() == 0)) { + // 重开的场景 + String xmmc = body.getXmmc(); + if (xmmc != null && headvo.getCkfp() != null && headvo.getCkfp().booleanValue()) { + xmmc = xmmc.replace("*", "");// 按税务云清除第一个*号 + xmmc = xmmc.replace("*", "");// 按税务云清除第二个*号 + } + detailvo.setXmmc(xmmc); + detailvo.setSpbm(body.getSpbm()); + } else { + // 正常开票的场景 + detailvo.setXmbm(body.getSpbm()); + detailvo.setXmmc(body.getXmmc()); + } + detailvo.setLslbs(body.getLslbs()); + if (headvo.getSgbz().booleanValue()) { + detailvo.setLslbs(IVAplocationLSLBS.LSLBS_MS.toStringValue()); + } + if(body.getYhzcbs()!=null){ + detailvo.setYhzcbs(body.getYhzcbs()); + detailvo.setZzstsgl(body.getZzstsgl()); + } + detailvo.setKce(body.getKce() == null ? null : getUFDoubleToBigDecimal(body.getKce())); + //简易征收 + if (body.getYhzcbs() != null) { + detailvo.setYhzcbs(body.getYhzcbs()); + } + detailvo.setZzstsgl(body.getZzstsgl()); + + //motor 明细数据处理 + PInvoiceSDetail motor = new PInvoiceSDetail(); + motor.setCqzsbh(body.getCqzsbh()); + motor.setJzfwfsd(body.getJzfwfsd()); + motor.setJzxmmc(body.getJzxmmc()); + // **************************2024-07-10 新增 对应税务云,开票申请表体增加9个自定义项 + + + if(!StringUtils.isEmpty(body.getDef24())) {//CD 产地 + motor.setCd(body.getDef24()); + } + + if(!StringUtils.isEmpty(body.getDef25())) {//CJHM 车架号码! + motor.setCjhm(body.getDef25()); + } + + if(!StringUtils.isEmpty(body.getDef26())) {//车辆类型 CLLX + motor.setCllx(body.getDef26()); + } + + if(!StringUtils.isEmpty(body.getDef27())) {//CPXH 厂牌型号 + motor.setCpxh(body.getDef27()); + } + + if(!StringUtils.isEmpty(body.getDef28())) {//SCQYMC 生产企业名称 + motor.setScqymc(body.getDef28()); + } + + if(!StringUtils.isEmpty(body.getDef29())) {// XCRS 限乘人数 + motor.setXcrs(body.getDef29()); + } + + if(!StringUtils.isEmpty(body.getDef17())) {// HGZH 合格证号 + motor.setHgzh(body.getDef17()); + } + + if(!StringUtils.isEmpty(body.getDef17())) {// HGZH 合格证号 + motor.setHgzh(body.getDef17()); + } + + if(!StringUtils.isEmpty(body.getDef20())) {// FDJHM 发动机号码 + motor.setFdjhm(body.getDef20()); + } + + if(!StringUtils.isEmpty(body.getDef30())) {// DUNWEI 吨位 + motor.setDunwei(body.getDef30()); + } + + + detailvo.setDetailMotor(motor); + //@特殊票种电子凭证@end + return detailvo; + } + + /** + * 特殊票种发票信息转换 + * @param tspzVOs + * @param invoice + * @return + */ + private static PInvoice getPInvoiceByApplyTspz(IVTspzsBodyVO[] tspzVOs, PInvoice invoice) { + List tspzs = new ArrayList(); + List cepzs = new ArrayList(); + for (IVTspzsBodyVO tspzVO : tspzVOs){ + //差额开票 + if (StringUtils.isNotEmpty(tspzVO.getPzlx()) && (IVAplocationZSFS.HCYY_CEZS.toStringValue().equals(invoice.getZsfs())|| IVAplocationZSFS.HCYY_QEZS.toStringValue().equals(invoice.getZsfs()))){ + PInvoiceCepz cepz = new PInvoiceCepz(); + cepz.setXh(tspzVO.getXh()); + cepz.setPzlx(tspzVO.getPzlx()); + cepz.setFphm(tspzVO.getFphm()); + cepz.setFpdm(tspzVO.getFpdm()); + cepz.setZzfphm(tspzVO.getZzfphm()); + cepz.setPzhm(tspzVO.getPzhm()); + cepz.setKjrq(getFormatDate(tspzVO.getKjrq())); + cepz.setHjje(tspzVO.getHjje() == null ? null : getUFDoubleToBigDecimal(tspzVO.getHjje()).setScale(2, UFDouble.ROUND_HALF_UP)); + cepz.setKce(tspzVO.getKce() == null ? null : getUFDoubleToBigDecimal(tspzVO.getKce()).setScale(2, UFDouble.ROUND_HALF_UP)); + cepz.setBz(tspzVO.getBz()); + cepz.setLy(tspzVO.getLy()); + cepz.setBckcje(tspzVO.getBckcje() == null ? null : getUFDoubleToBigDecimal(tspzVO.getBckcje()).setScale(2, UFDouble.ROUND_HALF_UP)); + cepz.setPzhjje(tspzVO.getPzhjje() == null ? null : getUFDoubleToBigDecimal(tspzVO.getPzhjje()).setScale(2, UFDouble.ROUND_HALF_UP)); + cepzs.add(cepz); + } + + //货物运输 + if (StringUtils.isNotEmpty(tspzVO.getYsgjzl()) && IVAWebConst.TSPZ_HWYS.equals(invoice.getTspz())){ + PInvoiceTspz tspz = new PInvoiceTspz(); + tspz.setYsmxxh(tspzVO.getYsmxxh()); + tspz.setYsgjzl(tspzVO.getYsgjzl()); + tspz.setYsgjph(tspzVO.getYsgjph()); + tspz.setQyd(tspzVO.getQyd()); + tspz.setDdd(tspzVO.getDdd()); + tspz.setYshwmc(tspzVO.getYshwmc()); + tspzs.add(tspz); + } + + //旅客运输 + if (StringUtils.isNotEmpty(tspzVO.getCxr()) && IVAWebConst.TSPZ_LKYS.equals(invoice.getTspz())){ + PInvoiceTspz tspz = new PInvoiceTspz(); + tspz.setCxrxh(tspzVO.getCxrxh()); + tspz.setCxr(tspzVO.getCxr()); + tspz.setChuxrq(getFormatDate(tspzVO.getChuxrq())); + tspz.setCxrzjlxDm(tspzVO.getCxrzjlxdm()); + tspz.setSfzjhm(tspzVO.getSfzjhm()); + tspz.setCfd(tspzVO.getCfd()); + tspz.setLkddd(tspzVO.getLkddd()); + tspz.setZwdj(tspzVO.getZwdj()); + tspz.setJtgjlxDm(tspzVO.getJtgjlxdm()); + tspzs.add(tspz); + } + } + + if (tspzs.size() > 0){ + invoice.setTspzs(tspzs.toArray(new PInvoiceTspz[0])); + } + if (cepzs.size() > 0){ + invoice.setCepzs(cepzs.toArray(new PInvoiceCepz[0])); + } + return invoice; + } + + /** + * 根据开票申请明细转成成发票平台明细VO + * + * @param body + * @return + */ + private static PInvoiceDetail getPInvoiceByApplybody4Red(IVApplicationBodyVO body) { + + PInvoiceDetail detailvo = new PInvoiceDetail(); + + detailvo.setXmmc(body.getXmmc()); + //开票神申请规格型号自动截取40位长度 + detailvo.setGgxh((body.getGgxh()!=null&&body.getGgxh().length()>40)?body.getGgxh().substring(0, 40):body.getGgxh()); + detailvo.setDw(body.getDw()); + detailvo.setXmsl(getUFDoubleToBigDecimal(body.getCaninvoice_xmsl())); + detailvo.setZkhhh(body.getZkhhh()); + detailvo.setFphxz(body.getFphxz() == null ? IVAplocationFPXZ.FPXZ_ZCH.toIntValue() : body.getFphxz()); + detailvo.setHh(body.getHh()); + // detailvo.setXmdj(getUFDoubleToBigDecimal(body.getXmdj())); //存在含税和不含税单价,统一交由税务云反算 + // detailvo.setXmje(getUFDoubleToBigDecimal(body.getXmje()));//存在含税和不含税单价,统一交由税务云反算 + detailvo.setXmjshj(getUFDoubleToBigDecimal(body.getCaninvoice_xmjshj()).setScale(2, UFDouble.ROUND_HALF_UP)); + detailvo.setSl(getUFDoubleToBigDecimal(body.getSl()).multiply(new BigDecimal(0.01))); + // detailvo.setSe(getUFDoubleToBigDecimal(body.getSe()));//存在含税和不含税单价,统一交由税务云反算 + if(body.getSsflbm()!=null && body.getSsflbm().length()>0){ + // 传税收分类编码的开票 + detailvo.setSpbm(body.getSsflbm()); + }else { + detailvo.setSpbm(body.getSpbm()); + } + return detailvo; + } + + /** + * 根据平台发票开票后返回的数据获取来源id数组 + * + * @param pinvoice + * @return + * @throws BusinessException + */ + public static String[] getInvoiceApplyStatusCallBack(RequestInfo request) + throws BusinessException { + String[] lyidarr = null; + String lyids = request.getData().getLyid(); + if (lyids != null && lyids.length() > 0) { + lyidarr = lyids.split(IVAWebConst.IVA_LYID_SPLIT); + } + return lyidarr; + } + + public static UFDouble getBigDecimalToUFDouble(BigDecimal in) { + UFDouble out = new UFDouble(0.00); + out = in == null ? new UFDouble(0.00) : new UFDouble(in); + return out; + } + + public static BigDecimal getUFDoubleToBigDecimal(UFDouble in) { + BigDecimal out = new BigDecimal(0.00); + out = in == null ? out : new BigDecimal(in.toString()); + return out; + } + + /** + * 获取开票日期 + * @param kprq 税务云传递过来的开票日期 + * @return UFDate 转换后的开票日期 + */ + public static UFDate getUFDate(String kprq){ + //日期为空或长度不对,直接取当前日期 + if(kprq != null && kprq.length() == 10) { + return new UFDate(kprq); + } + if (kprq == null || kprq.length() != 14){ + return new UFDate(); + } else { + StringBuffer date = new StringBuffer(); + date.append(kprq.substring(0, 4)); + date.append("-"); + date.append(kprq.substring(4, 6)); + date.append("-"); + date.append(kprq.substring(6, 8)); + date.append(" "); + date.append(kprq.substring(8, 10)); + date.append(":"); + date.append(kprq.substring(10, 12)); + date.append(":"); + date.append(kprq.substring(12, 14)); + return new UFDateTime(date.toString()).getDate(); + } + } + + + public static UFDouble tranZeroAmount(UFDouble amount) { + if(amount==null) {return UFDouble.ZERO_DBL;} + amount = (amount.compareTo(UFDouble.ZERO_DBL)<0)?UFDouble.ZERO_DBL:amount; + if (amount.abs().compareTo(new UFDouble(0.005)) < 0){ + amount = UFDouble.ZERO_DBL; + } + return amount; + } + + /** + * 把UFDate转换成yyyy-MM-dd格式 + * @param ufDate + * @return + */ + public static String getFormatDate(UFDate ufDate){ + if(ufDate==null){ + return null; + } + Date date = ufDate.toDate(); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + return format.format(date); + } + +} diff --git a/sscivm/src/public/nc/vo/sscivm/ivsale/IVApplicationHeadVO.java b/sscivm/src/public/nc/vo/sscivm/ivsale/IVApplicationHeadVO.java new file mode 100644 index 0000000..0146047 --- /dev/null +++ b/sscivm/src/public/nc/vo/sscivm/ivsale/IVApplicationHeadVO.java @@ -0,0 +1,2171 @@ +/***************************************************************\ + * The skeleton of this class is generated by an automatic * + * code generator for NC product. It is based on Velocity. * + \***************************************************************/ +package nc.vo.sscivm.ivsale; + +import nc.vo.pub.IVOMeta; +import nc.vo.pub.SuperVO; +import nc.vo.pub.lang.UFBoolean; +import nc.vo.pub.lang.UFDateTime; +import nc.vo.pub.lang.UFDouble; +import nc.vo.pub.lang.UFDate; +import nc.vo.pubapp.pattern.model.meta.entity.vo.VOMetaFactory; + +/** + * 在此处简要描述此类的功能 + *

+ * 在此处添加此类的描述信息 + *

+ * 创建日期: + * @author + * @version NCPrj ?? + */ +public class IVApplicationHeadVO extends SuperVO { + /** + * + */ + private static final long serialVersionUID = -6024527801462053600L; + private java.lang.String pk_ivapplication; + private java.lang.String pk_group; + private java.lang.String pk_org; + private java.lang.String pk_org_v; + private java.lang.String pk_dept; + private java.lang.String pk_billtype; + private java.lang.String pk_tradetype; + private java.lang.String transtypecode; + private java.lang.String billtypecode; + private java.lang.String billno; + private java.lang.String src_pkbusibill; + private java.lang.String src_billtype; + private java.lang.String src_tradetype; + private java.lang.String src_billno; + private UFDate src_billdate; + private java.lang.Integer fplx; + private java.lang.String xsf_nsrsbh; + private java.lang.String xsf_mc; + private java.lang.String xsf_dzdh; + private java.lang.String xsf_yhzh; + private java.lang.String xsf_khh; + private java.lang.String xsf_zh; + private java.lang.String pk_customer; + private java.lang.String pk_freecustom; + private java.lang.String gmf_nsrsbh; + private java.lang.String gmf_mc; + private java.lang.String gmf_dzdh; + private java.lang.String gmf_yhzh; + private java.lang.String gmf_khh; + private java.lang.String gmf_zh; + private java.lang.String kpr; + private java.lang.String skr; + private java.lang.String fhr; + private UFDouble jshj; + private UFDouble hjje; + private UFDouble hjse; + private UFDouble bchcje; + private java.lang.String bz; + private java.lang.String lyid; + private java.lang.String bmb_bbh; + private java.lang.String orgcode; + private java.lang.String wxorderid; + private java.lang.String wxappid; + private java.lang.String wxauthid; + private java.lang.String zdybz; + private UFBoolean sgbz; + private java.lang.String sqr; + private UFDate preparedate; + private java.lang.String approver; + private UFDateTime approvedate; + private java.lang.String creator; + private UFDateTime creationtime; + private java.lang.String modifier; + private UFDateTime modifiedtime; + private java.lang.String def1; + private java.lang.String def2; + private java.lang.String def3; + private java.lang.String def4; + private java.lang.String def5; + private java.lang.String def6; + private java.lang.String def7; + private java.lang.String def8; + private java.lang.String def9; + private java.lang.String def10; + private java.lang.String def11; + private java.lang.String def12; + private java.lang.String def13; + private java.lang.String def14; + private java.lang.String def15; + private java.lang.String def16; + private java.lang.String def17; + private java.lang.String def18; + private java.lang.String def19; + private java.lang.String def20; + private java.lang.String def21; + private java.lang.String def22; + private java.lang.String def23; + private java.lang.String def24; + private java.lang.String def25; + private java.lang.String def26; + private java.lang.String def27; + private java.lang.String def28; + private java.lang.String def29; + private java.lang.String def30; + private java.lang.String fpdm; + private java.lang.String fphm; + private java.lang.String hzxxsqb; + private java.lang.Integer billstatus; + private UFBoolean hzfp; + private UFBoolean ckfp; + private UFBoolean zffp; + private UFBoolean kpzt; + private java.lang.Integer kpfs;// 开票方式 + private java.lang.Integer dr = 0; + private UFDateTime ts; + private java.lang.String redrush_falg;//红冲来源标识,后台使用 + + private java.lang.String src_jx_sporg; + private java.lang.String src_jx_spr; + private java.lang.String src_jx_billno; + private java.lang.String src_jx_billid; + private java.lang.String src_jx_billtypeid; + private java.lang.String src_jx_tradetypeid; + + private UFDouble invoiceing_hjje = UFDouble.ZERO_DBL; + private UFDouble invoiceing_hjse = UFDouble.ZERO_DBL; + private UFDouble invoiceing_jshj = UFDouble.ZERO_DBL; + private UFDouble invoiced_hjje = UFDouble.ZERO_DBL; + private UFDouble invoiced_hjse = UFDouble.ZERO_DBL; + private UFDouble invoiced_jshj = UFDouble.ZERO_DBL; + private UFDouble caninvoice_hjje = UFDouble.ZERO_DBL; + private UFDouble caninvoice_hjse = UFDouble.ZERO_DBL; + private UFDouble caninvoice_jshj = UFDouble.ZERO_DBL; + + private java.lang.String email; + //接收手机 + private java.lang.String sms; + + private java.lang.String pk_customer_v; + + private java.lang.String ylfphm; + private java.lang.String ylfpdm; + + //分布式事务需要的字段 wangzhb2 + private java.lang.Integer saga_frozen; + private java.lang.String saga_gtxid; + private java.lang.String saga_btxid; + private java.lang.Integer saga_status; + + //税率说明红冲原因 + private UFBoolean xgmnsr; + private java.lang.String slsm; + private java.lang.String hcyy; + + private java.lang.String xsf_dz; + private java.lang.String xsf_dh; + private java.lang.String xsf_yh; + private java.lang.String xsf_zhh; + private java.lang.String gmf_dz; + private java.lang.String gmf_dh; + private java.lang.String gmf_yh; + private java.lang.String gmf_zhh; + private java.lang.String allelcusername; + private java.lang.String allelcpassword; + + + private java.lang.String pk_supplier; + private java.lang.String pk_supplier_v; + + private java.lang.String zsfs; //征税方式 + + + private java.lang.String tspz; + private java.lang.String tspzdef99; + private java.lang.String kdsbz; + private java.lang.String bdcdz; + private UFDate zlqq; + private UFDate zlqz; + private java.lang.String tdzzsxmbh; + private java.lang.String wqhtbabh; + private java.lang.String bdcdwdm; + private UFDouble hdjsjg; + private UFDouble sjcjhsje; + private java.lang.String bxdh; + private java.lang.String cphcbdjh; + private java.lang.String skssq; + private java.lang.String cjh; + private UFDouble dsccsje; + private UFDouble znj; + private UFDouble jehj; + + private java.lang.String kqysssxbgglbm; + public static final String KQYSSSXBGGLBM = "kqysssxbgglbm"; + + public java.lang.String getKqysssxbgglbm() { + return kqysssxbgglbm; + } + + public void setKqysssxbgglbm(java.lang.String kqysssxbgglbm) { + this.kqysssxbgglbm = kqysssxbgglbm; + } + + public static final String PK_IVAPPLICATION = "pk_ivapplication"; + public static final String BCHCJE = "bchcje"; + public static final String PK_GROUP = "pk_group"; + public static final String PK_ORG = "pk_org"; + public static final String PK_ORG_V = "pk_org_v"; + public static final String PK_DEPT = "pk_dept"; + public static final String PK_BILLTYPE = "pk_billtype"; + public static final String PK_TRADETYPE = "pk_tradetype"; + public static final String TRANSTYPECODE = "transtypecode"; + public static final String BILLNO = "billno"; + public static final String SRC_PKBUSIBILL = "src_pkbusibill"; + public static final String SRC_BILLTYPE = "src_billtype"; + public static final String SRC_TRADETYPE = "src_tradetype"; + public static final String SRC_BILLNO = "src_billno"; + public static final String SRC_BILLDATE = "src_billdate"; + public static final String FPLX = "fplx"; + public static final String PK_FREECUSTOM = "pk_freecustom"; + public static final String XSF_NSRSBH = "xsf_nsrsbh"; + public static final String XSF_MC = "xsf_mc"; + public static final String XSF_DZDH = "xsf_dzdh"; + public static final String XSF_YHZH = "xsf_yhzh"; + public static final String XSF_KHH = "xsf_khh"; + public static final String XSF_ZH = "xsf_zh"; + public static final String PK_CUSTOMER = "pk_customer"; + public static final String GMF_NSRSBH = "gmf_nsrsbh"; + public static final String GMF_MC = "gmf_mc"; + public static final String GMF_DZDH = "gmf_dzdh"; + public static final String GMF_YHZH = "gmf_yhzh"; + public static final String GMF_KHH = "gmf_khh"; + public static final String GMF_ZH = "gmf_zh"; + public static final String KPR = "kpr"; + public static final String SKR = "skr"; + public static final String FHR = "fhr"; + public static final String JSHJ = "jshj"; + public static final String HJJE = "hjje"; + public static final String HJSE = "hjse"; + public static final String BZ = "bz"; + public static final String LYID = "lyid"; + public static final String BMB_BBH = "bmb_bbh"; + public static final String ORGCODE = "orgcode"; + public static final String WXORDERID = "wxorderid"; + public static final String WXAPPID = "wxappid"; + public static final String WXAUTHID = "wxauthid"; + public static final String ZDYBZ = "zdybz"; + public static final String SGBZ = "sgbz"; + public static final String SQR = "sqr"; + public static final String PREPAREDATE = "preparedate"; + public static final String APPROVER = "approver"; + public static final String APPROVEDATE = "approvedate"; + public static final String CREATOR = "creator"; + public static final String CREATIONTIME = "creationtime"; + public static final String MODIFIER = "modifier"; + public static final String MODIFIEDTIME = "modifiedtime"; + public static final String DEF1 = "def1"; + public static final String DEF2 = "def2"; + public static final String DEF3 = "def3"; + public static final String DEF4 = "def4"; + public static final String DEF5 = "def5"; + public static final String DEF6 = "def6"; + public static final String DEF7 = "def7"; + public static final String DEF8 = "def8"; + public static final String DEF9 = "def9"; + public static final String DEF10 = "def10"; + public static final String DEF11 = "def11"; + public static final String DEF12 = "def12"; + public static final String DEF13 = "def13"; + public static final String DEF14 = "def14"; + public static final String DEF15 = "def15"; + public static final String DEF16 = "def16"; + public static final String DEF17 = "def17"; + public static final String DEF18 = "def18"; + public static final String DEF19 = "def19"; + public static final String DEF20 = "def20"; + public static final String DEF21 = "def21"; + public static final String DEF22 = "def22"; + public static final String DEF23 = "def23"; + public static final String DEF24 = "def24"; + public static final String DEF25 = "def25"; + public static final String DEF26 = "def26"; + public static final String DEF27 = "def27"; + public static final String DEF28 = "def28"; + public static final String DEF29 = "def29"; + public static final String DEF30 = "def30"; + public static final String FPDM = "fpdm"; + public static final String FPHM = "fphm"; + public static final String HZXXSQB = "hzxxsqb"; + public static final String BILLSTATUS = "billstatus"; + public static final String HZFP = "hzfp"; + public static final String KPZT = "kpzt"; + public static final String CKFP = "ckfp"; + public static final String ZFFP = "zffp"; + public static final String KPFS = "kpfs"; + public static final String REDRUSH_FALG = "redrush_falg"; + public static final String TS = "ts"; + + public static final String SAGA_FROZEN = "saga_frozen"; + public static final String SAGA_GTXID = "saga_gtxid"; + public static final String SAGA_BTXID = "saga_btxid"; + public static final String SAGA_STATUS = "saga_status"; + + + public static final String SRC_JX_SPORG = "src_jx_sporg"; + public static final String SRC_JX_SPR = "src_jx_spr"; + public static final String SRC_JX_BILLNO = "src_jx_billno"; + public static final String SRC_JX_BILLID = "src_jx_billid"; + public static final String SRC_JX_BILLTYPEID = "src_jx_billtypeid"; + public static final String SRC_JX_TRADETYPEID = "src_jx_tradetypeid"; + + public static final String INVOICEING_HJJE = "invoiceing_hjje"; + public static final String INVOICEING_HJSE = "invoiceing_hjse"; + public static final String INVOICEING_JSHJ = "invoiceing_jshj"; + public static final String INVOICED_HJJE = "invoiced_hjje"; + public static final String INVOICED_HJSE = "invoiced_hjse"; + public static final String INVOICED_JSHJ = "invoiced_jshj"; + public static final String CANINVOICE_HJJE = "caninvoice_hjje"; + public static final String CANINVOICE_HJSE = "caninvoice_hjse"; + public static final String CANINVOICE_JSHJ = "caninvoice_jshj"; + + public static final String EMAIL = "email"; + public static final String SMS = "sms"; + + public static final String PK_CUSTOMER_V = "pk_customer_v"; + + public static final String YLFPHM = "ylfphm"; + public static final String YLFPDM = "ylfpdm"; + + public static final String XGMNSR = "xgmnsr"; + public static final String SLSM = "slsm"; + public static final String HCYY = "hcyy"; + + public static final String XSF_DZ = "xsf_dz"; + public static final String XSF_DH = "xsf_dh"; + public static final String XSF_YH = "xsf_yh"; + public static final String XSF_ZHH = "xsf_zhh"; + public static final String GMF_DZ = "gmf_dz"; + public static final String GMF_DH = "gmf_dh"; + public static final String GMF_YH = "gmf_yh"; + public static final String GMF_ZHH = "gmf_zhh"; + public static final String ALLELCUSERNAME = "allelcusername"; + public static final String ALLELCPASSWORD = "allelcpassword"; + + public static final String PK_SUPPLIER = "pk_supplier"; + public static final String PK_SUPPLIER_V = "pk_supplier_v"; + + public static final String ZSFS = "zsfs"; + + public static final String TSPZ="tspz"; + public static final String TSPZDEF99="tspzdef99"; + public static final String KDSBZ="kdsbz"; + public static final String BDCDZ ="bdcdz"; + public static final String ZLQQ ="zlqq"; + public static final String ZLQZ="zlqz"; + public static final String TDZZSXMBH="tdzzsxmbh"; + public static final String WQHTBABH="wqhtbabh"; + public static final String BDCDWDM="bdcdwdm"; + public static final String HDJSJG="hdjsjg"; + public static final String SJCJHSJE="sjcjhsje"; + public static final String BXDH="bxdh"; + public static final String CPHCBDJH="cphcbdjh"; + public static final String SKSSQ="skssq"; + public static final String CJH="cjh"; + public static final String DSCCSJE="dsccsje"; + public static final String ZNJ="znj"; + public static final String JEHJ="jehj"; + + + /** + * 属性pk_ivapplication的Getter方法.属性名:主键 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_ivapplication () { + return pk_ivapplication; + } + /** + * 属性pk_ivapplication的Setter方法.属性名:主键 + * 创建日期: + * @param newPk_ivapplication java.lang.String + */ + public void setPk_ivapplication (java.lang.String newPk_ivapplication ) { + this.pk_ivapplication = newPk_ivapplication; + } + /** + * 属性pk_group的Getter方法.属性名:集团 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_group () { + return pk_group; + } + /** + * 属性pk_group的Setter方法.属性名:集团 + * 创建日期: + * @param newPk_group java.lang.String + */ + public void setPk_group (java.lang.String newPk_group ) { + this.pk_group = newPk_group; + } + /** + * 属性pk_org的Getter方法.属性名:财务组织 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_org () { + return pk_org; + } + /** + * 属性pk_org的Setter方法.属性名:财务组织 + * 创建日期: + * @param newPk_org java.lang.String + */ + public void setPk_org (java.lang.String newPk_org ) { + this.pk_org = newPk_org; + } + /** + * 属性pk_org_v的Getter方法.属性名:财务组织版本 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_org_v () { + return pk_org_v; + } + /** + * 属性pk_org_v的Setter方法.属性名:财务组织版本 + * 创建日期: + * @param newPk_org_v java.lang.String + */ + public void setPk_org_v (java.lang.String newPk_org_v ) { + this.pk_org_v = newPk_org_v; + } + /** + * 属性pk_billtype的Getter方法.属性名:单据类型 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_billtype () { + return pk_billtype; + } + /** + * 属性pk_billtype的Setter方法.属性名:单据类型 + * 创建日期: + * @param newPk_billtype java.lang.String + */ + public void setPk_billtype (java.lang.String newPk_billtype ) { + this.pk_billtype = newPk_billtype; + } + /** + * 属性pk_tradetype的Getter方法.属性名:交易类型 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_tradetype () { + return pk_tradetype; + } + /** + * 属性pk_tradetype的Setter方法.属性名:交易类型 + * 创建日期: + * @param newPk_tradetype java.lang.String + */ + public void setPk_tradetype (java.lang.String newPk_tradetype ) { + this.pk_tradetype = newPk_tradetype; + } + /** + * 属性transtypecode的Getter方法.属性名:交易类型编码 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getTranstypecode() { + return transtypecode; + } + /** + * 属性transtypecode的Setter方法.属性名:交易类型编码 + * 创建日期: + * @param newPk_tradetype java.lang.String + */ + public void setTranstypecode(java.lang.String transtypecode) { + this.transtypecode = transtypecode; + } + /** + * 属性billtypecode的Setter方法.属性名:交易类型编码 + * 创建日期: + * @param newPk_tradetype java.lang.String + */ + public void setBilltypecode(java.lang.String billtypecode) { + this.billtypecode = billtypecode; + } + /** + * 属性billtypecode的Getter方法.属性名:交易类型编码 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getBilltypecode() { + return billtypecode; + } + /** + * 属性billno的Getter方法.属性名:单据号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getBillno () { + return billno; + } + /** + * 属性billno的Setter方法.属性名:单据号 + * 创建日期: + * @param newBillno java.lang.String + */ + public void setBillno (java.lang.String newBillno ) { + this.billno = newBillno; + } + /** + * 属性src_pkbusibill的Getter方法.属性名:业务单据主键 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getSrc_pkbusibill () { + return src_pkbusibill; + } + /** + * 属性src_pkbusibill的Setter方法.属性名:业务单据主键 + * 创建日期: + * @param newSrc_pkbusibill java.lang.String + */ + public void setSrc_pkbusibill (java.lang.String newSrc_pkbusibill ) { + this.src_pkbusibill = newSrc_pkbusibill; + } + /** + * 属性src_billtype的Getter方法.属性名:来源单据类型 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getSrc_billtype () { + return src_billtype; + } + /** + * 属性src_billtype的Setter方法.属性名:来源单据类型 + * 创建日期: + * @param newSrc_billtype java.lang.String + */ + public void setSrc_billtype (java.lang.String newSrc_billtype ) { + this.src_billtype = newSrc_billtype; + } + /** + * 属性src_tradetype的Getter方法.属性名:来源交易类型 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getSrc_tradetype () { + return src_tradetype; + } + /** + * 属性src_tradetype的Setter方法.属性名:来源交易类型 + * 创建日期: + * @param newSrc_tradetype java.lang.String + */ + public void setSrc_tradetype (java.lang.String newSrc_tradetype ) { + this.src_tradetype = newSrc_tradetype; + } + /** + * 属性src_billno的Getter方法.属性名:来源单据编号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getSrc_billno () { + return src_billno; + } + /** + * 属性src_billno的Setter方法.属性名:来源单据编号 + * 创建日期: + * @param newSrc_billno java.lang.String + */ + public void setSrc_billno (java.lang.String newSrc_billno ) { + this.src_billno = newSrc_billno; + } + public UFDate getSrc_billdate() { + return src_billdate; + } + public void setSrc_billdate(UFDate src_billdate) { + this.src_billdate = src_billdate; + } + /** + * 属性fplx的Getter方法.属性名:发票类型 + * 创建日期: + * @return java.lang.String + */ + public java.lang.Integer getFplx () { + return fplx; + } + /** + * 属性fplx的Setter方法.属性名:发票类型 + * 创建日期: + * @param newFplx java.lang.String + */ + public void setFplx (java.lang.Integer newFplx ) { + this.fplx = newFplx; + } + /** + * 属性xsf_nsrsbh的Getter方法.属性名:销售方纳税人识别号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getXsf_nsrsbh () { + return xsf_nsrsbh; + } + /** + * 属性xsf_nsrsbh的Setter方法.属性名:销售方纳税人识别号 + * 创建日期: + * @param newXsf_nsrsbh java.lang.String + */ + public void setXsf_nsrsbh (java.lang.String newXsf_nsrsbh ) { + this.xsf_nsrsbh = newXsf_nsrsbh; + } + /** + * 属性xsf_mc的Getter方法.属性名:销售方名称 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getXsf_mc () { + return xsf_mc; + } + /** + * 属性xsf_mc的Setter方法.属性名:销售方名称 + * 创建日期: + * @param newXsf_mc java.lang.String + */ + public void setXsf_mc (java.lang.String newXsf_mc ) { + this.xsf_mc = newXsf_mc; + } + /** + * 属性xsf_dzdh的Getter方法.属性名:销售方地址、电话 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getXsf_dzdh () { + return xsf_dzdh; + } + /** + * 属性xsf_dzdh的Setter方法.属性名:销售方地址、电话 + * 创建日期: + * @param newXsf_dzdh java.lang.String + */ + public void setXsf_dzdh (java.lang.String newXsf_dzdh ) { + this.xsf_dzdh = newXsf_dzdh; + } + /** + * 属性xsf_yhzh的Getter方法.属性名:销售方银行账号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getXsf_yhzh () { + return xsf_yhzh; + } + /** + * 属性xsf_yhzh的Setter方法.属性名:销售方银行账号 + * 创建日期: + * @param newXsf_yhzh java.lang.String + */ + public void setXsf_yhzh (java.lang.String newXsf_yhzh ) { + this.xsf_yhzh = newXsf_yhzh; + } + /** + * 属性pk_customer的Getter方法.属性名:客户 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPk_customer () { + return pk_customer; + } + /** + * 属性pk_customer的Setter方法.属性名:客户 + * 创建日期: + * @param newPk_customer java.lang.String + */ + public void setPk_customer (java.lang.String newPk_customer ) { + this.pk_customer = newPk_customer; + } + + public String getPk_freecustom() { + + return pk_freecustom; + } + + public void setPk_freecustom(String pk_freecustom) { + + this.pk_freecustom = pk_freecustom; + } + + /** + * 属性gmf_nsrsbh的Getter方法.属性名:购买方纳税人识别号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getGmf_nsrsbh () { + return gmf_nsrsbh; + } + /** + * 属性gmf_nsrsbh的Setter方法.属性名:购买方纳税人识别号 + * 创建日期: + * @param newGmf_nsrsbh java.lang.String + */ + public void setGmf_nsrsbh (java.lang.String newGmf_nsrsbh ) { + this.gmf_nsrsbh = newGmf_nsrsbh; + } + /** + * 属性gmf_mc的Getter方法.属性名:购买方名称 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getGmf_mc () { + return gmf_mc; + } + /** + * 属性gmf_mc的Setter方法.属性名:购买方名称 + * 创建日期: + * @param newGmf_mc java.lang.String + */ + public void setGmf_mc (java.lang.String newGmf_mc ) { + this.gmf_mc = newGmf_mc; + } + /** + * 属性gmf_dzdh的Getter方法.属性名:购买方地址、电话 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getGmf_dzdh () { + return gmf_dzdh; + } + /** + * 属性gmf_dzdh的Setter方法.属性名:购买方地址、电话 + * 创建日期: + * @param newGmf_dzdh java.lang.String + */ + public void setGmf_dzdh (java.lang.String newGmf_dzdh ) { + this.gmf_dzdh = newGmf_dzdh; + } + /** + * 属性gmf_yhzh的Getter方法.属性名:购买方银行账号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getGmf_yhzh () { + return gmf_yhzh; + } + /** + * 属性gmf_yhzh的Setter方法.属性名:购买方银行账号 + * 创建日期: + * @param newGmf_yhzh java.lang.String + */ + public void setGmf_yhzh (java.lang.String newGmf_yhzh ) { + this.gmf_yhzh = newGmf_yhzh; + } + /** + * 属性kpr的Getter方法.属性名:开票人 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getKpr () { + return kpr; + } + /** + * 属性kpr的Setter方法.属性名:开票人 + * 创建日期: + * @param newKpr java.lang.String + */ + public void setKpr (java.lang.String newKpr ) { + this.kpr = newKpr; + } + /** + * 属性skr的Getter方法.属性名:收款人 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getSkr () { + return skr; + } + /** + * 属性skr的Setter方法.属性名:收款人 + * 创建日期: + * @param newSkr java.lang.String + */ + public void setSkr (java.lang.String newSkr ) { + this.skr = newSkr; + } + /** + * 属性fhr的Getter方法.属性名:复核人 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getFhr () { + return fhr; + } + /** + * 属性fhr的Setter方法.属性名:复核人 + * 创建日期: + * @param newFhr java.lang.String + */ + public void setFhr (java.lang.String newFhr ) { + this.fhr = newFhr; + } + /** + * 属性jshj的Getter方法.属性名:价税合计 + * 创建日期: + * @return UFDouble + */ + public UFDouble getJshj () { + return jshj; + } + /** + * 属性jshj的Setter方法.属性名:价税合计 + * 创建日期: + * @param newJshj UFDouble + */ + public void setJshj (UFDouble newJshj ) { + this.jshj = newJshj; + } + /** + * 属性hjje的Getter方法.属性名:合计金额 + * 创建日期: + * @return UFDouble + */ + public UFDouble getHjje () { + return hjje; + } + /** + * 属性hjje的Setter方法.属性名:合计金额 + * 创建日期: + * @param newHjje UFDouble + */ + public void setHjje (UFDouble newHjje ) { + this.hjje = newHjje; + } + /** + * 属性hjse的Getter方法.属性名:合计税额 + * 创建日期: + * @return UFDouble + */ + public UFDouble getHjse () { + return hjse; + } + /** + * 属性hjse的Setter方法.属性名:合计税额 + * 创建日期: + * @param newHjse UFDouble + */ + public void setHjse (UFDouble newHjse ) { + this.hjse = newHjse; + } + /** + * 属性bz的Getter方法.属性名:备注 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getBz () { + return bz; + } + /** + * 属性bz的Setter方法.属性名:备注 + * 创建日期: + * @param newBz java.lang.String + */ + public void setBz (java.lang.String newBz ) { + this.bz = newBz; + } + /** + * 属性lyid的Getter方法.属性名:请求来源唯一标识 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getLyid () { + return lyid; + } + /** + * 属性lyid的Setter方法.属性名:请求来源唯一标识 + * 创建日期: + * @param newLyid java.lang.String + */ + public void setLyid (java.lang.String newLyid ) { + this.lyid = newLyid; + } + /** + * 属性bmb_bbh的Getter方法.属性名:编码版本号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getBmb_bbh () { + return bmb_bbh; + } + /** + * 属性bmb_bbh的Setter方法.属性名:编码版本号 + * 创建日期: + * @param newBmb_bbh java.lang.String + */ + public void setBmb_bbh (java.lang.String newBmb_bbh ) { + this.bmb_bbh = newBmb_bbh; + } + /** + * 属性orgcode的Getter方法.属性名:开票点编码 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getOrgcode () { + return orgcode; + } + /** + * 属性orgcode的Setter方法.属性名:开票点编码 + * 创建日期: + * @param newOrgcode java.lang.String + */ + public void setOrgcode (java.lang.String newOrgcode ) { + this.orgcode = newOrgcode; + } + /** + * 属性wxorderid的Getter方法.属性名:微信订单号 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getWxorderid () { + return wxorderid; + } + /** + * 属性wxorderid的Setter方法.属性名:微信订单号 + * 创建日期: + * @param newWxorderid java.lang.String + */ + public void setWxorderid (java.lang.String newWxorderid ) { + this.wxorderid = newWxorderid; + } + /** + * 属性wxappid的Getter方法.属性名:微信商户id + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getWxappid () { + return wxappid; + } + /** + * 属性wxappid的Setter方法.属性名:微信商户id + * 创建日期: + * @param newWxappid java.lang.String + */ + public void setWxappid (java.lang.String newWxappid ) { + this.wxappid = newWxappid; + } + /** + * 属性wxauthid的Getter方法.属性名:微信批量插入卡包的授权id + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getWxauthid () { + return wxauthid; + } + /** + * 属性wxauthid的Setter方法.属性名:微信批量插入卡包的授权id + * 创建日期: + * @param newWxauthid java.lang.String + */ + public void setWxauthid (java.lang.String newWxauthid ) { + this.wxauthid = newWxauthid; + } + /** + * 属性zdybz的Getter方法.属性名:自定义备注 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getZdybz () { + return zdybz; + } + /** + * 属性zdybz的Setter方法.属性名:自定义备注 + * 创建日期: + * @param newZdybz java.lang.String + */ + public void setZdybz (java.lang.String newZdybz ) { + this.zdybz = newZdybz; + } + /** + * 属性sgbz的Getter方法.属性名:收购标志 + * 创建日期: + * @return java.lang.String + */ + public UFBoolean getSgbz () { + return sgbz; + } + /** + * 属性sgbz的Setter方法.属性名:收购标志 + * 创建日期: + * @param newSgbz java.lang.String + */ + public void setSgbz (UFBoolean newSgbz ) { + this.sgbz = newSgbz; + } + + public java.lang.String getSqr() { + return sqr; + } + public void setSqr(java.lang.String sqr) { + this.sqr = sqr; + } + /** + * 属性preparedate的Getter方法.属性名:申请日期 + * 创建日期: + * @return UFDate + */ + public UFDate getPreparedate () { + return preparedate; + } + /** + * 属性preparedate的Setter方法.属性名:申请日期 + * 创建日期: + * @param newPreparedate UFDate + */ + public void setPreparedate (UFDate newPreparedate ) { + this.preparedate = newPreparedate; + } + /** + * 属性approver的Getter方法.属性名:审核人 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getApprover () { + return approver; + } + /** + * 属性approver的Setter方法.属性名:审核人 + * 创建日期: + * @param newApprover java.lang.String + */ + public void setApprover (java.lang.String newApprover ) { + this.approver = newApprover; + } + /** + * 属性approvedate的Getter方法.属性名:审核日期 + * 创建日期: + * @return UFDate + */ + public UFDateTime getApprovedate () { + return approvedate; + } + /** + * 属性approvedate的Setter方法.属性名:审核日期 + * 创建日期: + * @param newApprovedate UFDate + */ + public void setApprovedate (UFDateTime newApprovedate ) { + this.approvedate = newApprovedate; + } + /** + * 属性creator的Getter方法.属性名:创建人 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getCreator () { + return creator; + } + /** + * 属性creator的Setter方法.属性名:创建人 + * 创建日期: + * @param newCreator java.lang.String + */ + public void setCreator (java.lang.String newCreator ) { + this.creator = newCreator; + } + /** + * 属性creationtime的Getter方法.属性名:创建时间 + * 创建日期: + * @return UFDateTime + */ + public UFDateTime getCreationtime () { + return creationtime; + } + /** + * 属性creationtime的Setter方法.属性名:创建时间 + * 创建日期: + * @param newCreationtime UFDateTime + */ + public void setCreationtime (UFDateTime newCreationtime ) { + this.creationtime = newCreationtime; + } + /** + * 属性modifier的Getter方法.属性名:最后修改人 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getModifier () { + return modifier; + } + /** + * 属性modifier的Setter方法.属性名:最后修改人 + * 创建日期: + * @param newModifier java.lang.String + */ + public void setModifier (java.lang.String newModifier ) { + this.modifier = newModifier; + } + /** + * 属性modifiedtime的Getter方法.属性名:最后修改时间 + * 创建日期: + * @return UFDateTime + */ + public UFDateTime getModifiedtime () { + return modifiedtime; + } + /** + * 属性modifiedtime的Setter方法.属性名:最后修改时间 + * 创建日期: + * @param newModifiedtime UFDateTime + */ + public void setModifiedtime (UFDateTime newModifiedtime ) { + this.modifiedtime = newModifiedtime; + } + /** + * 属性def1的Getter方法.属性名:自定义项1 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef1 () { + return def1; + } + /** + * 属性def1的Setter方法.属性名:自定义项1 + * 创建日期: + * @param newDef1 java.lang.String + */ + public void setDef1 (java.lang.String newDef1 ) { + this.def1 = newDef1; + } + /** + * 属性def2的Getter方法.属性名:自定义项2 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef2 () { + return def2; + } + /** + * 属性def2的Setter方法.属性名:自定义项2 + * 创建日期: + * @param newDef2 java.lang.String + */ + public void setDef2 (java.lang.String newDef2 ) { + this.def2 = newDef2; + } + /** + * 属性def3的Getter方法.属性名:自定义项3 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef3 () { + return def3; + } + /** + * 属性def3的Setter方法.属性名:自定义项3 + * 创建日期: + * @param newDef3 java.lang.String + */ + public void setDef3 (java.lang.String newDef3 ) { + this.def3 = newDef3; + } + /** + * 属性def4的Getter方法.属性名:自定义项4 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef4 () { + return def4; + } + /** + * 属性def4的Setter方法.属性名:自定义项4 + * 创建日期: + * @param newDef4 java.lang.String + */ + public void setDef4 (java.lang.String newDef4 ) { + this.def4 = newDef4; + } + /** + * 属性def5的Getter方法.属性名:自定义项5 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef5 () { + return def5; + } + /** + * 属性def5的Setter方法.属性名:自定义项5 + * 创建日期: + * @param newDef5 java.lang.String + */ + public void setDef5 (java.lang.String newDef5 ) { + this.def5 = newDef5; + } + /** + * 属性def6的Getter方法.属性名:自定义项6 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef6 () { + return def6; + } + /** + * 属性def6的Setter方法.属性名:自定义项6 + * 创建日期: + * @param newDef6 java.lang.String + */ + public void setDef6 (java.lang.String newDef6 ) { + this.def6 = newDef6; + } + /** + * 属性def7的Getter方法.属性名:自定义项7 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef7 () { + return def7; + } + /** + * 属性def7的Setter方法.属性名:自定义项7 + * 创建日期: + * @param newDef7 java.lang.String + */ + public void setDef7 (java.lang.String newDef7 ) { + this.def7 = newDef7; + } + /** + * 属性def8的Getter方法.属性名:自定义项8 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef8 () { + return def8; + } + /** + * 属性def8的Setter方法.属性名:自定义项8 + * 创建日期: + * @param newDef8 java.lang.String + */ + public void setDef8 (java.lang.String newDef8 ) { + this.def8 = newDef8; + } + /** + * 属性def9的Getter方法.属性名:自定义项9 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef9 () { + return def9; + } + /** + * 属性def9的Setter方法.属性名:自定义项9 + * 创建日期: + * @param newDef9 java.lang.String + */ + public void setDef9 (java.lang.String newDef9 ) { + this.def9 = newDef9; + } + /** + * 属性def10的Getter方法.属性名:自定义项10 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef10 () { + return def10; + } + /** + * 属性def10的Setter方法.属性名:自定义项10 + * 创建日期: + * @param newDef10 java.lang.String + */ + public void setDef10 (java.lang.String newDef10 ) { + this.def10 = newDef10; + } + /** + * 属性def11的Getter方法.属性名:自定义项11 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef11 () { + return def11; + } + /** + * 属性def11的Setter方法.属性名:自定义项11 + * 创建日期: + * @param newDef11 java.lang.String + */ + public void setDef11 (java.lang.String newDef11 ) { + this.def11 = newDef11; + } + /** + * 属性def12的Getter方法.属性名:自定义项12 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef12 () { + return def12; + } + /** + * 属性def12的Setter方法.属性名:自定义项12 + * 创建日期: + * @param newDef12 java.lang.String + */ + public void setDef12 (java.lang.String newDef12 ) { + this.def12 = newDef12; + } + /** + * 属性def13的Getter方法.属性名:自定义项13 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef13 () { + return def13; + } + /** + * 属性def13的Setter方法.属性名:自定义项13 + * 创建日期: + * @param newDef13 java.lang.String + */ + public void setDef13 (java.lang.String newDef13 ) { + this.def13 = newDef13; + } + /** + * 属性def14的Getter方法.属性名:自定义项14 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef14 () { + return def14; + } + /** + * 属性def14的Setter方法.属性名:自定义项14 + * 创建日期: + * @param newDef14 java.lang.String + */ + public void setDef14 (java.lang.String newDef14 ) { + this.def14 = newDef14; + } + /** + * 属性def15的Getter方法.属性名:自定义项15 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef15 () { + return def15; + } + /** + * 属性def15的Setter方法.属性名:自定义项15 + * 创建日期: + * @param newDef15 java.lang.String + */ + public void setDef15 (java.lang.String newDef15 ) { + this.def15 = newDef15; + } + /** + * 属性def16的Getter方法.属性名:自定义项16 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef16 () { + return def16; + } + /** + * 属性def16的Setter方法.属性名:自定义项16 + * 创建日期: + * @param newDef16 java.lang.String + */ + public void setDef16 (java.lang.String newDef16 ) { + this.def16 = newDef16; + } + /** + * 属性def17的Getter方法.属性名:自定义项17 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef17 () { + return def17; + } + /** + * 属性def17的Setter方法.属性名:自定义项17 + * 创建日期: + * @param newDef17 java.lang.String + */ + public void setDef17 (java.lang.String newDef17 ) { + this.def17 = newDef17; + } + /** + * 属性def18的Getter方法.属性名:自定义项18 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef18 () { + return def18; + } + /** + * 属性def18的Setter方法.属性名:自定义项18 + * 创建日期: + * @param newDef18 java.lang.String + */ + public void setDef18 (java.lang.String newDef18 ) { + this.def18 = newDef18; + } + /** + * 属性def19的Getter方法.属性名:自定义项19 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef19 () { + return def19; + } + /** + * 属性def19的Setter方法.属性名:自定义项19 + * 创建日期: + * @param newDef19 java.lang.String + */ + public void setDef19 (java.lang.String newDef19 ) { + this.def19 = newDef19; + } + /** + * 属性def20的Getter方法.属性名:自定义项20 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef20 () { + return def20; + } + /** + * 属性def20的Setter方法.属性名:自定义项20 + * 创建日期: + * @param newDef20 java.lang.String + */ + public void setDef20 (java.lang.String newDef20 ) { + this.def20 = newDef20; + } + /** + * 属性def21的Getter方法.属性名:自定义项21 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef21 () { + return def21; + } + /** + * 属性def21的Setter方法.属性名:自定义项21 + * 创建日期: + * @param newDef21 java.lang.String + */ + public void setDef21 (java.lang.String newDef21 ) { + this.def21 = newDef21; + } + /** + * 属性def22的Getter方法.属性名:自定义项22 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef22 () { + return def22; + } + /** + * 属性def22的Setter方法.属性名:自定义项22 + * 创建日期: + * @param newDef22 java.lang.String + */ + public void setDef22 (java.lang.String newDef22 ) { + this.def22 = newDef22; + } + /** + * 属性def23的Getter方法.属性名:自定义项23 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef23 () { + return def23; + } + /** + * 属性def23的Setter方法.属性名:自定义项23 + * 创建日期: + * @param newDef23 java.lang.String + */ + public void setDef23 (java.lang.String newDef23 ) { + this.def23 = newDef23; + } + /** + * 属性def24的Getter方法.属性名:自定义项24 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef24 () { + return def24; + } + /** + * 属性def24的Setter方法.属性名:自定义项24 + * 创建日期: + * @param newDef24 java.lang.String + */ + public void setDef24 (java.lang.String newDef24 ) { + this.def24 = newDef24; + } + /** + * 属性def25的Getter方法.属性名:自定义项25 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef25 () { + return def25; + } + /** + * 属性def25的Setter方法.属性名:自定义项25 + * 创建日期: + * @param newDef25 java.lang.String + */ + public void setDef25 (java.lang.String newDef25 ) { + this.def25 = newDef25; + } + /** + * 属性def26的Getter方法.属性名:自定义项26 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef26 () { + return def26; + } + /** + * 属性def26的Setter方法.属性名:自定义项26 + * 创建日期: + * @param newDef26 java.lang.String + */ + public void setDef26 (java.lang.String newDef26 ) { + this.def26 = newDef26; + } + /** + * 属性def27的Getter方法.属性名:自定义项27 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef27 () { + return def27; + } + /** + * 属性def27的Setter方法.属性名:自定义项27 + * 创建日期: + * @param newDef27 java.lang.String + */ + public void setDef27 (java.lang.String newDef27 ) { + this.def27 = newDef27; + } + /** + * 属性def28的Getter方法.属性名:自定义项28 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef28 () { + return def28; + } + /** + * 属性def28的Setter方法.属性名:自定义项28 + * 创建日期: + * @param newDef28 java.lang.String + */ + public void setDef28 (java.lang.String newDef28 ) { + this.def28 = newDef28; + } + /** + * 属性def29的Getter方法.属性名:自定义项29 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef29 () { + return def29; + } + /** + * 属性def29的Setter方法.属性名:自定义项29 + * 创建日期: + * @param newDef29 java.lang.String + */ + public void setDef29 (java.lang.String newDef29 ) { + this.def29 = newDef29; + } + /** + * 属性def30的Getter方法.属性名:自定义项30 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getDef30 () { + return def30; + } + /** + * 属性def30的Setter方法.属性名:自定义项30 + * 创建日期: + * @param newDef30 java.lang.String + */ + public void setDef30 (java.lang.String newDef30 ) { + this.def30 = newDef30; + } + /** + * 属性fpdm的Getter方法.属性名:蓝字发票代码 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getFpdm () { + return fpdm; + } + /** + * 属性fpdm的Setter方法.属性名:蓝字发票代码 + * 创建日期: + * @param newFpdm java.lang.String + */ + public void setFpdm (java.lang.String newFpdm ) { + this.fpdm = newFpdm; + } + /** + * 属性fphm的Getter方法.属性名:蓝字发票号码 + * 创建日期: + * @return java.lang.String + */ + public java.lang.String getFphm () { + return fphm; + } + /** + * 属性fphm的Setter方法.属性名:蓝字发票号码 + * 创建日期: + * @param newFphm java.lang.String + */ + public void setFphm (java.lang.String newFphm ) { + this.fphm = newFphm; + } + /** + * 属性dr的Getter方法.属性名:dr + * 创建日期: + * @return java.lang.Integer + */ + public java.lang.Integer getDr () { + return dr; + } + /** + * 属性dr的Setter方法.属性名:dr + * 创建日期: + * @param newDr java.lang.Integer + */ + public void setDr (java.lang.Integer newDr ) { + this.dr = newDr; + } + /** + * 属性ts的Getter方法.属性名:ts + * 创建日期: + * @return UFDateTime + */ + public UFDateTime getTs () { + return ts; + } + /** + * 属性ts的Setter方法.属性名:ts + * 创建日期: + * @param newTs UFDateTime + */ + public void setTs (UFDateTime newTs ) { + this.ts = newTs; + } + + + /** + * 属性redrush_falg的Getter方法.属性名:redrush_falg + * 红冲来源标识: + * @param java.lang.String + */ + public java.lang.String getRedrush_falg() { + return redrush_falg; + } + /** + * 属性redrush_falg的Setter方法.属性名:redrush_falg + * 红冲来源标识: + * @param java.lang.String + */ + public void setRedrush_falg(java.lang.String redrush_falg) { + this.redrush_falg = redrush_falg; + } + + public java.lang.String getPk_dept() { + return pk_dept; + } + public void setPk_dept(java.lang.String pk_dept) { + this.pk_dept = pk_dept; + } + + public java.lang.String getXsf_khh() { + return xsf_khh; + } + public void setXsf_khh(java.lang.String xsf_khh) { + this.xsf_khh = xsf_khh; + } + public java.lang.String getXsf_zh() { + return xsf_zh; + } + public void setXsf_zh(java.lang.String xsf_zh) { + this.xsf_zh = xsf_zh; + } + public java.lang.String getGmf_khh() { + return gmf_khh; + } + public void setGmf_khh(java.lang.String gmf_khh) { + this.gmf_khh = gmf_khh; + } + public java.lang.String getGmf_zh() { + return gmf_zh; + } + public void setGmf_zh(java.lang.String gmf_zh) { + this.gmf_zh = gmf_zh; + } + public UFBoolean getCkfp() { + return ckfp; + } + public void setCkfp(UFBoolean ckfp) { + this.ckfp = ckfp; + } + public UFBoolean getZffp() { + return zffp; + } + public void setZffp(UFBoolean zffp) { + this.zffp = zffp; + } + /** + *

取得父VO主键字段. + *

+ * 创建日期: + * @return java.lang.String + */ + public java.lang.String getParentPKFieldName() { + return null; + } + + public java.lang.String getHzxxsqb() { + return hzxxsqb; + } + public void setHzxxsqb(java.lang.String hzxxsqb) { + this.hzxxsqb = hzxxsqb; + } + public java.lang.Integer getBillstatus() { + return billstatus; + } + public void setBillstatus(java.lang.Integer billstatus) { + this.billstatus = billstatus; + } + public UFBoolean getHzfp() { + return hzfp; + } + public void setHzfp(UFBoolean hzfp) { + this.hzfp = hzfp; + } + public UFBoolean getKpzt() { + return kpzt; + } + public void setKpzt(UFBoolean kpzt) { + this.kpzt = kpzt; + } + + public UFDouble getBchcje() { + return bchcje; + } + public void setBchcje(UFDouble bchcje) { + this.bchcje = bchcje; + } + + public java.lang.Integer getKpfs() { + return kpfs; + } + public void setKpfs(java.lang.Integer kpfs) { + this.kpfs = kpfs; + } + + public java.lang.String getSrc_jx_sporg() { + return src_jx_sporg; + } + public void setSrc_jx_sporg(java.lang.String src_jx_sporg) { + this.src_jx_sporg = src_jx_sporg; + } + public java.lang.String getSrc_jx_spr() { + return src_jx_spr; + } + public void setSrc_jx_spr(java.lang.String src_jx_spr) { + this.src_jx_spr = src_jx_spr; + } + public java.lang.String getSrc_jx_billno() { + return src_jx_billno; + } + public void setSrc_jx_billno(java.lang.String src_jx_billno) { + this.src_jx_billno = src_jx_billno; + } + public java.lang.String getSrc_jx_billid() { + return src_jx_billid; + } + public void setSrc_jx_billid(java.lang.String src_jx_billid) { + this.src_jx_billid = src_jx_billid; + } + public java.lang.String getSrc_jx_billtypeid() { + return src_jx_billtypeid; + } + public void setSrc_jx_billtypeid(java.lang.String src_jx_billtypeid) { + this.src_jx_billtypeid = src_jx_billtypeid; + } + public java.lang.String getSrc_jx_tradetypeid() { + return src_jx_tradetypeid; + } + public void setSrc_jx_tradetypeid(java.lang.String src_jx_tradetypeid) { + this.src_jx_tradetypeid = src_jx_tradetypeid; + } + /** + *

取得表主键. + *

+ * 创建日期: + * @return java.lang.String + */ + public java.lang.String getPKFieldName() { + return "pk_ivapplication"; + } + + /** + *

返回表名称. + *

+ * 创建日期: + * @return java.lang.String + */ + public java.lang.String getTableName() { + return "sscivm_ivapplication"; + } + + /** + *

返回表名称. + *

+ * 创建日期: + * @return java.lang.String + */ + public static java.lang.String getDefaultTableName() { + return "sscivm_ivapplication"; + } + + /** + * 按照默认方式创建构造子. + * + * 创建日期: + */ + public IVApplicationHeadVO() { + super(); + } + + @nc.vo.annotation.MDEntityInfo(beanFullclassName = "nc.vo.sscivm.ivsale.IVApplicationHeadVO" ) + public IVOMeta getMetaData() { + return VOMetaFactory.getInstance().getVOMeta("sscivm.sscivm_ivapplication"); + } + public java.lang.Integer getSaga_frozen() { + return saga_frozen; + } + public void setSaga_frozen(java.lang.Integer saga_frozen) { + this.saga_frozen = saga_frozen; + } + public java.lang.String getSaga_gtxid() { + return saga_gtxid; + } + public void setSaga_gtxid(java.lang.String saga_gtxid) { + this.saga_gtxid = saga_gtxid; + } + public java.lang.String getSaga_btxid() { + return saga_btxid; + } + public void setSaga_btxid(java.lang.String saga_btxid) { + this.saga_btxid = saga_btxid; + } + public java.lang.Integer getSaga_status() { + return saga_status; + } + public void setSaga_status(java.lang.Integer saga_status) { + this.saga_status = saga_status; + } + public UFDouble getInvoiceing_hjje() { + return invoiceing_hjje; + } + public void setInvoiceing_hjje(UFDouble invoiceing_hjje) { + this.invoiceing_hjje = invoiceing_hjje; + } + public UFDouble getInvoiceing_hjse() { + return invoiceing_hjse; + } + public void setInvoiceing_hjse(UFDouble invoiceing_hjse) { + this.invoiceing_hjse = invoiceing_hjse; + } + public UFDouble getInvoiceing_jshj() { + return invoiceing_jshj; + } + public void setInvoiceing_jshj(UFDouble invoiceing_jshj) { + this.invoiceing_jshj = invoiceing_jshj; + } + public UFDouble getInvoiced_hjje() { + return invoiced_hjje; + } + public void setInvoiced_hjje(UFDouble invoiced_hjje) { + this.invoiced_hjje = invoiced_hjje; + } + public UFDouble getInvoiced_hjse() { + return invoiced_hjse; + } + public void setInvoiced_hjse(UFDouble invoiced_hjse) { + this.invoiced_hjse = invoiced_hjse; + } + public UFDouble getInvoiced_jshj() { + return invoiced_jshj; + } + public void setInvoiced_jshj(UFDouble invoiced_jshj) { + this.invoiced_jshj = invoiced_jshj; + } + public UFDouble getCaninvoice_hjje() { + return caninvoice_hjje; + } + public void setCaninvoice_hjje(UFDouble caninvoice_hjje) { + this.caninvoice_hjje = caninvoice_hjje; + } + public UFDouble getCaninvoice_hjse() { + return caninvoice_hjse; + } + public void setCaninvoice_hjse(UFDouble caninvoice_hjse) { + this.caninvoice_hjse = caninvoice_hjse; + } + public UFDouble getCaninvoice_jshj() { + return caninvoice_jshj; + } + public void setCaninvoice_jshj(UFDouble caninvoice_jshj) { + this.caninvoice_jshj = caninvoice_jshj; + } + public java.lang.String getEmail() { + return email; + } + public void setEmail(java.lang.String email) { + this.email = email; + } + public java.lang.String getPk_customer_v() { + return pk_customer_v; + } + public void setPk_customer_v(java.lang.String pk_customer_v) { + this.pk_customer_v = pk_customer_v; + } + public java.lang.String getSms() { + return sms; + } + public void setSms(java.lang.String sms) { + this.sms = sms; + } + public java.lang.String getYlfphm() { + return ylfphm; + } + public void setYlfphm(java.lang.String ylfphm) { + this.ylfphm = ylfphm; + } + public java.lang.String getYlfpdm() { + return ylfpdm; + } + public void setYlfpdm(java.lang.String ylfpdm) { + this.ylfpdm = ylfpdm; + } + public UFBoolean getXgmnsr() { + return xgmnsr; + } + public void setXgmnsr(UFBoolean xgmnsr) { + this.xgmnsr = xgmnsr; + } + public java.lang.String getSlsm() { + return slsm; + } + public void setSlsm(java.lang.String slsm) { + this.slsm = slsm; + } + public java.lang.String getHcyy() { + return hcyy; + } + public void setHcyy(java.lang.String hcyy) { + this.hcyy = hcyy; + } + public java.lang.String getXsf_dz() { + return xsf_dz; + } + public void setXsf_dz(java.lang.String xsf_dz) { + this.xsf_dz = xsf_dz; + } + public java.lang.String getXsf_dh() { + return xsf_dh; + } + public void setXsf_dh(java.lang.String xsf_dh) { + this.xsf_dh = xsf_dh; + } + public java.lang.String getXsf_yh() { + return xsf_yh; + } + public void setXsf_yh(java.lang.String xsf_yh) { + this.xsf_yh = xsf_yh; + } + public java.lang.String getXsf_zhh() { + return xsf_zhh; + } + public void setXsf_zhh(java.lang.String xsf_zhh) { + this.xsf_zhh = xsf_zhh; + } + public java.lang.String getGmf_dz() { + return gmf_dz; + } + public void setGmf_dz(java.lang.String gmf_dz) { + this.gmf_dz = gmf_dz; + } + public java.lang.String getGmf_dh() { + return gmf_dh; + } + public void setGmf_dh(java.lang.String gmf_dh) { + this.gmf_dh = gmf_dh; + } + public java.lang.String getGmf_yh() { + return gmf_yh; + } + public void setGmf_yh(java.lang.String gmf_yh) { + this.gmf_yh = gmf_yh; + } + public java.lang.String getGmf_zhh() { + return gmf_zhh; + } + public void setGmf_zhh(java.lang.String gmf_zhh) { + this.gmf_zhh = gmf_zhh; + } + public java.lang.String getAllelcusername() { + return allelcusername; + } + public void setAllelcusername(java.lang.String allelcusername) { + this.allelcusername = allelcusername; + } + public java.lang.String getAllelcpassword() { + return allelcpassword; + } + public void setAllelcpassword(java.lang.String allelcpassword) { + this.allelcpassword = allelcpassword; + } + public java.lang.String getPk_supplier() { + return pk_supplier; + } + public void setPk_supplier(java.lang.String pk_supplier) { + this.pk_supplier = pk_supplier; + } + public java.lang.String getPk_supplier_v() { + return pk_supplier_v; + } + public void setPk_supplier_v(java.lang.String pk_supplier_v) { + this.pk_supplier_v = pk_supplier_v; + } + public java.lang.String getZsfs() { + return zsfs; + } + public void setZsfs(java.lang.String zsfs) { + this.zsfs = zsfs; + } + + public java.lang.String getTspz() { + return tspz; + } + public void setTspz(java.lang.String tspz) { + this.tspz = tspz; + } + public java.lang.String getTspzdef99() { + return tspzdef99; + } + public void setTspzdef99(java.lang.String tspzdef99) { + this.tspzdef99 = tspzdef99; + } + public java.lang.String getKdsbz() { + return kdsbz; + } + public void setKdsbz(java.lang.String kdsbz) { + this.kdsbz = kdsbz; + } + public java.lang.String getBdcdz() { + return bdcdz; + } + public void setBdcdz(java.lang.String bdcdz) { + this.bdcdz = bdcdz; + } + public UFDate getZlqq() { + return zlqq; + } + public void setZlqq(UFDate zlqq) { + this.zlqq = zlqq; + } + public UFDate getZlqz() { + return zlqz; + } + public void setZlqz(UFDate zlqz) { + this.zlqz = zlqz; + } + public java.lang.String getTdzzsxmbh() { + return tdzzsxmbh; + } + public void setTdzzsxmbh(java.lang.String tdzzsxmbh) { + this.tdzzsxmbh = tdzzsxmbh; + } + public java.lang.String getWqhtbabh() { + return wqhtbabh; + } + public void setWqhtbabh(java.lang.String wqhtbabh) { + this.wqhtbabh = wqhtbabh; + } + public java.lang.String getBdcdwdm() { + return bdcdwdm; + } + public void setBdcdwdm(java.lang.String bdcdwdm) { + this.bdcdwdm = bdcdwdm; + } + public UFDouble getHdjsjg() { + return hdjsjg; + } + public void setHdjsjg(UFDouble hdjsjg) { + this.hdjsjg = hdjsjg; + } + public UFDouble getSjcjhsje() { + return sjcjhsje; + } + public void setSjcjhsje(UFDouble sjcjhsje) { + this.sjcjhsje = sjcjhsje; + } + public java.lang.String getBxdh() { + return bxdh; + } + public void setBxdh(java.lang.String bxdh) { + this.bxdh = bxdh; + } + public java.lang.String getCphcbdjh() { + return cphcbdjh; + } + public void setCphcbdjh(java.lang.String cphcbdjh) { + this.cphcbdjh = cphcbdjh; + } + public java.lang.String getSkssq() { + return skssq; + } + public void setSkssq(java.lang.String skssq) { + this.skssq = skssq; + } + public java.lang.String getCjh() { + return cjh; + } + public void setCjh(java.lang.String cjh) { + this.cjh = cjh; + } + public UFDouble getDsccsje() { + return dsccsje; + } + public void setDsccsje(UFDouble dsccsje) { + this.dsccsje = dsccsje; + } + public UFDouble getZnj() { + return znj; + } + public void setZnj(UFDouble znj) { + this.znj = znj; + } + public UFDouble getJehj() { + return jehj; + } + public void setJehj(UFDouble jehj) { + this.jehj = jehj; + } + +} + +