|
|
|
@ -298,7 +298,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@SentinelResource(value = "getAllocatedInvoicesV3",blockHandlerClass = InterfaceBlockExceptionUtil.class,blockHandler = "getAllocatedInvoicesV3Block") |
|
|
|
|
@SentinelResource(value = "getAllocatedInvoicesV3", blockHandlerClass = InterfaceBlockExceptionUtil.class, blockHandler = "getAllocatedInvoicesV3Block") |
|
|
|
|
public DdkjxxRspBO getAllocatedInvoicesV3(DdkjxxReqBO ddkjxxReq, String secretId) { |
|
|
|
|
|
|
|
|
|
DdkjxxRspBO getInvoiceRsp = new DdkjxxRspBO(); |
|
|
|
@ -535,7 +535,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@SentinelResource(value = "getOrderInfoAndInvoiceInfoV3",blockHandlerClass = InterfaceBlockExceptionUtil.class,blockHandler = "getOrderInfoAndInvoiceInfoV3Block") |
|
|
|
|
@SentinelResource(value = "getOrderInfoAndInvoiceInfoV3", blockHandlerClass = InterfaceBlockExceptionUtil.class, blockHandler = "getOrderInfoAndInvoiceInfoV3Block") |
|
|
|
|
public DdfpcxRspBO getOrderInfoAndInvoiceInfoV3(DdfpcxReqBO ddfpcxReq, String secretId) { |
|
|
|
|
String jsonString2 = JsonUtils.getInstance().toJsonString(ddfpcxReq); |
|
|
|
|
log.debug("{},根据订单号获取订单数据以及发票数据接口数据:{}", LOGGER_MSG, jsonString2); |
|
|
|
@ -874,7 +874,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
/** |
|
|
|
|
* 获取PDF判断 |
|
|
|
|
*/ |
|
|
|
|
List<FileDownLoad> fileDownLoadList = orderInvoiceInfoService.getInvoiceFile(orderInfo.getDdlx(), orderInvoiceInfo.getFpzlDm(), orderInvoiceInfo.getPdfUrl(), orderInvoiceInfo.getKplsh(), orderInvoiceInfo.getFpdm(), orderInvoiceInfo.getFphm(), orderInvoiceInfo.getXhfNsrsbh(), terminalCode,""); |
|
|
|
|
List<FileDownLoad> fileDownLoadList = orderInvoiceInfoService.getInvoiceFile(orderInfo.getDdlx(), orderInvoiceInfo.getFpzlDm(), orderInvoiceInfo.getPdfUrl(), orderInvoiceInfo.getKplsh(), orderInvoiceInfo.getFpdm(), orderInvoiceInfo.getFphm(), orderInvoiceInfo.getXhfNsrsbh(), terminalCode, ""); |
|
|
|
|
if (ObjectUtil.isNotEmpty(fileDownLoadList)) { |
|
|
|
|
ddfpxx.setPDFZJL(fileDownLoadList.get(0).getFileContent()); |
|
|
|
|
ddfpxx.setZJLLX(CommonUtils.getZjlLx(fileDownLoadList.get(0).getFileSuffix())); |
|
|
|
@ -1057,7 +1057,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
return ddfpcxRsp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(fpcxReqBO.getFPDM()) && StringUtils.isNotBlank(fpcxReqBO.getFPHM())){ |
|
|
|
|
if (StringUtils.isNotBlank(fpcxReqBO.getFPDM()) && StringUtils.isNotBlank(fpcxReqBO.getFPHM())) { |
|
|
|
|
if (StringUtils.length(fpcxReqBO.getFPDM()) > ConfigureConstant.INT_12 || !NumberUtil.isNumber(fpcxReqBO.getFPDM())) { |
|
|
|
|
ddfpcxRsp.setZTDM(OrderInfoContentEnum.GET_INVOICE_PARAM_FPDM_V3_009673.getKey()); |
|
|
|
|
ddfpcxRsp.setZTXX(OrderInfoContentEnum.GET_INVOICE_PARAM_FPDM_V3_009673.getMessage()); |
|
|
|
@ -1072,7 +1072,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
return ddfpcxRsp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
if (StringUtils.isBlank(fpcxReqBO.getKPRQQ())) { |
|
|
|
|
ddfpcxRsp.setZTDM(OrderInfoContentEnum.GET_INVOICE_PARAM_KPRQQ_V3_009663.getKey()); |
|
|
|
|
ddfpcxRsp.setZTXX(OrderInfoContentEnum.GET_INVOICE_PARAM_KPRQQ_V3_009663.getMessage()); |
|
|
|
@ -1087,7 +1087,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(fpcxReqBO.getKPRQQ()) && StringUtils.isNotBlank(fpcxReqBO.getKPRQZ())){ |
|
|
|
|
if (StringUtils.isNotBlank(fpcxReqBO.getKPRQQ()) && StringUtils.isNotBlank(fpcxReqBO.getKPRQZ())) { |
|
|
|
|
//开票日期起日期
|
|
|
|
|
if (!ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S.equals(StringUtil.checkDateFormat(fpcxReqBO.getKPRQQ()))) { |
|
|
|
|
ddfpcxRsp.setZTDM(OrderInfoContentEnum.GET_INVOICE_PARAM_DDRQQ_V3_009668.getKey()); |
|
|
|
@ -1236,7 +1236,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
/** |
|
|
|
|
* 获取PDF判断 |
|
|
|
|
*/ |
|
|
|
|
List<FileDownLoad> fileDownLoadList = orderInvoiceInfoService.getInvoiceFile(orderInfo.getDdlx(), orderInvoiceInfo.getFpzlDm(), orderInvoiceInfo.getPdfUrl(), orderInvoiceInfo.getKplsh(), orderInvoiceInfo.getFpdm(), orderInvoiceInfo.getFphm(), orderInvoiceInfo.getXhfNsrsbh(), terminalCode,""); |
|
|
|
|
List<FileDownLoad> fileDownLoadList = orderInvoiceInfoService.getInvoiceFile(orderInfo.getDdlx(), orderInvoiceInfo.getFpzlDm(), orderInvoiceInfo.getPdfUrl(), orderInvoiceInfo.getKplsh(), orderInvoiceInfo.getFpdm(), orderInvoiceInfo.getFphm(), orderInvoiceInfo.getXhfNsrsbh(), terminalCode, ""); |
|
|
|
|
if (ObjectUtil.isNotEmpty(fileDownLoadList)) { |
|
|
|
|
ddfpxx.setPDFZJL(fileDownLoadList.get(0).getFileContent()); |
|
|
|
|
ddfpxx.setZJLLX(CommonUtils.getZjlLx(fileDownLoadList.get(0).getFileSuffix())); |
|
|
|
@ -1320,7 +1320,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ddfpcxRsp.setDDFPZXX(ddfpzxxBOList); |
|
|
|
|
if(ObjectUtil.isNotEmpty(ddfpzxxBOList)){ |
|
|
|
|
if (ObjectUtil.isNotEmpty(ddfpzxxBOList)) { |
|
|
|
|
ddfpcxRsp.setZTDM(OrderInfoContentEnum.INTERFACE_GETINVOICE_STATUS_000000.getKey()); |
|
|
|
|
ddfpcxRsp.setZTXX(OrderInfoContentEnum.INTERFACE_GETINVOICE_STATUS_000000.getMessage()); |
|
|
|
|
} |
|
|
|
@ -1346,7 +1346,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public HzsqdscRspBO specialInvoiceRushRedV3(HzsqdscReqBO hzsqdscReq, String kpjh, String secretId,String interfaceVersion) { |
|
|
|
|
public HzsqdscRspBO specialInvoiceRushRedV3(HzsqdscReqBO hzsqdscReq, String kpjh, String secretId, String interfaceVersion) { |
|
|
|
|
HzsqdscRspBO hzsqdscRsp = new HzsqdscRspBO(); |
|
|
|
|
log.debug("{},接收红字发票申请单:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(hzsqdscReq)); |
|
|
|
|
|
|
|
|
@ -1383,15 +1383,15 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
//原开票日期补全后进行校验,红字专票(非成品油)购方已抵扣可不填
|
|
|
|
|
String xxbtsbs = hzsqdsczxx.getHZSQDTXX().getXXBTSBS(); |
|
|
|
|
String sqsm =hzsqdsczxx.getHZSQDTXX().getSQSM(); |
|
|
|
|
String sqsm = hzsqdsczxx.getHZSQDTXX().getSQSM(); |
|
|
|
|
boolean isCheck = OrderInfoEnum.SPECIAL_INVOICE_REASON_0000000100.getKey().equals(sqsm) || |
|
|
|
|
OrderInfoEnum.SPECIAL_INVOICE_REASON_1010000000.getKey().equals(sqsm) || |
|
|
|
|
CommonUtils.isGfsqAndOilProducts(sqsm,xxbtsbs); |
|
|
|
|
if(isCheck && StringUtils.isBlank(hzsqdsczxx.getHZSQDTXX().getYFPKPRQ())){ |
|
|
|
|
CommonUtils.isGfsqAndOilProducts(sqsm, xxbtsbs); |
|
|
|
|
if (isCheck && StringUtils.isBlank(hzsqdsczxx.getHZSQDTXX().getYFPKPRQ())) { |
|
|
|
|
log.error("{}红字申请单上传原开票日期校验未通过,未通过数据:{}", LOGGER_MSG, hzsqdsczxx); |
|
|
|
|
hzsqdscRsp.setZTDM(OrderInfoContentEnum.CHECK_ISS7PRI_115091.getKey()); |
|
|
|
|
hzsqdscRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_115091.getMessage()); |
|
|
|
|
if(CommonUtils.isGfsqAndOilProducts(sqsm,xxbtsbs)){ |
|
|
|
|
if (CommonUtils.isGfsqAndOilProducts(sqsm, xxbtsbs)) { |
|
|
|
|
hzsqdscRsp.setZTDM(OrderInfoContentEnum.CHECK_ISS7PRI_115092.getKey()); |
|
|
|
|
hzsqdscRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_115092.getMessage()); |
|
|
|
|
} |
|
|
|
@ -1400,19 +1400,18 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果申请类别为空,根据申请说明补全
|
|
|
|
|
HzsqdscpcBO hzsqdscpc1 = hzsqdscReq.getHZSQDSCPC(); |
|
|
|
|
if(StringUtils.isBlank(hzsqdscpc1.getSQLB())){ |
|
|
|
|
if (StringUtils.isBlank(hzsqdscpc1.getSQLB())) { |
|
|
|
|
HzsqdsczxxBO hzsqdsczxxBO = hzsqdscReq.getHZSQDSCZXX().get(0); |
|
|
|
|
HzsqdtxxBO hzsqdtxx = hzsqdsczxxBO.getHZSQDTXX(); |
|
|
|
|
//购方申请
|
|
|
|
|
if(StringUtils.equals(OrderInfoEnum.SPECIAL_INVOICE_REASON_1100000000.getKey(), hzsqdtxx.getSQSM()) || |
|
|
|
|
StringUtils.equals(OrderInfoEnum.SPECIAL_INVOICE_REASON_1010000000.getKey(), hzsqdtxx.getSQSM())){ |
|
|
|
|
if (StringUtils.equals(OrderInfoEnum.SPECIAL_INVOICE_REASON_1100000000.getKey(), hzsqdtxx.getSQSM()) || |
|
|
|
|
StringUtils.equals(OrderInfoEnum.SPECIAL_INVOICE_REASON_1010000000.getKey(), hzsqdtxx.getSQSM())) { |
|
|
|
|
hzsqdscpc1.setSQLB(ConfigureConstant.STRING_1); |
|
|
|
|
} |
|
|
|
|
//销方申请
|
|
|
|
|
if(StringUtils.equals(OrderInfoEnum.SPECIAL_INVOICE_REASON_0000000100.getKey(), hzsqdtxx.getSQSM())){ |
|
|
|
|
if (StringUtils.equals(OrderInfoEnum.SPECIAL_INVOICE_REASON_0000000100.getKey(), hzsqdtxx.getSQSM())) { |
|
|
|
|
hzsqdscpc1.setSQLB(ConfigureConstant.STRING_0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1433,7 +1432,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
String terminalCode = simsBackService.getTerminalCode(hzsqdscReq.getHZSQDSCPC().getNSRSBH(), null); |
|
|
|
|
if (StringUtils.isBlank(terminalCode)) { |
|
|
|
|
log.warn("{}企业未配置税控设备,税号:{}", LOGGER_MSG, hzsqdscReq.getHZSQDSCPC().getNSRSBH()); |
|
|
|
|
hzsqdscRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.COMMON_ERROR.getKey(),6,"0")); |
|
|
|
|
hzsqdscRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.COMMON_ERROR.getKey(), 6, "0")); |
|
|
|
|
hzsqdscRsp.setZTXX(OrderInfoContentEnum.COMMON_ERROR.getMessage()); |
|
|
|
|
return hzsqdscRsp; |
|
|
|
|
} |
|
|
|
@ -1457,7 +1456,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
if (!OrderInfoContentEnum.SUCCESS.getKey().equals(String.valueOf(result.get(OrderManagementConstant.CODE)))) { |
|
|
|
|
log.error("{}红字申请单上传数据自动匹配受理点失败:{}", LOGGER_MSG, checkInvParam); |
|
|
|
|
hzsqdscRsp.setZTDM(result.get(OrderManagementConstant.CODE) == null ? ConfigureConstant.STRING_009999 |
|
|
|
|
: StringUtils.leftPad(String.valueOf(result.get(OrderManagementConstant.CODE)),6,"0")); |
|
|
|
|
: StringUtils.leftPad(String.valueOf(result.get(OrderManagementConstant.CODE)), 6, "0")); |
|
|
|
|
hzsqdscRsp.setZTXX(result.get(OrderManagementConstant.MESSAGE) == null ? "红字申请单上传数据自动匹配受理点失败" |
|
|
|
|
: String.valueOf(result.get(OrderManagementConstant.MESSAGE))); |
|
|
|
|
return hzsqdscRsp; |
|
|
|
@ -1510,7 +1509,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果为调用税控版本的方格,需要调用税控接口,如果为订单的需要发送指令
|
|
|
|
|
if(CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh)){ |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
String uploadUrl = invoiceConfig.configFgApplicationUpload(); |
|
|
|
|
|
|
|
|
|
//当对外接口一批次上传多条红字申请单时,按单条轮询上传
|
|
|
|
@ -1522,7 +1521,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
hzsqdscReq1.setHZSQDSCZXX(HZSQDSCZXX); |
|
|
|
|
|
|
|
|
|
HzfpsqbsReq req = BeanTransitionUtils.transitionSpecialInvoiceRushRedV3(hzsqdscReq1, sldid, kpjh, fplx, fplb); |
|
|
|
|
HpUploadResponse hpUploadResponse = HttpInvoiceRequestUtil.redInvoiceUpload(uploadUrl, req, terminalCode,fgSkKpShList,sh); |
|
|
|
|
HpUploadResponse hpUploadResponse = HttpInvoiceRequestUtil.redInvoiceUpload(uploadUrl, req, terminalCode, fgSkKpShList, sh); |
|
|
|
|
String statusCode = hpUploadResponse.getResult().getStatusCode(); |
|
|
|
|
String statusMsg = hpUploadResponse.getResult().getStatusMessage(); |
|
|
|
|
|
|
|
|
@ -1530,25 +1529,25 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
hzsqdscjg.setSQDH(""); |
|
|
|
|
hzsqdscjg.setXXBBH(""); |
|
|
|
|
List<HpUploadResponseHzfpsqbsc> hpUploadResponseHzfpsqbscList = hpUploadResponse.getResult().getResponse_HZFPSQBSC(); |
|
|
|
|
if(CollectionUtil.isNotEmpty(hpUploadResponseHzfpsqbscList) |
|
|
|
|
&& Objects.nonNull(hpUploadResponseHzfpsqbscList.get(0))){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(hpUploadResponseHzfpsqbscList) |
|
|
|
|
&& Objects.nonNull(hpUploadResponseHzfpsqbscList.get(0))) { |
|
|
|
|
HpUploadResponseHzfpsqbsc hpUploadResponseHzfpsqbsc = hpUploadResponseHzfpsqbscList.get(0); |
|
|
|
|
hzsqdscjg.setSQDH(hpUploadResponseHzfpsqbsc.getSQDH()); |
|
|
|
|
hzsqdscjg.setXXBBH(hpUploadResponseHzfpsqbsc.getXXBBH()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(ConfigureConstant.STRING_0000.equals(statusCode)){ |
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(statusCode)) { |
|
|
|
|
hzsqdscjg.setZTDM(OrderInfoEnum.SPECIAL_INVOICE_STATUS_TZD0501.getKey()); |
|
|
|
|
hzsqdscjg.setZTXX(OrderInfoEnum.SPECIAL_INVOICE_STATUS_TZD0501.getValue()); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
hzsqdscjg.setZTDM(statusCode); |
|
|
|
|
hzsqdscjg.setZTXX(statusMsg); |
|
|
|
|
} |
|
|
|
|
hzsqdscjgs.add(hzsqdscjg); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
//存放上传信息到redis队列
|
|
|
|
|
fangGeService.saveMqttToRedis(hzsqdscReq.getHZSQDSCPC().getNSRSBH(), sldid, OrderInfoEnum.FANGGE_INTERFACE_TYPE_2.getKey(), hzsqdsczxx.getHZSQDTXX().getSQBSCQQLSH(),false); |
|
|
|
|
fangGeService.saveMqttToRedis(hzsqdscReq.getHZSQDSCPC().getNSRSBH(), sldid, OrderInfoEnum.FANGGE_INTERFACE_TYPE_2.getKey(), hzsqdsczxx.getHZSQDTXX().getSQBSCQQLSH(), false); |
|
|
|
|
//消费下一条数据
|
|
|
|
|
fangGeService.handleRedisMsg(hzsqdscReq.getHZSQDSCPC().getNSRSBH(), sldid); |
|
|
|
|
|
|
|
|
@ -1559,8 +1558,8 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
hzsqdscjgs.add(hzsqdscjg); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Objects.nonNull(specialInvoiceReversal) |
|
|
|
|
&& !SPECIAL_INVOICE_STATUS_TZD0500.getKey().equals(specialInvoiceReversal.getStatusCode())){ |
|
|
|
|
if (Objects.nonNull(specialInvoiceReversal) |
|
|
|
|
&& !SPECIAL_INVOICE_STATUS_TZD0500.getKey().equals(specialInvoiceReversal.getStatusCode())) { |
|
|
|
|
//如果数据库存在该红字信息表,返回数据库中的红字信息表状态
|
|
|
|
|
HzsqdscjgBO hzsqdscjg1 = new HzsqdscjgBO(); |
|
|
|
|
hzsqdscjg1.setSQBSCQQLSH(hzsqdtxx.getSQBSCQQLSH()); |
|
|
|
@ -1570,8 +1569,8 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
hzsqdscjg1.setXXBBH(specialInvoiceReversal.getXxbbh()); |
|
|
|
|
|
|
|
|
|
//如果是新版方格,税控接口返回失败时对外接口返回税控接口的错误信息
|
|
|
|
|
if(CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh) |
|
|
|
|
&& !ConfigureConstant.STRING_0000.equals(hzsqdscjg.getZTDM())){ |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh) |
|
|
|
|
&& !ConfigureConstant.STRING_0000.equals(hzsqdscjg.getZTDM())) { |
|
|
|
|
hzsqdscjg1.setZTDM(hzsqdscjg.getZTDM()); |
|
|
|
|
hzsqdscjg1.setZTXX(hzsqdscjg.getZTXX()); |
|
|
|
|
hzsqdscjg1.setXXBBH(hzsqdscjg.getXXBBH()); |
|
|
|
@ -1594,7 +1593,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
//组装对外接口出参数据
|
|
|
|
|
hzsqdscRsp.setHZSQDSCJG(hzsqdscjgsReturn); |
|
|
|
|
|
|
|
|
|
} else if(CommonUtils.judgeNewInterface(terminalCode)){ |
|
|
|
|
} else if (CommonUtils.judgeNewInterface(terminalCode)) { |
|
|
|
|
|
|
|
|
|
//上传成功的红字申请单集合
|
|
|
|
|
List<HpUploadResponse> successHpUploadResponseList = new ArrayList<>(hzsqdscReq.getHZSQDSCZXX().size()); |
|
|
|
@ -1614,22 +1613,22 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
log.debug("{},转换后数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(req)); |
|
|
|
|
|
|
|
|
|
String uploadUrl = invoiceConfig.configApplicationUpload(); |
|
|
|
|
HpUploadResponse redInvoiceUpload = HttpInvoiceRequestUtil.redInvoiceUpload(uploadUrl, req, terminalCode, fgSkKpShList,sh); |
|
|
|
|
HpUploadResponse redInvoiceUpload = HttpInvoiceRequestUtil.redInvoiceUpload(uploadUrl, req, terminalCode, fgSkKpShList, sh); |
|
|
|
|
List<HpUploadResponseHzfpsqbsc> hpUploadResponseHzfpsqbscList = redInvoiceUpload.getResult().getResponse_HZFPSQBSC(); |
|
|
|
|
//是否存在申请单明细信息
|
|
|
|
|
boolean isExistHpUploadResponseHzfpsqbsc = CollectionUtil.isNotEmpty(hpUploadResponseHzfpsqbscList) |
|
|
|
|
&& Objects.nonNull(hpUploadResponseHzfpsqbscList.get(0)); |
|
|
|
|
|
|
|
|
|
if(ConfigureConstant.STRING_0000.equals(redInvoiceUpload.getCode()) |
|
|
|
|
&& isExistHpUploadResponseHzfpsqbsc |
|
|
|
|
&& (SPECIAL_INVOICE_STATUS_TZD0000.getKey().equals(hpUploadResponseHzfpsqbscList.get(0).getSTATUS_CODE()) |
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(redInvoiceUpload.getCode()) |
|
|
|
|
&& isExistHpUploadResponseHzfpsqbsc |
|
|
|
|
&& (SPECIAL_INVOICE_STATUS_TZD0000.getKey().equals(hpUploadResponseHzfpsqbscList.get(0).getSTATUS_CODE()) |
|
|
|
|
|| SPECIAL_INVOICE_STATUS_TZD0001.getKey().equals(hpUploadResponseHzfpsqbscList.get(0).getSTATUS_CODE()) |
|
|
|
|
|| SPECIAL_INVOICE_STATUS_TZD1000.getKey().equals(hpUploadResponseHzfpsqbscList.get(0).getSTATUS_CODE()))){ |
|
|
|
|
|| SPECIAL_INVOICE_STATUS_TZD1000.getKey().equals(hpUploadResponseHzfpsqbscList.get(0).getSTATUS_CODE()))) { |
|
|
|
|
|
|
|
|
|
successHpUploadResponseList.add(redInvoiceUpload); |
|
|
|
|
} else { |
|
|
|
|
failHpUploadResponseList.add(redInvoiceUpload); |
|
|
|
|
} |
|
|
|
|
successHpUploadResponseList.add(redInvoiceUpload); |
|
|
|
|
} else { |
|
|
|
|
failHpUploadResponseList.add(redInvoiceUpload); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//合并所有红字发票申请单上传结果
|
|
|
|
@ -1640,7 +1639,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
|
|
|
|
|
List<HpUploadResponseHzfpsqbsc> hpUploadResponseHzfpsqbscList = new ArrayList<>(10); |
|
|
|
|
for (HpUploadResponse hpUploadResponse : hpUploadResponseList) { |
|
|
|
|
if(ConfigureConstant.STRING_0000.equals(hpUploadResponse.getCode())){ |
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(hpUploadResponse.getCode())) { |
|
|
|
|
hpUploadResponseHzfpsqbscList.addAll(hpUploadResponse.getResult().getResponse_HZFPSQBSC()); |
|
|
|
|
} else { |
|
|
|
|
HpUploadResponseHzfpsqbsc hpUploadResponseHzfpsqbsc = new HpUploadResponseHzfpsqbsc(); |
|
|
|
@ -1655,11 +1654,11 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
redInvoiceUpload.getResult().setResponse_HZFPSQBSC(hpUploadResponseHzfpsqbscList); |
|
|
|
|
|
|
|
|
|
hzsqdscRsp = BeanTransitionUtils.transitionSpecialInvoiceRushRedRspV3(redInvoiceUpload); |
|
|
|
|
if(hzsqdscReq.getHZSQDSCZXX().size() == failHpUploadResponseList.size()){ |
|
|
|
|
if (hzsqdscReq.getHZSQDSCZXX().size() == failHpUploadResponseList.size()) { |
|
|
|
|
//红字申请单批量上传全部失败
|
|
|
|
|
hzsqdscRsp.setZTDM(OrderInfoContentEnum.CHECK_ISS7PRI_SC_060002.getKey()); |
|
|
|
|
hzsqdscRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_SC_060002.getMessage()); |
|
|
|
|
} else if(hzsqdscReq.getHZSQDSCZXX().size() == successHpUploadResponseList.size()) { |
|
|
|
|
} else if (hzsqdscReq.getHZSQDSCZXX().size() == successHpUploadResponseList.size()) { |
|
|
|
|
//红字申请单批量上传全部成功
|
|
|
|
|
hzsqdscRsp.setZTDM(OrderInfoContentEnum.CHECK_ISS7PRI_SC_060000.getKey()); |
|
|
|
|
hzsqdscRsp.setZTXX(OrderInfoContentEnum.CHECK_ISS7PRI_SC_060000.getMessage()); |
|
|
|
@ -1677,7 +1676,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
log.debug("{},转换后数据:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(req)); |
|
|
|
|
|
|
|
|
|
String uploadUrl = invoiceConfig.configRedInvoiceUpload(); |
|
|
|
|
HpUploadResponse redInvoiceUpload = HttpInvoiceRequestUtil.redInvoiceUpload(uploadUrl, req, terminalCode, fgSkKpShList,sh); |
|
|
|
|
HpUploadResponse redInvoiceUpload = HttpInvoiceRequestUtil.redInvoiceUpload(uploadUrl, req, terminalCode, fgSkKpShList, sh); |
|
|
|
|
hzsqdscRsp = BeanTransitionUtils.transitionSpecialInvoiceRushRedRspV3(redInvoiceUpload); |
|
|
|
|
|
|
|
|
|
//更新数据库
|
|
|
|
@ -1736,7 +1735,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
String terminalCode = simsBackService.getTerminalCode(hzsqdxzReq.getNSRSBH(), null); |
|
|
|
|
if (StringUtils.isBlank(terminalCode)) { |
|
|
|
|
log.warn("{}企业未配置税控设备,税号:{}", LOGGER_MSG, hzsqdxzReq.getNSRSBH()); |
|
|
|
|
hzsqdxzRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.COMMON_ERROR.getKey(),6,"0")); |
|
|
|
|
hzsqdxzRsp.setZTDM(StringUtils.leftPad(OrderInfoContentEnum.COMMON_ERROR.getKey(), 6, "0")); |
|
|
|
|
hzsqdxzRsp.setZTXX(OrderInfoContentEnum.COMMON_ERROR.getMessage()); |
|
|
|
|
return hzsqdxzRsp; |
|
|
|
|
} |
|
|
|
@ -1744,14 +1743,14 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
log.info("税盘编码:{}", terminalCode); |
|
|
|
|
//方格税盘特殊处理
|
|
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode,fgSkKpShList,sh)) { |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 请求协议转换 |
|
|
|
|
*/ |
|
|
|
|
HpInvoiceRequest hpInvocieRequest = BeanTransitionUtils.transitionDownSpecialInvoiceV3(hzsqdxzReq, sldid, kpjh, fplx, fplb); |
|
|
|
|
|
|
|
|
|
HpResponseBean redInvoiceDown = specialInvoiceService.downloadSpecialInvoiceReversalFg(hpInvocieRequest,terminalCode); |
|
|
|
|
HpResponseBean redInvoiceDown = specialInvoiceService.downloadSpecialInvoiceReversalFg(hpInvocieRequest, terminalCode); |
|
|
|
|
hzsqdxzRsp = BeanTransitionUtils.transitionDownSpecialInvoiceRspV3(redInvoiceDown); |
|
|
|
|
recodeXxbtsbs(hzsqdxzRsp); |
|
|
|
|
} else { |
|
|
|
@ -1761,8 +1760,8 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
HpInvoiceRequest hpInvocieRequest = BeanTransitionUtils.transitionDownSpecialInvoiceV3(hzsqdxzReq, sldid, kpjh, fplx, fplb); |
|
|
|
|
|
|
|
|
|
//调用下载前自动轮训可用开票点进行赋值
|
|
|
|
|
List<SearchFjh> searchFjhList = unifyService.getFjh(hzsqdxzReq.getNSRSBH(), "", "",terminalCode); |
|
|
|
|
if(CollectionUtil.isEmpty(searchFjhList)){ |
|
|
|
|
List<SearchFjh> searchFjhList = unifyService.getFjh(hzsqdxzReq.getNSRSBH(), "", "", terminalCode); |
|
|
|
|
if (CollectionUtil.isEmpty(searchFjhList)) { |
|
|
|
|
log.error("{}红字申请单下载获取分机为空!,请求信息为:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(hpInvocieRequest)); |
|
|
|
|
hzsqdxzRsp.setZTDM(ConfigureConstant.STRING_009999); |
|
|
|
|
hzsqdxzRsp.setZTXX("红字申请单下载获取分机为空"); |
|
|
|
@ -1776,7 +1775,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
|
|
|
|
|
for (SearchFjh searchFjh : searchFjhList) { |
|
|
|
|
hpInvocieRequest.setKPJH(searchFjh.getFjh()); |
|
|
|
|
if(CommonUtils.judgeIsFgTerminalNew(terminalCode,fgSkKpShList,sh)) { |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
hpInvocieRequest.setKPJH(searchFjh.getJqbh()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1784,24 +1783,24 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
if (CommonUtils.judgeNewInterface(terminalCode)) { |
|
|
|
|
downUrl = invoiceConfig.configApplicationDownload(); |
|
|
|
|
} |
|
|
|
|
if(CommonUtils.judgeIsFgTerminalNew(terminalCode,fgSkKpShList,sh)){ |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
downUrl = invoiceConfig.configFgApplicationDownload(); |
|
|
|
|
} |
|
|
|
|
HpResponseBean redInvoiceDown = HttpInvoiceRequestUtil.redInvoiceDown(downUrl, hpInvocieRequest, terminalCode,fgSkKpShList,sh); |
|
|
|
|
HpResponseBean redInvoiceDown = HttpInvoiceRequestUtil.redInvoiceDown(downUrl, hpInvocieRequest, terminalCode, fgSkKpShList, sh); |
|
|
|
|
//如果调用税控红字信息表下载接口异常,轮询下一个分机
|
|
|
|
|
if(ExceptionContentEnum.HZSQD_UPLOAD_ERROR_999999.getKey().equals(redInvoiceDown.getCode())){ |
|
|
|
|
if (ExceptionContentEnum.HZSQD_UPLOAD_ERROR_999999.getKey().equals(redInvoiceDown.getCode())) { |
|
|
|
|
failRedInvoiceDownList.add(redInvoiceDown); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
//如果下载成功,继续轮询下一个分机
|
|
|
|
|
if(CollectionUtil.isNotEmpty(redInvoiceDown.getResult().getRedinvreqbillxx())){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(redInvoiceDown.getResult().getRedinvreqbillxx())) { |
|
|
|
|
successRedInvoiceDownList.add(redInvoiceDown); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HpResponseBean redInvoiceDown; |
|
|
|
|
//如果轮询分机都下载失败则返回第一个分机失败信息
|
|
|
|
|
if(searchFjhList.size() == CollectionUtil.size(failRedInvoiceDownList)){ |
|
|
|
|
if (searchFjhList.size() == CollectionUtil.size(failRedInvoiceDownList)) { |
|
|
|
|
redInvoiceDown = failRedInvoiceDownList.get(0); |
|
|
|
|
} else { |
|
|
|
|
redInvoiceDown = successRedInvoiceDownList.get(0); |
|
|
|
@ -1811,7 +1810,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
for (HpResponseBean hpResponseBean : successRedInvoiceDownList) { |
|
|
|
|
redinvreqbillxx.addAll(hpResponseBean.getResult().getRedinvreqbillxx()); |
|
|
|
|
} |
|
|
|
|
if(CollectionUtil.isNotEmpty(redinvreqbillxx)){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(redinvreqbillxx)) { |
|
|
|
|
redInvoiceDown.getResult().setRedinvreqbillxx(redinvreqbillxx); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1885,7 +1884,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//最大导入条数限制校验
|
|
|
|
|
if(ConfigureConstant.PC_MAX_ITEM_LENGTH <= ddfpzxxList.size()){ |
|
|
|
|
if (ConfigureConstant.PC_MAX_ITEM_LENGTH <= ddfpzxxList.size()) { |
|
|
|
|
DdfpdrRspBO ddfpdrRsp = new DdfpdrRspBO(); |
|
|
|
|
ddfpdrRsp.setZTDM(OrderInfoContentEnum.INVOICE_INFO_IMPORT_ERROR.getKey()); |
|
|
|
|
ddfpdrRsp.setZTXX("单个批次最多支持1000张发票导入"); |
|
|
|
@ -1903,65 +1902,65 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
try { |
|
|
|
|
//校验前补充数据
|
|
|
|
|
//清单项目名称(税控发票修复功能)
|
|
|
|
|
if(!StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V5, interfaceVersion) |
|
|
|
|
&& !StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V6, interfaceVersion)){ |
|
|
|
|
if (!StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V5, interfaceVersion) |
|
|
|
|
&& !StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V6, interfaceVersion)) { |
|
|
|
|
DdfpxxBO ddfpxx = ddfpzxx.getDDFPXX(); |
|
|
|
|
if(Objects.nonNull(ddfpxx)){ |
|
|
|
|
if (Objects.nonNull(ddfpxx)) { |
|
|
|
|
//补全清单项目名称
|
|
|
|
|
if(StringUtils.isBlank(ddfpxx.getQDXMMC()) && |
|
|
|
|
StringUtils.isNotBlank(ddfpxx.getQDBZ())){ |
|
|
|
|
if (StringUtils.isBlank(ddfpxx.getQDXMMC()) && |
|
|
|
|
StringUtils.isNotBlank(ddfpxx.getQDBZ())) { |
|
|
|
|
String qdxmmcConstant = ConfigureConstant.XJXHQD; |
|
|
|
|
if (OrderInfoEnum.INVOICE_BILLING_TYPE_1.getKey().equals(ddfpxx.getKPLX())) { |
|
|
|
|
qdxmmcConstant = ConfigureConstant.XJZSXHQD; |
|
|
|
|
} |
|
|
|
|
if(StringUtils.equals(OrderInfoEnum.QDBZ_CODE_1.getKey(),ddfpxx.getQDBZ()) || |
|
|
|
|
StringUtils.equals(OrderInfoEnum.QDBZ_CODE_3.getKey(),ddfpxx.getQDBZ())){ |
|
|
|
|
if (StringUtils.equals(OrderInfoEnum.QDBZ_CODE_1.getKey(), ddfpxx.getQDBZ()) || |
|
|
|
|
StringUtils.equals(OrderInfoEnum.QDBZ_CODE_3.getKey(), ddfpxx.getQDBZ())) { |
|
|
|
|
ddfpxx.setQDXMMC(qdxmmcConstant); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//补全编码表版本号
|
|
|
|
|
if(StringUtils.isBlank(ddfpxx.getBMBBBH())){ |
|
|
|
|
if (StringUtils.isBlank(ddfpxx.getBMBBBH())) { |
|
|
|
|
ddfpxx.setBMBBBH(baseServiceConfig.configBmbbbh()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果是全电发票,发票行性质,优惠政策标识需要特殊处理
|
|
|
|
|
if(CommonUtils.judgeIsQdfp("", ddfpxx.getFPLXDM())){ |
|
|
|
|
if (CommonUtils.judgeIsQdfp("", ddfpxx.getFPLXDM())) { |
|
|
|
|
ddfpzxx.getDDMXXX().forEach(ddmxxxBO -> { |
|
|
|
|
//发票行性质
|
|
|
|
|
ddmxxxBO.setFPHXZ(CommonUtils.transFphxz(ddmxxxBO.getFPHXZ())); |
|
|
|
|
//含税标志
|
|
|
|
|
if(StringUtils.isBlank(ddmxxxBO.getHSBZ())){ |
|
|
|
|
if (StringUtils.isBlank(ddmxxxBO.getHSBZ())) { |
|
|
|
|
ddmxxxBO.setHSBZ(HSBZ_0.getKey()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//优惠政策标识、增值税特殊管理、零税率标识
|
|
|
|
|
if(StringUtils.isNotBlank(ddmxxxBO.getYHZCBS())){ |
|
|
|
|
if (StringUtils.isNotBlank(ddmxxxBO.getYHZCBS())) { |
|
|
|
|
String zzstsgl = CommonUtils.transLocalZzstsgl(ddmxxxBO.getYHZCBS()); |
|
|
|
|
//免税和不征税需要设置零税率标识,如其他零税率标识设置为空,
|
|
|
|
|
if(OrderInfoEnum.ORDER_QD_YHZCBS_03.getValue().equals(zzstsgl)){ |
|
|
|
|
if (OrderInfoEnum.ORDER_QD_YHZCBS_03.getValue().equals(zzstsgl)) { |
|
|
|
|
ddmxxxBO.setLSLBS(OrderInfoEnum.LSLBS_1.getKey()); |
|
|
|
|
ddmxxxBO.setYHZCBS(OrderInfoEnum.YHZCBS_1.getKey()); |
|
|
|
|
ddmxxxBO.setZZSTSGL(zzstsgl); |
|
|
|
|
} else if(OrderInfoEnum.ORDER_QD_YHZCBS_04.getValue().equals(zzstsgl)){ |
|
|
|
|
} else if (OrderInfoEnum.ORDER_QD_YHZCBS_04.getValue().equals(zzstsgl)) { |
|
|
|
|
ddmxxxBO.setLSLBS(OrderInfoEnum.LSLBS_2.getKey()); |
|
|
|
|
ddmxxxBO.setYHZCBS(OrderInfoEnum.YHZCBS_1.getKey()); |
|
|
|
|
ddmxxxBO.setZZSTSGL(zzstsgl); |
|
|
|
|
} else { |
|
|
|
|
if(DecimalCalculateUtil.stringCompare(ConfigureConstant.STRING_000,CommonUtils.formatSl(ddmxxxBO.getSL())) == 0){ |
|
|
|
|
if (DecimalCalculateUtil.stringCompare(ConfigureConstant.STRING_000, CommonUtils.formatSl(ddmxxxBO.getSL())) == 0) { |
|
|
|
|
ddmxxxBO.setLSLBS(OrderInfoEnum.LSLBS_3.getKey()); |
|
|
|
|
ddmxxxBO.setYHZCBS(OrderInfoEnum.YHZCBS_0.getKey()); |
|
|
|
|
ddmxxxBO.setZZSTSGL(""); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
ddmxxxBO.setLSLBS(""); |
|
|
|
|
ddmxxxBO.setYHZCBS(OrderInfoEnum.YHZCBS_1.getKey()); |
|
|
|
|
ddmxxxBO.setZZSTSGL(zzstsgl); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
ddmxxxBO.setYHZCBS(OrderInfoEnum.YHZCBS_0.getKey()); |
|
|
|
|
ddmxxxBO.setZZSTSGL(""); |
|
|
|
|
if(DecimalCalculateUtil.stringCompare(ConfigureConstant.STRING_000,CommonUtils.formatSl(ddmxxxBO.getSL())) == 0){ |
|
|
|
|
if (DecimalCalculateUtil.stringCompare(ConfigureConstant.STRING_000, CommonUtils.formatSl(ddmxxxBO.getSL())) == 0) { |
|
|
|
|
ddmxxxBO.setLSLBS(OrderInfoEnum.LSLBS_3.getKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2047,7 +2046,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
/* |
|
|
|
|
* 订单业务bean |
|
|
|
|
*/ |
|
|
|
|
List<OrderInfo> insertOrder = buildOrderInfo(ddfpzxx, sourceType, terminalCode,entId,qdfwlx); |
|
|
|
|
List<OrderInfo> insertOrder = buildOrderInfo(ddfpzxx, sourceType, terminalCode, entId, qdfwlx); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 全电发票业务bean |
|
|
|
@ -2146,24 +2145,24 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
try { |
|
|
|
|
//校验前补充数据
|
|
|
|
|
//清单项目名称(税控发票修复功能)
|
|
|
|
|
if(!StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V5, interfaceVersion) |
|
|
|
|
&& !StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V6, interfaceVersion)){ |
|
|
|
|
if (!StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V5, interfaceVersion) |
|
|
|
|
&& !StringUtils.equals(ConfigurerInfo.INTERFACE_VERSION_V6, interfaceVersion)) { |
|
|
|
|
DdfpxxBO ddfpxx = ddfpzxx.getDDFPXX(); |
|
|
|
|
if(Objects.nonNull(ddfpxx)){ |
|
|
|
|
if (Objects.nonNull(ddfpxx)) { |
|
|
|
|
//补全清单项目名称
|
|
|
|
|
if(StringUtils.isBlank(ddfpxx.getQDXMMC()) && |
|
|
|
|
StringUtils.isNotBlank(ddfpxx.getQDBZ())){ |
|
|
|
|
if (StringUtils.isBlank(ddfpxx.getQDXMMC()) && |
|
|
|
|
StringUtils.isNotBlank(ddfpxx.getQDBZ())) { |
|
|
|
|
String qdxmmcConstant = ConfigureConstant.XJXHQD; |
|
|
|
|
if (OrderInfoEnum.INVOICE_BILLING_TYPE_1.getKey().equals(ddfpxx.getKPLX())) { |
|
|
|
|
qdxmmcConstant = ConfigureConstant.XJZSXHQD; |
|
|
|
|
} |
|
|
|
|
if(StringUtils.equals(OrderInfoEnum.QDBZ_CODE_1.getKey(),ddfpxx.getQDBZ()) || |
|
|
|
|
StringUtils.equals(OrderInfoEnum.QDBZ_CODE_3.getKey(),ddfpxx.getQDBZ())){ |
|
|
|
|
if (StringUtils.equals(OrderInfoEnum.QDBZ_CODE_1.getKey(), ddfpxx.getQDBZ()) || |
|
|
|
|
StringUtils.equals(OrderInfoEnum.QDBZ_CODE_3.getKey(), ddfpxx.getQDBZ())) { |
|
|
|
|
ddfpxx.setQDXMMC(qdxmmcConstant); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//补全编码表版本号
|
|
|
|
|
if(StringUtils.isBlank(ddfpxx.getBMBBBH())){ |
|
|
|
|
if (StringUtils.isBlank(ddfpxx.getBMBBBH())) { |
|
|
|
|
ddfpxx.setBMBBBH(baseServiceConfig.configBmbbbh()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2227,7 +2226,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
/* |
|
|
|
|
* 订单业务bean |
|
|
|
|
*/ |
|
|
|
|
List<OrderInfo> insertOrder = buildOrderInfo(ddfpzxx, sourceType, terminalCode,entId,qdfwlx); |
|
|
|
|
List<OrderInfo> insertOrder = buildOrderInfo(ddfpzxx, sourceType, terminalCode, entId, qdfwlx); |
|
|
|
|
/* |
|
|
|
|
* 订单明细业务bean |
|
|
|
|
*/ |
|
|
|
@ -2354,7 +2353,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3.按照纳税人识别号查询
|
|
|
|
|
PageUtils pageUtils = commodityService.queryCommodityList(param, shList); |
|
|
|
|
PageUtils pageUtils = commodityService.queryCommodityList(param, shList, null); |
|
|
|
|
List<SpxxBO> spxxCommonList = new ArrayList<>(); |
|
|
|
|
List<CommodityCodeEntity> commodityCodeEntityList = (List<CommodityCodeEntity>) pageUtils.getList(); |
|
|
|
|
log.info("{}查询商品信息结果:{}", LOGGER_MSG_V4, commodityCodeEntityList); |
|
|
|
@ -3544,7 +3543,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
DyResponse dyResponse = new DyResponse(); |
|
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
|
|
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode,fgSkKpShList,sh)) { |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
//新增校验,验证方格客户端是否在线,如果不在线直接返回异常
|
|
|
|
|
boolean subscriptions = unifyService.querySpzxzt(fpdyReqBO.getNSRSBH(), |
|
|
|
|
invoicePrintPackageDetailList.get(0).getFjh(), terminalCode); |
|
|
|
@ -3577,13 +3576,13 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
fangGeService.saveInvoicePrintInfo(printInfo); |
|
|
|
|
|
|
|
|
|
//如果为调用税控版本的方格,需要调用税控接口,如果为订单的需要发送指令
|
|
|
|
|
if(CommonUtils.judgeIsFgTerminalNew(terminalCode,fgSkKpShList,sh)){ |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
|
|
|
|
|
String fgInvoicePrint = invoiceConfig.configFgInvoicePrint(); |
|
|
|
|
|
|
|
|
|
dyRequest.setInvoicePrintPackageDetailList(invoicePrintPackageDetailList); |
|
|
|
|
|
|
|
|
|
dyResponse = HttpInvoiceRequestUtil.batchPrint(fgInvoicePrint, dyRequest, terminalCode,fgSkKpShList,sh); |
|
|
|
|
dyResponse = HttpInvoiceRequestUtil.batchPrint(fgInvoicePrint, dyRequest, terminalCode, fgSkKpShList, sh); |
|
|
|
|
|
|
|
|
|
String statusCode = dyResponse.getCode(); |
|
|
|
|
String statusMsg = dyResponse.getMsg(); |
|
|
|
@ -3592,11 +3591,11 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
dyResponse.setMsg(statusMsg); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
//存放打印信息到redis队列
|
|
|
|
|
fangGeService.saveMqttToRedis(dyRequestExtend.getNsrsbh(), dyRequestExtend.getFjh(), |
|
|
|
|
OrderInfoEnum.FANGGE_INTERFACE_TYPE_5.getKey(), printInfo.getFpdypch(),false); |
|
|
|
|
OrderInfoEnum.FANGGE_INTERFACE_TYPE_5.getKey(), printInfo.getFpdypch(), false); |
|
|
|
|
//消费下一条数据
|
|
|
|
|
fangGeService.handleRedisMsg(dyRequestExtend.getNsrsbh(), dyRequestExtend.getFjh()); |
|
|
|
|
} |
|
|
|
@ -3612,7 +3611,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} else if (CommonUtils.judgeNewInterface(terminalCode)) { |
|
|
|
|
requestUrl = invoiceConfig.configPrintInvoiceInfo(); |
|
|
|
|
} |
|
|
|
|
dyResponse = HttpInvoiceRequestUtil.batchPrint(requestUrl, dyRequest, terminalCode, fgSkKpShList,sh); |
|
|
|
|
dyResponse = HttpInvoiceRequestUtil.batchPrint(requestUrl, dyRequest, terminalCode, fgSkKpShList, sh); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(dyResponse.getCode())) { |
|
|
|
@ -3690,7 +3689,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
//3.调用税控接口
|
|
|
|
|
String fgSkKpShList = baseServiceConfig.getFgSkKpShList(); |
|
|
|
|
|
|
|
|
|
if(CommonUtils.judgeIsFgTerminalOld(terminalCode,fgSkKpShList,sh)){ |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
//方格
|
|
|
|
|
FgkpSkDyjmcCxParam fgkpSkDyjmcCxParam = new FgkpSkDyjmcCxParam(); |
|
|
|
|
fgkpSkDyjmcCxParam.setXhfNsrsbh(NsrsbhUtils.transShListByXhfNsrsbh(dyjcxReqBO.getNSRSBH())); |
|
|
|
@ -3699,7 +3698,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
fgkpSkDyjmcCxParam, terminalCode); |
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(skDyjByShZl.getCode())) { |
|
|
|
|
List<FgkpSkDyjEntity> fgkpSkDyjEntityList = skDyjByShZl.getData(); |
|
|
|
|
if(CollectionUtil.isEmpty(fgkpSkDyjEntityList)){ |
|
|
|
|
if (CollectionUtil.isEmpty(fgkpSkDyjEntityList)) { |
|
|
|
|
throw new OrderReceiveException(OrderInfoContentEnum.QUERYPRINTER_000005); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3729,10 +3728,10 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
if (CommonUtils.judgeNewInterface(terminalCode)) { |
|
|
|
|
dyjListUrl = invoiceConfig.configQueryPrinterInfo(); |
|
|
|
|
} |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode,fgSkKpShList,sh)) { |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalNew(terminalCode, fgSkKpShList, sh)) { |
|
|
|
|
dyjListUrl = invoiceConfig.configFgQueryPrinterInfo(); |
|
|
|
|
} |
|
|
|
|
DydResponse dyResponse = HttpInvoiceRequestUtil.queryDydxxcxList(dyjListUrl, dydListRequst, terminalCode,fgSkKpShList,sh); |
|
|
|
|
DydResponse dyResponse = HttpInvoiceRequestUtil.queryDydxxcxList(dyjListUrl, dydListRequst, terminalCode, fgSkKpShList, sh); |
|
|
|
|
|
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(dyResponse.getCode())) { |
|
|
|
|
// 4.响应协议Bean转换
|
|
|
|
@ -3758,9 +3757,9 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果打印机名称不为空,根据打印机名称过滤从税控底层查询到打印机列表
|
|
|
|
|
if(StringUtils.isNotBlank(dyjcxReqBO.getDYJMC())){ |
|
|
|
|
if (StringUtils.isNotBlank(dyjcxReqBO.getDYJMC())) { |
|
|
|
|
List<Dyjxx> dyjxxList = dyjcxRspBO.getDYJXX(); |
|
|
|
|
if(CollectionUtil.isNotEmpty(dyjxxList)){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(dyjxxList)) { |
|
|
|
|
List<Dyjxx> dyjxxes = dyjxxList.stream() |
|
|
|
|
.filter(dyjxx -> StringUtils.equals(dyjcxReqBO.getDYJMC(), dyjxx.getDYJMC())) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
@ -3843,7 +3842,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
qyjbxxCxRspBO.setNSRMC(taxEquipmentInfo.getXhfMc()); |
|
|
|
|
|
|
|
|
|
//税控
|
|
|
|
|
if(CollectionUtil.isNotEmpty(taxpayermachineinfos)){ |
|
|
|
|
if (CollectionUtil.isNotEmpty(taxpayermachineinfos)) { |
|
|
|
|
List<Sbjcxx> sbjcxxList = new ArrayList<>(taxpayermachineinfos.size()); |
|
|
|
|
taxpayermachineinfos.forEach(taxpayerMachineInfo -> { |
|
|
|
|
Sbjcxx sbjcxx = new Sbjcxx(); |
|
|
|
@ -3853,20 +3852,20 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
List<Fplxdmxx> fplxdmxxList = new ArrayList<>(invoiceTypeList.size()); |
|
|
|
|
for (InvoiceType invoiceType : invoiceTypeList) { |
|
|
|
|
//过滤掉 41(卷票) 数据
|
|
|
|
|
if(StringUtils.equals(OrderInfoEnum.ORDER_INVOICE_TYPE_41.getKey(),invoiceType.getFPZLDM())){ |
|
|
|
|
if (StringUtils.equals(OrderInfoEnum.ORDER_INVOICE_TYPE_41.getKey(), invoiceType.getFPZLDM())) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
Fplxdmxx fplxdmxx = new Fplxdmxx(); |
|
|
|
|
BeanUtils.copyProperties(invoiceType, fplxdmxx); |
|
|
|
|
fplxdmxx.setFPLXDM(CommonUtils.transFplxdm(invoiceType.getFPZLDM())); |
|
|
|
|
if(StringUtils.isNotBlank(invoiceType.getSJBSQSSJ())){ |
|
|
|
|
fplxdmxx.setSJBSQSSJ(DateUtil.format(DateUtil.parse(invoiceType.getSJBSQSSJ()),ConfigureConstant.DATE_FORMAT_DATE)); |
|
|
|
|
if (StringUtils.isNotBlank(invoiceType.getSJBSQSSJ())) { |
|
|
|
|
fplxdmxx.setSJBSQSSJ(DateUtil.format(DateUtil.parse(invoiceType.getSJBSQSSJ()), ConfigureConstant.DATE_FORMAT_DATE)); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isNotBlank(invoiceType.getZXBSSJ())){ |
|
|
|
|
fplxdmxx.setZXBSSJ(DateUtil.format(DateUtil.parse(invoiceType.getZXBSSJ()),ConfigureConstant.DATE_FORMAT_DATE)); |
|
|
|
|
if (StringUtils.isNotBlank(invoiceType.getZXBSSJ())) { |
|
|
|
|
fplxdmxx.setZXBSSJ(DateUtil.format(DateUtil.parse(invoiceType.getZXBSSJ()), ConfigureConstant.DATE_FORMAT_DATE)); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isNotBlank(invoiceType.getKPJZRQ())){ |
|
|
|
|
fplxdmxx.setKPJZRQ(DateUtil.format(DateUtil.parse(invoiceType.getKPJZRQ()),ConfigureConstant.DATE_FORMAT_DATE)); |
|
|
|
|
if (StringUtils.isNotBlank(invoiceType.getKPJZRQ())) { |
|
|
|
|
fplxdmxx.setKPJZRQ(DateUtil.format(DateUtil.parse(invoiceType.getKPJZRQ()), ConfigureConstant.DATE_FORMAT_DATE)); |
|
|
|
|
} |
|
|
|
|
fplxdmxxList.add(fplxdmxx); |
|
|
|
|
} |
|
|
|
@ -3878,7 +3877,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//全电
|
|
|
|
|
if(Objects.nonNull(qdjcxx) && Objects.nonNull(qdjcxx.getJCXX())){ |
|
|
|
|
if (Objects.nonNull(qdjcxx) && Objects.nonNull(qdjcxx.getJCXX())) { |
|
|
|
|
qyjbxxCxRspBO.setNSRMC(qdjcxx.getJCXX().getNSRMC()); |
|
|
|
|
QdjcxxBO qdjcxxBO = new QdjcxxBO(); |
|
|
|
|
JcxxBO jcxxBO = new JcxxBO(); |
|
|
|
@ -4790,7 +4789,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
} else { |
|
|
|
|
// 查询表 `order_invoice_info`
|
|
|
|
|
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfoByFpdmAndFphm(zfcxReqBO.getFPDM(), zfcxReqBO.getFPHM(), shList); |
|
|
|
|
if(Objects.nonNull(orderInvoiceInfo)){ |
|
|
|
|
if (Objects.nonNull(orderInvoiceInfo)) { |
|
|
|
|
zfBz = orderInvoiceInfo.getZfBz(); |
|
|
|
|
zfsj = orderInvoiceInfo.getZfsj(); |
|
|
|
|
} else { |
|
|
|
@ -4882,7 +4881,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
* @author <a href="tivenninesongs@163.com">yaoxuguang</a> |
|
|
|
|
* @date 2020/4/24 |
|
|
|
|
*/ |
|
|
|
|
private List<OrderInfo> buildOrderInfo(DdfpzxxBO ddfpzxx, String sourceType, String terminalCode,String entId,String qdfwlx) { |
|
|
|
|
private List<OrderInfo> buildOrderInfo(DdfpzxxBO ddfpzxx, String sourceType, String terminalCode, String entId, String qdfwlx) { |
|
|
|
|
List<OrderInfo> insertOrder = CollectionUtil.newArrayList(); |
|
|
|
|
OrderInfo orderInfo = BeanTransitionUtils.transitionInsertOrderInfo(ddfpzxx.getDDFPXX()); |
|
|
|
|
if (StringUtils.isEmpty(orderInfo.getDdh())) { |
|
|
|
@ -4891,7 +4890,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
/** |
|
|
|
|
* 设置订单数据类型 |
|
|
|
|
*/ |
|
|
|
|
if(CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())){ |
|
|
|
|
if (CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())) { |
|
|
|
|
orderInfo.setDdlx(OrderInfoEnum.ORDER_TYPE_0.getKey()); |
|
|
|
|
} else { |
|
|
|
|
if (OrderInfoEnum.ORDER_SOURCE_7.getKey().equals(sourceType)) { |
|
|
|
@ -4917,8 +4916,8 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
orderInfo.setBz(resultBz); |
|
|
|
|
//记录当前税控设备代码
|
|
|
|
|
orderInfo.setSksbCode(terminalCode); |
|
|
|
|
if(CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm()) |
|
|
|
|
&& StringUtils.isNotBlank(CommonUtils.getQdSksbdm(qdfwlx))){ |
|
|
|
|
if (CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm()) |
|
|
|
|
&& StringUtils.isNotBlank(CommonUtils.getQdSksbdm(qdfwlx))) { |
|
|
|
|
orderInfo.setSksbCode(CommonUtils.getQdSksbdm(qdfwlx)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4934,14 +4933,15 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建全电订单信息bean |
|
|
|
|
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a> |
|
|
|
|
* @date 2022-10-20 |
|
|
|
|
* |
|
|
|
|
* @param ddfpzxx 订单发票全数据返回协议bean |
|
|
|
|
* @return java.util.List<com.dxhy.order.model.qd.OrderInfoQd> |
|
|
|
|
* @author <a href="yaoxuguang@ele-cloud.com">yaoxuguang</a> |
|
|
|
|
* @date 2022-10-20 |
|
|
|
|
*/ |
|
|
|
|
private List<OrderInfoQd> buildOrderInfoQd(DdfpzxxBO ddfpzxx) { |
|
|
|
|
List<OrderInfoQd> orderInfoQdList = new ArrayList<>(5); |
|
|
|
|
if(Objects.nonNull(ddfpzxx.getQDTXXBO())){ |
|
|
|
|
if (Objects.nonNull(ddfpzxx.getQDTXXBO())) { |
|
|
|
|
OrderInfoQd orderInfoQd = BeanTransitionUtils.transitionOrderInfoQd(ddfpzxx.getQDTXXBO()); |
|
|
|
|
orderInfoQdList.add(orderInfoQd); |
|
|
|
|
} |
|
|
|
@ -5001,7 +5001,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
/** |
|
|
|
|
* 设置订单数据类型 |
|
|
|
|
*/ |
|
|
|
|
if(CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())){ |
|
|
|
|
if (CommonUtils.judgeIsQdfp("", orderInfo.getFpzlDm())) { |
|
|
|
|
orderProcessInfo.setDdly(OrderInfoEnum.ORDER_SOURCE_1.getKey()); |
|
|
|
|
} else { |
|
|
|
|
if (OrderInfoEnum.ORDER_TYPE_6.getKey().equals(orderInfo.getDdlx())) { |
|
|
|
@ -5026,7 +5026,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
orderProcessInfo.setId(orderInfo.getProcessId()); |
|
|
|
|
//订单表id
|
|
|
|
|
orderProcessInfo.setOrderInfoId(orderInfo.getId()); |
|
|
|
|
if(StringUtils.isNotBlank(orderInfo.getSksbCode())){ |
|
|
|
|
if (StringUtils.isNotBlank(orderInfo.getSksbCode())) { |
|
|
|
|
orderProcessInfo.setSksbCode(orderInfo.getSksbCode()); |
|
|
|
|
} |
|
|
|
|
insertProcessInfo.add(orderProcessInfo); |
|
|
|
@ -5073,7 +5073,7 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
orderInvoiceInfo.setId(apiInvoiceCommonService.getGenerateShotKey()); |
|
|
|
|
//发票来源和订单来源共用
|
|
|
|
|
orderInvoiceInfo.setFply(orderProcessInfo.getDdly()); |
|
|
|
|
if(StringUtils.isNotBlank(orderInfo.getSksbCode())){ |
|
|
|
|
if (StringUtils.isNotBlank(orderInfo.getSksbCode())) { |
|
|
|
|
orderInvoiceInfo.setSksbdm(orderInfo.getSksbCode()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5109,19 +5109,19 @@ public class InterfaceServiceImplV3 implements InterfaceServiceV3 { |
|
|
|
|
specialInvoiceReversalEntity.setSqdh(hzsqdtxx.getSQBSCQQLSH()); |
|
|
|
|
|
|
|
|
|
//如果是旧版方格,赋值申请单号
|
|
|
|
|
if(CommonUtils.judgeIsFgTerminalOld(terminalCode, baseServiceConfig.getFgSkKpShList(), |
|
|
|
|
hzsqdscReq.getHZSQDSCPC().getNSRSBH())){ |
|
|
|
|
if (CommonUtils.judgeIsFgTerminalOld(terminalCode, baseServiceConfig.getFgSkKpShList(), |
|
|
|
|
hzsqdscReq.getHZSQDSCPC().getNSRSBH())) { |
|
|
|
|
//为了防止并发生成相同的申请单号加分布式锁,锁的过期时间为1秒
|
|
|
|
|
String hzxxbscSqdhRedisLock = String.format(RedisConstant.REDIS_ORDER_LOCK__FG_HZXXBSC_SQDH_KEY, kpjh); |
|
|
|
|
String redisValue = hzsqdscReq.getHZSQDSCPC().getNSRSBH() + "," + kpjh; |
|
|
|
|
if(redisService.setNx(hzxxbscSqdhRedisLock, redisValue, 1)){ |
|
|
|
|
if (redisService.setNx(hzxxbscSqdhRedisLock, redisValue, 1)) { |
|
|
|
|
//方格重新生成申请单号,税号对应的12位机器编号 + 12位时间
|
|
|
|
|
String sqdh = kpjh + DateUtil.format(new Date(), ConfigureConstant.DATE_FORMAT_DATE_YMDHMS).substring(2); |
|
|
|
|
specialInvoiceReversalEntity.setSqdh(sqdh); |
|
|
|
|
Thread.sleep(1000); |
|
|
|
|
redisService.del(redisValue); |
|
|
|
|
} else { |
|
|
|
|
synchronized (this){ |
|
|
|
|
synchronized (this) { |
|
|
|
|
Thread.sleep(1000); |
|
|
|
|
//方格重新生成申请单号,税号对应的12位机器编号 + 12位时间
|
|
|
|
|
String sqdh = kpjh + DateUtil.format(new Date(), ConfigureConstant.DATE_FORMAT_DATE_YMDHMS).substring(2); |
|
|
|
|