Prechádzať zdrojové kódy

物流企业评分列表分页方式调整,司机行为拼接分值

tangyishan 1 deň pred
rodič
commit
4bf045b756

+ 8 - 11
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/PageUtils.java

@@ -1,9 +1,7 @@
 package com.sckw.core.utils;
 
 import com.github.pagehelper.PageHelper;
-import com.sckw.core.utils.sql.SqlUtil;
-import com.sckw.core.web.page.PageDomain;
-import com.sckw.core.web.page.TableSupport;
+import com.sckw.core.web.page.BaseQuery;
 
 /**
  * 分页工具类
@@ -15,15 +13,14 @@ public class PageUtils extends PageHelper
     /**
      * 设置请求分页数据
      */
-    public static PageDomain startPage()
+    public static void startPage(BaseQuery query)
     {
-        PageDomain pageDomain = TableSupport.buildPageRequest();
-        Integer pageNum = pageDomain.getPageNum();
-        Integer pageSize = pageDomain.getPageSize();
-        String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
-        Boolean reasonable = pageDomain.getReasonable();
-        PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
-        return pageDomain;
+//        PageDomain pageDomain = TableSupport.buildPageRequest();
+//        Integer pageNum = pageDomain.getPageNum();
+//        Integer pageSize = pageDomain.getPageSize();
+//        String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
+//        Boolean reasonable = pageDomain.getReasonable();
+        PageHelper.startPage(query.getPageNum(), query.getPageSize()).setReasonable(true);
     }
 
     /**

+ 2 - 10
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/controller/BaseController.java

@@ -22,14 +22,6 @@ public class BaseController
 {
     protected final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    /**
-     * 设置请求分页数据
-     */
-    protected PageDomain startPage()
-    {
-        return PageUtils.startPage();
-    }
-
     /**
      * 设置请求排序数据
      */
@@ -54,8 +46,8 @@ public class BaseController
     /**
      * 响应请求分页数据
      */
-    protected <T> PageDataResult<T> getDataTable(PageInfo<T> pageInfo,PageDomain pageDomain)
+    protected <T> PageDataResult<T> getDataTable(PageInfo<T> pageInfo)
     {
-        return PageDataResult.success(pageDomain.getPageNum(), pageDomain.getPageSize(), pageInfo.getTotal(), pageInfo.getList());
+        return PageDataResult.success(pageInfo.getPageNum(), pageInfo.getPageSize(), pageInfo.getTotal(), pageInfo.getList());
     }
 }

+ 16 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/page/BaseQuery.java

@@ -0,0 +1,16 @@
+package com.sckw.core.web.page;
+
+import lombok.Data;
+
+/**
+ * @author tangyishan
+ * @since 2026-01-08  10:23
+ *  基础查询参数
+ */
+@Data
+public class BaseQuery {
+    /** 页码 */
+    private  Integer pageNum = 1;
+    /** 页大小 */
+    private  Integer pageSize = 10;
+}

+ 9 - 11
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcContractLogisticsScoreController.java

@@ -2,9 +2,7 @@ package com.sckw.contract.controller;
 
 
 import com.github.pagehelper.PageInfo;
-import com.sckw.contract.model.dto.req.LogisticsScoreApprovalDto;
-import com.sckw.contract.model.dto.req.LogisticsScoreDetailAddDto;
-import com.sckw.contract.model.dto.req.LogisticsScoreDetailQueryDto;
+import com.sckw.contract.model.dto.req.*;
 import com.sckw.contract.model.vo.res.LogisticsScoreDetailResVo;
 import com.sckw.contract.model.vo.res.LogisticsScoreResVo;
 import com.sckw.core.web.context.LoginUserHolder;
@@ -38,16 +36,16 @@ public class KwcContractLogisticsScoreController extends BaseController
     /**
      * 查询物流企业评分列表
      */
-    @GetMapping("/queryListByPage")
+    @PostMapping("/queryListByPage")
     @Operation(summary = "分页查询供应商物流企业评分",parameters =  {
             @Parameter(name = "pageNum", description = "页码"),
             @Parameter(name = "pageSize", description = "每页数量")
     })
