Explorar el Código

评分管理及司机评分企业名称及司机名称处理

tangyishan hace 1 mes
padre
commit
637718aacd
Se han modificado 20 ficheros con 73 adiciones y 116 borrados
  1. 2 2
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/feign/LogisticsScoreFeignService.java
  2. 0 5
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/req/LogisticsScoreDetailFeignDto.java
  3. 2 2
      sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/feign/DriverScoreFeignService.java
  4. 5 9
      sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/model/dto/UpdateDriverScoreDto.java
  5. 3 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/api/KwcContractLogisticsScoreApiController.java
  6. 0 5
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/req/LogisticsScoreDetailAddDto.java
  7. 0 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScore.java
  8. 0 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScoreDetail.java
  9. 3 2
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/IKwcContractLogisticsScoreService.java
  10. 43 44
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/impl/KwcContractLogisticsScoreServiceImpl.java
  11. 1 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java
  12. 1 4
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreDetailMapper.xml
  13. 1 4
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreMapper.xml
  14. 3 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverScoreController.java
  15. 7 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java
  16. 0 3
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScore.java
  17. 0 7
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScoreDetail.java
  18. 0 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverScoreService.java
  19. 1 7
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreDetailMapper.xml
  20. 1 7
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreMapper.xml

+ 2 - 2
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/feign/LogisticsScoreFeignService.java

@@ -1,7 +1,7 @@
 package com.sckw.contract.api.feign;
 
 import com.sckw.contract.api.model.dto.req.LogisticsScoreDetailFeignDto;
-import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -12,5 +12,5 @@ public interface LogisticsScoreFeignService {
      * 系统修改物流企业评分
      */
     @PostMapping("/updateLogisticsScore")
-    public BaseResult<Boolean> updateLogisticsScore(@RequestBody LogisticsScoreDetailFeignDto detailDto);
+    public HttpResult updateLogisticsScore(@RequestBody LogisticsScoreDetailFeignDto detailDto);
 }

+ 0 - 5
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/req/LogisticsScoreDetailFeignDto.java

@@ -28,11 +28,6 @@ public class LogisticsScoreDetailFeignDto {
      */
     @NotNull(message = "影响人id不能为空")
     private Long influenceBy;
-    /**
-     * 评分行为影响人名称
-     */
-    @NotNull(message = "影响人名称不能为空")
-    private String influenceByName;
     /**
      * 评分行为
      */

+ 2 - 2
sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/feign/DriverScoreFeignService.java

@@ -1,6 +1,6 @@
 package com.sckw.fleet.api.feign;
 
-import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.model.dto.UpdateDriverScoreDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.validation.annotation.Validated;
@@ -13,5 +13,5 @@ public interface DriverScoreFeignService {
      * 更新司机评分
      */
     @PostMapping("/update")
-    public BaseResult<Boolean> update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto);
+    public HttpResult update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto);
 }

+ 5 - 9
sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/model/dto/UpdateDriverScoreDto.java

@@ -19,29 +19,25 @@ import java.math.BigDecimal;
 public class UpdateDriverScoreDto {
 
     /** 供应商企业id */
-    @NotNull
+    @NotNull(message = "供应商企业id不能为空")
     private Long providerEntId;
 
     /** 物流企业id */
-    @NotNull
+    @NotNull()
     private Long logisticsEntId;
 
-    /** 供应商企业名称 */
-    @NotBlank
-    private String providerEntName;
-
     /** 变动评分 */
     private BigDecimal scoreChange;
 
     /** 物流企业评分 */
-    @NotNull
+    @NotNull(message = "物流企业评分不能为空")
     private BigDecimal logisticsEntScore;
 
     /** 变动原因 */
-    @NotBlank
+    @NotBlank(message = "变动原因不能为空")
     private String action;
 
     /** 操作类型 1-初始化 2-修改评分 3-重置评分*/
-    @NotNull
+    @NotNull(message = "操作类型不能为空")
     private Integer operatorType;
 }

