From 9c6c71d12737632f6782b71027aa3932b4b3e441 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 9 Oct 2023 18:31:48 +0800 Subject: [PATCH] =?UTF-8?q?ariesy=20=E4=BF=AE=E6=94=B9controller=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=B0=83=E7=94=A8dao=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/erp/controller/ElectronController.java | 9 ++------- .../dxhy/erp/controller/ReimbursementController.java | 4 +--- .../java/com/dxhy/erp/service/ElectronService.java | 12 ++++++++++++ .../dxhy/erp/service/TDxInvoiceReimburseService.java | 2 ++ .../service/impl/TDxInvoiceReimburseServiceImpl.java | 5 +++++ .../extend/controller/VouncherSyncController.java | 5 ++--- .../dxhy/extend/service/bb/VouncherSyncService.java | 6 ++++++ .../service/bb/impl/VouncherSyncServiceImpl.java | 12 ++++++++++++ 8 files changed, 42 insertions(+), 13 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/ElectronController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/ElectronController.java index b3662e28..972eeeab 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/ElectronController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/ElectronController.java @@ -44,11 +44,6 @@ public class ElectronController { @Value("${pro.yl.gfTaxNo}") private String yLgfTaxNo; - @Resource - private InvoiceImgDao imgDao; - - @Resource - private SysDeptDao sysDeptDao; @Resource private FileService fileService; @@ -126,12 +121,12 @@ public class ElectronController { InvoiceImgQueryVo img; String downLondFile = ""; try { - SysDeptEntity deptEntity = sysDeptDao.getOrg(yLgfTaxNo); + SysDeptEntity deptEntity = electronService.getOrg(yLgfTaxNo); String dbName = null; if (deptEntity != null && deptEntity.getDbName() != null) { dbName = deptEntity.getDbName(); } - img = this.imgDao.getImg(scanId); + img = electronService.getImg(scanId); if (null != img) { String[] fileAccount = null; diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/ReimbursementController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/ReimbursementController.java index 1bd85d5e..5d3ac0b1 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/ReimbursementController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/ReimbursementController.java @@ -32,8 +32,6 @@ import java.util.List; @Slf4j public class ReimbursementController { - @Resource - SysDeptDao sysDeptDao; @Resource TDxInvoiceReimburseService tDxInvoiceReimburseService; @@ -48,7 +46,7 @@ public class ReimbursementController { if (StringUtils.isNotBlank(msg)){ return ResponseEntity.ok(R.error(msg)); }*/ - SysDeptEntity deptEntity = sysDeptDao.getOrgType(reimburseReq.getGfTaxNo()); + SysDeptEntity deptEntity = tDxInvoiceReimburseService.getOrgType(reimburseReq.getGfTaxNo()); if (deptEntity == null) { return ResponseEntity.ok(R.error("购方税号未配置")); } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/ElectronService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/ElectronService.java index 58b2c6e0..d8291e07 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/ElectronService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/ElectronService.java @@ -5,6 +5,9 @@ import java.util.*; import javax.annotation.Resource; +import com.dxhy.erp.dao.InvoiceImgDao; +import com.dxhy.erp.entity.InvoiceImgQueryVo; +import com.dxhy.erp.entity.SysDeptEntity; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -43,6 +46,8 @@ public class ElectronService { @Resource private SysDeptDao sysDeptDao; @Resource + private InvoiceImgDao imgDao; + @Resource private FileService fileService; public Map electronEvent(String content) { @@ -104,4 +109,11 @@ public class ElectronService { } return returnList; } + + public SysDeptEntity getOrg(String yLgfTaxNo) { + return sysDeptDao.getOrg(yLgfTaxNo); + } + public InvoiceImgQueryVo getImg(String scanId) { + return imgDao.getImg(scanId); + } } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/TDxInvoiceReimburseService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/TDxInvoiceReimburseService.java index f89d030d..37269aaa 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/TDxInvoiceReimburseService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/TDxInvoiceReimburseService.java @@ -21,4 +21,6 @@ public interface TDxInvoiceReimburseService extends IService map, HttpServletRequest request, HttpServletResponse response, Authorize authorize); + + SysDeptEntity getOrgType(String gfTaxNo); } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/TDxInvoiceReimburseServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/TDxInvoiceReimburseServiceImpl.java index a3077605..3e5eeda4 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/TDxInvoiceReimburseServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/TDxInvoiceReimburseServiceImpl.java @@ -322,6 +322,11 @@ public class TDxInvoiceReimburseServiceImpl extends ServiceImpl map){ //是否全量 X为全量推送,空为增量推送。 @@ -79,7 +78,7 @@ public class VouncherSyncController { // object.setZFILED2(""); // object.setZFILED3(""); // object.setZFILED4(""); - List gsClients = gsClientMapper.selectByGsdm(str); + List gsClients = vouncherSyncService.selectByGsdm(str); if(gsClients!=null && gsClients.size()>0){ object.setZFILED5(gsClients.get(0).getClient()); }else { diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/VouncherSyncService.java b/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/VouncherSyncService.java index c8e198bd..e1a1776b 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/VouncherSyncService.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/VouncherSyncService.java @@ -1,9 +1,15 @@ package com.dxhy.extend.service.bb; +import com.dxhy.extend.entity.GsClient; + +import java.util.List; + /** * @Author wangzhikun * @Date 2023/3/30 2023/3/30 */ public interface VouncherSyncService { String sendPo(String toJSONString); + + List selectByGsdm(String gsdm); } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/VouncherSyncServiceImpl.java b/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/VouncherSyncServiceImpl.java index 0741502c..952756fc 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/VouncherSyncServiceImpl.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/VouncherSyncServiceImpl.java @@ -1,11 +1,16 @@ package com.dxhy.extend.service.bb.impl; import cn.hutool.http.HttpRequest; +import com.dxhy.extend.dao.GsClientMapper; +import com.dxhy.extend.entity.GsClient; import com.dxhy.extend.service.bb.VouncherSyncService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * @Author wangzhikun * @Date 2023/3/30 2023/3/30 @@ -20,6 +25,8 @@ public class VouncherSyncServiceImpl implements VouncherSyncService { @Value("${po.password}") private String password; + @Resource + private GsClientMapper gsClientMapper; @Override public String sendPo(String request) { @@ -33,4 +40,9 @@ public class VouncherSyncServiceImpl implements VouncherSyncService { return body; } + + @Override + public List selectByGsdm(String gsdm) { + return gsClientMapper.selectByGsdm(gsdm); + } }