From 937d2d9462f8ce5536285568506cea9e280b2ca8 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Tue, 4 Jun 2024 13:59:43 +0800 Subject: [PATCH] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 4 +- .../web/controller/quot/QuotController.java | 16 ++++++ .../tool/quot/quotJswController.java | 53 ++++++++++++++++--- .../tool/quot/quotMaterialModel.java | 13 +++++ .../com/ruoyi/quot/domain/QuotMaterial.java | 15 +++++- .../com/ruoyi/quot/mapper/QuotMapper.java | 7 +++ .../com/ruoyi/quot/service/IQuotService.java | 6 +++ .../quot/service/impl/QuotServiceImpl.java | 9 ++++ .../main/resources/mapper/quot/QuotMapper.xml | 8 ++- 9 files changed, 119 insertions(+), 12 deletions(-) diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index 54b7363..f67dcdb 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Tue Jun 04 08:13:25 CST 2024 +#Tue Jun 04 13:59:05 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=d8I=KV+!D[+D!pL4TCjb[F!d9%S3gJ+,yj85yHvb$hqgCGl` +jco.client.passwd=g]8^b-oV5)bg?0=#[a~}U*AcfC4BmB/D}?F8E5.6%iG`lg]L jco.client.client=300 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 6f3b3b5..2623ca2 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 @@ -1,10 +1,12 @@ package com.ruoyi.web.controller.quot; import java.util.List; +import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.constant.WebsocketConst; import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileUploadUtils; @@ -15,6 +17,7 @@ import com.ruoyi.priceVerification.service.IQuotHjService; import com.ruoyi.quot.domain.QuotFile; import com.ruoyi.quot.domain.QuotMaterial; import com.ruoyi.quot.service.IQuotFileService; +import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysNoticeService; import com.ruoyi.technicalConfirm.domain.QuotJsqr; import com.ruoyi.technicalConfirm.service.IQuotJsqrService; @@ -44,6 +47,12 @@ import org.springframework.web.multipart.MultipartFile; @RequestMapping("/quot/quot") public class QuotController extends BaseController { + @Autowired + private RedisCache redisCache; + + @Autowired + private ISysConfigService configService; + @Autowired private IQuotService quotService; @@ -276,6 +285,13 @@ public class QuotController extends BaseController @PostMapping("/commitQuot") public AjaxResult commitQuot(@RequestBody Quot quot) { + // 每天限制提交200条 + String quotCommitCount = configService.selectConfigByKey("quot:commit:count"); + String count = quotService.selectQuotListCount(); + if(Integer.valueOf(count)>=Integer.valueOf(quotCommitCount)){ + return error("当前报价量已达极限,无法继续提供报价单"); + } + String quot_id = quot.getQuotId(); quot.setUpdateBy(getUsername()); 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 1994d96..aa85df1 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 @@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.quot.domain.Quot; import com.ruoyi.quot.domain.QuotMaterial; @@ -37,35 +38,65 @@ public class quotJswController extends BaseController { @PostMapping("/updateQuot") public R updateQuot(@RequestBody String quotJson) { - try{ - // 记录接口日志 - SysOperLog sysOperLog = new SysOperLog(); - sysOperLog.setTitle("金思维返回报价数据"); - sysOperLog.setOperParam(quotJson); - iSysOperLogService.insertOperlog(sysOperLog); + // 接口调用记录 + SysOperLog sysOperLog = new SysOperLog(); + sysOperLog.setTitle("金思维返回报价数据"); + sysOperLog.setOperParam(quotJson); + sysOperLog.setRequestMethod("POST"); + sysOperLog.setOperTime(DateUtils.getNowDate()); + long startTime = System.currentTimeMillis(); + try{ quotModel quot = JSON.parseObject(quotJson, quotModel.class); if(quot==null){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("参数异常为空"); } if(StringUtils.isBlank(quot.getQuotJswCode())){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("金思维报价单号不能为空"); } if(StringUtils.isBlank(quot.getQuotCode())){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("客户报价单号不能为空"); } if(StringUtils.isBlank(quot.getQuotTongPrice())){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("铜价不能为空"); } if(StringUtils.isBlank(quot.getQuotLvPrice())){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("铝价不能为空"); } if(StringUtils.isBlank(quot.getQuotMatpriceDiff())){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("整单料价价差率不能为空"); } List materials = quot.getQuotMaterial(); if(materials==null || materials.size()==0){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail("明细不能为空"); } @@ -91,8 +122,10 @@ public class quotJswController extends BaseController { quotMaterial.setMatMatprice(model.getMatMatprice()); quotMaterial.setMatPrice(model.getMatPrice()); quotMaterial.setMatQuotPrice(model.getMatQuotPrice()); + quotMaterial.setMatQuotTp(model.getMatQuotTp()); quotMaterial.setMatQuotAllPrice(model.getMatQuotAllPrice()); quotMaterial.setMatMatpriceDiff(model.getMatMatpriceDiff()); + quotMaterial.setXh(model.getXh()); quotMaterial.setIndex(model.getIndex()); qmaterials.add(quotMaterial); } @@ -100,9 +133,17 @@ public class quotJswController extends BaseController { q.setQuotMaterialList(qmaterials); quotService.updateQuot(q); }catch(Exception e){ + sysOperLog.setStatus(1); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.fail(e.getMessage()); } + sysOperLog.setStatus(0); + long endTime = System.currentTimeMillis(); + sysOperLog.setCostTime(endTime - startTime); + iSysOperLogService.insertOperlog(sysOperLog); return R.ok(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java index a20422a..1d71a9e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/quot/quotMaterialModel.java @@ -7,6 +7,10 @@ import java.math.BigDecimal; @ApiModel(value = "quotMaterialModel", description = "报价单产品明细") public class quotMaterialModel { + + @ApiModelProperty("序号") + private Integer xh;//序号 + @ApiModelProperty("行号") private Integer index;//行号 @@ -40,12 +44,18 @@ public class quotMaterialModel { @ApiModelProperty("报价") private BigDecimal matQuotPrice;//报价 + @ApiModelProperty("特批下点") + private BigDecimal matQuotTp;//特批下点 + @ApiModelProperty("报价金额") private BigDecimal matQuotAllPrice;//报价金额 @ApiModelProperty("料价价差率") private BigDecimal matMatpriceDiff;//料价价差率 + public Integer getXh() { return xh; } + public void setXh(Integer xh) { this.xh = xh; } + public Integer getIndex() { return index; } public void setIndex(Integer index) { this.index = index; } @@ -119,6 +129,9 @@ public class quotMaterialModel { this.matQuotPrice = matQuotPrice; } + public BigDecimal getMatQuotTp() { return matQuotTp; } + public void setMatQuotTp(BigDecimal matQuotTp) { this.matQuotTp = matQuotTp; } + public BigDecimal getMatQuotAllPrice() { return matQuotAllPrice; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java index 666d484..ad9c4f6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/domain/QuotMaterial.java @@ -56,14 +56,19 @@ public class QuotMaterial extends BaseEntity /** 报价 */ private BigDecimal matQuotPrice; + /** 特批下点 */ + private BigDecimal matQuotTp; + /** 报价金额 */ private BigDecimal matQuotAllPrice; /** 料价价差率 */ private BigDecimal matMatpriceDiff; - /** 排序 */ - private Integer index;//序号 + /** 序号 */ + private Integer xh;//序号 + /** 行号 */ + private Integer index;//行号 /** */ private String quotId; @@ -137,12 +142,18 @@ public class QuotMaterial extends BaseEntity public BigDecimal getMatQuotPrice() { return matQuotPrice; } public void setMatQuotPrice(BigDecimal matQuotPrice) { this.matQuotPrice = matQuotPrice; } + public BigDecimal getMatQuotTp() { return matQuotTp; } + + public void setMatQuotTp(BigDecimal matQuotTp) { this.matQuotTp = matQuotTp; } public BigDecimal getMatQuotAllPrice() { return matQuotAllPrice; } public void setMatQuotAllPrice(BigDecimal matQuotAllPrice) { this.matQuotAllPrice = matQuotAllPrice; } public BigDecimal getMatMatpriceDiff() { return matMatpriceDiff; } public void setMatMatpriceDiff(BigDecimal matMatpriceDiff) { this.matMatpriceDiff = matMatpriceDiff; } + public Integer getXh() { return xh; } + + public void setXh(Integer xh) { this.xh = xh; } public Integer getIndex() { return index; } public void setIndex(Integer index) { this.index = index; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java index cbb2ee4..b71ae09 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/mapper/QuotMapper.java @@ -36,6 +36,12 @@ public interface QuotMapper */ public List selectQuotList(Quot quot); + /** + * 统计当天协助中、已协助的报价单数量 + * @return + */ + String selectQuotListCount(); + /** * 新增报价 * @@ -115,4 +121,5 @@ public interface QuotMapper * @return */ String checkExistQuot(@Param("quotSalesmanCode") String username, @Param("quotCustomerBm") String quotCustomerBm, @Param("quotProject") String quotProject); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java index 20d355a..2907572 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/IQuotService.java @@ -37,6 +37,12 @@ public interface IQuotService */ public List selectQuotList(Quot quot); + /** + * 统计当天协助中、已协助的报价单数量 + * @return + */ + String selectQuotListCount(); + /** * 新增报价 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java index 265d696..b04d608 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quot/service/impl/QuotServiceImpl.java @@ -63,6 +63,15 @@ public class QuotServiceImpl implements IQuotService return quotMapper.selectQuotList(quot); } + /** + * 统计当天协助中、已协助的报价单数量 + * @return + */ + @Override + public String selectQuotListCount() { + return quotMapper.selectQuotListCount(); + } + /** * 新增报价 * diff --git a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml index 7c935a7..11c1048 100644 --- a/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quot/QuotMapper.xml @@ -139,6 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by a.update_time desc + +