This commit is contained in:
xd 2024-06-05 08:44:12 +08:00
parent eda91f92ee
commit 14465188a6
4 changed files with 81 additions and 13 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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<quotMaterialModel> 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();
}