From 7a11ccd71f7efcfb36abd592d9eaaaf60b3e74c8 Mon Sep 17 00:00:00 2001 From: yefei Date: Fri, 19 May 2023 11:06:46 +0800 Subject: [PATCH 1/6] =?UTF-8?q?ariesy=20=E6=97=A0=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=EF=BC=8C=E5=86=8D=E6=AC=A1=E6=9F=A5=E9=AA=8C?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SDNYMainProcessController.java | 73 ++++++++++++------- 1 file changed, 45 insertions(+), 28 deletions(-) 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 d9772285..55c6bd00 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 @@ -110,7 +110,7 @@ public class SDNYMainProcessController extends AbstractController { @PostMapping("/singleInvoiceCheck") @ResponseBody @SysLog("发票查验") - public ResponseEntity singleInvoiceCheck(@RequestBody Map pramsMap) throws ParseException { + public ResponseEntity singleInvoiceCheck(@RequestBody Map pramsMap) throws Exception { log.info("传入的参数为:{}", pramsMap); String userid = "101833"; String dbName = "business"; @@ -165,7 +165,7 @@ public class SDNYMainProcessController extends AbstractController { return ResponseEntity.ok(JSONObject.toJSONString(R.error("金额不能为空!"))); } } else { - if (StringUtils.isBlank(pramsMap.get("checkCode"))){ + if (StringUtils.isBlank(pramsMap.get("checkCode"))) { return ResponseEntity.ok(JSONObject.toJSONString(R.error("校验码不能为空!"))); } } @@ -184,7 +184,7 @@ public class SDNYMainProcessController extends AbstractController { } //非通行费类发票 先判断底账库中是否已存在 - if(!"32000".equals(pramsMap.get("invoiceType"))) { + if (!"32000".equals(pramsMap.get("invoiceType"))) { //查询底账库是否有对应发票,有则直接返回 QueryWrapper recordWrapper = new QueryWrapper<>(); recordWrapper.eq("uuid", uuid); @@ -197,9 +197,26 @@ public class SDNYMainProcessController extends AbstractController { detailWrapper.eq("uuid", uuid); DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); List baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); - DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); + if(baseTDxRecordInvoiceDetail != null && baseTDxRecordInvoiceDetail.size() == 0){ + //先删除原有主数据,再查验更新主数据和明细数据 + int delete = baseTDxRecordInvoiceDao.delete(recordWrapper); + if(delete > 0) { + checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); + + if (!checkInvoiceResult.containsKey("code")) { + if (!checkInvoiceResult.containsKey("cyjg")) { + checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber")); + signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName); + } + } + DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); + baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); + DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); + } + } + JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid); JSONArray checkInvoiceDetail = (JSONArray) JSONObject.toJSON(baseTDxRecordInvoiceDetail); @@ -240,8 +257,8 @@ public class SDNYMainProcessController extends AbstractController { } try { - checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); - log.info("查验结果为:{}", checkInvoiceResult); + checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); + log.info("查验结果为:{}", checkInvoiceResult); } catch (Exception e) { e.printStackTrace(); } @@ -312,7 +329,7 @@ public class SDNYMainProcessController extends AbstractController { private R errorInfo(JSONObject checkInvoiceResult, R data) { if ("0002".equals(checkInvoiceResult.getString("cyjg"))) { - data = new R(1002, checkInvoiceResult.getString("cyjgxx")); + data = new R(1002, checkInvoiceResult.getString("cyjgxx")); } if ("0005".equals(checkInvoiceResult.getString("cyjg"))) { @@ -375,7 +392,7 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("totalAmount", checkInvoice.getString("invoiceAmount")); //添加非空判断 String invoiceCode = null; - if ( checkInvoice.get("invoiceCode") != null){ + if (checkInvoice.get("invoiceCode") != null) { invoiceCode = checkInvoice.get("invoiceCode").toString(); } String invoiceType = checkInvoice.get("invoiceType").toString(); @@ -390,10 +407,10 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("administrativeDivisionNo", ""); checkInvoice.put("administrativeDivisionName", ""); - if("31".equals(invoiceType) || "32".equals(invoiceType) || "185".equals(invoiceType) || "186".equals(invoiceType)){ + if ("31".equals(invoiceType) || "32".equals(invoiceType) || "185".equals(invoiceType) || "186".equals(invoiceType)) { checkInvoice.put("invoiceCode", ""); - checkInvoice.put("invoiceNumber", invoiceCode == null ? checkInvoice.get("invoiceNo").toString() :invoiceCode + checkInvoice.get("invoiceNo").toString()); - }else { + checkInvoice.put("invoiceNumber", invoiceCode == null ? checkInvoice.get("invoiceNo").toString() : invoiceCode + checkInvoice.get("invoiceNo").toString()); + } else { checkInvoice.put("invoiceCode", invoiceCode); checkInvoice.put("invoiceNumber", checkInvoice.get("invoiceNo").toString()); } @@ -452,10 +469,10 @@ public class SDNYMainProcessController extends AbstractController { Float hjje = null; if (detail.getString("detailAmount") != null && detail.getString("taxAmount") != null) { Float je = Float.parseFloat(detail.getString("detailAmount")); - if(detail.getString("taxAmount") != null) { + if (detail.getString("taxAmount") != null) { Float se = Float.parseFloat(detail.getString("taxAmount")); hjje = je + se; - }else{ + } else { hjje = je; } } @@ -531,7 +548,7 @@ public class SDNYMainProcessController extends AbstractController { String company = ""; String taxno = ""; String taxname = ""; - if(orgByCompCode != null) { + if (orgByCompCode != null) { company = orgByCompCode.getCompany(); taxno = orgByCompCode.getTaxno(); taxname = orgByCompCode.getTaxname(); @@ -650,7 +667,7 @@ public class SDNYMainProcessController extends AbstractController { } } } catch (Exception exception) { - log.error("同步SAP失败,报错信息为:{}",exception); + log.error("同步SAP失败,报错信息为:{}", exception); exception.printStackTrace(); } return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY))); @@ -759,7 +776,7 @@ public class SDNYMainProcessController extends AbstractController { List sapInvoiceDetailList = new ArrayList<>(); //查询明细 String uuid = snInvoice.getInvoiceCode() + snInvoice.getInvoiceNumber(); - if (StringUtils.isBlank(snInvoice.getInvoiceCode())){ + if (StringUtils.isBlank(snInvoice.getInvoiceCode())) { uuid = snInvoice.getInvoiceNumber(); } DynamicContextHolder.push("business" + DbConstant.DETAIL_READ); @@ -788,7 +805,7 @@ public class SDNYMainProcessController extends AbstractController { //将类似于0.03数据格式转化为3.00 if (snInvoiceDetail.getTaxRate() != null && snInvoiceDetail.getTaxRate() != "") { sapInvoiceDetail.setZTAX(snInvoiceDetail.getTaxRate()); - if ( "0".equals(snInvoiceDetail.getTaxRate())){ + if ("0".equals(snInvoiceDetail.getTaxRate())) { sapInvoiceDetail.setZTAX("0.00"); // sapInvoiceDetail.setZSM(sapInvoiceDetail.getZTAX()); } @@ -802,7 +819,7 @@ public class SDNYMainProcessController extends AbstractController { BigDecimal tax1 = tax.multiply(new BigDecimal("100")); sapInvoiceDetail.setZTAX(tax1.toString()); } - if (snInvoiceDetail.getTaxRate().contains("%") && !snInvoiceDetail.getTaxRate().contains(".")){ + if (snInvoiceDetail.getTaxRate().contains("%") && !snInvoiceDetail.getTaxRate().contains(".")) { String replace = snInvoiceDetail.getTaxRate().replace("%", ".00"); sapInvoiceDetail.setZTAX(replace); } @@ -818,11 +835,11 @@ public class SDNYMainProcessController extends AbstractController { sapInvoiceDetail.setZCYR(info.getZCYRMC()); sapInvoiceDetail.setZDW(snInvoiceDetail.getUnit()); sapInvoiceDetail.setZGSJBM(snInvoiceDetail.getCommodityCode()); - if (StringUtils.isNotBlank(snInvoiceDetail.getTax())){ + if (StringUtils.isNotBlank(snInvoiceDetail.getTax())) { sapInvoiceDetail.setZSE(snInvoiceDetail.getTax()); - }else { - if (detailInfo != null && !detailInfo.isEmpty()){ + } else { + if (detailInfo != null && !detailInfo.isEmpty()) { for (InvoiceDetailInfo invoiceDetailInfo : detailInfo) { if (StringUtils.isNotBlank(invoiceDetailInfo.getDetailNo()) && invoiceDetailInfo.getDetailNo().equals(snInvoiceDetail.getRowNo())) { sapInvoiceDetail.setZSE(invoiceDetailInfo.getTaxAmount()); @@ -832,10 +849,10 @@ public class SDNYMainProcessController extends AbstractController { } sapInvoiceDetail.setZSL(snInvoiceDetail.getQuantity()); String zsmTax = snInvoiceDetail.getTaxRate(); - if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4){ - zsmTax = zsmTax.substring(0,4); + if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4) { + zsmTax = zsmTax.substring(0, 4); } - if (zsmTax != null && zsmTax.contains("%") && !zsmTax.contains(".")){ + if (zsmTax != null && zsmTax.contains("%") && !zsmTax.contains(".")) { zsmTax = (new BigDecimal(zsmTax.replace("%", ""))).divide(new BigDecimal("100")).toString(); } // sapInvoiceDetail.setZSM(getZSM(snInvoiceDetail.getTaxRate())); @@ -869,16 +886,16 @@ public class SDNYMainProcessController extends AbstractController { info.setZTAX(replace + ".00"); info.setZSM(getZSM(divide.toString())); } - if (taxRate != null && taxRate.contains(".") && !taxRate.contains("%")){ - if (taxRate.length() >4){ - taxRate = taxRate.substring(0,4); + if (taxRate != null && taxRate.contains(".") && !taxRate.contains("%")) { + if (taxRate.length() > 4) { + taxRate = taxRate.substring(0, 4); BigDecimal tax = new BigDecimal(taxRate); info.setZSM(getZSM(tax.toString())); BigDecimal tax1 = tax.multiply(new BigDecimal("100")); info.setZTAX(tax1.toString()); } } - if (taxRate != null && "0".equals(taxRate)){ + if (taxRate != null && "0".equals(taxRate)) { info.setZTAX("0.00"); info.setZSM(getZSM(info.getZTAX())); } From 7f6ce8f3ae4e0e50bd4739514a0496e133d26eb0 Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 21 May 2023 10:31:07 +0800 Subject: [PATCH 2/6] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=9C=BA?= =?UTF-8?q?=E5=8A=A8=E8=BD=A6=E5=8F=91=E7=A5=A8=E6=9F=A5=E9=AA=8C=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../singletable/impl/CoreSaveInvoiceInfoServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java index 7220607d..e2024b02 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java @@ -120,10 +120,12 @@ public class CoreSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl Date: Sun, 21 May 2023 10:48:40 +0800 Subject: [PATCH 3/6] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=9C=BA?= =?UTF-8?q?=E5=8A=A8=E8=BD=A6=E5=8F=91=E7=A5=A8=E6=9F=A5=E9=AA=8C=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../singletable/impl/CoreSaveInvoiceInfoServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java index e2024b02..b5546b8b 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java @@ -120,7 +120,8 @@ public class CoreSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl Date: Sun, 21 May 2023 11:00:35 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CoreSaveInvoiceInfoServiceImpl.java | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java index b5546b8b..3af11ec6 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java @@ -121,18 +121,24 @@ public class CoreSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl slvMap = new HashMap<>(16); for (int i = 0; i < dataArray.size(); i++) { JSONObject invoiceDetailQuery = dataArray.getJSONObject(i); - String slvPri = queryInvoiceResult.getString("invoiceCode") - + queryInvoiceResult.getString("invoiceNo") + invoiceDetailQuery.getString("taxRate"); + String taxRate = invoiceDetailQuery.getString("taxRate"); + if(StringUtils.isEmpty(taxRate)){ + taxRate = ""; + } + String slvPri = queryInvoiceResult.getString("invoiceCode") + queryInvoiceResult.getString("invoiceNo") + taxRate; if (!slvMap.containsKey(slvPri)) { slvMap.put(slvPri, slvPri); TDxRecordInvoiceStatistics invoiceStatistics = new TDxRecordInvoiceStatistics(); invoiceStatistics.setCreateDate(DateUtils.getSqlDateLong()); invoiceStatistics.setInvoiceCode(queryInvoiceResult.getString("invoiceCode")); invoiceStatistics.setInvoiceNo(queryInvoiceResult.getString("invoiceNo")); - invoiceStatistics.setDetailAmount(invoiceDetailQuery.getBigDecimal("detailAmount")); - try { - invoiceStatistics.setTaxRate(invoiceDetailQuery.getBigDecimal("taxRate")); - } catch (Exception e) { - invoiceStatistics.setTaxRate(new BigDecimal("0")); - } - try { - invoiceStatistics.setTaxAmount(invoiceDetailQuery.getBigDecimal("taxAmount")); - } catch (Exception e) { - invoiceStatistics.setTaxAmount(new BigDecimal("0")); + if(StringUtils.isNotBlank(taxRate)){ + try { + invoiceStatistics.setTaxRate(invoiceDetailQuery.getBigDecimal("taxRate")); + } catch (Exception e) { + invoiceStatistics.setTaxRate(new BigDecimal("0")); + } } String detailAmount = invoiceDetailQuery.getString("detailAmount"); String taxAmount = invoiceDetailQuery.getString("taxAmount"); + if(StringUtils.isNotBlank(detailAmount)){ + invoiceStatistics.setDetailAmount(invoiceDetailQuery.getBigDecimal("detailAmount")); + } + if(StringUtils.isNotBlank(taxAmount)){ + try { + invoiceStatistics.setTaxAmount(invoiceDetailQuery.getBigDecimal("taxAmount")); + } catch (Exception e) { + invoiceStatistics.setTaxAmount(new BigDecimal("0")); + } + } if (StringUtils.isNotBlank(detailAmount) && StringUtils.isNotBlank(taxAmount)) { try { detailAmount = new BigDecimal(detailAmount).toPlainString(); From 6ae0a425660a46bef5896717268f954aa31c9c3d Mon Sep 17 00:00:00 2001 From: yefei Date: Sun, 21 May 2023 11:27:31 +0800 Subject: [PATCH 5/6] =?UTF-8?q?ariesy=20=E4=BF=AE=E5=A4=8D=E6=9C=BA?= =?UTF-8?q?=E5=8A=A8=E8=BD=A6=E5=8F=91=E7=A5=A8=E6=9F=A5=E9=AA=8C=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../singletable/impl/CoreSaveInvoiceInfoServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java index 3af11ec6..42bc0a50 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java +++ b/dxhy-core/src/main/java/com/dxhy/core/service/singletable/impl/CoreSaveInvoiceInfoServiceImpl.java @@ -125,7 +125,11 @@ public class CoreSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl Date: Tue, 23 May 2023 16:21:38 +0800 Subject: [PATCH 6/6] =?UTF-8?q?ariesy=20=E6=96=B0=E5=A2=9E=E9=9C=80?= =?UTF-8?q?=E6=B1=82:=201.=E6=A0=B9=E6=8D=AE=E6=8A=A5=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=BF=94=E5=9B=9E=E6=8F=90=E7=A4=BA=E8=AF=AD=202.?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E6=A0=B9=E6=8D=AE=E5=BD=93=E5=89=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E9=80=89=E6=8B=A9=E7=9A=84=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/sys/controller/SysDeptController.java | 4 ++-- .../com/dxhy/admin/sys/service/SysDeptService.java | 9 +++++++++ .../sys/service/impl/SsoLoginServiceImpl.java | 6 ++++++ .../admin/sys/service/impl/SysDeptServiceImpl.java | 7 +++++++ .../com/dxhy/common/constant/CommonConstants.java | 11 +++++++++++ .../common/service/impl/DictdetaServciceImpl.java | 3 +++ .../erp/controller/SDNYMainProcessController.java | 14 ++++++++++++-- 7 files changed, 50 insertions(+), 4 deletions(-) diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/controller/SysDeptController.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/controller/SysDeptController.java index b1fa58a7..a0c8720a 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/controller/SysDeptController.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/controller/SysDeptController.java @@ -45,14 +45,14 @@ public class SysDeptController extends AbstractController { * 列表 */ @RequestMapping("/list") - public ResponseEntity list() { + public ResponseEntity list(@RequestBody long deptId) { String company = ""; UserInfo userInfo = getUserInfo(); if (Long.parseLong(getUserId()) != Constant.SUPER_ADMIN && !userInfo.getCompany().contains(SysConfig.ZXQY)) { company = userInfo.getCompany(); } - List deptList = sysDeptService.queryList(company); + List deptList = sysDeptService.queryList(company,deptId); log.info("树状信息:{}", JSON.toJSONString(deptList)); return ResponseEntity.ok(R.ok().put("data", deptList)); } diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysDeptService.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysDeptService.java index c7752c51..00594071 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysDeptService.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysDeptService.java @@ -22,6 +22,15 @@ public interface SysDeptService extends IService { */ List queryList(String company); + /** + * 根据集团编码获取部门信息 + * + * @param company + * 集团编码 + * @return 部门信息 + */ + List queryList(String company,long parentId); + /** * 根据集团编码获取用户关联信息 * diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java index 61fae781..65efa7bc 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java @@ -58,6 +58,9 @@ public class SsoLoginServiceImpl implements SsoLoginService { boolean insertRole = this.insertRole(user); // 保存用户信息 boolean insertUser = this.insertUser(user); + + log.info("insertOrg = {},insertRole={},insertUser",insertOrg,insertRole,insertUser); + // 刷新用户缓存 sysUserService.refreshCache(false, user.getUsername()); return insertOrg && insertUser && insertRole; @@ -75,6 +78,7 @@ public class SsoLoginServiceImpl implements SsoLoginService { sysUserService.saveUser(userEntity); return true; } catch (Exception e) { + log.error("insertUser 报错信息为{}",e); e.printStackTrace(); return false; } @@ -92,6 +96,7 @@ public class SsoLoginServiceImpl implements SsoLoginService { } return true; } catch (Exception e) { + log.error("insertRole 报错信息为{}",e); e.printStackTrace(); return false; } @@ -113,6 +118,7 @@ public class SsoLoginServiceImpl implements SsoLoginService { } return true; } catch (Exception e) { + log.error("insertOrg 报错信息为{}",e); e.printStackTrace(); return false; } diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysDeptServiceImpl.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysDeptServiceImpl.java index daf09f8f..afe54c19 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysDeptServiceImpl.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysDeptServiceImpl.java @@ -54,6 +54,13 @@ public class SysDeptServiceImpl extends ServiceImpl i return this.getChildPerms(deptList, parentId); } + @Override + public List queryList(String company, long parentId) { + DynamicContextHolder.push(DbConstant.BASICS_READ); + List deptList = baseMapper.queryList(company); + return this.getChildPerms(deptList, parentId); + } + /** * 根据父节点的ID获取所有子节点 * diff --git a/dxhy-common/src/main/java/com/dxhy/common/constant/CommonConstants.java b/dxhy-common/src/main/java/com/dxhy/common/constant/CommonConstants.java index 1fd3ab8f..2df3f3e6 100644 --- a/dxhy-common/src/main/java/com/dxhy/common/constant/CommonConstants.java +++ b/dxhy-common/src/main/java/com/dxhy/common/constant/CommonConstants.java @@ -60,6 +60,17 @@ public class CommonConstants { * 默认返回页面的错误信息 */ public static final String MSG_ERR_PUSH_SDNY = "推送数据到sap失败!"; + + /** + * 超时的错误信息 + */ + public static final String CONNECT_TIMEOUT = "网络超时,请稍后重试!"; + + /** + * 空指针的错误信息 + */ + public static final String NULL_POINTER_TIMEOUT = "系统错误,请稍后重试!"; + /** * 默认返回页面的成功信息 */ diff --git a/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java b/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java index f2a9b816..7cf18049 100644 --- a/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java +++ b/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java @@ -7,6 +7,7 @@ import java.util.stream.Collectors; import javax.annotation.Resource; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -20,6 +21,7 @@ import com.dxhy.common.vo.DictdetaModel; * @author jiaohongyang */ @Service("dictdetaServcice") +@Slf4j public class DictdetaServciceImpl implements DictdetaServcice { @Resource private RedisUtils redisUtils; @@ -32,6 +34,7 @@ public class DictdetaServciceImpl implements DictdetaServcice { @Override public String queryDictName(String type,String code) { + log.info("type={},code={}",type,code); String dictJson = redisUtils.get(RedisConstant.KEY_DICT + type); List dictdetaModels = JSON.parseArray(dictJson, DictdetaModel.class); Map collect = dictdetaModels.stream().collect(Collectors.toMap(DictdetaModel::getDictcode, DictdetaModel::getDictname)); 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 55c6bd00..fc98e346 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 @@ -35,6 +35,7 @@ import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.TimeoutException; /** * 山东能源查验主流程控制器 @@ -666,11 +667,20 @@ public class SDNYMainProcessController extends AbstractController { } } - } catch (Exception exception) { + } catch (TimeoutException exception) { log.error("同步SAP失败,报错信息为:{}", exception); exception.printStackTrace(); + return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT))); + } catch(NullPointerException exception){ + log.error("同步SAP失败,报错信息为:{}", exception); + exception.printStackTrace(); + return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT))); + } catch(Exception exception){ + log.error("同步SAP失败,报错信息为:{}", exception); + exception.printStackTrace(); + return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); } - return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY))); + }