+ 3 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/api/KwcContractLogisticsScoreApiController.java

@@ -2,7 +2,7 @@ package com.sckw.contract.api;
 
 import com.sckw.contract.api.model.dto.req.LogisticsScoreDetailFeignDto;
 import com.sckw.contract.service.IKwcContractLogisticsScoreService;
-import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -25,7 +25,7 @@ public class KwcContractLogisticsScoreApiController {
      * 系统修改物流企业评分
      */
     @PostMapping("/updateLogisticsScore")
-    public BaseResult<Boolean> updateLogisticsScore(@Validated @RequestBody LogisticsScoreDetailFeignDto detailDto) {
-        return BaseResult.success(kwcContractLogisticsScoreService.updateLogisticsScoreBySystem(detailDto));
+    public HttpResult updateLogisticsScore(@Validated @RequestBody LogisticsScoreDetailFeignDto detailDto) {
+        return HttpResult.ok(kwcContractLogisticsScoreService.updateLogisticsScoreBySystem(detailDto));
     }
 }

+ 0 - 5
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/req/LogisticsScoreDetailAddDto.java

@@ -24,11 +24,6 @@ public class LogisticsScoreDetailAddDto {
      */
     @Schema(hidden = true)
     private Long influenceBy;
-    /**
-     * 评分行为影响人名称
-     */
-    @Schema(hidden = true)
-    private String influenceByName;
     /**
      * 评分行为
      */

+ 0 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScore.java

@@ -29,9 +29,6 @@ public class KwcContractLogisticsScore extends BaseModel
     /** 物流企业id */
     private Long logisticsEntId;
 
-    /** 物流企业名称 */
-    private String logisticsEntName;
-
     /** 物流企业评分 */
     private BigDecimal score;
 

+ 0 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScoreDetail.java

@@ -28,9 +28,6 @@ public class KwcContractLogisticsScoreDetail extends BaseModel
     /** 影响人id */
     private Long influenceBy;
 
-    /** 影响人名字 */
-    private String influenceByName;
-
     /** 行为 */
     private String action;
 

+ 3 - 2
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/IKwcContractLogisticsScoreService.java

@@ -7,6 +7,7 @@ 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.entity.KwcContractLogisticsScoreDetail;
 import com.sckw.contract.model.vo.req.LogisticListReq;
 import com.sckw.contract.model.vo.res.LogisticsScoreDetailResVo;
 import com.sckw.contract.model.vo.res.LogisticsScoreResVo;
@@ -52,13 +53,13 @@ public interface IKwcContractLogisticsScoreService
      * 初始化物流企业评分
      * @param baseInfo
      */
-    void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo, Map<Long, EntCacheResDto> entCacheResDtoMap);
+    void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo);
 
     /**
      * 初始化物流企业评分明细
      * @param detailDto
      */
-    void initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto);
+    KwcContractLogisticsScoreDetail initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto);
 
 
     /**

+ 43 - 44
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/impl/KwcContractLogisticsScoreServiceImpl.java

@@ -29,13 +29,18 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.PageUtils;
 import com.sckw.core.web.config.CustomConfig;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.feign.DriverScoreFeignService;
 import com.sckw.fleet.api.model.dto.UpdateDriverScoreDto;
 import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
+import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.MapUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.sckw.contract.dao.KwcContractLogisticsScoreMapper;
@@ -49,9 +54,12 @@ import org.springframework.transaction.annotation.Transactional;
  * @author tangyishan
  * @date 2025-12-05
  */
+@Slf4j
 @Service
 public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisticsScoreService 
 {
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
     @Autowired
     private KwcContractLogisticsScoreMapper kwcContractLogisticsScoreMapper;
     @Autowired
@@ -90,9 +98,14 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                     logisticsScore.setPendingScore(scoreChangeMap.getOrDefault(logisticsScore.getId(), null));
                 }
             }
