From 871e7d471a1998b6cbbd361fea0e0122f91cdc98 Mon Sep 17 00:00:00 2001 From: kane Date: Wed, 7 Jun 2023 09:01:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BA=A4=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/mapper/CompanyServiceMapper.java | 17 ------ .../impl/InvoiceDeliveryServiceImpl.java | 56 +++++++++---------- .../platform/mapper/CompanyServiceMapper.xml | 16 ------ 3 files changed, 25 insertions(+), 64 deletions(-) delete mode 100644 jianshui-platform/src/main/java/com/jianshui/platform/mapper/CompanyServiceMapper.java delete mode 100644 jianshui-platform/src/main/resources/com/jianshui/platform/mapper/CompanyServiceMapper.xml diff --git a/jianshui-platform/src/main/java/com/jianshui/platform/mapper/CompanyServiceMapper.java b/jianshui-platform/src/main/java/com/jianshui/platform/mapper/CompanyServiceMapper.java deleted file mode 100644 index f438b25..0000000 --- a/jianshui-platform/src/main/java/com/jianshui/platform/mapper/CompanyServiceMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.jianshui.platform.mapper; - -import com.jianshui.common.core.domain.entity.Companyservice; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - * @Author: xingze - * @Description: 企业信息持久层 - * @CreateTime: 2023-06-06 12:05 - * @Version: 1.0 - **/ -@Mapper -public interface CompanyServiceMapper { - - Companyservice findByCompanyId(@Param("companyId") Long companyId); -} diff --git a/jianshui-platform/src/main/java/com/jianshui/platform/service/impl/InvoiceDeliveryServiceImpl.java b/jianshui-platform/src/main/java/com/jianshui/platform/service/impl/InvoiceDeliveryServiceImpl.java index e82590d..d655a30 100644 --- a/jianshui-platform/src/main/java/com/jianshui/platform/service/impl/InvoiceDeliveryServiceImpl.java +++ b/jianshui-platform/src/main/java/com/jianshui/platform/service/impl/InvoiceDeliveryServiceImpl.java @@ -19,11 +19,11 @@ import com.jianshui.invoice.domain.dto.HXResponse; import com.jianshui.platform.domain.InvoiceDelivery; import com.jianshui.platform.dto.InvoiceDeliveryDTO; import com.jianshui.platform.dto.InvoiceDeliveryJsonDataDTO; -import com.jianshui.platform.mapper.CompanyServiceMapper; import com.jianshui.platform.mapper.InvoiceDeliveryMapper; import com.jianshui.platform.service.InvoiceDeliveryService; import com.jianshui.system.domain.InvoiceAllApiLog; import com.jianshui.system.domain.InvoiceAllYhdj; +import com.jianshui.system.mapper.CompanyserviceMapper; import com.jianshui.system.mapper.InvoiceAllApiLogMapper; import com.jianshui.system.mapper.InvoiceAllYhdjMapper; import com.jianshui.system.mapper.SysUserMapper; @@ -47,7 +47,7 @@ public class InvoiceDeliveryServiceImpl implements InvoiceDeliveryService { @Autowired private SysUserMapper sysUserMapper; @Autowired - private CompanyServiceMapper companyServiceMapper; + private CompanyserviceMapper companyServiceMapper; @Autowired private InvoiceAllYhdjMapper yhdjMapper; @Autowired @@ -72,7 +72,7 @@ public class InvoiceDeliveryServiceImpl implements InvoiceDeliveryService { //根据用户id获取用户信息 SysUser sysUser = sysUserMapper.selectUserById(userId); //根据企业id获取企业信息 - Companyservice companyservice = companyServiceMapper.findByCompanyId(sysUser.getCompanyId()); + Companyservice companyservice = companyServiceMapper.selectCompanyserviceByCompanyid(sysUser.getCompanyId()); //获取登记用户信息 InvoiceAllYhdj userInfo = getUserInfo(companyservice); if (BeanUtil.isEmpty(userInfo)) { @@ -86,10 +86,10 @@ public class InvoiceDeliveryServiceImpl implements InvoiceDeliveryService { invoiceDeliveryDTO.setNsrsbh(userInfo.getNsrsbh()); //校验 ValidateUtils.validate(invoiceDeliveryDTO); - ValidateUtils.validate(dtos); InvoiceDelivery invoiceDelivery = new InvoiceDelivery(); for (InvoiceDeliveryJsonDataDTO dto : dtos) { invoiceDeliveryDTO.setJsonData(dto); + ValidateUtils.validate(invoiceDeliveryDTO); //发送请求获取结果 JSONObject result = null; try { @@ -99,40 +99,34 @@ public class InvoiceDeliveryServiceImpl implements InvoiceDeliveryService { String code = result.get("code") != null ? result.get("code").toString() : ""; String msg = result.get("msg") != null ? result.get("msg").toString() : ""; String data = result.get("data") != null ? result.get("data").toString() : ""; + //封装调用日志 + InvoiceAllApiLog allApiLog = new InvoiceAllApiLog(); + allApiLog.setUrl(WebServiceConstant.INVOIVEDELIVERY); + allApiLog.setSendMsg(invoiceDeliveryDTO.toString()); + allApiLog.setResultMsg(JSONUtil.toJsonStr(result)); + allApiLog.setCompany(companyservice.getSellertax()); + allApiLog.setIdentityId(companyservice.getIdentity()); + allApiLog.setCreateTime(new Date()); + //封装实体类 + BeanUtils.copyProperties(invoiceDeliveryDTO, invoiceDelivery); + invoiceDelivery.setJflx(dto.getJflx()); + invoiceDelivery.setFphm(dto.getFphm()); + invoiceDelivery.setGmflxdh(dto.getGmflxdh()); + invoiceDelivery.setGmfyx(dto.getGmfyx()); + invoiceDelivery.setType("1"); + invoiceDelivery.setClerk(sysUser.getUserId()); + invoiceDelivery.setCreateTime(new Date()); if ("0000".equals(code) && StrUtil.isNotEmpty(data)) { //存入调用日志表 - InvoiceAllApiLog allApiLog = new InvoiceAllApiLog(); - allApiLog.setUrl(WebServiceConstant.INVOIVEDELIVERY); - allApiLog.setSendMsg(invoiceDeliveryDTO.toString()); - allApiLog.setResultMsg(JSONUtil.toJsonStr(result)); - allApiLog.setCompany(companyservice.getSellertax()); - allApiLog.setIdentityId(companyservice.getIdentity()); - allApiLog.setCreateTime(new Date()); allApiLogMapper.insertInvoiceAllApiLog(allApiLog); - //封装实体类 - BeanUtils.copyProperties(invoiceDeliveryDTO, invoiceDelivery); - invoiceDelivery.setJflx(dto.getJflx()); - invoiceDelivery.setFphm(dto.getFphm()); - invoiceDelivery.setGmflxdh(dto.getGmflxdh()); - invoiceDelivery.setGmfyx(dto.getGmfyx()); - invoiceDelivery.setStatus("0"); - invoiceDelivery.setType("1"); - invoiceDelivery.setClerk(sysUser.getUserId()); - invoiceDelivery.setCreateTime(new Date()); //将数据存入业务表 + invoiceDelivery.setStatus("0"); invoiceDeliveryMapper.insertInvoiceDelivery(invoiceDelivery); } else { - //封装实体类 - BeanUtils.copyProperties(invoiceDeliveryDTO, invoiceDelivery); - invoiceDelivery.setJflx(dto.getJflx()); - invoiceDelivery.setFphm(dto.getFphm()); - invoiceDelivery.setGmflxdh(dto.getGmflxdh()); - invoiceDelivery.setGmfyx(dto.getGmfyx()); - invoiceDelivery.setStatus("1"); - invoiceDelivery.setType("1"); - invoiceDelivery.setClerk(sysUser.getUserId()); - invoiceDelivery.setCreateTime(new Date()); + //存入日志调用表 + allApiLogMapper.insertInvoiceAllApiLog(allApiLog); //将数据存入业务表 + invoiceDelivery.setStatus("1"); invoiceDeliveryMapper.insertInvoiceDelivery(invoiceDelivery); return new HXResponse(msg); } diff --git a/jianshui-platform/src/main/resources/com/jianshui/platform/mapper/CompanyServiceMapper.xml b/jianshui-platform/src/main/resources/com/jianshui/platform/mapper/CompanyServiceMapper.xml deleted file mode 100644 index 3169b2e..0000000 --- a/jianshui-platform/src/main/resources/com/jianshui/platform/mapper/CompanyServiceMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file