-    public BaseResult<PageDataResult<LogisticsScoreResVo>> queryListByPage()
+    public BaseResult<PageDataResult<LogisticsScoreResVo>> queryListByPage(@RequestBody @Validated LogisticsScoreQueryDto query)
     {
-        PageDomain pageDomain = TableSupport.buildPageRequest();
-        PageInfo<LogisticsScoreResVo> list = kwcContractLogisticsScoreService.selectLogisticsScoreWithPendingSocreList(LoginUserHolder.getEntId());
-        return BaseResult.success(getDataTable(list, pageDomain));
+        query.setProviderEntId(LoginUserHolder.getEntId());
+        PageInfo<LogisticsScoreResVo> list = kwcContractLogisticsScoreService.selectLogisticsScoreWithPendingSocreList(query);
+        return BaseResult.success(getDataTable(list));
     }
 
     /**
@@ -60,9 +58,9 @@ public class KwcContractLogisticsScoreController extends BaseController
     })
     public BaseResult<PageDataResult<LogisticsScoreDetailResVo>> queryDetailListByPage(@Validated @RequestBody LogisticsScoreDetailQueryDto detailReqDto)
     {
-        PageDomain pageDomain = TableSupport.buildPageRequest();
-        PageInfo<LogisticsScoreDetailResVo> list = kwcContractLogisticsScoreService.selectKwcContractLogisticsScoreDetailList(detailReqDto,LoginUserHolder.getEntId());
-        return BaseResult.success(getDataTable(list,pageDomain));
+        detailReqDto.setProviderEntId(LoginUserHolder.getEntId());
+        PageInfo<LogisticsScoreDetailResVo> list = kwcContractLogisticsScoreService.selectKwcContractLogisticsScoreDetailList(detailReqDto);
+        return BaseResult.success(getDataTable(list));
     }
 
     /**

+ 5 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/req/LogisticsScoreDetailQueryDto.java

@@ -1,5 +1,6 @@
 package com.sckw.contract.model.dto.req;
 
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotNull;
 import lombok.Data;
@@ -14,7 +15,7 @@ import java.util.List;
  */
 @Data
 public class
-LogisticsScoreDetailQueryDto {
+LogisticsScoreDetailQueryDto extends BaseQuery {
     /**
      * 评分id
      */
@@ -38,4 +39,7 @@ LogisticsScoreDetailQueryDto {
      */
     @Schema(hidden = true)
     private Integer status;
+
+    @Schema(hidden = true)
+    private Long providerEntId;
 }

+ 2 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/req/LogisticsScoreQueryDto.java

@@ -1,5 +1,6 @@
 package com.sckw.contract.model.dto.req;
 
+import com.sckw.core.web.page.BaseQuery;
 import lombok.Data;
 
 import java.util.List;
@@ -10,7 +11,7 @@ import java.util.List;
  * @Description: 物流评分查询参数
  */
 @Data
-public class LogisticsScoreQueryDto {
+public class LogisticsScoreQueryDto extends BaseQuery {
     /**
      * 供应商id
      */

+ 4 - 7
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/IKwcContractLogisticsScoreService.java

@@ -4,9 +4,7 @@ import java.util.Map;
 
 import com.github.pagehelper.PageInfo;
 import com.sckw.contract.api.model.dto.req.LogisticsScoreDetailFeignDto;
-import com.sckw.contract.model.dto.req.LogisticsScoreApprovalDto;
-import com.sckw.contract.model.dto.req.LogisticsScoreDetailAddDto;
-import com.sckw.contract.model.dto.req.LogisticsScoreDetailQueryDto;
+import com.sckw.contract.model.dto.req.*;
 import com.sckw.contract.model.entity.KwcContractLogisticsScoreDetail;
 import com.sckw.contract.model.vo.req.LogisticListReq;
 import com.sckw.contract.model.vo.res.LogisticsScoreDetailResVo;
@@ -24,20 +22,19 @@ public interface IKwcContractLogisticsScoreService
 
     /**
      * 查询供应商企业对应的物流企业评分列表带待审核评分
-     * @param providerEntId 供应商企业id
+     * @param query 查询参数
      * @return 物流企业评分集合
      */
-    PageInfo<LogisticsScoreResVo> selectLogisticsScoreWithPendingSocreList(Long providerEntId);
+    PageInfo<LogisticsScoreResVo> selectLogisticsScoreWithPendingSocreList(LogisticsScoreQueryDto query);
 
 
     /**
      * 查询物流企业评分明细列表
      *
      * @param detailReqDto 物流企业评分明细
-     * @param providerEntId 供应商企业id
      * @return 物流企业评分明细集合
      */
-    PageInfo<LogisticsScoreDetailResVo> selectKwcContractLogisticsScoreDetailList(LogisticsScoreDetailQueryDto detailReqDto, Long providerEntId);
+    PageInfo<LogisticsScoreDetailResVo> selectKwcContractLogisticsScoreDetailList(LogisticsScoreDetailQueryDto detailReqDto);
 
 
     /**

+ 16 - 18
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/impl/KwcContractLogisticsScoreServiceImpl.java

@@ -82,11 +82,11 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
      * @return 物流企业评分
      */
     @Override
-    public PageInfo<LogisticsScoreResVo> selectLogisticsScoreWithPendingSocreList(Long providerEntId)
+    public PageInfo<LogisticsScoreResVo> selectLogisticsScoreWithPendingSocreList(LogisticsScoreQueryDto query)
     {
         //查询评分列表
         PageInfo<LogisticsScoreResVo> pageInfo = new PageInfo<>(new ArrayList<>());
-        List<KwcContractLogisticsScore> logisticsScores = selectLogisticsScoreList(providerEntId, true);
+        List<KwcContractLogisticsScore> logisticsScores = selectLogisticsScoreList(query);
         List<Long> logisticsScoreIds = logisticsScores.stream().map(KwcContractLogisticsScore::getId).toList();
         if(CollectionUtils.isNotEmpty(logisticsScoreIds)){
             //查询待审评分
@@ -125,17 +125,16 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
      * 查询物流企业评分明细列表
      *
      * @param detailReqDto 物流企业评分明细
-     * @param providerEntId 供应商企业id
      * @return 物流企业评分明细
      */
     @Override
-    public PageInfo<LogisticsScoreDetailResVo> selectKwcContractLogisticsScoreDetailList(LogisticsScoreDetailQueryDto detailReqDto, Long providerEntId)
+    public PageInfo<LogisticsScoreDetailResVo> selectKwcContractLogisticsScoreDetailList(LogisticsScoreDetailQueryDto detailReqDto)
     {
         //校验评分权限
-        KwcContractLogisticsScore logisticsScore = checkLogisticsScoreAuth(providerEntId, detailReqDto.getScoreId());
+        KwcContractLogisticsScore logisticsScore = checkLogisticsScoreAuth(detailReqDto.getProviderEntId(), detailReqDto.getScoreId());
         EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(logisticsScore.getLogisticsEntId());
         PageInfo<LogisticsScoreDetailResVo> pageInfo = new PageInfo<>(new ArrayList<>());
-        PageUtils.startPage();
+        PageUtils.startPage(detailReqDto);
         detailReqDto.setScoreIds(Collections.singletonList(detailReqDto.getScoreId()));
         List<KwcContractLogisticsScoreDetail> logisticsScoreDetails = kwcContractLogisticsScoreDetailMapper.selectKwcContractLogisticsScoreDetailList(detailReqDto);
         //根据影响人id列表查询影响人
@@ -197,12 +196,10 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
      * isPage 是否是分页查询
      * @return 物流企业评分
      */
-    private List<KwcContractLogisticsScore> selectLogisticsScoreList(Long providerEntId, boolean isPage)
+    private List<KwcContractLogisticsScore> selectLogisticsScoreList(LogisticsScoreQueryDto query)
     {
-        LogisticsScoreQueryDto scoreReqDto = new LogisticsScoreQueryDto();
-        providerEntId = providerEntId !=null ? providerEntId : LoginUserHolder.getEntId();
         //1.查询当前供应商企业有效的自动派车物流合同
-        List<KwcContractLogistics> logisticsContracts = kwcContractLogisticsRepository.queryValidByEntId(providerEntId);
+        List<KwcContractLogistics> logisticsContracts = kwcContractLogisticsRepository.queryValidByEntId(query.getProviderEntId());
         List<Long> contractIds = logisticsContracts.stream().map(KwcContractLogistics::getId).toList();
         if(CollectionUtils.isNotEmpty(contractIds)){
             //2.根据物流合同id列表和托运商类型查询物流企业列表并得到物流企业id列表
@@ -210,15 +207,12 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
             List<Long> logisticsEntIds = logisticsUnits.stream().map(KwcContractLogisticsUnit::getEntId).toList();
             if(CollectionUtils.isNotEmpty(logisticsEntIds)){
                 //3.根据物流企业id列表和供应商企业id查询物流企业评分列表
-                scoreReqDto.setProviderEntId(providerEntId);
-                scoreReqDto.setLogisticsEntIds(logisticsEntIds);
-                if (isPage){
-                    PageUtils.startPage();
-                }
-                return kwcContractLogisticsScoreMapper.selectKwcContractLogisticsScoreList(scoreReqDto);
+                query.setLogisticsEntIds(logisticsEntIds);
+                PageUtils.startPage(query);
+                return kwcContractLogisticsScoreMapper.selectKwcContractLogisticsScoreList(query);
             }
         }
-        return Collections.emptyList();
+        return new Page<>(query.getPageNum(), query.getPageSize());
     }
 
 
@@ -418,7 +412,11 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
             if(userResDto != null){
                 detailAddDto.setInfluenceBy(userResDto.getId());
             }
-            detailAddDto.setAction(detailDto.getAction());
+            StringBuilder actionBuilder = new StringBuilder(detailDto.getAction());
+            if(detailDto.getScoreChange().compareTo(BigDecimal.ZERO)>0){
+                actionBuilder.append("+");
+            }
+            detailAddDto.setAction(actionBuilder.append(detailDto.getScoreChange()).append("分").toString());
             detailAddDto.setScoreChange(entScoreChange);
             detailAddDto.setScore(resultScore);
             //2.设置评分状态为通过