From 14465188a655fd05e8d91d03f01cd7bc1e5cab1d Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 5 Jun 2024 08:44:12 +0800 Subject: [PATCH] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 4 +- .../customer/CustomerController.java | 10 ++- .../web/controller/quot/QuotController.java | 13 +++- .../tool/quot/quotJswController.java | 67 ++++++++++++++++--- 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index decb9d9..42afebd 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Tue Jun 04 14:39:31 CST 2024 +#Tue Jun 04 16:46:03 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.120 @@ -7,5 +7,5 @@ jco.client.saprouter= jco.client.user=RFC jco.client.sysnr=00 jco.destination.peak_limit=10 -jco.client.passwd=g5KKZrvN-+Xtpu=Z,M*tL_-D%OFI;:Yt+;TW!Ku,Y~NxIG%z +jco.client.passwd=654321 jco.client.client=300 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java index 9861aba..970b630 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java @@ -141,7 +141,15 @@ public class CustomerController extends BaseController public AjaxResult getReturnUpdateInfo(@PathVariable("cusId") String cusId) { Customer customer = customerService.selectCustomerByCusId(cusId); - customer.setCusApprovalStatus("1");// 提交状态设置为 审核中 + if("2".equals(customer.getCusApprovalStatus())){ + customer.setCusApprovalStatus("1");// 提交状态设置为 审核中 + }else if("0".equals(customer.getCusApprovalStatus())){ + return error("该客户当前状态为【待提交】状态,无法修改"); + }else if("1".equals(customer.getCusApprovalStatus())){ + return error("该客户当前状态为【审批中】状态,无法修改"); + }else if("3".equals(customer.getCusApprovalStatus())){ + return error("该报价单当前状态为【已驳回】状态,无法修改"); + } return success(customer); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 2623ca2..111d37b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -126,8 +126,17 @@ public class QuotController extends BaseController public AjaxResult getReturnUpdateInfo(@PathVariable("quotId") String quotId) { Quot quot = quotService.selectQuotByQuotId(quotId); - quot.setQuotApprovalStatus("1");// 提交状态设置为 协助中 - quotService.updateQuot(quot); + if("2".equals(quot.getQuotApprovalStatus())){ + quot.setQuotApprovalStatus("1");// 提交状态设置为 协助中 + quotService.updateQuot(quot); + }else if("0".equals(quot.getQuotApprovalStatus())){ + return error("该报价单当前状态为【待提交】状态,无法修改"); + }else if("1".equals(quot.getQuotApprovalStatus())){ + return error("该报价单当前状态为【协助中】状态,无法修改"); + }else if("3".equals(quot.getQuotApprovalStatus())){ + return error("该报价单当前状态为【已驳回】状态,无法修改"); + } + return success(quot); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java index aa85df1..a46cd80 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotJswController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.tool.quot; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson2.JSON; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -49,60 +50,106 @@ public class quotJswController extends BaseController { try{ quotModel quot = JSON.parseObject(quotJson, quotModel.class); if(quot==null){ + String errMsg = "参数异常为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("参数异常为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotJswCode())){ + String errMsg = "金思维报价单号为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("金思维报价单号不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotCode())){ + String errMsg = "客户报价单号为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("客户报价单号不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotTongPrice())){ + String errMsg = "铜价为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("铜价不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotLvPrice())){ + String errMsg = "铝价为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("铝价不能为空"); + return R.fail(errMsg); } if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){ + String errMsg = "整单料价价差率为空,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("整单料价价差率不能为空"); + return R.fail(errMsg); } List materials = quot.getQuotMaterial(); if(materials==null || materials.size()==0){ + String errMsg = "无明细数据,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail("明细不能为空"); + return R.fail(errMsg); } // 更新报价单 String quotId = quotService.selectQuotByQuotCode(quot.getQuotCode()); + if(StringUtils.isEmpty(quotId)){ + String errMsg = "报价单号:"+quot.getQuotCode()+" 系统中不存在,同步失败"; + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); + iSysOperLogService.insertOperlog(sysOperLog); + return R.fail(errMsg); + } + Quot q = quotService.selectQuotByQuotId(quotId); + String quotApprovalStatus = q.getQuotApprovalStatus(); + if(!"1".equals(quotApprovalStatus)){ + String errMsg = "报价单号:"+quot.getQuotCode()+" 非协助中状态,同步失败"; + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); + iSysOperLogService.insertOperlog(sysOperLog); + return R.fail(errMsg); + } + + + q.setQuotJswCode(quot.getQuotJswCode()); q.setQuotLvPrice(quot.getQuotLvPrice()); q.setQuotTongPrice(quot.getQuotTongPrice()); @@ -133,16 +180,20 @@ public class quotJswController extends BaseController { q.setQuotMaterialList(qmaterials); quotService.updateQuot(q); }catch(Exception e){ + String errMsg = "接口异常,同步失败"; sysOperLog.setStatus(1); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setErrorMsg(errMsg); + sysOperLog.setJsonResult(JSONArray.toJSONString(R.fail(errMsg))); iSysOperLogService.insertOperlog(sysOperLog); - return R.fail(e.getMessage()); + return R.fail(errMsg); } sysOperLog.setStatus(0); long endTime = System.currentTimeMillis(); sysOperLog.setCostTime(endTime - startTime); + sysOperLog.setJsonResult(R.ok().toString()); iSysOperLogService.insertOperlog(sysOperLog); return R.ok(); }