From 9a9276ec957b5ee6f07abc63eab913563bf81492 Mon Sep 17 00:00:00 2001 From: yefei Date: Sat, 7 Oct 2023 14:01:27 +0800 Subject: [PATCH 01/35] =?UTF-8?q?ariesy=20=E5=A2=9E=E5=8A=A0=E6=89=8B?= =?UTF-8?q?=E5=B7=A5=E8=AE=A4=E8=AF=81=E8=AE=A4=E8=AF=81=E7=8A=B6=E6=80=81?= =?UTF-8?q?&=E8=AE=A4=E8=AF=81=E6=9F=A5=E8=AF=A2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 4 ++++ .../main/resources/mapper/BaseFpZhMapper.xml | 10 ++++++++-- .../resources/mapper/BaseSggxcxMapper.xml | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 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 78acc49a..a04caafa 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 @@ -499,6 +499,7 @@ public class BaseInvoiceController extends AbstractController { String kpksrq = (String)map.get("kpksrq"); String kpjsrq = (String)map.get("kpjsrq"); String qszt = (String)map.get("qszt"); + String rzzt = (String)map.get("rzzt"); String qsfs = (String)map.get("qsfs"); String businessCode = (String)map.get("businessCode"); String invoiceNo = (String)map.get("invoiceNo"); @@ -594,6 +595,9 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("taxRate",taxRate); } + if (StringUtils.isNotBlank(rzzt) && !"99".equals(rzzt)){ + pramsMap.put("rzzt",rzzt); + } if (!StringUtils.isBlank(invoiceType)) { if (!"99".equals(invoiceType)) { diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index cb95acee..30e678fe 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -124,9 +124,12 @@ and t.image_id = #{imageId} - + and t.auth_status = #{rzclzt} + + and (t.auth_status = '2' or t.auth_status = '3' or t.auth_status = '4') + and t.bdk_status = #{rzlx} @@ -402,9 +405,12 @@ and t.rzh_yesorno = #{rzzt} - + and t.auth_status = #{rzclzt} + + and (t.auth_status = '2' or t.auth_status = '3' or t.auth_status = '4') + and t.bdk_status = #{rzlx} diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index a8ec9d0c..60045e48 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -129,6 +129,15 @@ and t.qs_status = #{qszt} + + and t.auth_status = #{rzzt} + + + and (t.auth_status = '2' or t.auth_status = '3') + + + and t.auth_status = '5' + and t.inaccount_status = #{inAccountStatus} @@ -442,6 +451,16 @@ and t.qs_status = #{qszt} + + and t.auth_status = #{rzzt} + + + and (t.auth_status = '2' or t.auth_status = '3') + + + and t.auth_status = '5' + + and t.suspend_status = '1' From 87ccf9689e96390311a486f29a7784520db12916 Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 10:21:01 +0800 Subject: [PATCH 02/35] =?UTF-8?q?ariesy=20=20=E9=87=87=E9=9B=86=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-core/pom.xml | 4 +++ .../com/dxhy/core/config/RedissionConfig.java | 33 +++++++++++++++++++ .../impl/InvoiceInterfaceServiceImpl.java | 24 ++++++++++++-- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java diff --git a/dxhy-core/pom.xml b/dxhy-core/pom.xml index 45cd4923..a4af582f 100644 --- a/dxhy-core/pom.xml +++ b/dxhy-core/pom.xml @@ -164,6 +164,10 @@ itext-asian 5.2.0 + + org.redisson + redisson-spring-boot-starter + com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config diff --git a/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java b/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java new file mode 100644 index 00000000..cbcea2b1 --- /dev/null +++ b/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java @@ -0,0 +1,33 @@ +package com.dxhy.core.config; + +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.redisson.config.Config; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class RedissionConfig { + + @Value("${spring.redis.host}") + private String host; + + @Value("${spring.redis.port}") + private String port; + + @Value("${spring.redis.password}") + private String redisPassword; + + @Bean + public RedissonClient getRedisson(){ + + Config config = new Config(); + //单机模式 依次设置redis地址和密码 + config.useSingleServer() + .setAddress("redis://" + host + ":" + port) + .setPassword(redisPassword); + return Redisson.create(config); + } +} + diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java index 841e44f5..45dfde96 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java @@ -14,7 +14,10 @@ import javax.crypto.spec.SecretKeySpec; import com.dxhy.core.job.thread.InvoiceParseHandle; import org.apache.commons.lang.StringUtils; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSON; @@ -72,6 +75,16 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { @Resource private Sender sender; + @Resource + private StringRedisTemplate stringRedisTemplate; + + @Resource + private RedissonClient redisson; + + private static final String REDIS_KEY = "redis_oa_01"; + + private static final int MAX_SIZE = 1000; + @Value("${jxjk.collectUrl}") private String collectUrl; @Value("${jxjk.invoiceGet}") @@ -651,10 +664,17 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { } else { invoiceSelectInfo.setAuthStatus("0"); } + + //加分布式锁 + String lockKey = invoiceSelectInfo.getUuid(); + + RLock lock = redisson.getLock(lockKey); + lock.lock(); + stringRedisTemplate.opsForValue().set(REDIS_KEY, String.valueOf(0)); + // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao - .findInvoiceByUUid(invoiceSelectInfo.getUuid()); + TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); if (entity != null) { boolean flag = false; if (StringUtils.isBlank(entity.getCheckCode()) From c3e63f6e17a99b769ae2e8950f7b4a4f6fab1c1c Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 10:30:33 +0800 Subject: [PATCH 03/35] =?UTF-8?q?ariesy=20=20=E9=87=87=E9=9B=86=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D-=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E5=B8=83=E5=BC=8F=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/InvoiceInterfaceServiceImpl.java | 232 +++++++++--------- 1 file changed, 118 insertions(+), 114 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java index 45dfde96..d54ef101 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java @@ -81,7 +81,7 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { @Resource private RedissonClient redisson; - private static final String REDIS_KEY = "redis_oa_01"; + private static final String REDIS_KEY = "collect_invoice_"; private static final int MAX_SIZE = 1000; @@ -657,6 +657,9 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { String company = tDxRecordInvoiceJobDao.findCompany(taxno); List logList = new ArrayList<>(); for (InvoiceSelectInfo invoiceSelectInfo : invoicesList) { + //加分布式锁 + String lockKey = REDIS_KEY + invoiceSelectInfo.getUuid(); + RLock lock = redisson.getLock(lockKey); invoiceSelectInfo.setUuid(invoiceSelectInfo.getInvoiceCode() + invoiceSelectInfo.getInvoiceNo()); if ("1".equals(invoiceSelectInfo.getLegalizeState())) { //认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败 @@ -664,126 +667,127 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { } else { invoiceSelectInfo.setAuthStatus("0"); } - - //加分布式锁 - String lockKey = invoiceSelectInfo.getUuid(); - - RLock lock = redisson.getLock(lockKey); - lock.lock(); - stringRedisTemplate.opsForValue().set(REDIS_KEY, String.valueOf(0)); - - // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 - DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); - if (entity != null) { - boolean flag = false; - if (StringUtils.isBlank(entity.getCheckCode()) - && StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) { - entity.setCheckCode(invoiceSelectInfo.getCheckCode()); - entity.setCheckDate(new Date()); - flag = true; - } - if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) { - entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus()); - entity.setStatusUpdateDate(new Date()); - flag = true; - } - if ("0".equals(entity.getRzhYesorno()) - && !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) { - if ("1".equals(invoiceSelectInfo.getRzlx())) { - entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState()); - entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); - entity.setRzlx(invoiceSelectInfo.getRzlx()); - entity.setRzhType(invoiceSelectInfo.getLegalizeType()); - entity.setSfygx("1"); - if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { - SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); - entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); - } - if ("1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setAuthStatus("4"); - } else { - entity.setAuthStatus("0"); - } - entity.setBdkStatus("1"); - } else if ("4".equals(invoiceSelectInfo.getRzlx())) { - entity.setRzhYesorno("2"); - entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); - entity.setRzlx(invoiceSelectInfo.getRzlx()); - entity.setRzhType(invoiceSelectInfo.getLegalizeType()); - entity.setSfygx("1"); - if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { - SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); - entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); + try { + lock.lock(); + stringRedisTemplate.opsForValue().set(lockKey, String.valueOf(0)); + + // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 + DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); + TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); + if (entity != null) { + boolean flag = false; + if (StringUtils.isBlank(entity.getCheckCode()) + && StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) { + entity.setCheckCode(invoiceSelectInfo.getCheckCode()); + entity.setCheckDate(new Date()); + flag = true; + } + if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) { + entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus()); + entity.setStatusUpdateDate(new Date()); + flag = true; + } + if ("0".equals(entity.getRzhYesorno()) + && !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) { + if ("1".equals(invoiceSelectInfo.getRzlx())) { + entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState()); + entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); + entity.setRzlx(invoiceSelectInfo.getRzlx()); + entity.setRzhType(invoiceSelectInfo.getLegalizeType()); + entity.setSfygx("1"); + if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { + SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); + entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); + } + if ("1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setAuthStatus("4"); + } else { + entity.setAuthStatus("0"); + } + entity.setBdkStatus("1"); + } else if ("4".equals(invoiceSelectInfo.getRzlx())) { + entity.setRzhYesorno("2"); + entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); + entity.setRzlx(invoiceSelectInfo.getRzlx()); + entity.setRzhType(invoiceSelectInfo.getLegalizeType()); + entity.setSfygx("1"); + if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { + SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); + entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); + } + if ("1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setAuthStatus("4"); + } else { + entity.setAuthStatus("0"); + } + entity.setBdkStatus("2"); } - if ("1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setAuthStatus("4"); - } else { - entity.setAuthStatus("0"); + flag = true; + + } else if (!"0".equals(entity.getRzhYesorno()) + && !"1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setRzhYesorno("0"); + entity.setRzhBelongDate(null); + entity.setRzlx("0"); + entity.setRzhType(null); + entity.setRzhDate(null); + entity.setAuthStatus("0"); + entity.setBdkStatus("0"); + entity.setSfygx("0"); + flag = true; + } + //TODO 这块业务不理解?? + if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) { + entity.setCollectStatus("1"); + entity.setCollectFrom("0"); + entity.setCollectDate(new Date()); + entity.setPoolStatus("1"); + entity.setInPoolReason("数据重复"); + flag = true; + } + if (flag) { + DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); + if (StringUtils.isBlank(entity.getInvoiceCode())) { + entity.setInvoiceCode(""); } - entity.setBdkStatus("2"); + tDxRecordInvoiceJobDao.updateInvoice(entity, taxno); } - flag = true; - - } else if (!"0".equals(entity.getRzhYesorno()) - && !"1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setRzhYesorno("0"); - entity.setRzhBelongDate(null); - entity.setRzlx("0"); - entity.setRzhType(null); - entity.setRzhDate(null); - entity.setAuthStatus("0"); - entity.setBdkStatus("0"); - entity.setSfygx("0"); - flag = true; - } - //TODO 这块业务不理解?? - if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) { - entity.setCollectStatus("1"); - entity.setCollectFrom("0"); - entity.setCollectDate(new Date()); - entity.setPoolStatus("1"); - entity.setInPoolReason("数据重复"); - flag = true; - } - if (flag) { - DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); - if (StringUtils.isBlank(entity.getInvoiceCode())) { - entity.setInvoiceCode(""); + // 艺龙推送数据 + if (yLcompany.equals(company)) { + DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); + InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao + .selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin); + if (selectSign != null && "1".equals(selectSign.getQsStatus())) { + String record = JSON.toJSONString(entity); + sender.sendToStatus(Base64.encode(record)); + } } - tDxRecordInvoiceJobDao.updateInvoice(entity, taxno); - } - // 艺龙推送数据 - if (yLcompany.equals(company)) { - DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao - .selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin); - if (selectSign != null && "1".equals(selectSign.getQsStatus())) { - String record = JSON.toJSONString(entity); - sender.sendToStatus(Base64.encode(record)); + } else { + if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) { + invoiceSelectInfo.setLegalizeDate(null); } + TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo); + record.setCompany(company); + record.setCollectStatus("1"); + record.setCollectFrom("0"); + record.setCollectDate(new Date()); + record.setPoolStatus("0"); + DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); + tDxRecordInvoiceJobDao.insert(record); } - } else { - if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) { - invoiceSelectInfo.setLegalizeDate(null); - } - TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo); - record.setCompany(company); - record.setCollectStatus("1"); - record.setCollectFrom("0"); - record.setCollectDate(new Date()); - record.setPoolStatus("0"); - DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); - tDxRecordInvoiceJobDao.insert(record); + InvoiceLog invoiceLog = new InvoiceLog(); + invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode()); + invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo()); + invoiceLog.setType("1"); + invoiceLog.setInputStatus("0"); + invoiceLog.setCreateDate(new Date()); + invoiceLog.setInputName("系统自动"); + logList.add(invoiceLog); + }catch (Exception e) { + e.printStackTrace(); + } finally { + lock.unlock(); } - InvoiceLog invoiceLog = new InvoiceLog(); - invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode()); - invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo()); - invoiceLog.setType("1"); - invoiceLog.setInputStatus("0"); - invoiceLog.setCreateDate(new Date()); - invoiceLog.setInputName("系统自动"); - logList.add(invoiceLog); } httpLog.setStatus("1"); httpLog.setTotal(total); From fc604ad5d711de687b55c7fb6099685a88bd06b2 Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 10:35:56 +0800 Subject: [PATCH 04/35] =?UTF-8?q?ariesy=20=20=E9=87=87=E9=9B=86=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D-=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E5=B8=83=E5=BC=8F=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java index d54ef101..69759873 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java @@ -786,6 +786,8 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { }catch (Exception e) { e.printStackTrace(); } finally { + //关锁 + stringRedisTemplate.opsForValue().set(lockKey, String.valueOf(1)); lock.unlock(); } } From cbf66c696068a0b3b2f13ed2adb1c800dc2bf414 Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 11:24:03 +0800 Subject: [PATCH 05/35] =?UTF-8?q?ariesy=20=E8=AE=A4=E8=AF=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=EF=BC=8C=E5=8E=9F=E5=9B=A0=EF=BC=9Asys=5Fuser=5Forg?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E8=A1=A8taxno=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java index c9ae4164..89b01e45 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java @@ -160,8 +160,9 @@ public class SysUserServiceImpl extends ServiceImpl i // 保存客户信息,更新企业税号 user.getUserOrgEntities().stream().forEach(userOrg -> { if(StringUtils.isEmpty(userOrg.getTaxno())){ - if(StringUtils.isNotEmpty(taxnos.get(userOrg.getDeptId()))) { - userOrg.setTaxno(taxnos.get(userOrg.getDeptId())); + String taxno = taxnos.get(String.valueOf(userOrg.getDeptId())); + if(StringUtils.isNotEmpty(taxno)){ + userOrg.setTaxno(taxno); } } }); From 39c64262d1faab8fd1d9a9a0a0c32289c48737c2 Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 11:27:53 +0800 Subject: [PATCH 06/35] =?UTF-8?q?ariesy=20=E8=AE=A4=E8=AF=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=EF=BC=8C=E5=8E=9F=E5=9B=A0=EF=BC=9Asys=5Fuser=5Forg?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E8=A1=A8taxno=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java index 89b01e45..f5d30607 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java @@ -161,6 +161,7 @@ public class SysUserServiceImpl extends ServiceImpl i user.getUserOrgEntities().stream().forEach(userOrg -> { if(StringUtils.isEmpty(userOrg.getTaxno())){ String taxno = taxnos.get(String.valueOf(userOrg.getDeptId())); + log.info("销项同步税号为:taxno={}",taxno); if(StringUtils.isNotEmpty(taxno)){ userOrg.setTaxno(taxno); } From 29b90688dc09bd6136d7e994fe48b74461af8379 Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 16:05:08 +0800 Subject: [PATCH 07/35] =?UTF-8?q?ariesy=20=E6=89=8B=E5=B7=A5=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=A2=9E=E5=8A=A0=E8=AE=A4=E8=AF=81=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java | 4 ++++ .../invoicecheck/BaseInvoiceManualCheckServiceImpl.java | 1 + dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java b/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java index 8b9ef21c..8a615309 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java +++ b/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java @@ -74,6 +74,10 @@ public class BaseSggxCxRespVO { * 签收方式 */ private String qsfs; + /** + * 认证状态 + */ + private String rzzt; /** * 签收人 */ 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 ba61d402..4377acb6 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 @@ -194,6 +194,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl + @@ -76,7 +77,7 @@ select t.invoice_type,t.dept_id,t.dept_name,t.comp_code,t.bzr ,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name, DATE_FORMAT(t.invoice_date,'%Y-%m-%d')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,DATE_FORMAT(t.qs_date,'%Y-%m-%d')qs_date - ,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period, + ,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.auth_status,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period, case date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date when true then 1 else 2 end authStatus,t.bzdh,t.suspend_status,t.suspend_date, From eee1264bb6dc20cbafe7071aff4f7f50da67d82d Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 8 Oct 2023 16:23:50 +0800 Subject: [PATCH 08/35] =?UTF-8?q?ariesy=20=E8=A7=A3=E5=86=B3=E7=AD=9B?= =?UTF-8?q?=E9=80=89admin=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 30e678fe..fb931d17 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -156,10 +156,11 @@ and t.qs_name = #{qsr} - and t.confirm_user in + and (t.confirm_user in #{item} + or t.confirm_user is null or t.confirm_user = '') @@ -434,10 +435,11 @@ and t.qs_name = #{qsr} - and t.confirm_user in + and (t.confirm_user in #{item} + or t.confirm_user is null or t.confirm_user = '') = #{paymentDateStart} ]]> From c3f73dc371c7bfe03e0759d47efe96225b05ce42 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 9 Oct 2023 11:02:22 +0800 Subject: [PATCH 09/35] =?UTF-8?q?ariesy=20=E6=B5=B7=E5=85=B3=E7=BC=B4?= =?UTF-8?q?=E6=AC=BE=E4=B9=A6=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2=20=20=20?= =?UTF-8?q?=20=20=20=20=20=E8=BD=AC=E5=86=85=E9=94=80=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=20=20=20=20=20=20=20=E8=BD=AC=E5=86=85?= =?UTF-8?q?=E9=94=80=E7=BC=B4=E6=AC=BE=E4=B9=A6=E6=9F=A5=E8=AF=A2=20=20=20?= =?UTF-8?q?=20=20=20=20=20=E5=8F=91=E7=A5=A8=E7=BB=BC=E5=90=88=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20=E8=AE=A4=E8=AF=81=E4=BA=BA=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E8=AE=BE=E7=BD=AE=E6=88=90admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomsCustomsJkszhcxServiceImpl.java | 5 +++++ .../count/impl/DomesticCustomsExportCountServiceImpl.java | 5 +++++ .../count/impl/DomesticInvoiceExportCountServiceImpl.java | 5 ++++- .../dxhy/extend/service/bb/impl/ExtFpzhcxServiceImpl.java | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java b/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java index 76a0b2d7..14efeb9d 100644 --- a/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java +++ b/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java @@ -148,6 +148,11 @@ public class CustomsCustomsJkszhcxServiceImpl extends MpBaseServiceImpl Date: Mon, 9 Oct 2023 13:44:57 +0800 Subject: [PATCH 10/35] =?UTF-8?q?ariesy=20=E7=BC=B4=E6=AC=BE=E4=B9=A6?= =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2=20=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=98=BE=E7=A4=BA=E6=88=90admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java b/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java index 14efeb9d..ec1f51b0 100644 --- a/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java +++ b/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java @@ -151,7 +151,7 @@ public class CustomsCustomsJkszhcxServiceImpl extends MpBaseServiceImpl Date: Mon, 9 Oct 2023 14:16:21 +0800 Subject: [PATCH 11/35] =?UTF-8?q?ariesy=20=E6=89=8B=E5=B7=A5=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=A2=9E=E5=8A=A0=E5=B7=B2=E7=A1=AE=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E5=B7=B2=E5=8F=91=E9=80=81=E7=A1=AE=E8=AE=A4=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=91=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index 7228d12e..bf987785 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -87,7 +87,7 @@ WHERE t.invoice_date between #{kpksrq} and #{kpjsrq} and t.invoice_type in('01','03','08','14','31','283','161','183','185') and t.rzh_yesorno = '0' - and t.auth_status in('0','5','6') + and t.auth_status in('0','2','3','5','6') and t.export_mark = '0' and t.inaccount_status = '1' and t.company = #{company} @@ -427,7 +427,7 @@ WHERE t.invoice_date between #{kpksrq} and #{kpjsrq} and t.invoice_type in('01','03','08','14','31','283','161','183','185') and t.rzh_yesorno = '0' - and t.auth_status in('0','5','6') + and t.auth_status in('0','2','3','5','6') and t.inaccount_status = '1' and t.export_mark = '0' and t.company = #{company} From 7fca390474592b00058df512aadd360f5c50040d Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 9 Oct 2023 16:12:16 +0800 Subject: [PATCH 12/35] =?UTF-8?q?ariesy=20=E6=89=8B=E5=B7=A5=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=A2=9E=E5=8A=A0=E6=89=80=E5=B1=9E=E6=9C=9F=EF=BC=8C?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=97=B6=E9=97=B4=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 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 a04caafa..008717b7 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 @@ -287,24 +287,22 @@ public class BaseInvoiceController extends AbstractController { } if (!StringHelper.isBlank(rzzt)) { // 已认证传 认证起止日期和税款所属期做判断 - if (!"99".equals(rzzt)) { - pramsMap.put("rzzt", rzzt); - if (!"0".equals(rzzt)) { - if (!StringHelper.isBlank(rzksrq)) { - rzksrq = DateUtils.getMorning(DateUtils.strToDate(rzksrq)); - pramsMap.put("rzksrq", rzksrq); - } else { - return ResponseEntity.ok(R.error("认证开始日期不能为空!")); - } - if (!StringHelper.isBlank(rzjsrq)) { - rzjsrq = DateUtils.getNight(DateUtils.strToDate(rzjsrq)); - pramsMap.put("rzjsrq", rzjsrq); - } else { - return ResponseEntity.ok(R.error("认证结束日期不能为空!")); - } - if (!StringHelper.isBlank(skssq)) { - pramsMap.put("skssq", skssq); - } + pramsMap.put("rzzt", rzzt); + if (!"0".equals(rzzt)) { + if (!StringHelper.isBlank(rzksrq)) { + rzksrq = DateUtils.getMorning(DateUtils.strToDate(rzksrq)); + pramsMap.put("rzksrq", rzksrq); + } else { + return ResponseEntity.ok(R.error("认证开始日期不能为空!")); + } + if (!StringHelper.isBlank(rzjsrq)) { + rzjsrq = DateUtils.getNight(DateUtils.strToDate(rzjsrq)); + pramsMap.put("rzjsrq", rzjsrq); + } else { + return ResponseEntity.ok(R.error("认证结束日期不能为空!")); + } + if (!StringHelper.isBlank(skssq)) { + pramsMap.put("skssq", skssq); } } } else { From 5d05621ea8e3dd3d54951651519cde0537afb263 Mon Sep 17 00:00:00 2001 From: yefei Date: Mon, 9 Oct 2023 16:32:19 +0800 Subject: [PATCH 13/35] =?UTF-8?q?ariesy=20=E6=89=8B=E5=B7=A5=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=A2=9E=E5=8A=A0=E6=89=80=E5=B1=9E=E6=9C=9F=EF=BC=8C?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=97=B6=E9=97=B4=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/base/controller/BaseInvoiceController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 008717b7..ca339aad 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 @@ -287,7 +287,9 @@ public class BaseInvoiceController extends AbstractController { } if (!StringHelper.isBlank(rzzt)) { // 已认证传 认证起止日期和税款所属期做判断 - pramsMap.put("rzzt", rzzt); + if(!"99".equals(rzzt)) { + pramsMap.put("rzzt", rzzt); + } if (!"0".equals(rzzt)) { if (!StringHelper.isBlank(rzksrq)) { rzksrq = DateUtils.getMorning(DateUtils.strToDate(rzksrq)); From 23c4db70c4a9e0985731259eaa3ecc28f169f876 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 09:58:19 +0800 Subject: [PATCH 14/35] =?UTF-8?q?ariesy=20=E5=A2=9E=E5=8A=A0=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E7=8A=B6=E6=80=81=E7=AD=9B=E9=80=89=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index fb931d17..04ad4ad5 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -77,7 +77,7 @@ and t.invoice_type in('01','03','08','14','31','283','161','183','185') and t.bdk_status in ('1','2') and t.export_mark = '0' - and t.auth_status in ('2','3','4') + and t.auth_status in ('2','3','4','5','6') and t.company = #{company} and t.gf_tax_no = #{gfsh} and t.comp_code = #{companyCode} @@ -358,7 +358,7 @@ and t.gf_tax_no = #{gfsh} and t.comp_code = #{companyCode} and t.invoice_type in('01','03','08','14','31','283','161','183','185') - and t.auth_status in ('2','3','4') + and t.auth_status in ('2','3','4','5','6') and t.bdk_status in ('1','2') and t.export_mark = '0' and t.company =#{company} From 98c8668ea2884271f4d62583f76a3c7e8a1c9a2f Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 10:14:41 +0800 Subject: [PATCH 15/35] =?UTF-8?q?ariesy=20=E5=A2=9E=E5=8A=A0=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E7=8A=B6=E6=80=81=E7=AD=9B=E9=80=89=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 04ad4ad5..2e21c8c6 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -77,7 +77,7 @@ and t.invoice_type in('01','03','08','14','31','283','161','183','185') and t.bdk_status in ('1','2') and t.export_mark = '0' - and t.auth_status in ('2','3','4','5','6') + and t.auth_status in ('0','2','3','4','5','6') and t.company = #{company} and t.gf_tax_no = #{gfsh} and t.comp_code = #{companyCode} @@ -128,7 +128,7 @@ and t.auth_status = #{rzclzt} - and (t.auth_status = '2' or t.auth_status = '3' or t.auth_status = '4') + and (t.auth_status = '2' or t.auth_status = '3') and t.bdk_status = #{rzlx} @@ -358,7 +358,7 @@ and t.gf_tax_no = #{gfsh} and t.comp_code = #{companyCode} and t.invoice_type in('01','03','08','14','31','283','161','183','185') - and t.auth_status in ('2','3','4','5','6') + and t.auth_status in ('0','2','3','4','5','6') and t.bdk_status in ('1','2') and t.export_mark = '0' and t.company =#{company} @@ -410,7 +410,7 @@ and t.auth_status = #{rzclzt} - and (t.auth_status = '2' or t.auth_status = '3' or t.auth_status = '4') + and (t.auth_status = '2' or t.auth_status = '3') and t.bdk_status = #{rzlx} From 6e2afbec06701eb40498b19f8efa75c8474fd663 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 10:30:07 +0800 Subject: [PATCH 16/35] =?UTF-8?q?ariesy=20=E8=B4=AD=E6=96=B9=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E4=B8=BA=E7=A9=BA=E9=87=8D=E6=96=B0=E6=9F=A5=E9=AA=8C?= =?UTF-8?q?&=E6=9C=BA=E5=8A=A8=E8=BD=A6=E4=BB=B7=E7=A8=8E=E5=90=88?= =?UTF-8?q?=E8=AE=A1=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) 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 9eafc439..36a260a9 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 @@ -263,6 +263,41 @@ public class SDNYMainProcessController extends AbstractController { if (checkInvoiceByUuid != null) { log.info("进项票池已存在发票.直接返回票池信息"); R data = new R(1000, "default success"); + + //如果购方名称为空,则查验之后补充购销方相关信息 + String gfName = checkInvoiceByUuid.getGfName(); + String gfAddressAndPhone = checkInvoiceByUuid.getGfAddressAndPhone(); + if(StringUtils.isEmpty(gfName) || StringUtils.isEmpty(gfAddressAndPhone)){ + log.info("购方名称为空,查验补充信息"); + checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap, null); + + if (!checkInvoiceResult.containsKey("code")) { + if (!checkInvoiceResult.containsKey("cyjg")) { + //先删除原有主数据,再查验更新主数据和明细数据 + int delete = baseTDxRecordInvoiceDao.delete(recordWrapper); + if (delete > 0) { + checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); + signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); + } + } else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { + data = errorInfo(checkInvoiceResult, data); + + try { + DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); + requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0, JSONObject.toJSONString(data), + (String) checkInvoiceResult.get("cyjgxx")); + } catch (Exception e) { + log.error("发票查验接口记录保存失败,errormsg:{}", e); + } + + return ResponseEntity.ok(JSONObject.toJSONString(data)); + + } + } + + checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper); + } + String invoiceNo = checkInvoiceByUuid.getInvoiceNo(); QueryWrapper detailWrapper = new QueryWrapper<>(); detailWrapper.eq("uuid", uuid); @@ -807,7 +842,7 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("taxAuthorityNo", vehicleList.getString("taxBureauCode")); checkInvoice.put("taxAuthorityName", vehicleList.getString("taxBureauName")); checkInvoice.put("idcardNo", vehicleList.getString("buyerIdNum")); - checkInvoice.put("amountTax", vehicleList.getString("carPrice")); +// checkInvoice.put("amountTax", vehicleList.getString("carPrice")); } //二手车 if ("15".equals(invoiceType)) { From 2f2ff3b4e7c296999d122cff3e6c7a78cb055061 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 11:31:45 +0800 Subject: [PATCH 17/35] =?UTF-8?q?ariesy=20=E4=B8=80=E9=94=AE=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=85=A5=E8=B4=A6=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index a8ec9d0c..1652c681 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -1255,6 +1255,7 @@ and t.rzh_yesorno = '0' and t.invoice_status in ('0','7') and t.auth_status in('0','5','6') + and t.inaccount_status = '1' and t.export_mark = '0' and t.invoice_amount>0 and t.tax_amount>=0 From 1422fd23fc5710f0f44afa29a2035c28e8c3c991 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 14:52:28 +0800 Subject: [PATCH 18/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomsCustomsJkszhcxServiceImpl.java | 2 +- .../count/impl/DomesticCustomsExportCountServiceImpl.java | 2 +- .../count/impl/DomesticInvoiceExportCountServiceImpl.java | 2 +- .../dxhy/extend/service/bb/impl/ExtFpzhcxServiceImpl.java | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java b/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java index ec1f51b0..e9aba68e 100644 --- a/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java +++ b/dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java @@ -150,7 +150,7 @@ public class CustomsCustomsJkszhcxServiceImpl extends MpBaseServiceImpl Date: Tue, 10 Oct 2023 15:34:39 +0800 Subject: [PATCH 19/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/BaseFpZhMapper.xml | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 2e21c8c6..33696feb 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -156,11 +156,14 @@ and t.qs_name = #{qsr} - and (t.confirm_user in - - #{item} - - or t.confirm_user is null or t.confirm_user = '') + + + and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') + + + and t.confirm_user like CONCAT(#{rzhr},'%') + + @@ -435,11 +438,14 @@ and t.qs_name = #{qsr} - and (t.confirm_user in - - #{item} - - or t.confirm_user is null or t.confirm_user = '') + + + and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') + + + and t.confirm_user like CONCAT(#{rzhr},'%') + + = #{paymentDateStart} ]]> From 469f60f873326b7598e16f903e0ed0c7652f4918 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 16:10:41 +0800 Subject: [PATCH 20/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/BaseFpZhMapper.xml | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 33696feb..57ef2f1e 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -155,15 +155,11 @@ and t.qs_name = #{qsr} - - - - and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') - - - and t.confirm_user like CONCAT(#{rzhr},'%') - - + + and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') + + + and t.confirm_user like CONCAT(#{rzhr},'%') @@ -437,15 +433,11 @@ and t.qs_name = #{qsr} - - - - and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') - - - and t.confirm_user like CONCAT(#{rzhr},'%') - - + + and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') + + + and t.confirm_user like CONCAT(#{rzhr},'%') = #{paymentDateStart} ]]> From 526c73ff61d60dd720e61644b6ef40186d95b8e6 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 16:27:50 +0800 Subject: [PATCH 21/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/base/controller/BaseInvoiceController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ca339aad..181a44b8 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 @@ -190,7 +190,12 @@ public class BaseInvoiceController extends AbstractController { String[] split = rzhr.split(","); if (!Arrays.asList(split).contains("")) { String[] split1 = rzhr.split(","); - pramsMap.put("rzhr", Arrays.asList(split1)); + if(split1.length == 1){ + pramsMap.put("rzhr", rzhr); + }else{ + pramsMap.put("rzhr", Arrays.asList(split1)); + } + } } From 6d646e3d63708c39aa9f099a43b640d4ba71b23c Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 16:32:56 +0800 Subject: [PATCH 22/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 424 +++++++++--------- .../main/resources/mapper/BaseFpZhMapper.xml | 22 +- 2 files changed, 223 insertions(+), 223 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 181a44b8..3fb07ab0 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 @@ -51,7 +51,6 @@ import java.util.stream.Collectors; public class BaseInvoiceController extends AbstractController { /** * 认证发票查询service - * */ @Resource private BaseRzFpxxService baseRzFpxxService; @@ -107,7 +106,7 @@ public class BaseInvoiceController extends AbstractController { private static final Pattern PATTERN_DATE = Pattern.compile( - "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"); + "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"); private static final Pattern PATTERN_AMOUNT = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"); /** @@ -119,45 +118,45 @@ public class BaseInvoiceController extends AbstractController { @ResponseBody @SysLog("调用发票认证综合查询入口接口") public Object listRzFpxx(@RequestBody Map map) { - String gfsh = (String)map.get("gfsh"); + String gfsh = (String) map.get("gfsh"); String companyCode = (String) map.get("companyCode"); - if (StringUtils.isBlank(gfsh)||StringUtils.isBlank(companyCode)){ + if (StringUtils.isBlank(gfsh) || StringUtils.isBlank(companyCode)) { return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS)); } - String invoiceType = (String)map.get("invoiceType"); - String invoiceSource = (String)map.get("invoiceSource"); - String kpksrq = (String)map.get("kpksrq"); - String kpjsrq = (String)map.get("kpjsrq"); - String qszt = (String)map.get("qszt"); - String rzzt = (String)map.get("rzzt"); - String rzclzt = (String)map.get("rzclzt"); - String rzlx = (String)map.get("rzlx"); - String skssq = (String)map.get("skssq"); - String qsfs = (String)map.get("qsfs"); - String invoiceStatus = (String)map.get("invoiceStatus"); - String qsksrq = (String)map.get("qsksrq"); - String qsjsrq = (String)map.get("qsjsrq"); - String rzksrq = (String)map.get("rzksrq"); - String rzjsrq = (String)map.get("rzjsrq"); - String invoiceNo = (String)map.get("invoiceNo"); - String xfmc = (String)map.get("xfmc"); - String businessCode = (String)map.get("businessCode"); - String qsr = (String)map.get("qsr"); - String rzhr = (String)map.get("rzhr"); + String invoiceType = (String) map.get("invoiceType"); + String invoiceSource = (String) map.get("invoiceSource"); + String kpksrq = (String) map.get("kpksrq"); + String kpjsrq = (String) map.get("kpjsrq"); + String qszt = (String) map.get("qszt"); + String rzzt = (String) map.get("rzzt"); + String rzclzt = (String) map.get("rzclzt"); + String rzlx = (String) map.get("rzlx"); + String skssq = (String) map.get("skssq"); + String qsfs = (String) map.get("qsfs"); + String invoiceStatus = (String) map.get("invoiceStatus"); + String qsksrq = (String) map.get("qsksrq"); + String qsjsrq = (String) map.get("qsjsrq"); + String rzksrq = (String) map.get("rzksrq"); + String rzjsrq = (String) map.get("rzjsrq"); + String invoiceNo = (String) map.get("invoiceNo"); + String xfmc = (String) map.get("xfmc"); + String businessCode = (String) map.get("businessCode"); + String qsr = (String) map.get("qsr"); + String rzhr = (String) map.get("rzhr"); // String sortPzbh = String.valueOf(map.get("sortPzbh")); // String sortBzdh = String.valueOf(map.get("sortBzdh")); // String sortKprq = String.valueOf(map.get("sortKprq")); String taxRate = String.valueOf(map.get("taxRate")); - log.info("taxRate={}",taxRate); - String inAccountStatus = (String)map.get("inAccountStatus"); - int curr = (int)map.get("curr"); - int size = (int)map.get("size"); + log.info("taxRate={}", taxRate); + String inAccountStatus = (String) map.get("inAccountStatus"); + int curr = (int) map.get("curr"); + int size = (int) map.get("size"); String bzdh = (String) map.get("bzdh"); String bzr = (String) map.get("bzr"); Map pramsMap = new HashMap<>(25); pramsMap.put("bzdh", bzdh); - pramsMap.put("bzr",bzr); + pramsMap.put("bzr", bzr); pramsMap.put("inAccountStatus", inAccountStatus); pramsMap.put("qszt", map.get("qszt")); pramsMap.put("wrzfpStart", map.get("wrzfpStart")); @@ -166,9 +165,9 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("postingTimeStart", map.get("postingTimeStart")); pramsMap.put("postingTimeEnd", map.get("postingTimeEnd")); if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) { - String accountPeriod = map.get("accountPeriod").toString().substring(0,7); + String accountPeriod = map.get("accountPeriod").toString().substring(0, 7); pramsMap.put("accountPeriod", accountPeriod); - log.info("accountPeriod:{}",accountPeriod); + log.info("accountPeriod:{}", accountPeriod); } // pramsMap.put("accountPeriodStart", map.get("accountPeriodStart")); // pramsMap.put("accountPeriodEnd", map.get("accountPeriodEnd")); @@ -190,19 +189,14 @@ public class BaseInvoiceController extends AbstractController { String[] split = rzhr.split(","); if (!Arrays.asList(split).contains("")) { String[] split1 = rzhr.split(","); - if(split1.length == 1){ - pramsMap.put("rzhr", rzhr); - }else{ - pramsMap.put("rzhr", Arrays.asList(split1)); - } - + pramsMap.put("rzhr", Arrays.asList(split1)); } } if (!StringUtils.isBlank(invoiceNo)) { - if(invoiceNo.length()==8){ + if (invoiceNo.length() == 8) { pramsMap.put("invoiceNo", invoiceNo); - }else { + } else { pramsMap.put("eleInvoiceNo", invoiceNo); } } @@ -211,13 +205,13 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("payment", map.get("payment")); pramsMap.put("paymentStatus", map.get("paymentStatus")); - if(map.get("paymentDateStart") != null) { + if (map.get("paymentDateStart") != null) { if (StringUtils.isNotEmpty(map.get("paymentDateStart").toString())) { String paymentDateStart = DateUtils.getMorning(DateUtils.strToDate(map.get("paymentDateStart").toString())); pramsMap.put("paymentDateStart", paymentDateStart); } } - if(map.get("paymentEnd") != null) { + if (map.get("paymentEnd") != null) { if (StringUtils.isNotEmpty(map.get("paymentEnd").toString())) { String paymentDateEnd = DateUtils.getNight(DateUtils.strToDate(map.get("paymentEnd").toString())); pramsMap.put("paymentDateEnd", paymentDateEnd); @@ -230,13 +224,13 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("gfsh", gfsh); - pramsMap.put("companyCode",companyCode); + pramsMap.put("companyCode", companyCode); - if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)){ + if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)) { // List rates = new ArrayList<>(); // rates = convertRates(taxRate,rates); - pramsMap.put("taxRate",taxRate); + pramsMap.put("taxRate", taxRate); } if (!StringHelper.isBlank(invoiceType)) { @@ -292,7 +286,7 @@ public class BaseInvoiceController extends AbstractController { } if (!StringHelper.isBlank(rzzt)) { // 已认证传 认证起止日期和税款所属期做判断 - if(!"99".equals(rzzt)) { + if (!"99".equals(rzzt)) { pramsMap.put("rzzt", rzzt); } if (!"0".equals(rzzt)) { @@ -348,19 +342,19 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("inAccountStatus", inAccountStatus); } - if(pramsMap.get("imageNumber") != null){ - pramsMap.put("imageNumber",pramsMap.get("imageNumber")); + if (pramsMap.get("imageNumber") != null) { + pramsMap.put("imageNumber", pramsMap.get("imageNumber")); } - if(pramsMap.get("snVoucherNumber") != null){ - pramsMap.put("snVoucherNumber",pramsMap.get("snVoucherNumber")); + if (pramsMap.get("snVoucherNumber") != null) { + pramsMap.put("snVoucherNumber", pramsMap.get("snVoucherNumber")); } - if(pramsMap.get("accountPeriod") != null ){ - if(pramsMap.get("accountPeriod").toString().length() > 7) { + if (pramsMap.get("accountPeriod") != null) { + if (pramsMap.get("accountPeriod").toString().length() > 7) { String accountPeriod = pramsMap.get("accountPeriod").toString().substring(0, 7); pramsMap.put("accountPeriod", accountPeriod); - }else{ + } else { pramsMap.put("accountPeriod", pramsMap.get("accountPeriod")); } } @@ -374,7 +368,7 @@ public class BaseInvoiceController extends AbstractController { DateUtils.getNight(DateUtils.strToDate(pramsMap.get("postingTimeEnd").toString()))); } - log.info("请求列表的参数为:{}",pramsMap); + log.info("请求列表的参数为:{}", pramsMap); try { return ResponseEntity.ok(R.ok().put("data", baseRzFpxxService.selectByPramsMap(pramsMap, curr, size))); @@ -389,14 +383,13 @@ public class BaseInvoiceController extends AbstractController { /** * 撤销认证 * - * @param map - * 请求参数 id逗号分隔 + * @param map 请求参数 id逗号分隔 * @return 返回结果 */ @PostMapping("/rzzhcx/cxrz") @SysLog("调用撤销认证接口") public Object cxrz(@RequestBody Map map) { - String cxids = (String)map.get("cxids"); + String cxids = (String) map.get("cxids"); Map pramsMap = new HashMap<>(16); pramsMap.put("dbName", getUserInfo().getDbName()); @@ -417,7 +410,6 @@ public class BaseInvoiceController extends AbstractController { } /** - * * 扫码勾选录入查询 */ @PostMapping("/smgx/smgxcx") @@ -488,56 +480,54 @@ public class BaseInvoiceController extends AbstractController { @ResponseBody public Object sggxcx(@RequestBody Map map) { - if(map.get("gfsh") == null || "".equals(map.get("gfsh"))){ + if (map.get("gfsh") == null || "".equals(map.get("gfsh"))) { return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS)); } - if (map.get("companyCode") == null || "".equals(map.get("companyCode"))){ + if (map.get("companyCode") == null || "".equals(map.get("companyCode"))) { return ResponseEntity.ok(R.error("组织编码不能为空")); } String gfsh = (String) map.get("gfsh"); String companyCode = (String) map.get("companyCode"); - String invoiceType = (String)map.get("invoiceType"); - String invoiceSource = (String)map.get("invoiceSource"); - String kpksrq = (String)map.get("kpksrq"); - String kpjsrq = (String)map.get("kpjsrq"); - String qszt = (String)map.get("qszt"); - String rzzt = (String)map.get("rzzt"); - String qsfs = (String)map.get("qsfs"); - String businessCode = (String)map.get("businessCode"); - String invoiceNo = (String)map.get("invoiceNo"); - String qsksrq = (String)map.get("qsksrq"); - String qsjsrq = (String)map.get("qsjsrq"); - String xfmc = (String)map.get("xfmc"); + String invoiceType = (String) map.get("invoiceType"); + String invoiceSource = (String) map.get("invoiceSource"); + String kpksrq = (String) map.get("kpksrq"); + String kpjsrq = (String) map.get("kpjsrq"); + String qszt = (String) map.get("qszt"); + String rzzt = (String) map.get("rzzt"); + String qsfs = (String) map.get("qsfs"); + String businessCode = (String) map.get("businessCode"); + String invoiceNo = (String) map.get("invoiceNo"); + String qsksrq = (String) map.get("qsksrq"); + String qsjsrq = (String) map.get("qsjsrq"); + String xfmc = (String) map.get("xfmc"); String sortPzbh = String.valueOf(map.get("sortPzbh")); String sortBzdh = String.valueOf(map.get("sortBzdh")); String sortKprq = String.valueOf(map.get("sortKprq")); - String position = (String)map.get("position"); - String fpzt = (String)map.get("invoiceStatus"); - String sfkrz = (String)map.get("sfkrz"); - int curr = (int)map.get("curr"); - int size = (int)map.get("size"); - String qsr = (String)map.get("qsr"); - String company = (String)map.get("company"); - String menuId = (String)map.get("menuId"); + String position = (String) map.get("position"); + String fpzt = (String) map.get("invoiceStatus"); + String sfkrz = (String) map.get("sfkrz"); + int curr = (int) map.get("curr"); + int size = (int) map.get("size"); + String qsr = (String) map.get("qsr"); + String company = (String) map.get("company"); + String menuId = (String) map.get("menuId"); String bzdh = (String) map.get("bzdh"); String inAccountStatus = (String) map.get("inAccountStatus"); String suspendStatus = (String) map.get("suspendStastus"); String suspendDate = (String) map.get("suspendDate"); String bzr = (String) map.get("bzr"); String taxRate = String.valueOf(map.get("taxRate")); - if (StringUtils.isNotEmpty(suspendDate) && suspendDate.length() >7){ - suspendDate = suspendDate.substring(0,7); + if (StringUtils.isNotEmpty(suspendDate) && suspendDate.length() > 7) { + suspendDate = suspendDate.substring(0, 7); } - - Map pramsMap = new HashMap<>(32); - pramsMap.put("companyCode",companyCode); + pramsMap.put("companyCode", companyCode); pramsMap.put("gfsh", gfsh); pramsMap.put("bzdh", bzdh); pramsMap.put("inAccountStatus", inAccountStatus); @@ -558,26 +548,26 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("postingTimeEnd", map.get("postingTimeEnd")); pramsMap.put("postingTimeStart", map.get("postingTimeStart")); pramsMap.put("imageNumber", map.get("imageNumber")); - pramsMap.put("suspendStatus",suspendStatus); - pramsMap.put("suspendDate",suspendDate); - pramsMap.put("sortPzbh",sortPzbh); - pramsMap.put("sortBzdh",sortBzdh); - pramsMap.put("sortKprq",sortKprq); - pramsMap.put("bzr",bzr); - if(StringUtils.isNotEmpty(sortPzbh)) { + pramsMap.put("suspendStatus", suspendStatus); + pramsMap.put("suspendDate", suspendDate); + pramsMap.put("sortPzbh", sortPzbh); + pramsMap.put("sortBzdh", sortBzdh); + pramsMap.put("sortKprq", sortKprq); + pramsMap.put("bzr", bzr); + if (StringUtils.isNotEmpty(sortPzbh)) { pramsMap.put("sortPzbh", sortPzbh); } - if(StringUtils.isNotEmpty(sortBzdh)) { + if (StringUtils.isNotEmpty(sortBzdh)) { pramsMap.put("sortBzdh", sortBzdh); } - if(StringUtils.isNotEmpty(sortKprq)) { + if (StringUtils.isNotEmpty(sortKprq)) { pramsMap.put("sortKprq", sortKprq); } if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) { - String accountPeriod = map.get("accountPeriod").toString().substring(0,7); + String accountPeriod = map.get("accountPeriod").toString().substring(0, 7); pramsMap.put("accountPeriod", accountPeriod); - log.info("accountPeriod:{}",accountPeriod); + log.info("accountPeriod:{}", accountPeriod); } if (sfkrz != null) { @@ -590,18 +580,18 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("invoiceSource", invoiceSource); } } - if (!StringUtils.isNotBlank(gfsh)){ - pramsMap.put("sign","88"); + if (!StringUtils.isNotBlank(gfsh)) { + pramsMap.put("sign", "88"); } - if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)){ + if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)) { // List rates = new ArrayList<>(); // rates = convertRates(taxRate,rates); - pramsMap.put("taxRate",taxRate); + pramsMap.put("taxRate", taxRate); } - if (StringUtils.isNotBlank(rzzt) && !"99".equals(rzzt)){ - pramsMap.put("rzzt",rzzt); + if (StringUtils.isNotBlank(rzzt) && !"99".equals(rzzt)) { + pramsMap.put("rzzt", rzzt); } if (!StringUtils.isBlank(invoiceType)) { @@ -670,9 +660,9 @@ public class BaseInvoiceController extends AbstractController { //发票号码 if (!StringUtils.isBlank(invoiceNo)) { - if(invoiceNo.length()==8){ + if (invoiceNo.length() == 8) { pramsMap.put("invoiceNo", invoiceNo); - }else { + } else { pramsMap.put("eleInvoiceNo", invoiceNo); } } @@ -689,7 +679,7 @@ public class BaseInvoiceController extends AbstractController { // } try { return ResponseEntity - .ok(R.ok().put("data", baseInvoiceManualCheckService.selectByManualCheck(pramsMap, curr, size))); + .ok(R.ok().put("data", baseInvoiceManualCheckService.selectByManualCheck(pramsMap, curr, size))); } catch (Exception e) { e.printStackTrace(); log.error("", e); @@ -699,11 +689,11 @@ public class BaseInvoiceController extends AbstractController { } private List getGfshList(List gfshList, List companyCodes) { - gfshList = baseInvoiceManualCheckService.getGfshList(gfshList,companyCodes); + gfshList = baseInvoiceManualCheckService.getGfshList(gfshList, companyCodes); return gfshList; } - private List convertRates(String taxRate,List rates) { + private List convertRates(String taxRate, List rates) { switch (taxRate) { case "0": rates.add("0"); @@ -754,17 +744,17 @@ public class BaseInvoiceController extends AbstractController { } public boolean checkList(List list) { - boolean flag =false; - if (list == null || list.isEmpty()){ + boolean flag = false; + if (list == null || list.isEmpty()) { flag = true; - }else { - String s = list.toString().replace("[","").replace("]",""); - if (StringHelper.isBlank(s)){ + } else { + String s = list.toString().replace("[", "").replace("]", ""); + if (StringHelper.isBlank(s)) { flag = true; } - if (StringHelper.isNotBlank(s) && s.contains(",")){ + if (StringHelper.isNotBlank(s) && s.contains(",")) { String replace = s.replace(",", ""); - if (StringHelper.isBlank(replace)){ + if (StringHelper.isBlank(replace)) { flag = true; } } @@ -781,22 +771,22 @@ public class BaseInvoiceController extends AbstractController { @SysLog("调用智能勾选查询接口") @ResponseBody public Object zngxcx(@RequestBody Map map) { - String gfsh = (String)map.get("gfsh"); - String invoiceType = (String)map.get("invoiceType"); - String invoiceSource = (String)map.get("invoiceSource"); - String kpksrq = (String)map.get("kpksrq"); - String kpjsrq = (String)map.get("kpjsrq"); - String qszt = (String)map.get("qszt"); - String qsfs = (String)map.get("qsfs"); - String businessCode = (String)map.get("businessCode"); - String qsksrq = (String)map.get("qsksrq"); - String qsjsrq = (String)map.get("qsjsrq"); - String xfmc = (String)map.get("xfmc"); - String maxTax = (String)map.get("maxTax"); - String floatTax = (String)map.get("floatTax"); - String yxsxfs = (String)map.get("yxsxfs"); - String qsr = (String)map.get("qsr"); - String invoiceNo = (String)map.get("invoiceNo"); + String gfsh = (String) map.get("gfsh"); + String invoiceType = (String) map.get("invoiceType"); + String invoiceSource = (String) map.get("invoiceSource"); + String kpksrq = (String) map.get("kpksrq"); + String kpjsrq = (String) map.get("kpjsrq"); + String qszt = (String) map.get("qszt"); + String qsfs = (String) map.get("qsfs"); + String businessCode = (String) map.get("businessCode"); + String qsksrq = (String) map.get("qsksrq"); + String qsjsrq = (String) map.get("qsjsrq"); + String xfmc = (String) map.get("xfmc"); + String maxTax = (String) map.get("maxTax"); + String floatTax = (String) map.get("floatTax"); + String yxsxfs = (String) map.get("yxsxfs"); + String qsr = (String) map.get("qsr"); + String invoiceNo = (String) map.get("invoiceNo"); Map pramsMap = new HashMap<>(18); pramsMap.put("business", getUserInfo().getBusiness()); @@ -887,9 +877,9 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("xfmc", xfmc); } if (!StringUtils.isBlank(invoiceNo)) { - if(invoiceNo.length()==8){ + if (invoiceNo.length() == 8) { pramsMap.put("invoiceNo", invoiceNo); - }else { + } else { pramsMap.put("eleInvoiceNo", invoiceNo); } } @@ -916,38 +906,38 @@ public class BaseInvoiceController extends AbstractController { String inAccountStatus = (String) map.get("inAccountStatus"); String companyCode = (String) map.get("companyCode"); - String gfsh = (String)map.get("gfsh"); + String gfsh = (String) map.get("gfsh"); String maxTax = (String) map.get("maxTax"); - String menuId = (String)map.get("menuId"); - String company = (String)map.get("company"); + String menuId = (String) map.get("menuId"); + String company = (String) map.get("company"); String isChooseAll = (String) map.get("isChooseAll"); - if (org.apache.commons.lang3.StringUtils.isBlank(isChooseAll)){ + if (org.apache.commons.lang3.StringUtils.isBlank(isChooseAll)) { isChooseAll = "N"; } int curr = 0; int size = 0; - if ("N".equalsIgnoreCase(isChooseAll)){ + if ("N".equalsIgnoreCase(isChooseAll)) { - if (map.get("curr") != null){ + if (map.get("curr") != null) { curr = (int) map.get("curr"); - }else { + } else { ResponseEntity.ok(R.error("分页数据不能为空")); } - if (map.get("size")!= null){ + if (map.get("size") != null) { size = (int) map.get("size"); - }else { + } else { ResponseEntity.ok(R.error("分页大小不能为空")); } } - if (StringUtils.isBlank(inAccountStatus)){ + if (StringUtils.isBlank(inAccountStatus)) { return ResponseEntity.ok(R.error("入账状态不能为空")); } - if (StringUtils.isBlank(maxTax)){ + if (StringUtils.isBlank(maxTax)) { return ResponseEntity.ok(R.error("税额上限不能为空")); } @@ -963,10 +953,10 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("inAccountStatus", inAccountStatus); pramsMap.put("company", company); pramsMap.put("menuId", menuId); - pramsMap.put("maxTax",maxTax); - pramsMap.put("curr",curr); - pramsMap.put("size",size); - pramsMap.put("isChooseAll",isChooseAll); + pramsMap.put("maxTax", maxTax); + pramsMap.put("curr", curr); + pramsMap.put("size", size); + pramsMap.put("isChooseAll", isChooseAll); pramsMap.put("business", getUserInfo().getBusiness()); pramsMap.put("dbName", getUserInfo().getDbName()); List taxList = getUserInfo().getOrg(); @@ -981,21 +971,20 @@ public class BaseInvoiceController extends AbstractController { //TODO 合并分支后把checkList加上可以让用户不使用上级权限就可以进行认证 - pramsMap.put("gfsh",gfshList); + pramsMap.put("gfsh", gfshList); - pramsMap.put("sign","99"); + pramsMap.put("sign", "99"); - if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){ - pramsMap.put("companyCodes",getUserInfo().getCompanyCodes()); - log.info("组织机构====>{}",pramsMap.get("companyCodes")); + if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)) { + pramsMap.put("companyCodes", getUserInfo().getCompanyCodes()); + log.info("组织机构====>{}", pramsMap.get("companyCodes")); } - if (StringUtils.isNotBlank(companyCode)){ - pramsMap.put("companyCode",companyCode); + if (StringUtils.isNotBlank(companyCode)) { + pramsMap.put("companyCode", companyCode); } - try { return ResponseEntity .ok(R.ok().put("data", baseInvoiceManualCheckService.inTellingCheck(pramsMap))); @@ -1018,7 +1007,7 @@ public class BaseInvoiceController extends AbstractController { // isChooseAll = "Y"; // } - map.put("isChooseAll","Y"); + map.put("isChooseAll", "Y"); int curr = 1; int size = 10; int count = 0; @@ -1026,16 +1015,16 @@ public class BaseInvoiceController extends AbstractController { Map pramsMap = new HashMap<>(16); String companyCode = (String) map.get("companyCode"); - String gfsh = (String)map.get("gfsh"); + String gfsh = (String) map.get("gfsh"); List gfshList = new ArrayList<>(); - if(StringUtils.isNotBlank(gfsh) && "99".equals(gfsh)){ - gfshList=UserInfoUtil.getGfshAll(getUserInfo().getOrg()); - }else { + if (StringUtils.isNotBlank(gfsh) && "99".equals(gfsh)) { + gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); + } else { gfshList.add(gfsh); } String gxType = (String) map.get("gxType"); - if (StringUtils.isBlank(gxType)){ + if (StringUtils.isBlank(gxType)) { return ResponseEntity.ok(R.error("所选发票勾选类型不能为空")); } @@ -1043,7 +1032,7 @@ public class BaseInvoiceController extends AbstractController { map.put("dbName", getUserInfo().getDbName()); List taxList = getUserInfo().getOrg(); map.put("taxList", taxList); - map.put("gfsh",gfshList); + map.put("gfsh", gfshList); map.put("qsflag", getUserInfo().getQsStatus()); // List gfshList = new ArrayList<>(); // if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) { @@ -1056,41 +1045,41 @@ public class BaseInvoiceController extends AbstractController { // // map.put("gfsh",gfshList); // - map.put("sign","99"); + map.put("sign", "99"); - if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){ - map.put("companyCodes",getUserInfo().getCompanyCodes()); - log.info("组织机构====>{}",map.get("companyCodes")); + if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)) { + map.put("companyCodes", getUserInfo().getCompanyCodes()); + log.info("组织机构====>{}", map.get("companyCodes")); } - if (StringUtils.isNotBlank(companyCode)){ - map.put("companyCode",companyCode); + if (StringUtils.isNotBlank(companyCode)) { + map.put("companyCode", companyCode); } String sgrzzngxcx = baseInvoiceManualCheckService.inTellingCheck(map); - log.info("sgrzzngxcx======={}",sgrzzngxcx); + log.info("sgrzzngxcx======={}", sgrzzngxcx); String decodeStr = Base64.decodeStr(sgrzzngxcx); BaseReturnEntity baseReturnEntity = JSON.parseObject(decodeStr, BaseReturnEntity.class); List dataList = baseReturnEntity.getDataList(); StringBuilder uuids = new StringBuilder(); StringBuilder dkses = new StringBuilder(); - if (dataList != null && dataList.size() > 0){ + if (dataList != null && dataList.size() > 0) { for (int i = 0; i < dataList.size(); i++) { uuids.append(dataList.get(i).getUuid()); dkses.append(dataList.get(i).getTaxAmount()); - if (i{}",uuids); - log.info("dkses====>{}",dkses); - }else { + log.info("uuids====>{}", uuids); + log.info("dkses====>{}", dkses); + } else { return ResponseEntity.ok(R.error("没有可操作的数据")); } - pramsMap.put("uuids",uuids); - pramsMap.put("dkses",dkses); + pramsMap.put("uuids", uuids); + pramsMap.put("dkses", dkses); pramsMap.put("name", getUserName()); pramsMap.put("dbName", getUserInfo().getDbName()); pramsMap.put("loginName", getLoginName()); @@ -1118,12 +1107,12 @@ public class BaseInvoiceController extends AbstractController { @SysLog("智能勾选发票入库接口") @ResponseBody public Object insertZngx(@RequestBody Map map) { - List idlist = (List)map.get("ids"); + List idlist = (List) map.get("ids"); Map pramsMap = new HashMap<>(16); pramsMap.put("business", getUserInfo().getBusiness()); pramsMap.put("dbName", getUserInfo().getDbName()); pramsMap.put("userName", getUserName()); - pramsMap.put("userAccount",getUserInfo().getLoginname()); + pramsMap.put("userAccount", getUserInfo().getLoginname()); pramsMap.put("company", map.get("company")); pramsMap.put("menuId", map.get("menuId")); pramsMap.put("gxType", map.get("gxType")); @@ -1182,7 +1171,7 @@ public class BaseInvoiceController extends AbstractController { /** * 扫码,手工,导入勾选操做入口 - * + *

* 0-手工勾选 1-扫码勾选 2-导入勾选 3- 智能勾选 4-手工认证 5-扫码认证 6-导入认证 * * @return 返回结果 @@ -1190,9 +1179,9 @@ public class BaseInvoiceController extends AbstractController { @PostMapping("/gx/invoiceCheck") @SysLog("调用扫码,手工,导入勾选操做入口接口") public Object invoiceCheck(@RequestBody Map map) { - String ids = (String)map.get("ids"); - String gxType = String.valueOf((int)map.get("gxType")); - String ses = (String)map.get("ses"); + String ids = (String) map.get("ids"); + String gxType = String.valueOf((int) map.get("gxType")); + String ses = (String) map.get("ses"); Map pramsMap = new HashMap<>(16); pramsMap.put("dbName", getUserInfo().getDbName()); @@ -1226,23 +1215,22 @@ public class BaseInvoiceController extends AbstractController { /** * 已勾选发票待确认列表 * - * @param map - * 请求参数 + * @param map 请求参数 * @return 返回结果 */ @PostMapping("/ygxfp/jgxfpcx") @SysLog("调用已勾选发票待确认列表接口") public Object jgxfpcx(@RequestBody Map map) { - String gfsh = (String)map.get("gfsh"); - String invoiceType = (String)map.get("invoiceType"); - String invoiceSource = (String)map.get("invoiceSource"); - String gxksrq = (String)map.get("gxksrq"); - String gxjsrq = (String)map.get("gxjsrq"); - String businessCode = (String)map.get("businessCode"); - String invoiceNo = (String)map.get("invoiceNo"); - String xfmc = (String)map.get("xfmc"); - int curr = (int)map.get("curr"); - int size = (int)map.get("size"); + String gfsh = (String) map.get("gfsh"); + String invoiceType = (String) map.get("invoiceType"); + String invoiceSource = (String) map.get("invoiceSource"); + String gxksrq = (String) map.get("gxksrq"); + String gxjsrq = (String) map.get("gxjsrq"); + String businessCode = (String) map.get("businessCode"); + String invoiceNo = (String) map.get("invoiceNo"); + String xfmc = (String) map.get("xfmc"); + int curr = (int) map.get("curr"); + int size = (int) map.get("size"); Map pramsMap = new HashMap<>(16); pramsMap.put("dbName", getUserInfo().getDbName()); List taxList = getUserInfo().getOrg(); @@ -1299,16 +1287,16 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("xfmc", xfmc); } if (!StringUtils.isBlank(invoiceNo)) { - if(invoiceNo.length()==8){ + if (invoiceNo.length() == 8) { pramsMap.put("invoiceNo", invoiceNo); - }else { + } else { pramsMap.put("eleInvoiceNo", invoiceNo); } } try { return ResponseEntity.ok(Objects - .requireNonNull(R.ok().put("data", baseYgxfpqrService.selectByGfshAndKprq(pramsMap, curr, size)))); + .requireNonNull(R.ok().put("data", baseYgxfpqrService.selectByGfshAndKprq(pramsMap, curr, size)))); } catch (Exception e) { e.printStackTrace(); log.error("", e); @@ -1319,14 +1307,13 @@ public class BaseInvoiceController extends AbstractController { /** * 撤销已经勾选的发票 * - * @param map - * 请求参数 + * @param map 请求参数 * @return 返回结果 */ @PostMapping("/gxfp/cxgx") @SysLog("调用撤销已经勾选的发票接口") public Object cxgx(@RequestBody Map map) { - String cxids = (String)map.get("cxids"); + String cxids = (String) map.get("cxids"); Map pramsMap = new HashMap<>(16); pramsMap.put("dbName", getUserInfo().getDbName()); @@ -1349,17 +1336,16 @@ public class BaseInvoiceController extends AbstractController { /** * 一键提交 * - * @param map - * 请求参数 + * @param map 请求参数 * @return 返回结果 */ @PostMapping("/gxfp/tjrz") @SysLog("调用一键提交接口") public Object fprz(@RequestBody Map map) { - String uuids = (String)map.get("uuids"); - String dkses = (String)map.get("dkses"); - String gxType = (String)map.get("gxType"); + String uuids = (String) map.get("uuids"); + String dkses = (String) map.get("dkses"); + String gxType = (String) map.get("gxType"); int curr = 0; int size = 50; int count = 0; @@ -1388,7 +1374,7 @@ public class BaseInvoiceController extends AbstractController { try { return ResponseEntity - .ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.identifiByIds(pramsMap, curr, size, count))); + .ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.identifiByIds(pramsMap, curr, size, count))); } catch (Exception e) { e.printStackTrace(); log.error("", e); @@ -1399,49 +1385,49 @@ public class BaseInvoiceController extends AbstractController { @PostMapping("/sgrz/changeSuspend") @SysLog("修改暂挂状态") @ResponseBody - public Object changeSuspend(@RequestBody Map map){ + public Object changeSuspend(@RequestBody Map map) { - if (map == null){ + if (map == null) { return ResponseEntity.ok(R.error("缺少请求参数")); } - log.info("getUserInfo====>{}",getUserInfo()); + log.info("getUserInfo====>{}", getUserInfo()); List gfshAll = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); - if (gfshAll ==null || gfshAll.isEmpty()){ + if (gfshAll == null || gfshAll.isEmpty()) { return ResponseEntity.ok(R.error("购方信息不能为空")); } JSONObject jsonObject = new JSONObject(map); String uuids = jsonObject.getString("uuids"); - if (StringUtils.isEmpty(uuids) ||(uuids.length() == 1 && uuids.contains(","))){ + if (StringUtils.isEmpty(uuids) || (uuids.length() == 1 && uuids.contains(","))) { return ResponseEntity.ok(R.error("请先选择要暂挂的数据")); } String suspendType = jsonObject.getString("suspendType"); - if (StringUtils.isEmpty(suspendType)){ + if (StringUtils.isEmpty(suspendType)) { return ResponseEntity.ok(R.error("暂挂状态不能为空")); } String[] uuidArray = uuids.split(","); List uuidList = Arrays.asList(uuidArray); //查询库中是否包含对应数据 - DynamicContextHolder.push(getUserInfo().getDbName()+ DbConstant.BUSINESS_READ); + DynamicContextHolder.push(getUserInfo().getDbName() + DbConstant.BUSINESS_READ); List list = baseIRzTDxRecordInvoiceService.findSuspendStatus(uuidList); - if (list == null || list.isEmpty()){ + if (list == null || list.isEmpty()) { return ResponseEntity.ok(R.error("没有可操作的数据")); } - if (list.contains("1")&& (list.contains("0")||list.contains(null) || list.contains(""))){ + if (list.contains("1") && (list.contains("0") || list.contains(null) || list.contains(""))) { return ResponseEntity.ok(R.error("同时存在暂挂状态为是和否的数据,请重新选择!")); } - Map pramsMap = new HashMap<>(); - pramsMap.put("suspendType",suspendType); - pramsMap.put("uuids",uuidList); - pramsMap.put("dbName",getUserInfo().getDbName()); + Map pramsMap = new HashMap<>(); + pramsMap.put("suspendType", suspendType); + pramsMap.put("uuids", uuidList); + pramsMap.put("dbName", getUserInfo().getDbName()); // pramsMap.put("dbName","business"); try { return ResponseEntity - .ok(R.ok().put("data",baseIRzTDxRecordInvoiceService.updateSuspendType(pramsMap))); + .ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.updateSuspendType(pramsMap))); } catch (Exception e) { e.printStackTrace(); log.error("", e); diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 57ef2f1e..8558d0ca 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -156,10 +156,17 @@ and t.qs_name = #{qsr} - and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') + and (t.confirm_user in + + #{item} + + or t.confirm_user is null or t.confirm_user = '') - and t.confirm_user like CONCAT(#{rzhr},'%') + and t.confirm_user in + + #{item} + @@ -434,10 +441,17 @@ and t.qs_name = #{qsr} - and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') + and (t.confirm_user in + + #{item} + + or t.confirm_user is null or t.confirm_user = '') - and t.confirm_user like CONCAT(#{rzhr},'%') + and t.confirm_user in + + #{item} + = #{paymentDateStart} ]]> From 56b2a9ff5e26daa13239be996495fbfa336c2402 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 16:47:12 +0800 Subject: [PATCH 23/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 8558d0ca..3d68865d 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -440,7 +440,7 @@ and t.qs_name = #{qsr} - + and (t.confirm_user in #{item} From 57b1c2b5c80f8cb7c15f0e5e2b93b203c9ae98aa Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 17:02:22 +0800 Subject: [PATCH 24/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/controller/BaseInvoiceController.java | 12 ++++++++---- .../src/main/resources/mapper/BaseFpZhMapper.xml | 14 +++----------- 2 files changed, 11 insertions(+), 15 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 3fb07ab0..c03498cd 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 @@ -186,10 +186,14 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("xfmc", xfmc); pramsMap.put("qsr", qsr); if (StringUtils.isNotBlank(rzhr)) { - String[] split = rzhr.split(","); - if (!Arrays.asList(split).contains("")) { - String[] split1 = rzhr.split(","); - pramsMap.put("rzhr", Arrays.asList(split1)); + if("admin".equals(rzhr)){ + pramsMap.put("rzhr", rzhr); + }else { + String[] split = rzhr.split(","); + if (!Arrays.asList(split).contains("")) { + String[] split1 = rzhr.split(","); + pramsMap.put("rzhr", Arrays.asList(split1)); + } } } diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 3d68865d..265c6a6a 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -156,11 +156,7 @@ and t.qs_name = #{qsr} - and (t.confirm_user in - - #{item} - - or t.confirm_user is null or t.confirm_user = '') + and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') and t.confirm_user in @@ -440,12 +436,8 @@ and t.qs_name = #{qsr} - - and (t.confirm_user in - - #{item} - - or t.confirm_user is null or t.confirm_user = '') + + and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') and t.confirm_user in From 2818adf7c2ab2daadf733012d8e28f30c37e4ed6 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 18:14:28 +0800 Subject: [PATCH 25/35] =?UTF-8?q?ariesy=20=E5=B7=B2=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=AE=A4=E8=AF=81=E8=AF=81=E4=BA=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E6=88=90?= =?UTF-8?q?damin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dxhy/base/controller/BaseInvoiceController.java | 12 ++++-------- .../src/main/resources/mapper/BaseFpZhMapper.xml | 10 ++-------- 2 files changed, 6 insertions(+), 16 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 c03498cd..3fb07ab0 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 @@ -186,14 +186,10 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("xfmc", xfmc); pramsMap.put("qsr", qsr); if (StringUtils.isNotBlank(rzhr)) { - if("admin".equals(rzhr)){ - pramsMap.put("rzhr", rzhr); - }else { - String[] split = rzhr.split(","); - if (!Arrays.asList(split).contains("")) { - String[] split1 = rzhr.split(","); - pramsMap.put("rzhr", Arrays.asList(split1)); - } + String[] split = rzhr.split(","); + if (!Arrays.asList(split).contains("")) { + String[] split1 = rzhr.split(","); + pramsMap.put("rzhr", Arrays.asList(split1)); } } diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index 265c6a6a..053d5258 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -155,10 +155,7 @@ and t.qs_name = #{qsr} - - and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') - - + and t.confirm_user in #{item} @@ -436,10 +433,7 @@ and t.qs_name = #{qsr} - - and (t.confirm_user = 'admin' or t.confirm_user is null or t.confirm_user = '') - - + and t.confirm_user in #{item} From 613324f3dd24420b52c9a415dab3f2d04a699cb9 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 10 Oct 2023 20:00:56 +0800 Subject: [PATCH 26/35] =?UTF-8?q?ariesy=20=E5=A2=9E=E5=8A=A0=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=95=B0=E6=8D=AE=E6=BA=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/erp/controller/SDNYMainProcessController.java | 1 + 1 file changed, 1 insertion(+) 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 36a260a9..1d58d7b4 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 @@ -295,6 +295,7 @@ public class SDNYMainProcessController extends AbstractController { } } + DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper); } From 4087aeffdfa26a47503471019f123025893bd949 Mon Sep 17 00:00:00 2001 From: yefei Date: Wed, 11 Oct 2023 11:45:41 +0800 Subject: [PATCH 27/35] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=89=8B?= =?UTF-8?q?=E5=B7=A5=E8=AE=A4=E8=AF=81=E7=95=8C=E9=9D=A2=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=80=89=E6=8B=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index 75c25c25..69523f6d 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -27,7 +27,6 @@ - @@ -77,7 +76,7 @@ select t.invoice_type,t.dept_id,t.dept_name,t.comp_code,t.bzr ,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name, DATE_FORMAT(t.invoice_date,'%Y-%m-%d')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,DATE_FORMAT(t.qs_date,'%Y-%m-%d')qs_date - ,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.auth_status,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period, + ,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period, case date_format(t.invoice_date,'%Y%m%d') between c.select_start_date and c.select_end_date when true then 1 else 2 end authStatus,t.bzdh,t.suspend_status,t.suspend_date, From a13f530a5dd419bad41aadea36ca5c6564f75e58 Mon Sep 17 00:00:00 2001 From: yefei Date: Wed, 11 Oct 2023 11:54:49 +0800 Subject: [PATCH 28/35] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=89=8B?= =?UTF-8?q?=E5=B7=A5=E8=AE=A4=E8=AF=81=E7=95=8C=E9=9D=A2=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=80=89=E6=8B=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java | 1 - 1 file changed, 1 deletion(-) 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 4377acb6..ba61d402 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 @@ -194,7 +194,6 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl Date: Mon, 16 Oct 2023 09:43:57 +0800 Subject: [PATCH 29/35] =?UTF-8?q?ariesy=20=E5=8A=A0=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/InvoiceInterfaceServiceImpl.java | 220 +++++++++--------- 1 file changed, 111 insertions(+), 109 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java index 69759873..a3dd8a1b 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java @@ -668,126 +668,128 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { invoiceSelectInfo.setAuthStatus("0"); } try { - lock.lock(); - stringRedisTemplate.opsForValue().set(lockKey, String.valueOf(0)); - - // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 - DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); - if (entity != null) { - boolean flag = false; - if (StringUtils.isBlank(entity.getCheckCode()) - && StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) { - entity.setCheckCode(invoiceSelectInfo.getCheckCode()); - entity.setCheckDate(new Date()); - flag = true; - } - if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) { - entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus()); - entity.setStatusUpdateDate(new Date()); - flag = true; - } - if ("0".equals(entity.getRzhYesorno()) - && !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) { - if ("1".equals(invoiceSelectInfo.getRzlx())) { - entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState()); - entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); - entity.setRzlx(invoiceSelectInfo.getRzlx()); - entity.setRzhType(invoiceSelectInfo.getLegalizeType()); - entity.setSfygx("1"); - if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { - SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); - entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); - } - if ("1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setAuthStatus("4"); - } else { - entity.setAuthStatus("0"); - } - entity.setBdkStatus("1"); - } else if ("4".equals(invoiceSelectInfo.getRzlx())) { - entity.setRzhYesorno("2"); - entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); - entity.setRzlx(invoiceSelectInfo.getRzlx()); - entity.setRzhType(invoiceSelectInfo.getLegalizeType()); - entity.setSfygx("1"); - if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { - SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); - entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); + boolean isLock = lock.tryLock(); + + if(!isLock){ + log.info("当前已有线程获取到锁"); + }else { + // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 + DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); + TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); + if (entity != null) { + boolean flag = false; + if (StringUtils.isBlank(entity.getCheckCode()) + && StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) { + entity.setCheckCode(invoiceSelectInfo.getCheckCode()); + entity.setCheckDate(new Date()); + flag = true; + } + if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) { + entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus()); + entity.setStatusUpdateDate(new Date()); + flag = true; + } + if ("0".equals(entity.getRzhYesorno()) + && !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) { + if ("1".equals(invoiceSelectInfo.getRzlx())) { + entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState()); + entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); + entity.setRzlx(invoiceSelectInfo.getRzlx()); + entity.setRzhType(invoiceSelectInfo.getLegalizeType()); + entity.setSfygx("1"); + if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { + SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); + entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); + } + if ("1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setAuthStatus("4"); + } else { + entity.setAuthStatus("0"); + } + entity.setBdkStatus("1"); + } else if ("4".equals(invoiceSelectInfo.getRzlx())) { + entity.setRzhYesorno("2"); + entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); + entity.setRzlx(invoiceSelectInfo.getRzlx()); + entity.setRzhType(invoiceSelectInfo.getLegalizeType()); + entity.setSfygx("1"); + if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { + SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); + entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); + } + if ("1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setAuthStatus("4"); + } else { + entity.setAuthStatus("0"); + } + entity.setBdkStatus("2"); } - if ("1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setAuthStatus("4"); - } else { - entity.setAuthStatus("0"); + flag = true; + + } else if (!"0".equals(entity.getRzhYesorno()) + && !"1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setRzhYesorno("0"); + entity.setRzhBelongDate(null); + entity.setRzlx("0"); + entity.setRzhType(null); + entity.setRzhDate(null); + entity.setAuthStatus("0"); + entity.setBdkStatus("0"); + entity.setSfygx("0"); + flag = true; + } + //TODO 这块业务不理解?? + if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) { + entity.setCollectStatus("1"); + entity.setCollectFrom("0"); + entity.setCollectDate(new Date()); + entity.setPoolStatus("1"); + entity.setInPoolReason("数据重复"); + flag = true; + } + if (flag) { + DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); + if (StringUtils.isBlank(entity.getInvoiceCode())) { + entity.setInvoiceCode(""); } - entity.setBdkStatus("2"); + tDxRecordInvoiceJobDao.updateInvoice(entity, taxno); } - flag = true; - - } else if (!"0".equals(entity.getRzhYesorno()) - && !"1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setRzhYesorno("0"); - entity.setRzhBelongDate(null); - entity.setRzlx("0"); - entity.setRzhType(null); - entity.setRzhDate(null); - entity.setAuthStatus("0"); - entity.setBdkStatus("0"); - entity.setSfygx("0"); - flag = true; - } - //TODO 这块业务不理解?? - if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) { - entity.setCollectStatus("1"); - entity.setCollectFrom("0"); - entity.setCollectDate(new Date()); - entity.setPoolStatus("1"); - entity.setInPoolReason("数据重复"); - flag = true; - } - if (flag) { - DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); - if (StringUtils.isBlank(entity.getInvoiceCode())) { - entity.setInvoiceCode(""); + // 艺龙推送数据 + if (yLcompany.equals(company)) { + DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); + InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao + .selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin); + if (selectSign != null && "1".equals(selectSign.getQsStatus())) { + String record = JSON.toJSONString(entity); + sender.sendToStatus(Base64.encode(record)); + } } - tDxRecordInvoiceJobDao.updateInvoice(entity, taxno); - } - // 艺龙推送数据 - if (yLcompany.equals(company)) { - DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao - .selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin); - if (selectSign != null && "1".equals(selectSign.getQsStatus())) { - String record = JSON.toJSONString(entity); - sender.sendToStatus(Base64.encode(record)); + } else { + if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) { + invoiceSelectInfo.setLegalizeDate(null); } + TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo); + record.setCompany(company); + record.setCollectStatus("1"); + record.setCollectFrom("0"); + record.setCollectDate(new Date()); + record.setPoolStatus("0"); + DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); + tDxRecordInvoiceJobDao.insert(record); } - } else { - if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) { - invoiceSelectInfo.setLegalizeDate(null); - } - TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo); - record.setCompany(company); - record.setCollectStatus("1"); - record.setCollectFrom("0"); - record.setCollectDate(new Date()); - record.setPoolStatus("0"); - DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); - tDxRecordInvoiceJobDao.insert(record); + InvoiceLog invoiceLog = new InvoiceLog(); + invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode()); + invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo()); + invoiceLog.setType("1"); + invoiceLog.setInputStatus("0"); + invoiceLog.setCreateDate(new Date()); + invoiceLog.setInputName("系统自动"); + logList.add(invoiceLog); } - InvoiceLog invoiceLog = new InvoiceLog(); - invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode()); - invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo()); - invoiceLog.setType("1"); - invoiceLog.setInputStatus("0"); - invoiceLog.setCreateDate(new Date()); - invoiceLog.setInputName("系统自动"); - logList.add(invoiceLog); }catch (Exception e) { e.printStackTrace(); } finally { //关锁 - stringRedisTemplate.opsForValue().set(lockKey, String.valueOf(1)); lock.unlock(); } } From bc2c6d8c03e197ab864d89e71ffeede6d42fbc5b Mon Sep 17 00:00:00 2001 From: wangrangrang Date: Tue, 17 Oct 2023 11:02:50 +0800 Subject: [PATCH 30/35] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/erp/controller/SDNYMainProcessController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1d58d7b4..8cd64a63 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 @@ -1048,7 +1048,7 @@ public class SDNYMainProcessController extends AbstractController { if (gsClients != null && gsClients.size() > 0) { object.setZFILED5(gsClients.get(0).getClient()); } else { - object.setZFILED5(environment); + throw new RuntimeException("未能查到 "+orgCode+" 公司对应的推送client"); } List sapInvoiceInfos = new ArrayList<>(); From b5284da765ced1806c720effcf676e9fbf98307a Mon Sep 17 00:00:00 2001 From: wangrangrang Date: Tue, 17 Oct 2023 14:13:18 +0800 Subject: [PATCH 31/35] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC,=E4=BF=AE=E6=94=B9=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=8F=82=E6=95=B0=E4=B8=BA300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java | 2 +- .../com/dxhy/erp/controller/SDNYMainProcessController.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java index dad62fa6..3fe32ba4 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java @@ -86,7 +86,7 @@ public class SdnyClientTask extends AbstractController { object.setSYSID("FPXT"); object.setIFYWID("FI846"); object.setBSKEY(UUID.randomUUID().toString().replace("-", "")); - object.setZFILED5("200"); + object.setZFILED5("300"); object.setZDATA(""); //推送到SAP 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 8cd64a63..394593e7 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 @@ -1048,7 +1048,8 @@ public class SDNYMainProcessController extends AbstractController { if (gsClients != null && gsClients.size() > 0) { object.setZFILED5(gsClients.get(0).getClient()); } else { - throw new RuntimeException("未能查到 "+orgCode+" 公司对应的推送client"); + log.error("未能查到 "+orgCode+" 公司对应的推送client"); + return ResponseEntity.ok(JSONObject.toJSONString(R.error("未能查到 "+orgCode+" 公司对应的推送client"))); } List sapInvoiceInfos = new ArrayList<>(); From d4f9900e343c2840d6c8fab05205e72109e3e678 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 17 Oct 2023 14:40:58 +0800 Subject: [PATCH 32/35] =?UTF-8?q?ariesy=20client=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/core/task/SdnyClientTask.java | 87 ++++++++++--------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java index 3fe32ba4..e599359d 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java @@ -37,6 +37,9 @@ public class SdnyClientTask extends AbstractController { @Value("${sdny.snYxUrl}") private String snYxUrl; + @Value("${sdny.client}") + private String client; + @Value("${po.userName}") private String userName; @@ -79,48 +82,50 @@ public class SdnyClientTask extends AbstractController { scheduleJobService.updateById(scheduleJobEntity); // 准备请求参数 // 需判断 设置不认证状态 - - List list = new ArrayList<>(); - long startTime = System.currentTimeMillis(); - SNSAPObject object = new SNSAPObject(); - object.setSYSID("FPXT"); - object.setIFYWID("FI846"); - object.setBSKEY(UUID.randomUUID().toString().replace("-", "")); - object.setZFILED5("300"); - object.setZDATA(""); - - //推送到SAP - log.info("推送山能数据:{}", JSONObject.toJSONString(object)); - JSONObject request = new JSONObject(); - request.put("IS_INPUT", object); - - log.info("{}获取公司client入参:{}", LOGGER_MSG, request.toJSONString()); - String result = HttpUtils.sendPo(snYxUrl, request.toJSONString(), userName, password); - log.info("{}获取公司client出参:{}", LOGGER_MSG, result); - PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class); - EsOutput es_output = poCommonResponseParam.getES_OUTPUT(); - String ztype = es_output.getZTYPE(); - String zmessage = es_output.getZMESSAGE(); - Object zdata = es_output.getZDATA(); - if ("s".equals(ztype)) { - List> gsClientList = JsonUtils.getInstance().parseObject(zdata.toString(), List.class); - gsClientList.stream().forEach(f -> { - GsClient gsClient = new GsClient(); - gsClient.setGsdm(ObjectUtil.isNull(f.get("BUKRS")) ? "" : f.get("BUKRS").toString()); - gsClient.setGsmc(ObjectUtil.isNull(f.get("BUTXT")) ? "" : f.get("BUTXT").toString()); - gsClient.setClient(ObjectUtil.isNull(f.get("MANDT")) ? "" : f.get("MANDT").toString()); - gsClient.setCreateTime(new Date()); - list.add(gsClient); - }); - } else { - log.error("{}client:{},获取公司client出错:{}", LOGGER_MSG, "200", zmessage); + String[] split = client.split(","); + for(int i = 0;i < split.length;i++) { + List list = new ArrayList<>(); + long startTime = System.currentTimeMillis(); + SNSAPObject object = new SNSAPObject(); + object.setSYSID("FPXT"); + object.setIFYWID("FI846"); + object.setBSKEY(UUID.randomUUID().toString().replace("-", "")); + object.setZFILED5(split[i]); + object.setZDATA(""); + + //推送到SAP + log.info("推送山能数据:{}", JSONObject.toJSONString(object)); + JSONObject request = new JSONObject(); + request.put("IS_INPUT", object); + + log.info("{}获取公司client入参:{}", LOGGER_MSG, request.toJSONString()); + String result = HttpUtils.sendPo(snYxUrl, request.toJSONString(), userName, password); + log.info("{}获取公司client出参:{}", LOGGER_MSG, result); + PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class); + EsOutput es_output = poCommonResponseParam.getES_OUTPUT(); + String ztype = es_output.getZTYPE(); + String zmessage = es_output.getZMESSAGE(); + Object zdata = es_output.getZDATA(); + if ("s".equals(ztype)) { + List> gsClientList = JsonUtils.getInstance().parseObject(zdata.toString(), List.class); + gsClientList.stream().forEach(f -> { + GsClient gsClient = new GsClient(); + gsClient.setGsdm(ObjectUtil.isNull(f.get("BUKRS")) ? "" : f.get("BUKRS").toString()); + gsClient.setGsmc(ObjectUtil.isNull(f.get("BUTXT")) ? "" : f.get("BUTXT").toString()); + gsClient.setClient(ObjectUtil.isNull(f.get("MANDT")) ? "" : f.get("MANDT").toString()); + gsClient.setCreateTime(new Date()); + list.add(gsClient); + }); + } else { + log.error("{}client:{},获取公司client出错:{}", LOGGER_MSG, "200", zmessage); + } + log.info("{}删除gs_client表数据", LOGGER_MSG); + gsClientMapper.deleteAll(); + log.info("{}插入gs_client表", LOGGER_MSG); + gsClientMapper.insertList(list); + long endTime = System.currentTimeMillis(); + log.debug("{}任务结束,耗时:{}", LOGGER_MSG, endTime - startTime); } - log.info("{}删除gs_client表数据", LOGGER_MSG); - gsClientMapper.deleteAll(); - log.info("{}插入gs_client表", LOGGER_MSG); - gsClientMapper.insertList(list); - long endTime = System.currentTimeMillis(); - log.debug("{}任务结束,耗时:{}", LOGGER_MSG, endTime - startTime); } catch (Exception e) { e.printStackTrace(); From 28d64f6b79f7069b0ac88749731c4bbadadbbadb Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 17 Oct 2023 19:21:02 +0800 Subject: [PATCH 33/35] =?UTF-8?q?ariesy=20=E5=8E=BB=E6=8E=89redission?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dxhy/core/config/RedissionConfig.java | 48 ++-- .../impl/InvoiceInterfaceServiceImpl.java | 237 +++++++++--------- 2 files changed, 143 insertions(+), 142 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java b/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java index cbcea2b1..33478921 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java +++ b/dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java @@ -7,27 +7,27 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -@Configuration -public class RedissionConfig { - - @Value("${spring.redis.host}") - private String host; - - @Value("${spring.redis.port}") - private String port; - - @Value("${spring.redis.password}") - private String redisPassword; - - @Bean - public RedissonClient getRedisson(){ - - Config config = new Config(); - //单机模式 依次设置redis地址和密码 - config.useSingleServer() - .setAddress("redis://" + host + ":" + port) - .setPassword(redisPassword); - return Redisson.create(config); - } -} - +//@Configuration +//public class RedissionConfig { +// +// @Value("${spring.redis.host}") +// private String host; +// +// @Value("${spring.redis.port}") +// private String port; +// +// @Value("${spring.redis.password}") +// private String redisPassword; +// +// @Bean +// public RedissonClient getRedisson(){ +// +// Config config = new Config(); +// //单机模式 依次设置redis地址和密码 +// config.useSingleServer() +// .setAddress("redis://" + host + ":" + port) +// .setPassword(redisPassword); +// return Redisson.create(config); +// } +//} +// diff --git a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java index a3dd8a1b..c62e119f 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java @@ -78,8 +78,8 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { @Resource private StringRedisTemplate stringRedisTemplate; - @Resource - private RedissonClient redisson; +// @Resource +// private RedissonClient redisson; private static final String REDIS_KEY = "collect_invoice_"; @@ -658,8 +658,8 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { List logList = new ArrayList<>(); for (InvoiceSelectInfo invoiceSelectInfo : invoicesList) { //加分布式锁 - String lockKey = REDIS_KEY + invoiceSelectInfo.getUuid(); - RLock lock = redisson.getLock(lockKey); +// String lockKey = REDIS_KEY + invoiceSelectInfo.getUuid(); +// RLock lock = redisson.getLock(lockKey); invoiceSelectInfo.setUuid(invoiceSelectInfo.getInvoiceCode() + invoiceSelectInfo.getInvoiceNo()); if ("1".equals(invoiceSelectInfo.getLegalizeState())) { //认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败 @@ -668,130 +668,131 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService { invoiceSelectInfo.setAuthStatus("0"); } try { - boolean isLock = lock.tryLock(); - - if(!isLock){ - log.info("当前已有线程获取到锁"); - }else { - // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 - DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); - if (entity != null) { - boolean flag = false; - if (StringUtils.isBlank(entity.getCheckCode()) - && StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) { - entity.setCheckCode(invoiceSelectInfo.getCheckCode()); - entity.setCheckDate(new Date()); - flag = true; - } - if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) { - entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus()); - entity.setStatusUpdateDate(new Date()); - flag = true; - } - if ("0".equals(entity.getRzhYesorno()) - && !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) { - if ("1".equals(invoiceSelectInfo.getRzlx())) { - entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState()); - entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); - entity.setRzlx(invoiceSelectInfo.getRzlx()); - entity.setRzhType(invoiceSelectInfo.getLegalizeType()); - entity.setSfygx("1"); - if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { - SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); - entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); - } - if ("1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setAuthStatus("4"); - } else { - entity.setAuthStatus("0"); - } - entity.setBdkStatus("1"); - } else if ("4".equals(invoiceSelectInfo.getRzlx())) { - entity.setRzhYesorno("2"); - entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); - entity.setRzlx(invoiceSelectInfo.getRzlx()); - entity.setRzhType(invoiceSelectInfo.getLegalizeType()); - entity.setSfygx("1"); - if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { - SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); - entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); - } - if ("1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setAuthStatus("4"); - } else { - entity.setAuthStatus("0"); - } - entity.setBdkStatus("2"); +// boolean isLock = lock.tryLock(); + +// if(!isLock){ +// log.info("当前已有线程获取到锁"); +// }else { + // 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新 + DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); + TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid()); + if (entity != null) { + boolean flag = false; + if (StringUtils.isBlank(entity.getCheckCode()) + && StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) { + entity.setCheckCode(invoiceSelectInfo.getCheckCode()); + entity.setCheckDate(new Date()); + flag = true; + } + if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) { + entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus()); + entity.setStatusUpdateDate(new Date()); + flag = true; + } + if ("0".equals(entity.getRzhYesorno()) + && !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) { + if ("1".equals(invoiceSelectInfo.getRzlx())) { + entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState()); + entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); + entity.setRzlx(invoiceSelectInfo.getRzlx()); + entity.setRzhType(invoiceSelectInfo.getLegalizeType()); + entity.setSfygx("1"); + if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { + SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); + entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); } - flag = true; - - } else if (!"0".equals(entity.getRzhYesorno()) - && !"1".equals(invoiceSelectInfo.getLegalizeState())) { - entity.setRzhYesorno("0"); - entity.setRzhBelongDate(null); - entity.setRzlx("0"); - entity.setRzhType(null); - entity.setRzhDate(null); - entity.setAuthStatus("0"); - entity.setBdkStatus("0"); - entity.setSfygx("0"); - flag = true; - } - //TODO 这块业务不理解?? - if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) { - entity.setCollectStatus("1"); - entity.setCollectFrom("0"); - entity.setCollectDate(new Date()); - entity.setPoolStatus("1"); - entity.setInPoolReason("数据重复"); - flag = true; - } - if (flag) { - DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); - if (StringUtils.isBlank(entity.getInvoiceCode())) { - entity.setInvoiceCode(""); + if ("1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setAuthStatus("4"); + } else { + entity.setAuthStatus("0"); } - tDxRecordInvoiceJobDao.updateInvoice(entity, taxno); - } - // 艺龙推送数据 - if (yLcompany.equals(company)) { - DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); - InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao - .selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin); - if (selectSign != null && "1".equals(selectSign.getQsStatus())) { - String record = JSON.toJSONString(entity); - sender.sendToStatus(Base64.encode(record)); + entity.setBdkStatus("1"); + } else if ("4".equals(invoiceSelectInfo.getRzlx())) { + entity.setRzhYesorno("2"); + entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate()); + entity.setRzlx(invoiceSelectInfo.getRzlx()); + entity.setRzhType(invoiceSelectInfo.getLegalizeType()); + entity.setSfygx("1"); + if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) { + SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd"); + entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate())); } + if ("1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setAuthStatus("4"); + } else { + entity.setAuthStatus("0"); + } + entity.setBdkStatus("2"); } - } else { - if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) { - invoiceSelectInfo.setLegalizeDate(null); - } - TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo); - record.setCompany(company); - record.setCollectStatus("1"); - record.setCollectFrom("0"); - record.setCollectDate(new Date()); - record.setPoolStatus("0"); + flag = true; + + } else if (!"0".equals(entity.getRzhYesorno()) + && !"1".equals(invoiceSelectInfo.getLegalizeState())) { + entity.setRzhYesorno("0"); + entity.setRzhBelongDate(null); + entity.setRzlx("0"); + entity.setRzhType(null); + entity.setRzhDate(null); + entity.setAuthStatus("0"); + entity.setBdkStatus("0"); + entity.setSfygx("0"); + flag = true; + } + //TODO 这块业务不理解?? + if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) { + entity.setCollectStatus("1"); + entity.setCollectFrom("0"); + entity.setCollectDate(new Date()); + entity.setPoolStatus("1"); + entity.setInPoolReason("数据重复"); + flag = true; + } + if (flag) { DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); - tDxRecordInvoiceJobDao.insert(record); + if (StringUtils.isBlank(entity.getInvoiceCode())) { + entity.setInvoiceCode(""); + } + tDxRecordInvoiceJobDao.updateInvoice(entity, taxno); } - InvoiceLog invoiceLog = new InvoiceLog(); - invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode()); - invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo()); - invoiceLog.setType("1"); - invoiceLog.setInputStatus("0"); - invoiceLog.setCreateDate(new Date()); - invoiceLog.setInputName("系统自动"); - logList.add(invoiceLog); + // 艺龙推送数据 + if (yLcompany.equals(company)) { + DynamicContextHolder.push(db + DbConstant.BUSINESS_READ); + InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao + .selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin); + if (selectSign != null && "1".equals(selectSign.getQsStatus())) { + String record = JSON.toJSONString(entity); + sender.sendToStatus(Base64.encode(record)); + } + } + } else { + if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) { + invoiceSelectInfo.setLegalizeDate(null); + } + TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo); + record.setCompany(company); + record.setCollectStatus("1"); + record.setCollectFrom("0"); + record.setCollectDate(new Date()); + record.setPoolStatus("0"); + DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE); + tDxRecordInvoiceJobDao.insert(record); } + InvoiceLog invoiceLog = new InvoiceLog(); + invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode()); + invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo()); + invoiceLog.setType("1"); + invoiceLog.setInputStatus("0"); + invoiceLog.setCreateDate(new Date()); + invoiceLog.setInputName("系统自动"); + logList.add(invoiceLog); +// } }catch (Exception e) { e.printStackTrace(); - } finally { - //关锁 - lock.unlock(); } +// finally { +// //关锁 +// lock.unlock(); +// } } httpLog.setStatus("1"); httpLog.setTotal(total); From a11d0d1e9c5fbd06e94c4573ac91910b85061a18 Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 17 Oct 2023 19:35:36 +0800 Subject: [PATCH 34/35] =?UTF-8?q?ariesy=20=E4=BF=AE=E6=94=B9=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java index e599359d..4f32484a 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java @@ -106,7 +106,7 @@ public class SdnyClientTask extends AbstractController { String ztype = es_output.getZTYPE(); String zmessage = es_output.getZMESSAGE(); Object zdata = es_output.getZDATA(); - if ("s".equals(ztype)) { + if ("S".equals(ztype)) { List> gsClientList = JsonUtils.getInstance().parseObject(zdata.toString(), List.class); gsClientList.stream().forEach(f -> { GsClient gsClient = new GsClient(); From 4dbf9d62e2df898e3b20d86ffb9b71febe843e9c Mon Sep 17 00:00:00 2001 From: yefei Date: Tue, 17 Oct 2023 19:40:55 +0800 Subject: [PATCH 35/35] =?UTF-8?q?ariesy=20=E4=BF=AE=E6=94=B9=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dxhy/core/task/SdnyClientTask.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java index 4f32484a..eb490fe9 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java +++ b/dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java @@ -80,12 +80,12 @@ public class SdnyClientTask extends AbstractController { scheduleJobEntity.setJobStatus("1"); DynamicContextHolder.push(DbConstant.BASICS_WRITE); scheduleJobService.updateById(scheduleJobEntity); + long startTime = System.currentTimeMillis(); + List list = new ArrayList<>(); // 准备请求参数 // 需判断 设置不认证状态 String[] split = client.split(","); for(int i = 0;i < split.length;i++) { - List list = new ArrayList<>(); - long startTime = System.currentTimeMillis(); SNSAPObject object = new SNSAPObject(); object.setSYSID("FPXT"); object.setIFYWID("FI846"); @@ -119,13 +119,14 @@ public class SdnyClientTask extends AbstractController { } else { log.error("{}client:{},获取公司client出错:{}", LOGGER_MSG, "200", zmessage); } - log.info("{}删除gs_client表数据", LOGGER_MSG); - gsClientMapper.deleteAll(); - log.info("{}插入gs_client表", LOGGER_MSG); - gsClientMapper.insertList(list); - long endTime = System.currentTimeMillis(); - log.debug("{}任务结束,耗时:{}", LOGGER_MSG, endTime - startTime); } + log.info("{}删除gs_client表数据", LOGGER_MSG); + gsClientMapper.deleteAll(); + log.info("{}插入gs_client表", LOGGER_MSG); + gsClientMapper.insertList(list); + long endTime = System.currentTimeMillis(); + log.debug("{}任务结束,耗时:{}", LOGGER_MSG, endTime - startTime); + } catch (Exception e) { e.printStackTrace();