From 9fa2e8b833d7a989ba81310e55cae750b0fae5f6 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Fri, 14 Apr 2023 23:26:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 1 - .../BaseRzTDxRecordInvoiceController.java | 1 - .../BaseInvoiceManualCheckServiceImpl.java | 11 ++++- .../receipt/BaseReceiptOutServiceImpl.java | 7 ++- .../resources/mapper/BaseSggxcxMapper.xml | 28 +---------- .../com/dxhy/common/util/ExcelPoiUtil.java | 2 + .../dxhy/core/controller/ExcelController.java | 6 ++- .../mailGather/EmailMaintainController.java | 21 -------- .../mailGather/MailGatherLogController.java | 29 ----------- .../core/dao/mailGather/EmailMaintainDao.java | 4 +- .../job/service/impl/ConfirmServiceImpl.java | 3 -- .../model/mailGather/MailGatherLogVo.java | 13 ----- .../InvoiceDetailServiceImpl.java | 2 +- .../mailGather/EmailMaintainService.java | 2 - .../impl/EmailMaintainServiceImpl.java | 7 +-- .../impl/MailGatherLogServiceImpl.java | 7 --- .../com/dxhy/core/task/SnEmailGatherTask.java | 7 +-- .../dxhy/core/task/SnEmailGatherTaskTest.java | 14 +++--- .../dxhy/core/thread/CustomExportThread.java | 3 ++ .../com/dxhy/core/util/InvoiceQueryUtil.java | 2 +- .../mapper/mailGather/EmailMaintainMapper.xml | 2 +- .../mapper/mailGather/MailGatherLogMapper.xml | 48 +++++++++++-------- .../erp/controller/InterfaceController.java | 18 +++---- .../controller/SDNYMainProcessController.java | 42 +++++++++++++--- .../com/dxhy/erp/dao/TdxRecordInvoiceDao.java | 2 - .../dxhy/erp/entity/sdny/SAPInvoiceInfo.java | 6 +-- .../service/BaseIReceiptInvoiceService.java | 4 +- .../impl/BaseIReceiptInvoiceServiceImpl.java | 6 +-- .../resources/mapper/TdxRecordInvoiceDao.xml | 13 ++--- .../companypool/TicketServiceImpl.java | 4 +- .../src/main/resources/bootstrap.yml | 1 + .../fpqs/impl/SignFpqsServiceImpl.java | 1 - 32 files changed, 128 insertions(+), 189 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java index e80b0e81..6af5b05d 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java +++ b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java @@ -632,7 +632,6 @@ public class BaseInvoiceController extends AbstractController { return ResponseEntity.ok(R.error("签收状态不能为空!")); } String qsflag = getUserInfo().getQsStatus(); - log.info("签收开关qsflag:{}",qsflag); if ("1".equals(qsflag)) { pramsMap.put("qszt", "1"); } diff --git a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseRzTDxRecordInvoiceController.java b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseRzTDxRecordInvoiceController.java index a95d93f5..4574ac2a 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseRzTDxRecordInvoiceController.java +++ b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseRzTDxRecordInvoiceController.java @@ -467,7 +467,6 @@ public class BaseRzTDxRecordInvoiceController extends AbstractController { pramsMap.put("gfsh", gfshList); String qsflag = getUserInfo().getQsStatus(); pramsMap.put("qsflag", qsflag); - log.info("签收认证状态为:{}",qsflag); if (!StringHelper.isBlank(datalist)) { pramsMap.put("datalist", datalist); diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java index 324d8afd..cb015514 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java @@ -125,6 +125,8 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl pageList = super.baseMapper.selectSggxcx(pramsMap); PageInfo pageInfo = new PageInfo<>(pageList); + log.info("查询的发票list为:{}",pageList); + // 转化为页面展示对象 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (pageList.size() > 0) { @@ -159,9 +161,13 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl query = new QueryWrapper<>(); query.eq("reason_code", record.getOutReason()); BaseTDxOutReason reason = baseTDxOutReasonDao.selectOne(query); - if (reason != null) - vo.setReason(reason.getOutReason()); + vo.setReason(reason.getOutReason()); // 认证日期 string类型的长日期转为string类型的短日期 String certDate = record.getCertDate(); Date date = new Date(); diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index 1afb3819..a0d93896 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -171,18 +171,6 @@ order by t.invoice_date desc - - and t.sn_voucher_number = #{snVoucherNumber} - - - and t.postingTime = #{postingTime} - - - and t.image_id = #{imageId} - - - and t.account_period = #{accountPeriod} - - select count(1) from email_maintain diff --git a/dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml b/dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml index 1c9614e9..734cbac5 100644 --- a/dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml +++ b/dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml @@ -7,7 +7,7 @@ - + @@ -28,32 +28,42 @@ diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java index 8f3e5dfa..672c43ea 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java @@ -19,13 +19,10 @@ import com.dxhy.common.utils.GzipUtils; import com.dxhy.common.utils.TripleDesUtil; import com.dxhy.common.vo.UserInfo; import com.dxhy.erp.dao.SysDeptDao; -import com.dxhy.erp.entity.BaseInvoiceEditVO; -import com.dxhy.erp.entity.SysDeptEntity; -import com.dxhy.erp.entity.TDxInvoiceReimburse; +import com.dxhy.erp.entity.*; import com.dxhy.erp.entity.V5.CheckResult; import com.dxhy.erp.entity.V5.DxhyInterfaceRequest; import com.dxhy.erp.entity.V5.DxhyInterfaceResponse; -import com.dxhy.erp.entity.VoucherRecord; import com.dxhy.erp.model.*; import com.dxhy.erp.model.auth.InterfaceCode; import com.dxhy.erp.service.*; @@ -106,8 +103,6 @@ public class InterfaceController extends AbstractController { private IReceiptOutService iReceiptOutService; @Resource private VoucherRecordService voucherRecordService; - @Value("${erp.ipUrl}") - private String ipUrl; @Resource private BaseIReceiptInvoiceService baseIReceiptInvoiceService; @@ -153,7 +148,7 @@ public class InterfaceController extends AbstractController { /** * 鉴权 */ - result = authV5( version+"/"+interfaceName, request, dxhyInterfaceRequest,secretKey); + result = authV5(request, dxhyInterfaceRequest,secretKey); long end1 = System.currentTimeMillis(); log.debug("{}鉴权耗时{}毫秒", LOGGER_MSG, end1 - begin1); if (!ConfigurerInfo.SUCCSSCODE.equals(result.getCode())) { @@ -298,15 +293,14 @@ public class InterfaceController extends AbstractController { return result; } - private CheckResult authV5(String url,HttpServletRequest request, DxhyInterfaceRequest dxhyInterfaceRequest,String secretKey) { + private CheckResult authV5(HttpServletRequest request, DxhyInterfaceRequest dxhyInterfaceRequest,String secretKey) { CheckResult checkResult = new CheckResult(RespStatusEnum.AUTHFAIL); String reqUrl = request.getRequestURL().toString(); if (reqUrl.contains(ConfigureConstant.STRING_WH)) { reqUrl = reqUrl.substring(ConfigureConstant.INT_0, reqUrl.indexOf(ConfigureConstant.STRING_WH)); } - log.debug("{}请求路径:{}", LOGGER_MSG, reqUrl); //获取鉴权URL - String signUrl = ipUrl+url+"?"; + String signUrl = getAuthUrl(reqUrl, request.getMethod()); TreeMap sortMap = new TreeMap<>(); sortMap.put(ConfigurerInfo.SECRETID, dxhyInterfaceRequest.getSecretId()); sortMap.put(ConfigurerInfo.DATA_EXCHANGE_ID, dxhyInterfaceRequest.getDataExchangeId()); @@ -388,7 +382,7 @@ public class InterfaceController extends AbstractController { } return method + reqUrl + "?"; } - + private CheckResult checkInterfaceParamV5(String interfaceVersion, String interfaceName, String secretId, String dataExchangeId, String signature, String encryptCode, String zipCode, String content) { log.info("{},数据校验,请求的interfaceVersion:{},interfaceName:{},dataExchangeId:{},secretId:{},signature:{},encryptCode:{},zipCode:{},content:{}", LOGGER_MSG, interfaceVersion, interfaceName, dataExchangeId, secretId, signature, encryptCode, zipCode, content); @@ -713,7 +707,6 @@ public class InterfaceController extends AbstractController { case "INVOICE.SALSESPUSH": returnResult = invoicePoolService.salsePush(globalInfo, requestParam, request, response, authorize); break; - // 接口编码不存在 // 获取单张发票 case "INVOICE.SINGLEINVOICECHECK": @@ -724,6 +717,7 @@ public class InterfaceController extends AbstractController { returnResult = gatherService.syncInvoiceInfo(globalInfo, requestParam, request, response, authorize); break; + // 接口编码不存在 default: returnResult = authStatusService.getInterfaceCodeError(globalInfo); break; diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java index 3f93c65a..6c150a6a 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java @@ -25,6 +25,9 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; +import java.text.ParseException; +import java.text.ParsePosition; +import java.text.SimpleDateFormat; import java.util.*; /** @@ -327,9 +330,13 @@ public class SDNYMainProcessController extends AbstractController { private SAPInvoiceInfo convertToSapOnject(SNInvoice snInvoice, String imageId, String compCode) { + //转换时间格式 Date date = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss"); + String dateString = formatter.format(date); SAPInvoiceInfo info = new SAPInvoiceInfo(); + String snFplx = convertToSapType(snInvoice.getInvoiceType()); info.setZBAZT("0"); info.setZXFSH(snInvoice.getSalesTaxNo()); @@ -340,15 +347,17 @@ public class SDNYMainProcessController extends AbstractController { info.setZJKZM(snInvoice.getImportCertificateNo()); info.setZDJZH(snInvoice.getCertificateNo()); info.setZGFMC(snInvoice.getPurchaserName()); + info.setSORT(snInvoice.getSort()); if (snInvoice.getTotalAmount() != null && snInvoice.getTotalTax() != null) { BigDecimal total = new BigDecimal(snInvoice.getTotalAmount()); // BigDecimal tax = new BigDecimal(snInvoice.getTotalTax()); // BigDecimal subtract = total.subtract(tax); info.setZJK(total.toString()); + }else { + info.setZJK("0.00"); } info.setZSCSJ(date); - info.setZCYZT(snInvoice.getCheckStaus()); info.setZYSHW(snInvoice.getCargoInformation()); info.setZFPLX(snFplx); info.setZQYD(snInvoice.getTransportRoute()); @@ -359,6 +368,7 @@ public class SDNYMainProcessController extends AbstractController { info.setZSKPH(snInvoice.getMachineCode()); info.setZGFZH(snInvoice.getPurchaserBank()); info.setZBZ(snInvoice.getRemarks()); + System.out.println(info.getZGXR()); List invoiceLineList = snInvoice.getInvoiceLineList(); List sapInvoiceDetailList = new ArrayList<>(); if (invoiceLineList != null && invoiceLineList.size() > 0) { @@ -390,7 +400,7 @@ public class SDNYMainProcessController extends AbstractController { sapInvoiceDetail.setZDW(snInvoiceDetail.getUnit()); sapInvoiceDetail.setZGSJBM(snInvoiceDetail.getCommodityCode()); sapInvoiceDetail.setZSE(snInvoiceDetail.getTax()); - sapInvoiceDetail.setZSL(snInvoiceDetail.getQuantity()); + sapInvoiceDetail.setZSL(snInvoiceDetail.getTaxRate()); sapInvoiceDetail.setZSM(info.getZSM()); sapInvoiceDetail.setZGGXH(snInvoiceDetail.getSpecificationModel()); if (snInvoice.getInvoiceCode() != null) { @@ -419,8 +429,13 @@ public class SDNYMainProcessController extends AbstractController { info.setIMG_ID(imageId); info.setZCPH(snInvoice.getLicensePlate()); info.setZLSLBZ(snInvoice.getZeroTaxRateSign()); - info.setZCJSJ(date); + info.setFPYXBH(snInvoice.getFileId()); + //转换日期 + info.setZCJSJ(dateString); info.setZFPZT(snInvoice.getState()); + if (snInvoice.getState() == null) { + info.setZFPZT("0"); + } // info.setZESCSC(""); info.setZFDJM(snInvoice.getEngineNo()); info.setZGXR(""); @@ -441,7 +456,7 @@ public class SDNYMainProcessController extends AbstractController { info.setZXCRS(snInvoice.getPassengersLimited()); info.setZWSPZ(snInvoice.getPaymentVoucherNo()); info.setZCCDW(snInvoice.getTonnage()); - info.setZSWJG(snInvoice.getTaxAuthorityNo()); + info.setZSWJG(snInvoice.getTaxAuthorityName()); // info.setZYWDJ(""); info.setZXCCZ(snInvoice.getStationGetOff()); info.setZCCRZH(snInvoice.getIdcardNo()); @@ -455,10 +470,23 @@ public class SDNYMainProcessController extends AbstractController { info.setZJSHJ(snInvoice.getAmountTax()); info.setZCYRMC(snInvoice.getCarrierName()); info.setZJGDM(snInvoice.getAdministrativeDivisionNo()); - info.setZGXSJ(date); -// info.setZQM(""); - info.setZPJLY(snInvoice.getSource()); + //时间转换 + info.setZGXSJ(dateString); + info.setZPJZT(snInvoice.getState()); info.setZZWLX(snInvoice.getSeat()); + info.setZPJLY(snInvoice.getSource()); + if (snInvoice.getSource() == null) { + info.setZPJLY("1"); + } + info.setZCYZT(snInvoice.getCheckStaus()); + if (snInvoice.getCheckStaus()==null){ + info.setZCYZT("1"); + } + info.setZCJR("opentext"); + info.setZGXR("opentext"); + info.setZQM("opentext"); + String checkDate = snInvoice.getCheckDate().replace("-", "/"); + info.setZCYRQ(checkDate); if (snInvoice.getInvoiceCode() != null) { info.setZTID(snInvoice.getInvoiceCode() + snInvoice.getInvoiceNumber() + snFplx); } else { diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java index 729e712f..4f2ba4a7 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java @@ -3,7 +3,6 @@ package com.dxhy.erp.dao; import java.util.List; import java.util.Map; -import com.dxhy.erp.entity.BaseTDxRecordInvoice; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -186,5 +185,4 @@ public interface TdxRecordInvoiceDao extends BaseMapper { void saveInvoiceAccount(TdxInvoiceAccount invoice); void deleteByuuid(@Param("uuids") String[] uuids); - } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SAPInvoiceInfo.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SAPInvoiceInfo.java index e7d375fb..c48baa6e 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SAPInvoiceInfo.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SAPInvoiceInfo.java @@ -109,7 +109,7 @@ public class SAPInvoiceInfo { * 查验日期 */ @JSONField(name = "ZCYRQ") - private Date ZCYRQ; + private String ZCYRQ; /** * 查验状态 @@ -314,7 +314,7 @@ public class SAPInvoiceInfo { * 创建时间 */ @JSONField(name = "ZCJSJ") - private Date ZCJSJ; + private String ZCJSJ; /** * 发票状态 @@ -513,7 +513,7 @@ public class SAPInvoiceInfo { * 更新时间 */ @JSONField(name = "ZGXSJ") - private Date ZGXSJ; + private String ZGXSJ; /** * 全名 diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/BaseIReceiptInvoiceService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/BaseIReceiptInvoiceService.java index b040667f..7474df9e 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/BaseIReceiptInvoiceService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/BaseIReceiptInvoiceService.java @@ -1,8 +1,8 @@ package com.dxhy.erp.service; +import com.dxhy.erp.entity.BaseReceiptOutCancelEditReqVO; import com.dxhy.erp.entity.BaseTDxRecordInvoice; -import com.dxhy.erp.model.BaseReceiptOutCancelEditReqVO; import java.util.List; @@ -23,6 +23,7 @@ public interface BaseIReceiptInvoiceService { */ void updateBatch(List condEntity); + /** * 取消已转出进项税,请求确认 * @@ -32,5 +33,4 @@ public interface BaseIReceiptInvoiceService { */ String cancelOut(BaseReceiptOutCancelEditReqVO reqVO); - } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/BaseIReceiptInvoiceServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/BaseIReceiptInvoiceServiceImpl.java index 016e7597..676bb6ad 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/BaseIReceiptInvoiceServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/BaseIReceiptInvoiceServiceImpl.java @@ -11,9 +11,9 @@ import com.dxhy.common.enums.JxszcZtEnum; import com.dxhy.common.service.impl.MpBaseServiceImpl; import com.dxhy.erp.dao.BaseTDxRecordInvoiceDao; import com.dxhy.erp.dao.TdxRecordInvoiceDao; +import com.dxhy.erp.entity.BaseReceiptOutCancelEditReqVO; import com.dxhy.erp.entity.BaseTDxRecordInvoice; import com.dxhy.erp.entity.BaseTDxRecordInvoiceOut; -import com.dxhy.erp.model.BaseReceiptOutCancelEditReqVO; import com.dxhy.erp.service.BaseIReceiptInvoiceService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -33,8 +33,10 @@ import java.util.List; @SuppressWarnings("AlibabaUndefineMagicConstant") @Service("baseIReceiptInvoiceService") public class BaseIReceiptInvoiceServiceImpl extends MpBaseServiceImpl implements BaseIReceiptInvoiceService { + @Resource private TdxRecordInvoiceDao tdxRecordInvoiceDao; + @Override public List selectByUuids(String[] uuids) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -51,7 +53,6 @@ public class BaseIReceiptInvoiceServiceImpl extends MpBaseServiceImpl - - delete from t_dx_record_invoice_out where uuid in - - #{item} - - + + delete from t_dx_record_invoice_out where uuid in + + #{item} + + +