Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
a4631eacee
|
@ -2,3 +2,7 @@
|
|||
/out/
|
||||
/.idea/
|
||||
/taikai2312.iml
|
||||
.classpath
|
||||
.settings
|
||||
# 忽略任意目录下的 .project
|
||||
**/.project
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
@ -12,12 +11,11 @@ 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;
|
||||
|
@ -167,18 +165,6 @@ class ApplyRequest extends EInvoiceRequest implements IFactoryRequest {
|
|||
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++) {
|
||||
|
@ -210,18 +196,6 @@ class ApplyRequest extends EInvoiceRequest implements IFactoryRequest {
|
|||
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;
|
||||
|
@ -308,16 +282,7 @@ class ApplyRequest extends EInvoiceRequest implements IFactoryRequest {
|
|||
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;
|
||||
}
|
||||
/**
|
||||
* 设置税务云回调信息
|
||||
*
|
||||
|
@ -537,13 +502,15 @@ class ApplyRequest extends EInvoiceRequest implements IFactoryRequest {
|
|||
//车辆识别代码/车架号码
|
||||
private String CJH;
|
||||
|
||||
//跨区域涉税事项报验管理编号
|
||||
private String KQYSSSXBGGLBM;
|
||||
|
||||
//货物运输
|
||||
private ApplyInvoiceTspz[] tspzs;
|
||||
|
||||
//差额开票
|
||||
private ApplyInvoiceCepz[] cepzs;
|
||||
//跨区域涉税事项报验管理编号
|
||||
private String KQYSSSXBGGLBM;
|
||||
|
||||
public String getZSFS() {
|
||||
return ZSFS;
|
||||
}
|
||||
|
@ -1037,12 +1004,13 @@ class ApplyRequest extends EInvoiceRequest implements IFactoryRequest {
|
|||
public void setCepzs(ApplyInvoiceCepz[] cepzs) {
|
||||
this.cepzs = cepzs;
|
||||
}
|
||||
|
||||
public String getKQYSSSXBGGLBM() {
|
||||
return KQYSSSXBGGLBM;
|
||||
}
|
||||
|
||||
public void setKQYSSSXBGGLBM(String kQYSSSXBGGLBM) {
|
||||
KQYSSSXBGGLBM = kQYSSSXBGGLBM;
|
||||
public void setKQYSSSXBGGLBM(String KQYSSSXBGGLBM) {
|
||||
this.KQYSSSXBGGLBM = KQYSSSXBGGLBM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1364,109 +1332,6 @@ class ApplyRequest extends EInvoiceRequest implements IFactoryRequest {
|
|||
|
||||
//建筑服务发生地
|
||||
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;
|
||||
|
|
|
@ -1461,8 +1461,6 @@ public class InvoiceTransferUtil {
|
|||
motor.setJzfwfsd(body.getJzfwfsd());
|
||||
motor.setJzxmmc(body.getJzxmmc());
|
||||
// **************************2024-07-10 新增 对应税务云,开票申请表体增加9个自定义项
|
||||
|
||||
|
||||
if(!StringUtils.isEmpty(body.getDef24())) {//CD 产地
|
||||
motor.setCd(body.getDef24());
|
||||
}
|
||||
|
|
|
@ -1,213 +1,380 @@
|
|||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package nc.vo.sscivm.ivmpub;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import nc.md.model.IEnumValue;
|
||||
import nc.md.model.impl.MDEnum;
|
||||
|
||||
public class InvoiceTypeEnum extends MDEnum {
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "1");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZZYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "2");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "3");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ZYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "4");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_JDCTYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "5");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_CPY = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "8");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_CPYPTFP_JS = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "9");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_CPYPTFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "10");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_CPYZXFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "11");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP_JS = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "12");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_TXF = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "14");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_JDFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "15");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_TRAIN = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "16");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_AIR = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "17");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_BUS = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "18");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_TAXI = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "19");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ROADTOLL = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "20");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_TUOTA = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "21");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_OTHER = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "22");
|
||||
public static final InvoiceTypeEnum DZFP_ZZSZYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "31");
|
||||
public static final InvoiceTypeEnum DZFP_PTFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "32");
|
||||
public static final InvoiceTypeEnum ZZFP_ZZSZYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "33");
|
||||
public static final InvoiceTypeEnum ZZFP_JDCXSTYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "36");
|
||||
public static final InvoiceTypeEnum ZZFP_PTFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "34");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ZYFP_JDC = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "99");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_KCL = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "116");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZZYFP_KCL = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "216");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP_KCL = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "316");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ZYFP_KCL = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "416");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ESCTYFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "105");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_CZFSPJ = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "64");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_YLMZ = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "65");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_YLZY = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "66");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_YBJKS = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "67");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_NCP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "109");
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP_NCP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "309");
|
||||
|
||||
public InvoiceTypeEnum(IEnumValue enumvalue) {
|
||||
/**
|
||||
* <b> 在此处简要描述此类的功能 </b>
|
||||
* <p>
|
||||
* 在此处添加此类的描述信息
|
||||
* </p>
|
||||
* 创建日期:
|
||||
* @author
|
||||
* @version NCPrj ??
|
||||
*/
|
||||
public class InvoiceTypeEnum extends MDEnum{
|
||||
public InvoiceTypeEnum(IEnumValue enumvalue){
|
||||
super(enumvalue);
|
||||
}
|
||||
/**
|
||||
* 增值税电子普通发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP= MDEnum.valueOf(InvoiceTypeEnum.class, "1");
|
||||
|
||||
public static boolean isDzfp(String value) {
|
||||
return INVOICETYPE_DZPTFP.getEnumValue().getValue().equals(value) || INVOICETYPE_DZZYFP.getEnumValue().getValue().equals(value) || INVOICETYPE_DZPTFP_CPY.getEnumValue().getValue().equals(value) || INVOICETYPE_DZPTFP_TXF.getEnumValue().getValue().equals(value) || DZFP_ZZSZYFP.getEnumValue().getValue().equals(value) || DZFP_PTFP.getEnumValue().getValue().equals(value) || INVOICETYPE_DZPTFP_KCL.getEnumValue().getValue().equals(value) || INVOICETYPE_DZZYFP_KCL.getEnumValue().getValue().equals(value) || INVOICETYPE_DZPTFP_NCP.getEnumValue().getValue().equals(value);
|
||||
/**
|
||||
* 增值税电子专用发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZZYFP= MDEnum.valueOf(InvoiceTypeEnum.class, "2");
|
||||
|
||||
|
||||
/**
|
||||
* 增值税普通发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP= MDEnum.valueOf(InvoiceTypeEnum.class, "3");
|
||||
/**
|
||||
* 增值税专用发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ZYFP= MDEnum.valueOf(InvoiceTypeEnum.class, "4");
|
||||
|
||||
/**
|
||||
* 机动车统一发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_JDCTYFP= MDEnum.valueOf(InvoiceTypeEnum.class, "5");
|
||||
/**
|
||||
* 增值税电子普通发票(成品油)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_CPY= MDEnum.valueOf(InvoiceTypeEnum.class, "8");
|
||||
/**
|
||||
* 成品油普通发票(卷式)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_CPYPTFP_JS= MDEnum.valueOf(InvoiceTypeEnum.class, "9");
|
||||
/**
|
||||
* 成品油普通发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_CPYPTFP= MDEnum.valueOf(InvoiceTypeEnum.class, "10");
|
||||
/**
|
||||
* 成品油专用发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_CPYZXFP= MDEnum.valueOf(InvoiceTypeEnum.class, "11");
|
||||
/**
|
||||
* 增值税普通发票(卷式)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP_JS= MDEnum.valueOf(InvoiceTypeEnum.class, "12");
|
||||
/**
|
||||
* 通行费增值税电子普通发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_TXF= MDEnum.valueOf(InvoiceTypeEnum.class, "14");
|
||||
|
||||
/**
|
||||
* 机打发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_JDFP= MDEnum.valueOf(InvoiceTypeEnum.class, "15");
|
||||
/**
|
||||
* 火车票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_TRAIN= MDEnum.valueOf(InvoiceTypeEnum.class, "16");
|
||||
/**
|
||||
* 航空客票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_AIR= MDEnum.valueOf(InvoiceTypeEnum.class, "17");
|
||||
/**
|
||||
* 客运汽车票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_BUS= MDEnum.valueOf(InvoiceTypeEnum.class, "18");
|
||||
/**
|
||||
* 出租车票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_TAXI= MDEnum.valueOf(InvoiceTypeEnum.class, "19");
|
||||
/**
|
||||
* 过路费票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ROADTOLL= MDEnum.valueOf(InvoiceTypeEnum.class, "20");
|
||||
/**
|
||||
* 定额发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_TUOTA= MDEnum.valueOf(InvoiceTypeEnum.class, "21");
|
||||
/**
|
||||
* 其他发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_OTHER= MDEnum.valueOf(InvoiceTypeEnum.class, "22");
|
||||
/**
|
||||
* 数电票(增值税专用发票)
|
||||
*/
|
||||
public static final InvoiceTypeEnum DZFP_ZZSZYFP= MDEnum.valueOf(InvoiceTypeEnum.class, "31");
|
||||
/**
|
||||
* 数电票(普通发票)
|
||||
*/
|
||||
public static final InvoiceTypeEnum DZFP_PTFP= MDEnum.valueOf(InvoiceTypeEnum.class, "32");
|
||||
/**
|
||||
* 数电纸质发票(增值税专用发票)
|
||||
*/
|
||||
public static final InvoiceTypeEnum ZZFP_ZZSZYFP= MDEnum.valueOf(InvoiceTypeEnum.class, "33");
|
||||
public static final InvoiceTypeEnum ZZFP_SDFP = (InvoiceTypeEnum)MDEnum.valueOf(InvoiceTypeEnum.class, "36");
|
||||
|
||||
/**
|
||||
* 数电纸质发票(普通发票)
|
||||
*/
|
||||
public static final InvoiceTypeEnum ZZFP_PTFP= MDEnum.valueOf(InvoiceTypeEnum.class, "34");
|
||||
/**
|
||||
* 增值税专用发票(机动车)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ZYFP_JDC= MDEnum.valueOf(InvoiceTypeEnum.class, "99");
|
||||
/**
|
||||
* 增值税电子普通发票(矿产类)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_KCL= MDEnum.valueOf(InvoiceTypeEnum.class, "116");
|
||||
/**
|
||||
* 增值税电子专用发票(矿产类)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZZYFP_KCL= MDEnum.valueOf(InvoiceTypeEnum.class, "216");
|
||||
/**
|
||||
* 增值税普通发票(矿产类)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP_KCL= MDEnum.valueOf(InvoiceTypeEnum.class, "316");
|
||||
/**
|
||||
* 增值税专用发票(矿产类)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ZYFP_KCL= MDEnum.valueOf(InvoiceTypeEnum.class, "416");
|
||||
|
||||
/**
|
||||
* 二手车销售统一发票
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_ESCTYFP= MDEnum.valueOf(InvoiceTypeEnum.class, "105");
|
||||
|
||||
/**
|
||||
* 财政非税票据
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_CZFSPJ= MDEnum.valueOf(InvoiceTypeEnum.class, "64");
|
||||
/**
|
||||
* 医疗门诊票据
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_YLMZ= MDEnum.valueOf(InvoiceTypeEnum.class, "65");
|
||||
/**
|
||||
* 医疗住院票据
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_YLZY= MDEnum.valueOf(InvoiceTypeEnum.class, "66");
|
||||
/**
|
||||
* 非税收入一般缴款书
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_NOTAX_YBJKS= MDEnum.valueOf(InvoiceTypeEnum.class, "67");
|
||||
/**
|
||||
* 增值税电子普通发票(农产品)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_DZPTFP_NCP= MDEnum.valueOf(InvoiceTypeEnum.class, "109");
|
||||
/**
|
||||
* 增值税普通发票(农产品)
|
||||
*/
|
||||
public static final InvoiceTypeEnum INVOICETYPE_PTFP_NCP= MDEnum.valueOf(InvoiceTypeEnum.class, "309");
|
||||
|
||||
/**
|
||||
* 判断是否是电子发票
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static boolean isDzfp(String value){
|
||||
if (
|
||||
InvoiceTypeEnum.INVOICETYPE_DZPTFP.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.INVOICETYPE_DZZYFP.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.INVOICETYPE_DZPTFP_CPY.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.INVOICETYPE_DZPTFP_TXF.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.DZFP_ZZSZYFP.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.DZFP_PTFP.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.getEnumValue().getValue().equals(value)
|
||||
||InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.getEnumValue().getValue().equals(value)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Set<Integer> getPaperInvoice() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_PTFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_JDCTYFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_ESCTYFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP_JS.toIntValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_CPYZXFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_JS.toIntValue());
|
||||
invoices.add(INVOICETYPE_JDFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_TRAIN.toIntValue());
|
||||
invoices.add(INVOICETYPE_AIR.toIntValue());
|
||||
invoices.add(INVOICETYPE_BUS.toIntValue());
|
||||
invoices.add(INVOICETYPE_TAXI.toIntValue());
|
||||
invoices.add(INVOICETYPE_ROADTOLL.toIntValue());
|
||||
invoices.add(INVOICETYPE_TUOTA.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_JDC.toIntValue());
|
||||
invoices.add(ZZFP_ZZSZYFP.toIntValue());
|
||||
invoices.add(ZZFP_JDCXSTYFP.toIntValue());
|
||||
invoices.add(ZZFP_PTFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_NCP.toIntValue());
|
||||
/**
|
||||
* 获取纸质发票
|
||||
* @return 纸票集合
|
||||
*/
|
||||
public static Set<Integer> getPaperInvoice(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_JDCTYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ESCTYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP_JS.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYZXFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_JS.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_JDFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_TRAIN.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_AIR.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_BUS.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_TAXI.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ROADTOLL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_TUOTA.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_ZZSZYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_PTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<Integer> getBxTzInvoice() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_JDFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_TRAIN.toIntValue());
|
||||
invoices.add(INVOICETYPE_AIR.toIntValue());
|
||||
invoices.add(INVOICETYPE_BUS.toIntValue());
|
||||
invoices.add(INVOICETYPE_TAXI.toIntValue());
|
||||
invoices.add(INVOICETYPE_ROADTOLL.toIntValue());
|
||||
invoices.add(INVOICETYPE_TUOTA.toIntValue());
|
||||
invoices.add(INVOICETYPE_OTHER.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_CZFSPJ.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_YLZY.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_YLMZ.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_YBJKS.toIntValue());
|
||||
/**
|
||||
* 获取报销台账税务云发票集合
|
||||
* @return
|
||||
*/
|
||||
public static Set<Integer> getBxTzInvoice(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_JDFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_TRAIN.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_AIR.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_BUS.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_TAXI.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ROADTOLL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_TUOTA.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_OTHER.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_CZFSPJ.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_YLZY.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_YLMZ.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_YBJKS.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<Integer> getCommonInvoice() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_DZPTFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_CPY.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_JS.toIntValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP.toIntValue());
|
||||
invoices.add(DZFP_PTFP.toIntValue());
|
||||
invoices.add(ZZFP_PTFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_NCP.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_NCP.toIntValue());
|
||||
/**
|
||||
* 获取普通发票
|
||||
* @return 普通发票
|
||||
*/
|
||||
public static Set<Integer> getCommonInvoice(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_CPY.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_JS.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.DZFP_PTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_PTFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<Integer> getSpecialInvoice() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_DZZYFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_CPYZXFP.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_JDC.toIntValue());
|
||||
invoices.add(INVOICETYPE_DZZYFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_KCL.toIntValue());
|
||||
invoices.add(DZFP_ZZSZYFP.toIntValue());
|
||||
invoices.add(ZZFP_ZZSZYFP.toIntValue());
|
||||
invoices.add(ZZFP_JDCXSTYFP.toIntValue());
|
||||
/**
|
||||
* 获取专用发票
|
||||
* @return 专用发票
|
||||
*/
|
||||
public static Set<Integer> getSpecialInvoice(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYZXFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.DZFP_ZZSZYFP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_ZZSZYFP.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<Integer> getKCLInvoice() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_DZPTFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_DZZYFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_KCL.toIntValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_KCL.toIntValue());
|
||||
/**
|
||||
* 获取矿产发票
|
||||
* @return
|
||||
*/
|
||||
public static Set<Integer> getKCLInvoice(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<Integer> getNoTaxInvoice() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_NOTAX_CZFSPJ.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_YLMZ.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_YLZY.toIntValue());
|
||||
invoices.add(INVOICETYPE_NOTAX_YBJKS.toIntValue());
|
||||
/**
|
||||
* 获取非税类发票
|
||||
* @return
|
||||
*/
|
||||
public static Set<Integer> getNoTaxInvoice(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_CZFSPJ.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_YLMZ.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_YLZY.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_NOTAX_YBJKS.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<String> getVerifyInvoice() {
|
||||
Set<String> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_DZPTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZZYFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_ZYFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_JDCTYFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_ESCTYFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP_JS.toStringValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_CPYZXFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP_JS.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_CPY.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_TXF.toStringValue());
|
||||
invoices.add(DZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(DZFP_PTFP.toStringValue());
|
||||
invoices.add(ZZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(ZZFP_JDCXSTYFP.toStringValue());
|
||||
invoices.add(ZZFP_PTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_JDC.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZZYFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_NCP.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP_NCP.toStringValue());
|
||||
/**
|
||||
* 获取需要查验的发票集合
|
||||
* @return
|
||||
*/
|
||||
public static Set<String> getVerifyInvoice(){
|
||||
Set<String> invoices = new HashSet<String>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_JDCTYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ESCTYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP_JS.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYZXFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_JS.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_CPY.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_TXF.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.DZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.DZFP_PTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_PTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toStringValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<String> getRecInvoice() {
|
||||
Set<String> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_DZPTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZZYFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_ZYFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP_JS.toStringValue());
|
||||
invoices.add(INVOICETYPE_CPYPTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_CPYZXFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP_JS.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_CPY.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_TXF.toStringValue());
|
||||
invoices.add(DZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(DZFP_PTFP.toStringValue());
|
||||
invoices.add(ZZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(ZZFP_JDCXSTYFP.toStringValue());
|
||||
invoices.add(ZZFP_PTFP.toStringValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_JDC.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZZYFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_ZYFP_KCL.toStringValue());
|
||||
invoices.add(INVOICETYPE_DZPTFP_NCP.toStringValue());
|
||||
invoices.add(INVOICETYPE_PTFP_NCP.toStringValue());
|
||||
|
||||
/**
|
||||
* 获取可以收票的发票集合
|
||||
* @return
|
||||
*/
|
||||
public static Set<String> getRecInvoice(){
|
||||
Set<String> invoices = new HashSet<String>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP_JS.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYPTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_CPYZXFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_JS.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_CPY.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_TXF.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.DZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.DZFP_PTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_ZZSZYFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.ZZFP_PTFP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.toStringValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toStringValue());
|
||||
return invoices;
|
||||
}
|
||||
|
||||
public static Set<Integer> getSGFP() {
|
||||
Set<Integer> invoices = new HashSet();
|
||||
invoices.add(INVOICETYPE_DZPTFP_NCP.toIntValue());
|
||||
invoices.add(INVOICETYPE_PTFP_NCP.toIntValue());
|
||||
/**
|
||||
* 获取收购发票
|
||||
* @return 收购发票集合
|
||||
*/
|
||||
public static Set<Integer> getSGFP(){
|
||||
Set<Integer> invoices = new HashSet<Integer>();
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.toIntValue());
|
||||
invoices.add(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toIntValue());
|
||||
return invoices;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding='gb2312'?>
|
||||
<module>
|
||||
<rest>
|
||||
<resource classname="nccloud.api.uapbd.QuerySync" exinfo=""/>
|
||||
</rest>
|
||||
</module>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding='gb2312'?>
|
||||
<module>
|
||||
<rest>
|
||||
<resource classname="nccloud.api.uapbd.stordocmanage.storedoc.StordocManageResource" exinfo="仓库的查询接口"/>
|
||||
</rest>
|
||||
</module>
|
|
@ -0,0 +1,59 @@
|
|||
package nccloud.api.uapbd;
|
||||
|
||||
|
||||
import nccloud.api.rest.utils.IJsonForAPI;
|
||||
import nccloud.api.rest.utils.JsonFactoryForAPI;
|
||||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.api.rest.utils.vo.ApiDataVO;
|
||||
import nccloud.api.rest.utils.vo.ApiQueryParam;
|
||||
import nccloud.api.rest.utils.vo.ApiUfinterface;
|
||||
import nccloud.ws.rest.resource.AbstractNCCRestResource;
|
||||
import org.json.JSONString;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
|
||||
@Path("/uapbd/querySync")
|
||||
public class QuerySync extends AbstractNCCRestResource {
|
||||
|
||||
@Override
|
||||
public String getModule() {
|
||||
return "uapbd";
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("query")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString query(JSONString json) {
|
||||
IJsonForAPI iJsonForAPI = JsonFactoryForAPI.create();
|
||||
ApiQueryParam apiQueryParam = iJsonForAPI.fromJson(json.toJSONString(), ApiQueryParam.class);
|
||||
ApiDataVO apiDataVO = apiQueryParam.getUfinterface().getData();
|
||||
// 从中抓取接口枚举类型
|
||||
ApiUfinterface ufinterface = apiQueryParam.getUfinterface();
|
||||
if (ufinterface.getData().getParamdata().containsKey("type")) {
|
||||
String type = (String) ufinterface.getData().getParamdata().get("type");
|
||||
try {
|
||||
switch (type) {
|
||||
case "queryStordoc":
|
||||
return queryStordoc(ufinterface);
|
||||
default:
|
||||
return ResultMessageUtil.exceptionToJSON(new Exception("不支持的接口类型: " + type));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 捕获并返回异常信息
|
||||
return ResultMessageUtil.exceptionToJSON(e);
|
||||
}
|
||||
} else {
|
||||
return ResultMessageUtil.exceptionToJSON(new Exception("缺失接口类型,请检查参数"));
|
||||
}
|
||||
}
|
||||
|
||||
private JSONString queryStordoc(ApiUfinterface apiUfinterface) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package nccloud.api.uapbd.material.materialclass;
|
||||
|
||||
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.itf.bd.material.marbasclass.IMaterialBasClassQueryService;
|
||||
import nc.vo.bd.material.marbasclass.MarBasClassVO;
|
||||
import nccloud.api.rest.utils.ApiResourceParamUtils;
|
||||
import nccloud.api.rest.utils.IJsonForAPI;
|
||||
import nccloud.api.rest.utils.JsonFactoryForAPI;
|
||||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.api.rest.utils.vo.ApiDataVO;
|
||||
import nccloud.api.rest.utils.vo.ApiQueryParam;
|
||||
import nccloud.api.rest.utils.vo.PageInfo;
|
||||
import nccloud.ws.rest.resource.AbstractNCCRestResource;
|
||||
import org.json.JSONString;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Path("/uapbd/materialclass")
|
||||
public class MaterialClassQueryResources extends AbstractNCCRestResource {
|
||||
|
||||
public String getModule() {
|
||||
return "uapbd";
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("query")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString query(JSONString json) {
|
||||
IJsonForAPI iJsonForAPI = JsonFactoryForAPI.create();
|
||||
ApiQueryParam apiQueryParam = (ApiQueryParam) iJsonForAPI.fromJson(json.toJSONString(), ApiQueryParam.class);
|
||||
String sender = apiQueryParam.getUfinterface().getSender();
|
||||
ApiDataVO apiDataVO = apiQueryParam.getUfinterface().getData();
|
||||
PageInfo pageInfo = apiQueryParam.getUfinterface().getPageInfo();
|
||||
Map<String, Object> param = apiDataVO.getParamdata();
|
||||
if (param.containsKey("name") && param.get("name") != null) {
|
||||
List<String> names = (List<String>) param.get("name");
|
||||
if (!names.isEmpty()) {
|
||||
param.put("name", names.toArray(new String[0]));
|
||||
} else {
|
||||
param.remove("name");
|
||||
}
|
||||
}
|
||||
if (param.containsKey("code") && param.get("code") != null) {
|
||||
List<String> codes = (List<String>) param.get("code");
|
||||
if (!codes.isEmpty()) {
|
||||
param.put("code", codes.toArray(new String[0]));
|
||||
} else {
|
||||
param.remove("code");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
String querycondition = (new ApiResourceParamUtils()).parseParmToSqlByCode(new MarBasClassVO(), param);
|
||||
MarBasClassVO[] vos = NCLocator.getInstance().lookup(IMaterialBasClassQueryService.class).queryMaterialClassByCondition(null, querycondition);
|
||||
return vos != null && vos.length > 0 ? ResultMessageUtil.toJSON(vos) : null;
|
||||
} catch (Exception ex) {
|
||||
return ResultMessageUtil.exceptionToJSON(ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +1,22 @@
|
|||
package nccloud.api.uapbd.materialmanage.material;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import nc.bs.dao.BaseDAO;
|
||||
import nc.ws.opm.pub.utils.result.APIErrCodeEnum;
|
||||
import nc.bs.dao.DAOException;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.bs.framework.core.util.ObjectCreator;
|
||||
import nc.impl.pubapp.pattern.database.SqlBuilderUtil;
|
||||
import nc.itf.bd.material.assign.IMaterialAssignService;
|
||||
import nc.jdbc.framework.processor.ColumnListProcessor;
|
||||
import nc.jdbc.framework.processor.MapListProcessor;
|
||||
import nc.vo.bd.material.MaterialVO;
|
||||
import nc.vo.bd.material.prod.MaterialProdVO;
|
||||
import nc.vo.bd.material.sale.MaterialSaleVO;
|
||||
import nc.vo.bd.material.stock.MaterialStockVO;
|
||||
import nc.ws.opm.pub.utils.result.APIErrCodeEnum;
|
||||
import nccloud.api.baseapp.exchange.convert.IOpenApiJsonConvertToExChangeXmlService;
|
||||
import nccloud.api.baseapp.exchange.convert.OpenApiConvertDataObject;
|
||||
import nccloud.api.baseapp.exchange.convert.OpenApiConvertDataResult;
|
||||
|
@ -32,10 +26,18 @@ import nccloud.api.rest.utils.OpenApiPageInfo;
|
|||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.api.uapbd.common.utils.OpenApiPagenationUtils;
|
||||
import nccloud.commons.lang.StringUtils;
|
||||
import nc.jdbc.framework.processor.MapListProcessor;
|
||||
import nccloud.ws.rest.resource.AbstractNCCRestResource;
|
||||
import org.json.JSONString;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ÎïÁϽӿÚÊÊÅä2312
|
||||
*/
|
||||
|
@ -160,7 +162,9 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
|
|||
param.put("name", name.toArray(new String[0]));
|
||||
}
|
||||
if (marbaseclass != null && marbaseclass.size() > 0) {
|
||||
param.put("marbaseclass", marbaseclass.toArray(new String[0]));
|
||||
// param.put("marbaseclass", marbaseclass.toArray(new String[0]));
|
||||
//数据库无此字段,修改成
|
||||
param.put("pk_marbasclass", marbaseclass.toArray(new String[0]));
|
||||
}
|
||||
try {
|
||||
ApiResourceParamUtils ApiResourceParamUtils = new ApiResourceParamUtils();
|
||||
|
@ -169,6 +173,10 @@ public class MaterialManageMaterial extends AbstractNCCRestResource {
|
|||
ApiResourceParamUtils.addTranslatorMap("pk_org", IParamTranslator);
|
||||
String condition = ApiResourceParamUtils.parseParmToSqlByCode(new MaterialVO(), param);
|
||||
|
||||
if (condition.isBlank()) {
|
||||
condition = "1=1";// 没有条件就拼接个1=1,防止sql报错
|
||||
}
|
||||
|
||||
String sql = "select pk_material from bd_material where " + condition;
|
||||
List<String> allPks = (List) (new BaseDAO()).executeQuery(sql, new ColumnListProcessor());
|
||||
OpenApiPageInfo openApiPageInfo = new OpenApiPageInfo();
|
||||
|
|
|
@ -0,0 +1,305 @@
|
|||
package nccloud.api.uapbd.stordocmanage.storedoc;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import nc.bs.dao.BaseDAO;
|
||||
import nc.jdbc.framework.processor.ColumnListProcessor;
|
||||
import nc.jdbc.framework.processor.MapListProcessor;
|
||||
import nccloud.api.rest.utils.OpenApiPageInfo;
|
||||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.api.uapbd.common.utils.OpenApiPagenationUtils;
|
||||
import nccloud.commons.lang.StringUtils;
|
||||
import nccloud.ws.rest.resource.AbstractNCCRestResource;
|
||||
import org.json.JSONString;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 仓库接口
|
||||
*/
|
||||
@Path("uapbd/stordoc/stordoc")
|
||||
public class StordocManageResource extends AbstractNCCRestResource {
|
||||
|
||||
public static final BaseDAO BASE_DAO = new BaseDAO();
|
||||
|
||||
@Override
|
||||
public String getModule() {
|
||||
return "uapbd";
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动构建SQL条件
|
||||
*
|
||||
* @param paramMap 参数Map
|
||||
* @return SQL条件字符串
|
||||
*/
|
||||
private String buildCondition(Map<String, Object> paramMap) {
|
||||
List<String> conditions = new ArrayList<>();
|
||||
|
||||
// 处理code数组 - 使用IN条件
|
||||
if (paramMap.containsKey("code")) {
|
||||
String[] codes = (String[]) paramMap.get("code");
|
||||
if (codes != null && codes.length > 0) {
|
||||
StringBuilder codeCondition = new StringBuilder("code in (");
|
||||
for (int i = 0; i < codes.length; i++) {
|
||||
if (i > 0) {
|
||||
codeCondition.append(",");
|
||||
}
|
||||
codeCondition.append("'").append(escapeSql(codes[i])).append("'");
|
||||
}
|
||||
codeCondition.append(")");
|
||||
conditions.add(codeCondition.toString());
|
||||
}
|
||||
}
|
||||
// 处理pk_group数组 - 使用IN条件
|
||||
if (paramMap.containsKey("pk_group")) {
|
||||
String[] pk_groups = (String[]) paramMap.get("pk_group");
|
||||
if (pk_groups != null && pk_groups.length > 0) {
|
||||
StringBuilder codeCondition = new StringBuilder("pk_group in (");
|
||||
for (int i = 0; i < pk_groups.length; i++) {
|
||||
if (i > 0) {
|
||||
codeCondition.append(",");
|
||||
}
|
||||
codeCondition.append("'").append(escapeSql(pk_groups[i])).append("'");
|
||||
}
|
||||
codeCondition.append(")");
|
||||
conditions.add(codeCondition.toString());
|
||||
}
|
||||
}
|
||||
// 处理pk_org数组 - 使用IN条件
|
||||
if (paramMap.containsKey("pk_org")) {
|
||||
String[] pk_orgs = (String[]) paramMap.get("pk_org");
|
||||
if (pk_orgs != null && pk_orgs.length > 0) {
|
||||
StringBuilder codeCondition = new StringBuilder("pk_org in (");
|
||||
for (int i = 0; i < pk_orgs.length; i++) {
|
||||
if (i > 0) {
|
||||
codeCondition.append(",");
|
||||
}
|
||||
codeCondition.append("'").append(escapeSql(pk_orgs[i])).append("'");
|
||||
}
|
||||
codeCondition.append(")");
|
||||
conditions.add(codeCondition.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// 处理name数组 - 使IN条件
|
||||
if (paramMap.containsKey("name")) {
|
||||
String[] names = (String[]) paramMap.get("name");
|
||||
if (names != null && names.length > 0) {
|
||||
StringBuilder nameCondition = new StringBuilder("name in (");
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
if (i > 0) {
|
||||
nameCondition.append(",");
|
||||
}
|
||||
nameCondition.append("'").append(escapeSql(names[i])).append("'");
|
||||
}
|
||||
nameCondition.append(")");
|
||||
conditions.add(nameCondition.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return conditions.isEmpty() ? "" : String.join(" and ", conditions);
|
||||
}
|
||||
|
||||
/**
|
||||
* SQL注入防护 - 转义单引号
|
||||
*
|
||||
* @param input 输入字符串
|
||||
* @return 转义后的字符串
|
||||
*/
|
||||
private String escapeSql(String input) {
|
||||
return input == null ? null : input.replace("'", "''");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库信息
|
||||
* 示例:
|
||||
* JSON输入示例:
|
||||
* {
|
||||
* "ufinterface": {
|
||||
* "data": {
|
||||
* "code": ["仓库code", "ST002"],
|
||||
* "name": ["仓库name", "仓库B"],
|
||||
* "org_code": ["ORG01", "ORG02"],
|
||||
* "group_codes": ["GROUP001", "GROUP002"]
|
||||
* },
|
||||
* "pageInfo": {
|
||||
* "pageNo": 1,
|
||||
* "pageSize": 10
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @param json 输入的JSON字符串
|
||||
* @return JSONString 包含查询结果或错误信息
|
||||
*/
|
||||
@POST
|
||||
@Path("queryStordoc")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString queryStordoc(JSONString json) {
|
||||
JSONObject jObject = JSON.parseObject(json.toJSONString());
|
||||
if (jObject == null) {
|
||||
return ResultMessageUtil.exceptionToJSON(new NullPointerException("请求JSON对象为null"));
|
||||
}
|
||||
JSONObject ufinterfaceObj = jObject.getJSONObject("ufinterface");
|
||||
if (ufinterfaceObj == null) {
|
||||
return ResultMessageUtil.exceptionToJSON(new NullPointerException("ufinterface节点为null"));
|
||||
}
|
||||
JSONObject data = ufinterfaceObj.getJSONObject("data"); // 查询条件
|
||||
JSONObject pageInfoJson = ufinterfaceObj.getJSONObject("pageInfo"); // 分页信息
|
||||
if (data == null) {
|
||||
data = new JSONObject();
|
||||
}
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
JSONArray code_json = data.getJSONArray("code");
|
||||
JSONArray name_json = data.getJSONArray("name");
|
||||
JSONArray orgCodeArr = data.getJSONArray("org_code");
|
||||
JSONArray groupCodeArr = data.getJSONArray("group_codes");
|
||||
|
||||
// 处理数组类型的参数
|
||||
if (code_json != null && !code_json.isEmpty()) {
|
||||
paramMap.put("code", code_json.toArray(new String[0]));
|
||||
}
|
||||
if (name_json != null && !name_json.isEmpty()) {
|
||||
paramMap.put("name", name_json.toArray(new String[0]));
|
||||
}
|
||||
|
||||
try {
|
||||
// 将 org_code 转换为主键保存到 paramMap
|
||||
if (orgCodeArr != null && !orgCodeArr.isEmpty()) {
|
||||
List<String> pkOrgList = new ArrayList<>();
|
||||
StringBuilder cond = new StringBuilder("code in (");
|
||||
for (int i = 0; i < orgCodeArr.size(); i++) {
|
||||
if (i > 0) {
|
||||
cond.append(",");
|
||||
}
|
||||
cond.append("'").append(escapeSql(orgCodeArr.getString(i))).append("'");
|
||||
}
|
||||
cond.append(")");
|
||||
Collection stockOrgs = BASE_DAO.retrieveByClause(nc.vo.org.StockOrgVO.class, cond.toString(), new String[]{"pk_stockorg"});
|
||||
if (stockOrgs != null) {
|
||||
for (Object obj : stockOrgs) {
|
||||
nc.vo.org.StockOrgVO vo = (nc.vo.org.StockOrgVO) obj;
|
||||
pkOrgList.add(vo.getPk_stockorg());
|
||||
}
|
||||
}
|
||||
if (!pkOrgList.isEmpty()) {
|
||||
paramMap.put("pk_org", pkOrgList.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
|
||||
// 将 group_codes 转换为主键保存到 paramMap
|
||||
if (groupCodeArr != null && !groupCodeArr.isEmpty()) {
|
||||
List<String> pkGroupList = new ArrayList<>();
|
||||
StringBuilder cond = new StringBuilder("code in (");
|
||||
for (int i = 0; i < groupCodeArr.size(); i++) {
|
||||
if (i > 0) {
|
||||
cond.append(",");
|
||||
}
|
||||
cond.append("'").append(escapeSql(groupCodeArr.getString(i))).append("'");
|
||||
}
|
||||
cond.append(")");
|
||||
Collection groups = BASE_DAO.retrieveByClause(nc.vo.org.GroupVO.class, cond.toString(), new String[]{"pk_group"});
|
||||
if (groups != null) {
|
||||
for (Object obj : groups) {
|
||||
nc.vo.org.GroupVO vo = (nc.vo.org.GroupVO) obj;
|
||||
pkGroupList.add(vo.getPk_group());
|
||||
}
|
||||
}
|
||||
if (!pkGroupList.isEmpty()) {
|
||||
paramMap.put("pk_group", pkGroupList.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
|
||||
String condition = buildCondition(paramMap);
|
||||
if (StringUtils.isNotBlank(condition)) {
|
||||
condition = "dr = 0 and " + condition;
|
||||
} else {
|
||||
condition = "dr=0";
|
||||
}
|
||||
|
||||
String sql = "SELECT pk_stordoc FROM bd_stordoc WHERE " + condition;
|
||||
List<String> allPks = (List<String>) BASE_DAO.executeQuery(sql, new ColumnListProcessor());
|
||||
OpenApiPageInfo openApiPageInfo = new OpenApiPageInfo();
|
||||
String[] currPks = OpenApiPagenationUtils.getCurrentPagePksAndPageInfo(allPks, pageInfoJson, openApiPageInfo);
|
||||
|
||||
if (currPks == null || currPks.length == 0) {
|
||||
return ResultMessageUtil.toJSONByPage(new JSONObject[0], openApiPageInfo, false);
|
||||
}
|
||||
StringJoiner stringJoiner = new StringJoiner(",");
|
||||
for (String pk : currPks) {
|
||||
stringJoiner.add("'" + pk + "'");
|
||||
}
|
||||
String pks = stringJoiner.toString();
|
||||
|
||||
String mainSql = "SELECT sd.*, " +
|
||||
"so.code AS org_code, so.name AS org_name, " +
|
||||
"og.code AS group_code, og.name AS group_name, " +
|
||||
"ad.code AS address_code, ad.name AS address_name, " +
|
||||
"ba.code AS storaddr_code " +
|
||||
"FROM bd_stordoc sd " +
|
||||
"LEFT JOIN org_stockorg so ON sd.pk_org = so.pk_stockorg " +
|
||||
"LEFT JOIN org_group og ON sd.pk_group = og.pk_group " +
|
||||
"LEFT JOIN bd_addressdoc ad ON sd.pk_address = ad.pk_addressdoc " +
|
||||
"LEFT JOIN bd_address ba ON sd.storaddr = ba.pk_address " +
|
||||
"WHERE sd.pk_stordoc IN (" + pks + ")";
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> rows = (List<Map<String, Object>>) BASE_DAO.executeQuery(mainSql, new MapListProcessor());
|
||||
|
||||
List<JSONObject> resultList = new ArrayList<>();
|
||||
for (Map<String, Object> row : rows) {
|
||||
JSONObject stordocJson = new JSONObject(true); // 使用有序Map
|
||||
|
||||
for (Map.Entry<String, Object> entry : row.entrySet()) {
|
||||
String key = entry.getKey().toLowerCase();
|
||||
if ("org_code".equals(key) || "org_name".equals(key) ||
|
||||
"group_code".equals(key) || "group_name".equals(key) ||
|
||||
"address_code".equals(key) || "address_name".equals(key) ||
|
||||
"storaddr_code".equals(key)) {
|
||||
continue;
|
||||
}
|
||||
stordocJson.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
JSONObject pkOrgDetailsJson = new JSONObject(true);
|
||||
pkOrgDetailsJson.put("pk_org", row.get("pk_org"));
|
||||
pkOrgDetailsJson.put("code", row.get("org_code"));
|
||||
pkOrgDetailsJson.put("name", row.get("org_name"));
|
||||
stordocJson.put("pk_org", pkOrgDetailsJson);
|
||||
|
||||
JSONObject pkGroupDetailsJson = new JSONObject(true);
|
||||
pkGroupDetailsJson.put("pk_group", row.get("pk_group"));
|
||||
pkGroupDetailsJson.put("code", row.get("group_code"));
|
||||
pkGroupDetailsJson.put("name", row.get("group_name"));
|
||||
stordocJson.put("pk_group", pkGroupDetailsJson);
|
||||
|
||||
JSONObject pkAddressDetailsJson = new JSONObject(true);
|
||||
pkAddressDetailsJson.put("pk_address", row.get("pk_address"));
|
||||
pkAddressDetailsJson.put("code", row.get("address_code"));
|
||||
pkAddressDetailsJson.put("name", row.get("address_name"));
|
||||
stordocJson.put("pk_address", pkAddressDetailsJson);
|
||||
|
||||
JSONObject storaddrDetailsJson = new JSONObject(true);
|
||||
storaddrDetailsJson.put("pk_address", row.get("storaddr"));
|
||||
storaddrDetailsJson.put("code", row.get("storaddr_code"));
|
||||
stordocJson.put("storaddr", storaddrDetailsJson);
|
||||
|
||||
resultList.add(stordocJson);
|
||||
}
|
||||
|
||||
return ResultMessageUtil.toJSONByPage(resultList.toArray(new JSONObject[0]), openApiPageInfo, false);
|
||||
|
||||
} catch (Exception e) {
|
||||
return ResultMessageUtil.exceptionToJSON(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue