提交 144e92ff authored 作者: 刘海泉's avatar 刘海泉

Merge remote-tracking branch 'origin/v20.4_exception_report_20240802' into dev

package com.clx.performance.feign;
import com.clx.open.sdk.request.action.GetOrderBreakContractOwnerRuleFileAction;
import com.clx.open.sdk.request.action.GetOwnerAccountInfoAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressLogAction;
import com.clx.open.sdk.request.dto.OwnerCancelResidueWeightDTO;
import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.PerformanceProgressDetailVO;
import com.clx.performance.vo.pc.PerformanceProgressOperationLogVO;
import com.clx.performance.vo.pc.PerformanceProgressVO;
import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleFileVO;
import com.msl.common.result.Result;
......@@ -41,4 +41,7 @@ public interface PerformanceSDKFeign {
@GetMapping("clx-performance/feign/sdk/queryPerformanceProgress")
Result<List<PerformanceProgressVO>> queryPerformanceProgress(@RequestBody QueryPerformanceProgressAction action);
@GetMapping("clx-performance/feign/sdk/queryPerformanceProgressLog")
Result<List<PerformanceProgressOperationLogVO>> queryPerformanceProgressLog(@RequestBody QueryPerformanceProgressLogAction action);
}
......@@ -3,6 +3,7 @@ package com.clx.performance.controller.feign;
import com.clx.open.sdk.request.action.GetOrderBreakContractOwnerRuleFileAction;
import com.clx.open.sdk.request.action.GetOwnerAccountInfoAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressLogAction;
import com.clx.open.sdk.request.dto.OwnerCancelResidueWeightDTO;
import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.service.OrderCancelService;
......@@ -11,6 +12,7 @@ import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.PerformanceProgressService;
import com.clx.performance.service.breakcontract.BreakContractOwnerRuleService;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.PerformanceProgressOperationLogVO;
import com.clx.performance.vo.pc.PerformanceProgressVO;
import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleFileVO;
import com.msl.common.result.Result;
......@@ -25,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
import static com.clx.performance.enums.PerformanceProgressEnum.LogType.PERFORMANCE_ABNORMAL_REASON;
@Slf4j
@RestController
@RequestMapping("/feign/sdk")
......@@ -78,4 +82,10 @@ public class PerformanceSdkFeignController {
Result<List<PerformanceProgressVO>> queryPerformanceProgress(@RequestBody QueryPerformanceProgressAction action){
return Result.ok(performanceProgressService.queryPerformanceProgress(action.getOrderNoList()));
}
@ApiOperation(value = "查询履约进度操作日志", notes = "<br>By:杨启发")
@GetMapping("/queryPerformanceProgressLog")
Result<List<PerformanceProgressOperationLogVO>> queryPerformanceProgressLog(@RequestBody QueryPerformanceProgressLogAction action){
return Result.ok(performanceProgressService.getOperationLog(action.getOrderNo(),PERFORMANCE_ABNORMAL_REASON.getCode()));
}
}
......@@ -75,7 +75,7 @@ public class CarrierPerformanceProgressController {
@ApiOperation(value = "获取履约进度编辑日志列表",notes = "<br>By:刘海泉")
@GetMapping("/getOperationLog")
public Result<List<PerformanceProgressOperationLogVO>> getOperationLog(@RequestParam("orderNo") @NotBlank(message = "订单编号不能为空") String orderNo) {
List<PerformanceProgressOperationLogVO> list = performanceProgressService.getOperationLog(orderNo);
List<PerformanceProgressOperationLogVO> list = performanceProgressService.getOperationLog(orderNo,null);
return Result.ok(list);
}
......
......@@ -12,5 +12,5 @@ import java.util.List;
* Time 16:02
*/
public interface PerformanceProgressLogDao extends BaseDao<PerformanceProgressLogMapper, PerformanceProgressLog, Integer> {
List<PerformanceProgressLog> getOperationLog(String orderNo);
List<PerformanceProgressLog> getOperationLog(String orderNo,Integer operateType);
}
......@@ -8,6 +8,7 @@ import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
/**
* @author kavin
......@@ -17,9 +18,10 @@ import java.util.List;
@Repository
public class PerformanceProgressLogDaoImpl extends BaseDaoImpl<PerformanceProgressLogMapper, PerformanceProgressLog, Integer> implements PerformanceProgressLogDao {
@Override
public List<PerformanceProgressLog> getOperationLog(String orderNo) {
public List<PerformanceProgressLog> getOperationLog(String orderNo,Integer operateType) {
LambdaQueryWrapper<PerformanceProgressLog> query = new LambdaQueryWrapper<>();
query.eq(PerformanceProgressLog :: getOrderNo,orderNo);
query.eq(Objects.nonNull(operateType),PerformanceProgressLog :: getOperateType,operateType);
query.orderByDesc(PerformanceProgressLog :: getId);
return baseMapper.selectList(query);
}
......
......@@ -30,7 +30,7 @@ public interface PerformanceProgressService {
PerformanceProgressDetailVO getPerformanceProgressDetail(Integer id);
List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo);
List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo,Integer operateType);
void dealPerformanceProgress4OrderInfo(OrderInfoMessage data);
......
package com.clx.performance.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.open.sdk.callback.OpenCallBackClient;
import com.clx.open.sdk.callback.message.OrderInfoMessage;
import com.clx.open.sdk.callback.message.TransportExceptionReportMessage;
import com.clx.order.enums.SyncPlatformEnum;
import com.clx.order.feign.OrderFeign;
import com.clx.order.vo.feign.FeignAddressVO;
import com.clx.order.vo.feign.FeignOrderInfoVO;
import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.order.vo.feign.SystemAddressVO;
import com.clx.performance.config.ThirdAppConfig;
import com.clx.performance.constant.BusinessConstants;
import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao;
......@@ -36,7 +43,13 @@ import com.clx.performance.vo.pc.PerformanceProgressVO;
import com.google.common.base.Joiner;
import com.msl.common.base.Optional;
import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
......@@ -45,10 +58,6 @@ import org.apache.commons.lang.exception.ExceptionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.*;
/**
* @author kavin
......@@ -70,7 +79,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
private final OrderGoodsDao orderGoodsDao;
private final OrderChildDao orderChildDao;
private final OrderService orderService;
private final ThirdAppConfig thirdAppConfig;
private final OrderFeign orderFeign;
public static List<Integer> inProcessStatusList;
public static List<Integer> endStatusList ;
......@@ -271,11 +281,30 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
change = true;
}
if(!StringUtils.equals(item.getPerformanceAbnormalReason(),param.getPerformanceAbnormalReason())){
PerformanceProgressLog log = performanceProgressLogService.generateLog(item.getOrderNo(),
PerformanceProgressLog progressLog = performanceProgressLogService.generateLog(item.getOrderNo(),
PerformanceProgressEnum.LogType.PERFORMANCE_ABNORMAL_REASON,
param.getPerformanceAbnormalReason(),userNo,userName);
logs.add(log);
logs.add(progressLog);
change = true;
//上报履约异常
if (StringUtils.isNotBlank(param.getPerformanceAbnormalReason())) {
FeignOrderVO orderVO = orderFeign.getOrderInfoFeign(item.getOrderNo());
if (orderVO != null && Objects.equals(orderVO.getOrderSource(), SyncPlatformEnum.Source.NEW_OWNER_CLIENT.getCode())) {
OpenCallBackClient openCallBackClient = thirdAppConfig.getOpenCallBackClient(SyncPlatformEnum.Source.NEW_OWNER_CLIENT.getCode().toString());
TransportExceptionReportMessage message = new TransportExceptionReportMessage();
message.setOrderNo(item.getOrderNo());
message.setCreateName(progressLog.getCreateName());
message.setOperateContent(param.getPerformanceAbnormalReason());
message.setReportTime(LocalDateTime.now());
Result<?> result = openCallBackClient.encryptPost(JSONUtil.parse(message).toString(), message.topic());
if (result.succeed()) {
log.info("上报履约异常成功,响应信息:{}", JSONUtil.parse(result));
} else {
log.info("上报履约异常失败,响应信息:{}", JSONUtil.parse(result));
}
}
}
}
if(!StringUtils.equals(item.getDispatchFollow(),param.getDispatchFollow())){
PerformanceProgressLog log = performanceProgressLogService.generateLog(item.getOrderNo(),
......@@ -300,8 +329,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
}
@Override
public List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo) {
List<PerformanceProgressLog> list = performanceProgressLogDao.getOperationLog(orderNo);
public List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo,Integer operateType) {
List<PerformanceProgressLog> list = performanceProgressLogDao.getOperationLog(orderNo,operateType);
return performanceProgressLogStruct.convertList(list);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论