+            Map<Long, EntCacheResDto> entCacheResDtoMap = remoteSystemService.queryEntCacheMapByIds(logisticsScores.stream().map(KwcContractLogisticsScore::getLogisticsEntId).toList());
             pageInfo = ((Page<KwcContractLogisticsScore>) logisticsScores).toPageInfo(e -> {
                 LogisticsScoreResVo logisticsScoreResVo = new LogisticsScoreResVo();
                 BeanUtils.copyProperties(e, logisticsScoreResVo);
+                EntCacheResDto entCacheResDto = entCacheResDtoMap.get(e.getLogisticsEntId());
+                if(entCacheResDto!=null){
+                    logisticsScoreResVo.setLogisticsEntName(entCacheResDto.getFirmName());
+                }
                 if(e.getPendingScore()!=null && e.getPendingScore().compareTo(BigDecimal.ZERO) > 0){
                     logisticsScoreResVo.setPendingScore("+"+e.getPendingScore());
                 }else if(e.getPendingScore()==null){
@@ -118,6 +131,7 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
     {
         //校验评分权限
         KwcContractLogisticsScore logisticsScore = checkLogisticsScoreAuth(providerEntId, detailReqDto.getScoreId());
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(logisticsScore.getLogisticsEntId());
         PageInfo<LogisticsScoreDetailResVo> pageInfo = new PageInfo<>(new ArrayList<>());
         PageUtils.startPage();
         detailReqDto.setScoreIds(Collections.singletonList(detailReqDto.getScoreId()));
@@ -134,7 +148,7 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                 if(e.getScore() == null){
                     logisticsScoreDetailResVo.setScore("");
                 }
-                logisticsScoreDetailResVo.setLogisticsEntName(logisticsScore.getLogisticsEntName());
+                logisticsScoreDetailResVo.setLogisticsEntName(entCacheResDto.getFirmName());
                 return logisticsScoreDetailResVo;
             });
         }
@@ -157,7 +171,8 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         if(logisticsScoreDetail == null){
             return null;
         }
-        logisticsScoreDetail.setLogisticsEntName(logisticsScore.getLogisticsEntName());
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(logisticsScore.getLogisticsEntId());
+        logisticsScoreDetail.setLogisticsEntName(entCacheResDto.getFirmName());
         LogisticsScoreDetailResVo logisticsScoreDetailResVo = new LogisticsScoreDetailResVo();
         BeanUtils.copyProperties(logisticsScoreDetail,logisticsScoreDetailResVo);
         logisticsScoreDetailResVo.setScore(logisticsScore.getScore().toString());
@@ -215,7 +230,7 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo,Map<Long, EntCacheResDto> entCacheResDtoMap) {
+    public void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo) {
         KwcContractLogisticsScore logisticsScore = new KwcContractLogisticsScore();
 
         long scoreId = new IdWorker(1L).nextId();
@@ -223,8 +238,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         //自动派单合同的托运单位等于当前登陆企业
         logisticsScore.setProviderEntId(baseInfo.getProvideEntId());
         logisticsScore.setLogisticsEntId(baseInfo.getPurchaseEntId());
-        EntCacheResDto logisticsEnt = entCacheResDtoMap.get(baseInfo.getPurchaseEntId());
-        logisticsScore.setLogisticsEntName(logisticsEnt != null ? logisticsEnt.getFirmName() : null);
         logisticsScore.setScore(new BigDecimal(customConfig.getLogisticsInitScore()));
         logisticsScore.setCreateBy(LoginUserHolder.getUserId());
         Date date = new Date();
@@ -244,23 +257,14 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                 LogisticsScoreDetailAddDto detailDto  = new LogisticsScoreDetailAddDto();
                 detailDto.setScoreId(scoreId);
                 detailDto.setInfluenceBy(LoginUserHolder.getUserId());
-                detailDto.setInfluenceByName(LoginUserHolder.getUserName());
                 detailDto.setAction("物流企业评分初始化");
                 detailDto.setScoreChange(logisticsScore.getScore());
                 detailDto.setScore(logisticsScore.getScore());
                 detailDto.setStatus(NumberConstant.ONE);
-                initLogisticsScoreDetail(detailDto);
-
-                //初始化司机评分,需要传参供应企业id,物流企业id,供应企业名称,评分变动,当前物流企业评分,变动原因
-                UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
-                updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
-                updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
-                updateDriverScoreDto.setProviderEntName(LoginUserHolder.getEntName());
-                updateDriverScoreDto.setScoreChange(logisticsScore.getScore());
-                updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
-                updateDriverScoreDto.setAction(detailDto.getAction());
-                updateDriverScoreDto.setOperatorType(1);
-                driverScoreFeignService.update(updateDriverScoreDto);
+                KwcContractLogisticsScoreDetail logisticsScoreDetail = initLogisticsScoreDetail(detailDto);
+
+                //初始化司机评分
+                updateDriverScore(logisticsScore,logisticsScoreDetail,1);
             }
         } finally {
             RedissonUtils.unlock(lockKey);
@@ -269,10 +273,11 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
 
 
     @Override
-    public void initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto) {
+    public KwcContractLogisticsScoreDetail initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto) {
         KwcContractLogisticsScoreDetail logisticsScoreDetail = buildLogisticsScoreDetail(detailDto);
         logisticsScoreDetail.setScore(logisticsScoreDetail.getScoreChange());
         kwcContractLogisticsScoreDetailMapper.insertKwcContractLogisticsScoreDetail(logisticsScoreDetail);
+        return logisticsScoreDetail;
     }
 
 
@@ -319,16 +324,8 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                     logisticsScoreDetail.setUpdateBy(LoginUserHolder.getUserId());
                     logisticsScoreDetail.setUpdateTime(new Date());
                     kwcContractLogisticsScoreDetailMapper.updateKwcContractLogisticsScoreDetail(logisticsScoreDetail);
-                    //修改司机评分,需要传参供应企业id,物流企业id,供应企业名称,评分变动,当前物流企业评分,变动原因
-                    UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
-                    updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
-                    updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
-                    updateDriverScoreDto.setProviderEntName(LoginUserHolder.getEntName());
-                    updateDriverScoreDto.setScoreChange(logisticsScoreDetail.getScoreChange());
-                    updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
-                    updateDriverScoreDto.setAction(logisticsScoreDetail.getAction());
-                    updateDriverScoreDto.setOperatorType(2);
-                    driverScoreFeignService.update(updateDriverScoreDto);
+                    //修改司机评分
+                    updateDriverScore(logisticsScore,logisticsScoreDetail,2);
                 }
             }else{
                 throw new BusinessException("该评分已审批完成");
@@ -368,7 +365,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
             }
             //用户修改评分
             detailDto.setInfluenceBy(LoginUserHolder.getUserId());
-            detailDto.setInfluenceByName(LoginUserHolder.getUserName());
             detailDto.setStatus(NumberConstant.ZERO);
             detailDto.setAction("修改企业评分,原因:"+detailDto.getAction());
             KwcContractLogisticsScoreDetail logisticsScoreDetail = buildLogisticsScoreDetail(detailDto);
@@ -401,7 +397,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         LogisticsScoreDetailAddDto detailAddDto = new LogisticsScoreDetailAddDto();
         detailAddDto.setScoreId(logisticsScore.getId());
         detailAddDto.setInfluenceBy(detailDto.getInfluenceBy());
-        detailAddDto.setInfluenceByName(detailDto.getInfluenceByName());
         detailAddDto.setAction(detailDto.getAction());
         detailAddDto.setScoreChange(detailDto.getScoreChange());
         detailAddDto.setScore(resultScore);
@@ -435,17 +430,8 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
             kwcContractLogisticsScoreDetailMapper.insertKwcContractLogisticsScoreDetail(resetLogisticsScoreDetail);
             //4.清除待审核评分
             kwcContractLogisticsScoreDetailMapper.deleteKwcContractLogisticsScoreDetailByScoreId(logisticsScore.getId(),NumberConstant.ZERO);
-            //重置司机评分,需要传参供应企业id,物流企业id,供应企业名称,评分变动,当前物流企业评分,变动原因
-            UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
-            updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
-            updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
-            updateDriverScoreDto.setProviderEntName(LoginUserHolder.getEntName());
-            updateDriverScoreDto.setScoreChange(resetLogisticsScoreDetail.getScoreChange());
-            updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
-            updateDriverScoreDto.setAction(resetLogisticsScoreDetail.getAction());
-            updateDriverScoreDto.setOperatorType(3);
-            driverScoreFeignService.update(updateDriverScoreDto);
-
+            //重置司机评分
+            updateDriverScore(logisticsScore,resetLogisticsScoreDetail,3);
 
         } finally {
             RedissonUtils.unlock(lockKey);
@@ -453,6 +439,21 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
     }
 
 
+    private void updateDriverScore(KwcContractLogisticsScore logisticsScore,KwcContractLogisticsScoreDetail logisticsScoreDetail,Integer operatorType){
+        UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
+        updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
+        updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
+        updateDriverScoreDto.setScoreChange(logisticsScoreDetail.getScoreChange());
+        updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
+        updateDriverScoreDto.setAction(logisticsScoreDetail.getAction());
+        updateDriverScoreDto.setOperatorType(operatorType);
+        HttpResult result = driverScoreFeignService.update(updateDriverScoreDto);
+        if(result.getCode()!= HttpStatus.SUCCESS_CODE){
+            log.error("更新司机评分失败,原因:{}",result.getMsg());
+            throw new BusinessException("更新司机评分失败,原因:"+result.getMsg());
+        }
+    }
+
     /**
      * 构建重置评分记录明细
      *
@@ -465,7 +466,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         logisticsScoreDetail.setId(scoreDetailId);
         logisticsScoreDetail.setScoreId(scoreId);
         logisticsScoreDetail.setInfluenceBy(LoginUserHolder.getUserId());
-        logisticsScoreDetail.setInfluenceByName(LoginUserHolder.getUserName());
         logisticsScoreDetail.setAction("重置企业评分");
         logisticsScoreDetail.setScore(new BigDecimal(customConfig.getLogisticsInitScore()));
         logisticsScoreDetail.setScoreChange(null);
@@ -484,7 +484,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         logisticsScoreDetail.setId(scoreDetailId);
         logisticsScoreDetail.setScoreId(detailDto.getScoreId());
         logisticsScoreDetail.setInfluenceBy(detailDto.getInfluenceBy());
-        logisticsScoreDetail.setInfluenceByName(detailDto.getInfluenceByName());
         logisticsScoreDetail.setAction(detailDto.getAction());
         logisticsScoreDetail.setScoreChange(detailDto.getScoreChange());
         logisticsScoreDetail.setScore(detailDto.getScore());

+ 1 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java

@@ -1306,7 +1306,7 @@ public class KwcContractLogisticsService {
 
         //如果是自动派单合同需要初始化物流企业评分记录和评分记录明细
         if(DispatchingTypeEnum.AUTO.getValue().equals(baseInfo.getDispatching())){
-            logisticsScoreService.initLogisticsScore(baseInfo,entCacheResDtoMap);
+            logisticsScoreService.initLogisticsScore(baseInfo);
         }
         return Boolean.TRUE;
     }

+ 1 - 4
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreDetailMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="scoreId"    column="score_id"    />
         <result property="influenceBy"    column="influence_by"    />
-        <result property="influenceByName"    column="influence_by_name"    />
         <result property="action"    column="action"    />
         <result property="scoreChange"    column="score_change"    />
         <result property="score"    column="score"    />
@@ -20,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwcContractLogisticsScoreDetailVo">
-        select id, score_id, influence_by, influence_by_name, action, score_change, score, status, create_by, create_time, update_by, update_time from kwc_contract_logistics_score_detail
+        select id, score_id, influence_by, action, score_change, score, status, create_by, create_time, update_by, update_time from kwc_contract_logistics_score_detail
     </sql>
 
     <select id="selectKwcContractLogisticsScoreDetailList" parameterType="com.sckw.contract.model.dto.req.LogisticsScoreDetailQueryDto" resultMap="KwcContractLogisticsScoreDetailResult">
@@ -56,7 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="scoreId != null">score_id,</if>
             <if test="influenceBy != null">influence_by,</if>
-            <if test="influenceByName != null and influenceByName != ''">influence_by_name,</if>
             <if test="action != null and action != ''">action,</if>
             <if test="scoreChange != null">score_change,</if>
             <if test="score != null">score,</if>
@@ -70,7 +68,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="scoreId != null">#{scoreId},</if>
             <if test="influenceBy != null">#{influenceBy},</if>
-            <if test="influenceByName != null and influenceByName != ''">#{influenceByName},</if>
             <if test="action != null and action != ''">#{action},</if>
             <if test="scoreChange != null">#{scoreChange},</if>
             <if test="score != null">#{score},</if>

+ 1 - 4
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="providerEntId"    column="provider_ent_id"    />
         <result property="logisticsEntId"    column="logistics_ent_id"    />
-        <result property="logisticsEntName"    column="logistics_ent_name"    />
         <result property="score"    column="score"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -17,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwcContractLogisticsScoreVo">
-        select id, provider_ent_id, logistics_ent_id, logistics_ent_name, score, create_by, create_time, update_by, update_time from kwc_contract_logistics_score
+        select id, provider_ent_id, logistics_ent_id, score, create_by, create_time, update_by, update_time from kwc_contract_logistics_score
     </sql>
 
     <select id="selectKwcContractLogisticsScoreList" parameterType="com.sckw.contract.model.dto.req.LogisticsScoreQueryDto" resultMap="KwcContractLogisticsScoreResult">
@@ -52,7 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="providerEntId != null">provider_ent_id,</if>
             <if test="logisticsEntId != null">logistics_ent_id,</if>
-            <if test="logisticsEntName != null and logisticsEntName != ''">logistics_ent_name,</if>
             <if test="score != null">score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -63,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="providerEntId != null">#{providerEntId},</if>
             <if test="logisticsEntId != null">#{logisticsEntId},</if>
-            <if test="logisticsEntName != null and logisticsEntName != ''">#{logisticsEntName},</if>
             <if test="score != null">#{score},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>

+ 3 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverScoreController.java

@@ -1,6 +1,7 @@
 package com.sckw.fleet.controller;
 
 import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.model.dto.UpdateDriverScoreDto;
 import com.sckw.fleet.service.KwfDriverScoreService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,8 +27,8 @@ public class KwfDriverScoreController {
      * 更新司机评分
      */
     @PostMapping("/update")
-    public BaseResult<Boolean> update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto) {
+    public HttpResult update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto) {
         kwfDriverScoreService.update(updateDriverScoreDto);
-        return BaseResult.success();
+        return HttpResult.ok();
     }
 }

+ 7 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java

@@ -14,7 +14,10 @@ import com.sckw.fleet.dao.KwfDriverMapper;
 import com.sckw.fleet.dao.KwfTruckMapper;
 import com.sckw.fleet.model.*;
 import com.sckw.fleet.repository.*;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +41,8 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
     @Autowired
     KwfDriverMapper driverDao;
     private final KwfFleetRepository fleetRepository;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
 
     private final KwfTruckRepository kwfTruckRepository;
     private final KwfDriverRepository driverRepository;
@@ -637,11 +642,12 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
      * @return 车辆数据
      */
     private RDriverScoreVo getDriverScoreVo(KwfDriverScore driverScore) {
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(driverScore.getProviderEntId());
         RDriverScoreVo vo = new RDriverScoreVo();
         vo.setProviderEntId(driverScore.getProviderEntId());
         vo.setLogisticsEntId(driverScore.getLogisticsEntId());
         vo.setDriverId(driverScore.getDriverId());
-        vo.setProviderEntName(driverScore.getProviderEntName());
+        vo.setProviderEntName(entCacheResDto.getFirmName());
         vo.setScore(driverScore.getScore());
         return vo;
     }

+ 0 - 3
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScore.java

@@ -29,9 +29,6 @@ public class KwfDriverScore extends BaseModel
     /** 司机id */
     private Long driverId;
 
-    /** 供应商企业名称 */
-    private String providerEntName;
-
     /** 司机评分 */
     private BigDecimal score;
 }

+ 0 - 7
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScoreDetail.java

@@ -25,9 +25,6 @@ public class KwfDriverScoreDetail extends BaseModel {
     /** 司机id */
     private Long driverId;
 
-    /** 司机名字 */
-    private String driverName;
-
     /** 行为 */
     private String action;
 
@@ -36,8 +33,4 @@ public class KwfDriverScoreDetail extends BaseModel {
 
     /** 变动后评分 */
     private BigDecimal score;
-
-    /** 物流企业名称 */
-    @TableField(exist = false)
-    private String logisticsEntName;
 }

+ 0 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverScoreService.java

@@ -179,7 +179,6 @@ public class KwfDriverScoreService {
             driverScore.setProviderEntId(updateDriverScoreDto.getProviderEntId());
             driverScore.setLogisticsEntId(updateDriverScoreDto.getLogisticsEntId());
             driverScore.setDriverId(driver.getId());
-            driverScore.setProviderEntName(updateDriverScoreDto.getProviderEntName());
             driverScore.setScore(updateDriverScoreDto.getLogisticsEntScore());
             driverScore.setCreateBy(LoginUserHolder.getUserId());
             driverScore.setCreateTime(now);
@@ -240,7 +239,6 @@ public class KwfDriverScoreService {
         scoreDetail.setScoreId(driverScore.getId());
         if(driver != null){
             scoreDetail.setDriverId(driver.getId());
-            scoreDetail.setDriverName(driver.getName());
         }
         scoreDetail.setAction(updateDriverScoreDto.getAction());
         BigDecimal scoreChange = driverScore.getScore().subtract(originDriverScore);

+ 1 - 7
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreDetailMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="scoreId"    column="score_id"    />
         <result property="driverId"    column="driver_id"    />
-        <result property="driverName"    column="driver_name"    />
         <result property="action"    column="action"    />
         <result property="scoreChange"    column="score_change"    />
         <result property="score"    column="score"    />
@@ -19,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwfDriverScoreDetailVo">
-        select id, score_id, driver_id, driver_name, action, score_change, score, create_by, create_time, update_by, update_time from kwf_driver_score_detail
+        select id, score_id, driver_id, action, score_change, score, create_by, create_time, update_by, update_time from kwf_driver_score_detail
     </sql>
 
     <select id="selectKwfDriverScoreDetailList" parameterType="com.sckw.fleet.model.KwfDriverScoreDetail" resultMap="KwfDriverScoreDetailResult">
@@ -42,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="scoreId != null">score_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="driverName != null and driverName != ''">driver_name,</if>
             <if test="action != null and action != ''">action,</if>
             <if test="scoreChange != null">score_change,</if>
             <if test="score != null">score,</if>
@@ -55,7 +53,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="scoreId != null">#{scoreId},</if>
             <if test="driverId != null">#{driverId},</if>
-            <if test="driverName != null and driverName != ''">#{driverName},</if>
             <if test="action != null and action != ''">#{action},</if>
             <if test="scoreChange != null">#{scoreChange},</if>
             <if test="score != null">#{score},</if>
@@ -72,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="scoreId != null">score_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="driverName != null and driverName != ''">driver_name,</if>
             <if test="action != null and action != ''">action,</if>
             <if test="scoreChange != null">score_change,</if>
             <if test="score != null">score,</if>
@@ -87,7 +83,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="id != null">#{scoreDetail.id},</if>
                 <if test="scoreId != null">#{scoreDetail.scoreId},</if>
                 <if test="driverId != null">#{scoreDetail.driverId},</if>
-                <if test="driverName != null and driverName != ''">#{scoreDetail.driverName},</if>
                 <if test="action != null and action != ''">#{scoreDetail.action},</if>
                 <if test="scoreChange != null">#{scoreDetail.scoreChange},</if>
                 <if test="score != null">#{scoreDetail.score},</if>
@@ -104,7 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="scoreId != null">score_id = #{scoreId},</if>
             <if test="driverId != null">driver_id = #{driverId},</if>
-            <if test="driverName != null and driverName != ''">driver_name = #{driverName},</if>
             <if test="action != null and action != ''">action = #{action},</if>
             <if test="scoreChange != null">score_change = #{scoreChange},</if>
             <if test="score != null">score = #{score},</if>

+ 1 - 7
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreMapper.xml

@@ -9,7 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="providerEntId"    column="provider_ent_id"    />
         <result property="logisticsEntId"    column="logistics_ent_id"    />
         <result property="driverId"    column="driver_id"    />
-        <result property="providerEntName"    column="provider_ent_name"    />
         <result property="score"    column="score"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -18,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwfDriverScoreVo">
-        select id, provider_ent_id, logistics_ent_id, driver_id, provider_ent_name, score, create_by, create_time, update_by, update_time from kwf_driver_score
+        select id, provider_ent_id, logistics_ent_id, driver_id, score, create_by, create_time, update_by, update_time from kwf_driver_score
     </sql>
 
     <select id="selectKwfDriverScoreList" parameterType="com.sckw.fleet.model.KwfDriverScore" resultMap="KwfDriverScoreResult">
@@ -42,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">provider_ent_id,</if>
             <if test="logisticsEntId != null">logistics_ent_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="providerEntName != null and providerEntName != ''">provider_ent_name,</if>
             <if test="score != null">score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -54,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">#{providerEntId},</if>
             <if test="logisticsEntId != null">#{logisticsEntId},</if>
             <if test="driverId != null">#{driverId},</if>
-            <if test="providerEntName != null and providerEntName != ''">#{providerEntName},</if>
             <if test="score != null">#{score},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -70,7 +67,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">provider_ent_id,</if>
             <if test="logisticsEntId != null">logistics_ent_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="providerEntName != null and providerEntName != ''">provider_ent_name,</if>
             <if test="score != null">score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -84,7 +80,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="providerEntId != null">#{driverScore.providerEntId},</if>
                 <if test="logisticsEntId != null">#{driverScore.logisticsEntId},</if>
                 <if test="driverId != null">#{driverScore.driverId},</if>
-                <if test="providerEntName != null and providerEntName != ''">#{driverScore.providerEntName},</if>
                 <if test="score != null">#{driverScore.score},</if>
                 <if test="createBy != null">#{driverScore.createBy},</if>
                 <if test="createTime != null">#{driverScore.createTime},</if>
@@ -100,7 +95,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">provider_ent_id = #{providerEntId},</if>
             <if test="logisticsEntId != null">logistics_ent_id = #{logisticsEntId},</if>
             <if test="driverId != null">driver_id = #{driverId},</if>
-            <if test="providerEntName != null and providerEntName != ''">provider_ent_name = #{providerEntName},</if>
             <if test="score != null">score = #{score},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>