From 99d67227295f915585b87386b6f94b6674c8ff84 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 15 Apr 2023 10:25:22 +0800 Subject: [PATCH 01/10] =?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 --- .../mailGather/EmailMaintainController.java | 20 ++++++++ .../mailGather/MailGatherLogController.java | 29 ++++++++++++ .../core/dao/mailGather/EmailMaintainDao.java | 2 +- .../job/service/impl/ConfirmServiceImpl.java | 3 ++ .../model/mailGather/MailGatherLogVo.java | 13 ++++++ .../mailGather/EmailMaintainService.java | 2 + .../impl/EmailMaintainServiceImpl.java | 6 +++ .../impl/MailGatherLogServiceImpl.java | 7 +++ .../com/dxhy/core/task/SnEmailGatherTask.java | 4 +- .../dxhy/core/task/SnEmailGatherTaskTest.java | 13 ++++-- .../mapper/mailGather/EmailMaintainMapper.xml | 2 +- .../mapper/mailGather/MailGatherLogMapper.xml | 46 ++++++++----------- 12 files changed, 110 insertions(+), 37 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/EmailMaintainController.java b/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/EmailMaintainController.java index b2f4cf11..53dca740 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/EmailMaintainController.java +++ b/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/EmailMaintainController.java @@ -4,7 +4,9 @@ import cn.hutool.core.codec.Base64; import cn.hutool.core.util.ObjectUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; +import com.dxhy.common.constant.DbConstant; import com.dxhy.common.controller.AbstractController; +import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.util.UUIDUtils; import com.dxhy.common.utils.Base64Encoding; import com.dxhy.common.utils.R; @@ -91,6 +93,13 @@ public class EmailMaintainController extends AbstractController { } String loginname = getUserInfo().getLoginname(); emailMaintain.setCreateUser(loginname); + DynamicContextHolder.push(DbConstant.BASICS_READ); + EmailMaintainVo vo = new EmailMaintainVo(); + vo.setEmailAddress(emailMaintain.getEmailAddress()); + EmailMaintainVo maintainVo = emailMaintainService.getEmailMaintainVo(vo); + if(maintainVo != null){ + return ResponseEntity.ok(R.error("邮箱地址已存在!")); + } boolean insert = this.emailMaintainService.insert(emailMaintain); if(insert){ return ResponseEntity.ok(R.ok()); @@ -106,6 +115,16 @@ public class EmailMaintainController extends AbstractController { */ @PostMapping("/edit") public ResponseEntity edit(@RequestBody EmailMaintainVo emailMaintain) { + if(StringUtils.isBlank(emailMaintain.getEmailPassword())){ + return ResponseEntity.ok(R.error("邮箱地址不能为空!")); + } + DynamicContextHolder.push(DbConstant.BASICS_READ); + EmailMaintainVo vo = new EmailMaintainVo(); + vo.setEmailAddress(emailMaintain.getEmailAddress()); + EmailMaintainVo maintainVo = emailMaintainService.getEmailMaintainVo(vo); + if(maintainVo != null && maintainVo.getId().equals(emailMaintain.getId())){ + return ResponseEntity.ok(R.error("邮箱地址已存在!")); + } boolean b = emailMaintainService.update(emailMaintain); if(b){ return ResponseEntity.ok(R.ok()); @@ -142,6 +161,7 @@ public class EmailMaintainController extends AbstractController { errorMsgList.add("第" + resultIndex + "行,用户编码不能为空"); continue; } + DynamicContextHolder.push(DbConstant.BASICS_READ); String userName = emailMaintainService.getUserName(userId); if(StringUtils.isBlank(userName)){ errorMsgList.add("第" + resultIndex + "行,用户编码在系统中查询不到,请核实!"); diff --git a/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/MailGatherLogController.java b/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/MailGatherLogController.java index 6815c9d5..448522f5 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/MailGatherLogController.java +++ b/dxhy-core/src/main/java/com/dxhy/core/controller/mailGather/MailGatherLogController.java @@ -1,8 +1,12 @@ package com.dxhy.core.controller.mailGather; +import com.dxhy.common.constant.DbConstant; import com.dxhy.common.controller.AbstractController; +import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.utils.R; import com.dxhy.core.service.mailGather.MailGatherLogService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -10,6 +14,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.Map; /** @@ -18,6 +25,7 @@ import java.util.Map; * @author makejava * @since 2023-03-23 08:42:35 */ +@Slf4j @RestController @RequestMapping("/mailGatherLog") public class MailGatherLogController extends AbstractController { @@ -26,6 +34,7 @@ public class MailGatherLogController extends AbstractController { */ @Resource private MailGatherLogService mailGatherLogService; + final SimpleDateFormat sf2 = new SimpleDateFormat("yyyy-MM-dd"); /** * 分页查询 @@ -46,6 +55,26 @@ public class MailGatherLogController extends AbstractController { if (pramsMap.get("parseEnd") == null || "".equals(pramsMap.get("parseEnd"))) { return ResponseEntity.ok(R.error("结束日期不能为空!")); } + Object parseStart = pramsMap.get("parseStart"); + Object parseEnd = pramsMap.get("parseEnd"); + if (parseEnd == null || parseEnd == null) { + + } else { + try { + Date starttime = sf2.parse(String.valueOf(parseStart)); + Date endtime = sf2.parse(String.valueOf(parseEnd)); + if (starttime.after(endtime)) { + return ResponseEntity.ok(R.error("开始时间不能大于结束时间")); + } + pramsMap.put("startTime", starttime); + pramsMap.put("endTime", endtime); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + String loginname = getUserInfo().getLoginname(); + pramsMap.put("createUser",loginname); + DynamicContextHolder.push(DbConstant.BASICS_READ); return ResponseEntity.ok(R.ok().put("data",this.mailGatherLogService.queryByPage(pramsMap))); } diff --git a/dxhy-core/src/main/java/com/dxhy/core/dao/mailGather/EmailMaintainDao.java b/dxhy-core/src/main/java/com/dxhy/core/dao/mailGather/EmailMaintainDao.java index 4cad42c4..67042ce5 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/dao/mailGather/EmailMaintainDao.java +++ b/dxhy-core/src/main/java/com/dxhy/core/dao/mailGather/EmailMaintainDao.java @@ -35,7 +35,7 @@ public interface EmailMaintainDao extends BaseMapper { * @param emailMaintainVo 查询条件 * @return 总行数 */ - long count(EmailMaintainVo emailMaintainVo); + EmailMaintainVo getEmailMaintainVo(EmailMaintainVo emailMaintainVo); /** * 新增数据 diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java index d7983001..8c0c8b3a 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/ConfirmServiceImpl.java @@ -102,6 +102,9 @@ public class ConfirmServiceImpl extends ServiceImpl impl if (list != null && list.size() > 0) { for (TAcOrg tAcOrg : list) { + + DynamicContextHolder.push(DbConstant.BASICS_READ); + BasisSysDeptCfg baseSysDeptCfg = basisSysDeptCfgDao.selectOne(new QueryWrapper().eq("nsrsbh", tAcOrg.getTaxno())); if (baseSysDeptCfg != null) { continue; diff --git a/dxhy-core/src/main/java/com/dxhy/core/model/mailGather/MailGatherLogVo.java b/dxhy-core/src/main/java/com/dxhy/core/model/mailGather/MailGatherLogVo.java index 2e665fa2..5e8a9a96 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/model/mailGather/MailGatherLogVo.java +++ b/dxhy-core/src/main/java/com/dxhy/core/model/mailGather/MailGatherLogVo.java @@ -26,4 +26,17 @@ public class MailGatherLogVo extends CommonDTO { private String fileName; private Date createTime; + + public String deptId; + + private String companyCode; + + public String deptName; + + public String username; + + public String userId; + + public String createUser; + } diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/EmailMaintainService.java b/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/EmailMaintainService.java index 99328e74..d855e687 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/EmailMaintainService.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/EmailMaintainService.java @@ -51,4 +51,6 @@ public interface EmailMaintainService { String getUserName(String userCode); int insertBatch(List entities); + + EmailMaintainVo getEmailMaintainVo(EmailMaintainVo emailMaintain); } diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java index 892b849f..338a5daa 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java @@ -70,6 +70,7 @@ public class EmailMaintainServiceImpl implements EmailMaintainService { */ @Override public boolean insert(EmailMaintainVo emailMaintain) { + DynamicContextHolder.push(DbConstant.BASICS_READ); if(StringUtils.isEmpty(emailMaintain.getId())){ emailMaintain.setId(IdUtil.nanoId()); } @@ -116,6 +117,11 @@ public class EmailMaintainServiceImpl implements EmailMaintainService { return emailMaintainDao.insertBatch(entities); } + @Override + public EmailMaintainVo getEmailMaintainVo(EmailMaintainVo emailMaintain) { + return emailMaintainDao.getEmailMaintainVo(emailMaintain); + } + //根据用户名进行查询 public void getdeptInfo(String deptId){ DynamicContextHolder.push(DbConstant.BASICS_READ); diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/MailGatherLogServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/MailGatherLogServiceImpl.java index 83ebd997..12e63f4f 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/MailGatherLogServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/MailGatherLogServiceImpl.java @@ -5,16 +5,19 @@ import cn.hutool.core.codec.Base64; import com.alibaba.fastjson.JSONObject; import com.dxhy.common.constant.DbConstant; import com.dxhy.common.datasource.config.DynamicContextHolder; +import com.dxhy.common.util.UUIDUtils; import com.dxhy.core.dao.mailGather.MailGatherLogDao; import com.dxhy.core.model.mailGather.MailGatherLogVo; import com.dxhy.core.service.mailGather.MailGatherLogService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; @@ -70,6 +73,10 @@ public class MailGatherLogServiceImpl implements MailGatherLogService { */ @Override public MailGatherLogVo insert(MailGatherLogVo mailGatherLog) { + if(StringUtils.isEmpty(mailGatherLog.getId())){ + mailGatherLog.setId(UUIDUtils.generateShortUuid()); + } + mailGatherLog.setCreateTime(new Date()); this.mailGatherLogDao.insert(mailGatherLog); return mailGatherLog; } diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java index 0e009d08..a166c837 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import com.dxhy.common.constant.DbConstant; import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.util.MD5; +import com.dxhy.common.util.UUIDUtils; import com.dxhy.core.job.entity.ScheduleJobEntity; import com.dxhy.core.job.service.ScheduleJobService; import com.dxhy.core.model.mailGather.EmailMaintainVo; @@ -98,10 +99,9 @@ public class SnEmailGatherTask { Store store = mailAuth(emailName, password); if(store == null){ MailGatherLogVo gatherLogVo = new MailGatherLogVo(); - gatherLogVo.setId(IdUtil.nanoId()); + gatherLogVo.setId(UUIDUtils.generateShortUuid()); gatherLogVo.setErrorMsg("邮箱认证失败"); gatherLogVo.setOcrType("1"); - gatherLogVo.setCreateTime(new Date()); gatherLogVo.setFromAddress(emailName); mailGatherLogService.insert(gatherLogVo); return; diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java index f18287d5..20c937e1 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java @@ -37,8 +37,10 @@ class SnEmailGatherTaskTest { String port = "110"; //邮件接收服务器地址 String mail_host = "mail.pop3.host"; - String emailName = "15201210373@163.com"; - String password = "JKZATQTPHDDQTQSH"; + String emailName = "1149953701@qq.com"; + String password = "pmdzleyabmlzgdhc"; +// String emailName = "15201210373@163.com"; +// String password = "JKZATQTPHDDQTQSH"; String mailSuffix = emailName.split("@")[1]; //邮箱类型 String mailType = mailSuffix.split("\\.")[0]; @@ -61,7 +63,7 @@ class SnEmailGatherTaskTest { //连接邮箱服务器 //获取当前时间 Date currentTime = new Date(); - // 获得收件箱 pop3协议只有一个有效的文件夹就是INBOX + // 品 ping获得收件箱 pop3协议只有一个有效的文件夹就是INBOX Folder folder = store.getFolder("INBOX"); //获取邮件列表 folder.open(Folder.READ_WRITE); @@ -113,6 +115,7 @@ class SnEmailGatherTaskTest { Map resultMap = JSONObject.parseObject(body, Map.class); Object status = resultMap.get("status"); + System.out.println(JSONObject.toJSONString("================="+resultMap)); if(status != null && "200".equals(String.valueOf(status))){ } @@ -165,7 +168,7 @@ class SnEmailGatherTaskTest { OpenServiceOcr openServiceOcr = openServiceOcrs.get(i); OpenServiceOcr.InvoiceOcrData invoiceOcrData = openServiceOcr.getData(); OcrResultToyxVo resultToyxVo = new OcrResultToyxVo(); - resultToyxVo.setCompanyId(""); + resultToyxVo.setCompanyId("c040"); resultToyxVo.setSource("01"); resultToyxVo.setInvoiceCode(invoiceOcrData.getFPDM()); resultToyxVo.setInvoiceNumber(invoiceOcrData.getFPHM()); @@ -176,7 +179,7 @@ class SnEmailGatherTaskTest { resultToyxVo.setFileType("102"); resultToyxVo.setFileByte(map.get("pdfStream")); resultToyxVo.setEmail(map.get("emailName")); - resultToyxVo.setEmployeeId(""); + resultToyxVo.setEmployeeId("01142085"); resultToyxVoList.add(resultToyxVo); } diff --git a/dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml b/dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml index d1ae63c0..9d3d1a52 100644 --- a/dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml +++ b/dxhy-core/src/main/resources/mapper/mailGather/EmailMaintainMapper.xml @@ -48,7 +48,7 @@ - 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 734cbac5..16ebd4b3 100644 --- a/dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml +++ b/dxhy-core/src/main/resources/mapper/mailGather/MailGatherLogMapper.xml @@ -28,42 +28,32 @@ From bb59ce275640569622bbc238e947dc42e78ddc0c Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 15 Apr 2023 10:31:07 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/dxhy/core/task/SnEmailGatherTask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java index a166c837..60113e14 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java @@ -151,9 +151,11 @@ public class SnEmailGatherTask { } gatherLogVo.setMsgUid(uid); boolean isContainerAttachment = EmailParseUtils.isContainAttachment(msg); + log.debug("是否有附件: "+isContainerAttachment); if(isContainerAttachment){ List> mapList = Lists.newArrayList(); EmailParseUtils.saveAttachment(msg, mapList); + log.debug("获取附件的数量:"+mapList.size()); for (Map map : mapList) { map.put("emailName",emailName); String pdfStream = map.get("pdfStream"); @@ -184,6 +186,8 @@ public class SnEmailGatherTask { throw new RuntimeException(e); } + }else { + log.debug("山能OCR识别失败------"); } } } From 7cb37f98586d81468a721abf21ddc3590f88b5fa Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 15 Apr 2023 10:49:33 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/core/task/SnEmailGatherTask.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java index 60113e14..7146b18d 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java @@ -127,17 +127,19 @@ public class SnEmailGatherTask { gatherLogVo.setId(IdUtil.nanoId()); gatherLogVo.setSubject(EmailParseUtils.getSubject(msg)); gatherLogVo.setFromAddress(emailName); - gatherLogVo.setReceiveAddress(EmailParseUtils.getReceiveAddress(msg, null)); - gatherLogVo.setSentDate( EmailParseUtils.getSentDate(msg, null)); +// String address = EmailParseUtils.getReceiveAddress(msg, null); + gatherLogVo.setReceiveAddress(emailName); + String sentDate = EmailParseUtils.getSentDate(msg, null); + gatherLogVo.setSentDate(sentDate); gatherLogVo.setCreateTime(new Date()); log.debug("主题: " + EmailParseUtils.getSubject(msg)); log.debug("发件人: " + EmailParseUtils.getFrom(msg)); - log.debug("收件人:" + EmailParseUtils.getReceiveAddress(msg, null)); - log.debug("发送时间:" + EmailParseUtils.getSentDate(msg, null)); +// log.debug("收件人:" + address); + log.debug("发送时间:" + sentDate); log.debug("是否已读:" + EmailParseUtils.isSeen(msg)); - log.debug("邮件优先级:" + EmailParseUtils.getPriority(msg)); - log.debug("是否需要回执:" + EmailParseUtils.isReplySign(msg)); +// log.debug("邮件优先级:" + EmailParseUtils.getPriority(msg)); +// log.debug("是否需要回执:" + EmailParseUtils.isReplySign(msg)); log.debug("邮件大小:" + msg.getSize() * 1024 + "kb"); POP3Folder inbox = (POP3Folder) folder; From 6dbbebe07fda8210e73c1f456bee9eff03647302 Mon Sep 17 00:00:00 2001 From: wangzhikun Date: Sat, 15 Apr 2023 10:53:51 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E9=83=A8=E5=88=86=E8=BD=AC=E5=87=BAbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ReceiptOutServiceImpl.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java index 56402633..fbcaf001 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java @@ -132,8 +132,8 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl 0) { throw new RRException("累计转出金额不能大于发票金额"); } + **/ // 转出金额 - condRecord.setOutInvoiceAmout(newOutAmount); + condRecord.setOutInvoiceAmout(record.getInvoiceAmount()); // 转出税额累加 BigDecimal oldOutTax = record.getOutTaxAmount() == null ? new BigDecimal(0) : record.getOutTaxAmount(); @@ -166,7 +169,7 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl 0) { - throw new RRException("累计转出金额不能大于发票金额"); - } // 转出金额 - record.setOutInvoiceAmout(newOutAmount); + record.setOutInvoiceAmout(invoice.getInvoiceAmount()); // 转出税额累加 BigDecimal oldOutTax = record.getOutTaxAmount() == null ? new BigDecimal(0) : record.getOutTaxAmount(); @@ -232,7 +226,7 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl Date: Sat, 15 Apr 2023 10:55:36 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/dxhy/core/task/SnEmailGatherTask.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java index 7146b18d..32aab53b 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java @@ -149,7 +149,8 @@ public class SnEmailGatherTask { } //增量处理 等于之后就跳过本地循环 if(StringUtils.isNotBlank(maintainVo.getEmailUid()) && maintainVo.getEmailUid().equals(uid)){ - return; + log.debug("跳过本次循环: "+maintainVo.getEmailUid()+"===="+uid); + continue; } gatherLogVo.setMsgUid(uid); boolean isContainerAttachment = EmailParseUtils.isContainAttachment(msg); From c6a9fc0a8f235554eb571884b6529375afa46388 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 15 Apr 2023 14:58:25 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=87=87=E9=9B=86-?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=A3=E6=9E=90=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/core/task/SnEmailGatherTaskTest.java | 11 ++++++----- .../main/java/com/dxhy/core/util/EmailParseUtils.java | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java index 20c937e1..3c5b6fdb 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTaskTest.java @@ -37,8 +37,8 @@ class SnEmailGatherTaskTest { String port = "110"; //邮件接收服务器地址 String mail_host = "mail.pop3.host"; - String emailName = "1149953701@qq.com"; - String password = "pmdzleyabmlzgdhc"; + String emailName = "745139984@qq.com"; + String password = "ncmydeiilzyabfgb"; // String emailName = "15201210373@163.com"; // String password = "JKZATQTPHDDQTQSH"; String mailSuffix = emailName.split("@")[1]; @@ -62,7 +62,7 @@ class SnEmailGatherTaskTest { store.connect(emailName, password); //连接邮箱服务器 //获取当前时间 - Date currentTime = new Date(); +// Date currentTime = new Date(); // 品 ping获得收件箱 pop3协议只有一个有效的文件夹就是INBOX Folder folder = store.getFolder("INBOX"); //获取邮件列表 @@ -87,13 +87,14 @@ class SnEmailGatherTaskTest { System.out.println("------------------解析第" + msg.getMessageNumber() + "封邮件-------------------- "); System.out.println("主题: " + EmailParseUtils.getSubject(msg)); System.out.println("发件人: " + EmailParseUtils.getFrom(msg)); - System.out.println("收件人:" + EmailParseUtils.getReceiveAddress(msg, null)); +// System.out.println("收件人:" + EmailParseUtils.getReceiveAddress(msg, null)); System.out.println("发送时间:" + EmailParseUtils.getSentDate(msg, null)); System.out.println("是否已读:" + EmailParseUtils.isSeen(msg)); System.out.println("邮件优先级:" + EmailParseUtils.getPriority(msg)); System.out.println("是否需要回执:" + EmailParseUtils.isReplySign(msg)); System.out.println("邮件大小:" + msg.getSize() * 1024 + "kb"); boolean isContainerAttachment = EmailParseUtils.isContainAttachment(msg); + System.out.println("是否有附件: "+isContainerAttachment); if(isContainerAttachment) { List> mapList = Lists.newArrayList(); EmailParseUtils.saveAttachment(msg, mapList); @@ -141,7 +142,7 @@ class SnEmailGatherTaskTest { System.out.println(""); } System.out.println(""); - Date endTime = new Date(); +// Date endTime = new Date(); //计算耗时时间 // double elapsedTime = CalendarUtil.arithDateTime(endTime, currentTime); // 释放资源 diff --git a/dxhy-core/src/main/java/com/dxhy/core/util/EmailParseUtils.java b/dxhy-core/src/main/java/com/dxhy/core/util/EmailParseUtils.java index 8ae7d7c2..b53732c8 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/util/EmailParseUtils.java +++ b/dxhy-core/src/main/java/com/dxhy/core/util/EmailParseUtils.java @@ -267,19 +267,20 @@ public class EmailParseUtils { //某一个邮件体也有可能是由多个邮件体组成的复杂体 String disp = bodyPart.getDisposition(); if (disp != null && (disp.equalsIgnoreCase(Part.ATTACHMENT) || disp.equalsIgnoreCase(Part.INLINE))) { - if ((StringUtils.isNotBlank(contentType)) && - (contentType.toUpperCase().contains("PDF") || contentType.toUpperCase().contains("OFD"))){ + if ((StringUtils.isNotBlank(contentType)) && (contentType.toUpperCase().contains("PDF") || contentType.toUpperCase().contains("OFD"))){ InputStream is = bodyPart.getInputStream(); byte[] pdfStream = IOUtils.toByteArray(is); - mapLog.put("contentType", contentType.toUpperCase().contains("PDF")?"PDF":"OFD"); + String pdf = contentType.toUpperCase().contains("PDF") ? "PDF" : "OFD"; + mapLog.put("contentType", pdf); if(pdfStream != null){ mapLog.put("pdfStream", Base64Encoding.encodeToString(pdfStream)); mapList.add(mapLog); } - }else if (StringUtils.isNotBlank(fileName) && "application/octet-stream".equals(contentType) && (fileName.endsWith("pdf") || fileName.endsWith("ofd"))){ + }else if (StringUtils.isNotBlank(fileName) && (fileName.toUpperCase().contains("PDF") || fileName.toUpperCase().contains("OFD"))){ InputStream is = bodyPart.getInputStream(); byte[] pdfStream = IOUtils.toByteArray(is); - mapLog.put("contentType", contentType.toUpperCase().contains("PDF")?"PDF":"OFD"); + String pdf = fileName.toUpperCase().contains("PDF") ? "PDF" : "OFD"; + mapLog.put("contentType", pdf); if(pdfStream != null){ mapLog.put("pdfStream", Base64Encoding.encodeToString(pdfStream)); mapList.add(mapLog); From 6e7df467bdae2f2961ee77c9b45469b9fc0403c8 Mon Sep 17 00:00:00 2001 From: "zhenghaiyang@ele-cloud.com" Date: Sat, 15 Apr 2023 15:51:48 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=87=87=E9=9B=86-?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BC=A0=E5=88=B0=E7=A5=A8=E5=A4=B9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OpenServicePlatformServiceImpl.java | 2 - .../model/ocr/SnpjInvoiceTypeEnum.java | 78 +++++++++++++++++++ .../com/dxhy/core/task/SnEmailGatherTask.java | 5 +- 3 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 dxhy-core/src/main/java/com/dxhy/core/service/openservice/model/ocr/SnpjInvoiceTypeEnum.java diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java index 8fe4a8f7..1710424c 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/impl/OpenServicePlatformServiceImpl.java @@ -205,7 +205,6 @@ public class OpenServicePlatformServiceImpl implements IOpenServicePlatformServi */ public List OcrToSn(String picture){ //判断是否为图片流文件, 兼容公司平台进行base64解密 - String str = Base64Decoder.decodeStr(picture); String requestUrl = snOcrUrl; String result = FileUtil.uploadFile(requestUrl, Base64Decoder.decode(picture)); if(StringUtils.isBlank(result)){ @@ -227,7 +226,6 @@ public class OpenServicePlatformServiceImpl implements IOpenServicePlatformServi */ public static List OcrToSnTest(String picture){ //判断是否为图片流文件, 兼容公司平台进行base64解密 - String str = Base64Decoder.decodeStr(picture); String requestUrl = "http://192.168.33.102:30006/cci_ai/service/v1/receipt_crop_and_recog?crop_complete_image=1"; String result = FileUtil.uploadFile(requestUrl, Base64Decoder.decode(picture)); if(StringUtils.isBlank(result)){ diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/openservice/model/ocr/SnpjInvoiceTypeEnum.java b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/model/ocr/SnpjInvoiceTypeEnum.java new file mode 100644 index 00000000..0dc78f77 --- /dev/null +++ b/dxhy-core/src/main/java/com/dxhy/core/service/openservice/model/ocr/SnpjInvoiceTypeEnum.java @@ -0,0 +1,78 @@ +package com.dxhy.core.service.openservice.model.ocr; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum SnpjInvoiceTypeEnum { + + TAX_SPECIAL_INVOICE("01","100", "增值税专用发票"), + TAX_INVOICE("04","101", "增值税普通发票" ), + ELECTRONIC_INVOICE("10","102","增值税电子普通发票"), + ROLL_TICKET("11","103","增值税普通发票(卷票)"), + MOTOR_VEHICLE_SALE("15","104","机动车销售统一发票"), + USED_CAR_SALES("15","105","二手车销售统一发票"), + QUOTA_INVOICE("95","106","定额发票"), + AIRCRAFT_INVOICE("97","107","机打发票"), + TAXI_TICKETS("91","108","出租车发票"), + RAILWAY_TICKET("92","109","火车票"), + PASSENGER_TICKET("94","110","客运汽车票"), + FLIGHT_ITINERARY("93","111","航空运输电子客票行程单"), + STEAMER_TICKET("00","112","船票"), + TOLL_ROADS("98","113","过路费"), + RECEIPT("96","115","小票"), + DIDI_ITINERARY("86","116","滴滴出行行程单"), + DUTY_PAID_PROOF("87","117","完税证明"), + ELECTRONIC_INVOICE_ITINERARY("14","118","增值税电子普通发票(通行费)"), +// ELECTRONIC_INVOICE_QUKUAILIAN("119","区块链发票", ""), +// PLACE_AIRCRAFT_INVOICE("120","浙江通用机打发票", ""), + ELECTRONIC_OFD_INVOICE("04","121","增值税电子专用发票"), + ELECTRONIC_TAX_SPECIAL_INVOICE("31","130","电子发票(增值税专用发票)"), + ELECTRONIC_TAX_INVOICE("32","131","电子发票(普通发票)"), +// FINAL_STATEMENT("200","结算单", ""), +// RECEIPT_OF_RECEIPT("201","验收单", ""), + IMAGE_OTHERS("00","444","其他"); + + private String key; + + private String value; + + private String msg; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public static String getVal(String key) { + for (SnpjInvoiceTypeEnum typeEnum : SnpjInvoiceTypeEnum.values()) { + if (typeEnum.key.equals(key)) { + return typeEnum.getValue(); + } + } + return null; + } + + public static void main(String[] args) { + String val = getVal("00"); + System.out.println(val); + } +} diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java index 32aab53b..622f3e94 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SnEmailGatherTask.java @@ -19,6 +19,7 @@ import com.dxhy.core.service.mailGather.EmailMaintainService; import com.dxhy.core.service.mailGather.MailGatherLogService; import com.dxhy.core.service.openservice.IOpenServicePlatformService; import com.dxhy.core.service.openservice.impl.OpenServicePlatformServiceImpl; +import com.dxhy.core.service.openservice.model.ocr.SnpjInvoiceTypeEnum; import com.dxhy.core.util.EmailParseUtils; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -163,7 +164,7 @@ public class SnEmailGatherTask { map.put("emailName",emailName); String pdfStream = map.get("pdfStream"); if(StringUtils.isNotBlank(pdfStream)){ - List openServiceOcrs = OpenServicePlatformServiceImpl.OcrToSnTest(pdfStream); + List openServiceOcrs = openServicePlatformService.ocrInvoice(pdfStream); if(openServiceOcrs != null && !openServiceOcrs.isEmpty()){ Map ocrResult = convertToOcrResult(openServiceOcrs, map, maintainVo); try { @@ -236,7 +237,7 @@ public class SnEmailGatherTask { resultToyxVo.setBuyerName(invoiceOcrData.getGMFMC()); resultToyxVo.setSellerName(invoiceOcrData.getXHFMC()); resultToyxVo.setFileName(map.get("fileName")); - resultToyxVo.setFileType("102"); + resultToyxVo.setFileType(SnpjInvoiceTypeEnum.getVal(openServiceOcr.getFPLXDM())); resultToyxVo.setFileByte(map.get("pdfStream")); resultToyxVo.setEmail(map.get("emailName")); resultToyxVo.setEmployeeId(maintainVo.getUserId()); From 2470bf7ef5f367fae7a95a4ed92c30cd4dfffd45 Mon Sep 17 00:00:00 2001 From: wangzhikun Date: Sat, 15 Apr 2023 17:32:17 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=8B=89=E5=8F=96=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ExtInvoicePoolController.java | 20 ++++++ .../dxhy/extend/dao/ExtInvoicePoolDao.java | 6 +- .../dxhy/extend/entity/PullRecordModel.java | 68 +++++++++++++++++++ .../com/dxhy/extend/entity/PullRecordReq.java | 32 +++++++++ .../service/pool/ExtInvoicePoolService.java | 3 + .../pool/ExtInvoicePoolServiceImpl.java | 31 ++++++++- .../resources/mapper/ExtInvoicePoolMapper.xml | 44 ++++++++++++ 7 files changed, 198 insertions(+), 6 deletions(-) create mode 100644 dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordModel.java create mode 100644 dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java b/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java index 87af02cd..9445ebf8 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java @@ -7,6 +7,9 @@ import java.util.Objects; import javax.annotation.Resource; +import com.dxhy.auth.client.annotation.IgnoreClientToken; +import com.dxhy.auth.client.annotation.IgnoreUserToken; +import com.dxhy.extend.entity.PullRecordReq; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -233,4 +236,21 @@ public class ExtInvoicePoolController extends AbstractController { return ResponseEntity.ok(R.error(CommonConstants.MSG_ERR_DEFAULT)); } } + /** + * 拉取记录列表获取 + */ + @IgnoreClientToken + @IgnoreUserToken + @RequestMapping("getPullRecordList") + public ResponseEntity getPullRecordList(@RequestBody PullRecordReq pullRecordReq){ + try{ + return ResponseEntity.ok(R.ok().put("data",extInvoicePoolService.selectPullRecord(pullRecordReq))); + }catch (Exception e){ + e.printStackTrace(); + log.error("",e); + return ResponseEntity.ok(R.error(CommonConstants.MSG_ERR_DEFAULT)); + + } + + } } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/dao/ExtInvoicePoolDao.java b/dxhy-extend/src/main/java/com/dxhy/extend/dao/ExtInvoicePoolDao.java index 7edda046..b98e92cc 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/dao/ExtInvoicePoolDao.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/dao/ExtInvoicePoolDao.java @@ -3,12 +3,10 @@ package com.dxhy.extend.dao; import java.util.List; import java.util.Map; +import com.dxhy.extend.entity.*; import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.dxhy.extend.entity.AmortizeRecordEntity; -import com.dxhy.extend.entity.ExtAddTaxInvoice; -import com.dxhy.extend.entity.ExtOtherInvoice; /** * @author dxhy @@ -80,4 +78,6 @@ public interface ExtInvoicePoolDao extends BaseMapper { List listAmortizeRecord(Map pramsMap); List listIncentiveFlag(); + + List getPullRecord(PullRecordReq pullRecordReq); } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordModel.java b/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordModel.java new file mode 100644 index 00000000..45664035 --- /dev/null +++ b/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordModel.java @@ -0,0 +1,68 @@ +package com.dxhy.extend.entity; + +import lombok.Data; + +/** + * @Author wangzhikun + * @Date 2023/4/15 2023/4/15 + */ +@Data +public class PullRecordModel { + + //公司名称 + private String companyName; + //会计凭证号码 + private String belnr; + //会计年度 + private String gjahr; + //账期 + private String monat; + //过账日期 + private String budat; + //报账单号 + private String zbzdh; + + //结算单 + private String zjsdh; + //报账单状态 + private String zbzdzt; + //借贷标识 + private String zdrcrk; + //科目编码 + private String racct; + //科目描述 + private String txt50; + //供应商名称 + private String zname; + //供应商编码 + private String lifnr; + //客户编码 + private String kunnr; + //客户名称 + private String zname2; + //物料编码 + private String matnr; + //数量 + private String msl; + //单位 + private String runit; + //税码 + private String mwskz; + //税率 + private String kbetr; + //本位币借方金额 + private String zhslj; + //本位币贷方金额 + private String zhsld; + //销售订单 + private String kdauf; + //销售订单行 + private String kdpos; + //矿别编号 + private String kbbh; + //矿别 + private String ktype; + //最后接收时间 + private String lastReceiveTime; + +} diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java b/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java new file mode 100644 index 00000000..75ffa921 --- /dev/null +++ b/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java @@ -0,0 +1,32 @@ +package com.dxhy.extend.entity; + +import lombok.Data; + +/** + * @Author wangzhikun + * @Date 2023/4/14 2023/4/14 + */ +@Data +public class PullRecordReq { + //公司名称 + private String companyName; + //账期 + private String accountPeriod; + //税码 + private String sm; + //科目编码 + private String kmbm; + //科目描述 + private String kmms; + //供应商名称 + private String supplierName; + //客户名称 + private String customerName; + //过账起始日期 + private String accountStartDate; + //过账终止日期 + private String accountEndDate; + + private int curr; + private int size; +} diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolService.java b/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolService.java index aa3cc9b2..8365106e 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolService.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolService.java @@ -4,6 +4,7 @@ import java.util.Map; import com.dxhy.common.service.MpBaseService; import com.dxhy.extend.entity.ExtAddTaxInvoice; +import com.dxhy.extend.entity.PullRecordReq; /** * @author dxhy @@ -59,4 +60,6 @@ public interface ExtInvoicePoolService extends MpBaseService { Object amortizeRecord(Map pramsMap); Object incentiveFlagList(String dbName); + + Object selectPullRecord(PullRecordReq pullRecordReq); } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java b/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java index eea4ec67..31e0cbbc 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java @@ -3,6 +3,7 @@ package com.dxhy.extend.service.pool; import java.util.List; import java.util.Map; +import com.dxhy.extend.entity.*; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -14,9 +15,6 @@ import com.dxhy.common.service.impl.MpBaseServiceImpl; import com.dxhy.common.util.AmountFormatUtil; import com.dxhy.common.util.MathUtil; import com.dxhy.extend.dao.ExtInvoicePoolDao; -import com.dxhy.extend.entity.AmortizeRecordEntity; -import com.dxhy.extend.entity.ExtAddTaxInvoice; -import com.dxhy.extend.entity.ExtOtherInvoice; import com.dxhy.extend.util.InvoiceTypeUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -406,6 +404,32 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl recordList=super.baseMapper.getPullRecord(pullRecordReq); + PageInfo pageInfo = new PageInfo<>(recordList); + json.put("total",pageInfo.getTotal()); + json.put("dataList",pageInfo.getList()); + + }catch (Exception e){ + e.printStackTrace(); + json = super.errorResult(e); + } + return super.responseResult(json); + } /** * 摊销记录 @@ -452,4 +476,5 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl + +