From a2ab7857147b2dd2816bd43a3129ce2fcab0e245 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 17 Jul 2024 17:22:18 +0800 Subject: [PATCH] '1122' --- .../web/controller/bid/BidController.java | 49 +++++++++++++++ .../ruoyi/common/constant/CacheConstants.java | 5 ++ .../java/com/ruoyi/bid/mapper/BidMapper.java | 12 ++++ .../com/ruoyi/bid/service/IBidService.java | 13 ++++ .../bid/service/impl/BidServiceImpl.java | 19 ++++++ .../main/resources/mapper/bid/BidMapper.xml | 16 +++++ ruoyi-ui/src/api/bid/bid.js | 11 ++++ ruoyi-ui/src/views/bid/bid/index.vue | 61 +++++++++++++------ 8 files changed, 166 insertions(+), 20 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java index be0c0db..3dbacb6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java @@ -4,7 +4,11 @@ import javax.servlet.http.HttpServletResponse; import com.ruoyi.bid.domain.BidFile; import com.ruoyi.bid.domain.SysOaBid; import com.ruoyi.bid.service.IBidFileService; +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; @@ -12,10 +16,13 @@ import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.MinioUtil; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.quot.domain.Quot; +import com.ruoyi.redBook.domain.OAQuot; +import com.ruoyi.redBook.domain.RbVersionDateResult; import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.technicalConfirm.domain.BidJsqr; import com.ruoyi.technicalConfirm.service.IBidJsqrService; import com.ruoyi.technicalConfirm.service.IQuotJsqrService; +import org.apache.commons.collections.CollectionUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -51,6 +58,10 @@ public class BidController extends BaseController @Autowired private ISysDeptService deptService; + @Autowired + private RedisCache redisCache; + + /** * 分派 */ @@ -411,4 +422,42 @@ public class BidController extends BaseController bidService.updateBid(bid); return success(); } + + /** + * 获取调价日期 + * @param oAQuot + * @return + */ + @DataSource(DataSourceType.OAREDBOOK) + @GetMapping("/versionList") + public AjaxResult versionList(OAQuot oAQuot) + { + AjaxResult ajax = AjaxResult.success(); + + List resCache = redisCache.getCacheObject(getCacheKey("versionBidList")); + if(CollectionUtils.isEmpty(resCache)){ + resCache = bidService.versionList(); + redisCache.setCacheObject(getCacheKey("versionBidList"),resCache); + }else{ + // 判断是否有最新调价 + String maxUid = resCache.get(0).getValue();//获取缓存里最新调价版本 + String rb_price_version = bidService.rb_price_version();//获取电子红本最新的调价版本 + if(!rb_price_version.equals(maxUid)){ + resCache = bidService.versionList(); + redisCache.setCacheObject(getCacheKey("versionBidList"),resCache); + } + } + ajax.put("versionList", resCache); + return ajax; + } + + /** + * 获取redis 调价日期 + * @param type + * @return + */ + private String getCacheKey(String type) + { + return CacheConstants.RB_VERSION_BID_DATE + type; + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index 6b1df2d..36fbaad 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -62,6 +62,11 @@ public class CacheConstants */ public static final String RB_VERSION_DATE = "rb_version_date:"; + /** + * 调价日期数据-投标用 redis key + */ + public static final String RB_VERSION_BID_DATE = "rb_version_bid_date:"; + /** * 企查查客户查询次数 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/bid/mapper/BidMapper.java b/ruoyi-system/src/main/java/com/ruoyi/bid/mapper/BidMapper.java index c023c9c..4337a4a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bid/mapper/BidMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bid/mapper/BidMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.bid.mapper; import java.util.List; import com.ruoyi.bid.domain.Bid; import com.ruoyi.bid.domain.SysOaBid; +import com.ruoyi.redBook.domain.RbVersionDateResult; /** * 投标信息Mapper接口 @@ -86,4 +87,15 @@ public interface BidMapper */ void insertSysOABid(SysOaBid sysOaBid); + /** + * 获取调价日期 + * @return + */ + List versionList(); + + /** + * 获取本地记录的调价版本 + * @return + */ + String rb_price_version(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bid/service/IBidService.java b/ruoyi-system/src/main/java/com/ruoyi/bid/service/IBidService.java index 9c0e6ca..b799be3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bid/service/IBidService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bid/service/IBidService.java @@ -4,6 +4,7 @@ import java.util.List; import com.ruoyi.bid.domain.Bid; import com.ruoyi.bid.domain.SysOaBid; import com.ruoyi.quot.domain.Quot; +import com.ruoyi.redBook.domain.RbVersionDateResult; /** * 投标信息Service接口 @@ -88,4 +89,16 @@ public interface IBidService */ void insertSysOABid(SysOaBid sysOaBid); + /** + * 获取调价日期 + * @return + */ + List versionList(); + + /** + * 获取本地记录的调价版本 + * @return + */ + String rb_price_version(); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bid/service/impl/BidServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bid/service/impl/BidServiceImpl.java index ad6c550..9b160de 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bid/service/impl/BidServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bid/service/impl/BidServiceImpl.java @@ -7,6 +7,7 @@ import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.redBook.domain.RbVersionDateResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.bid.mapper.BidMapper; @@ -139,4 +140,22 @@ public class BidServiceImpl implements IBidService public void insertSysOABid(SysOaBid sysOaBid) { bidMapper.insertSysOABid(sysOaBid); } + + /** + * 获取调价日期 + * @return + */ + @Override + public List versionList() { + return bidMapper.versionList(); + } + + /** + * 获取本地记录的调价版本 + * @return + */ + @Override + public String rb_price_version() { + return bidMapper.rb_price_version(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/bid/BidMapper.xml b/ruoyi-system/src/main/resources/mapper/bid/BidMapper.xml index 732aabe..04ceb94 100644 --- a/ruoyi-system/src/main/resources/mapper/bid/BidMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/bid/BidMapper.xml @@ -438,4 +438,20 @@ where a.bid_jsxz_confirm_id = #{bidJsqrId} + + + + diff --git a/ruoyi-ui/src/api/bid/bid.js b/ruoyi-ui/src/api/bid/bid.js index 6eb4ac8..d0661c3 100644 --- a/ruoyi-ui/src/api/bid/bid.js +++ b/ruoyi-ui/src/api/bid/bid.js @@ -8,6 +8,7 @@ export function bidAssign(query) { data: query }) } + // 查询投标信息列表 export function listBid(query) { return request({ @@ -95,3 +96,13 @@ export function rejectBid(data) { data: data }) } + + +//获取调价日期 +export function versionList(query) { + return request({ + url: '/bid/bid/versionList', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/views/bid/bid/index.vue b/ruoyi-ui/src/views/bid/bid/index.vue index 946c2bb..0920c40 100644 --- a/ruoyi-ui/src/views/bid/bid/index.vue +++ b/ruoyi-ui/src/views/bid/bid/index.vue @@ -402,7 +402,7 @@ -
+
投标信息 @@ -421,6 +421,30 @@ + + + + + + + + + + + + + + + + + + + @@ -434,28 +458,11 @@ - - - - - - - - - - - - - - - - - @@ -892,7 +899,7 @@