Blame view

parking-module-pay/src/main/java/com/zteits/pay/job/custcredit/CustCreDitDicJob.java 5.02 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
  //package com.zteits.pay.job.custcredit;
  //
  //
  //import org.apache.commons.collections4.CollectionUtils;
  //import com.alibaba.fastjson.JSONObject;
  //import com.clouds.common.cache.pay.CustUserCreditCacheUtil;
  //import com.clouds.common.constants.ExamineStateEnum;
  //import com.clouds.common.utils.ResultUtils;
  //import com.xxl.job.core.biz.model.ReturnT;
  //import com.xxl.job.core.handler.IJobHandler;
  //import com.xxl.job.core.handler.annotation.JobHander;
  //import com.xxl.job.core.log.XxlJobLogger;
  //import com.zteits.clouds.api.apibase.bean.BizResult;
  //import com.zteits.clouds.api.apibase.constants.BasicEnum;
  //import com.zteits.clouds.api.dto.pay.dto.CustPersonCreditDTO;
  //import com.zteits.clouds.api.dto.pay.dto.CustPersonCreditWebserviceDTO;
  //import com.zteits.clouds.api.dto.pay.param.CustPersonCreditRequest;
  //import com.zteits.clouds.api.service.pay.CustPersonCreditService;
  //import org.slf4j.Logger;
  //import org.slf4j.LoggerFactory;
  //import org.springframework.beans.BeanUtils;
  //import org.springframework.beans.factory.annotation.Autowired;
  //import org.springframework.stereotype.Component;
  //
  //import java.util.Date;
  //import java.util.List;
  //
  ///**
  // * 用户信用积分更新
  // * Copyright: Copyright (c) 2017  zteits
  // *
  // * @ClassName: CustCerDitDicJob.java
  // * @Description:
  // * @version: v1.0.0
  // * @author: wb
  // * @date: 2022年4月28日   下午2:53:38
  // * Modification History:
  // * Date         Author          Version      Description
  // * ---------------------------------------------------------*
  // */
  //@JobHander(value="CustCreDitDicJob")
  //@Component
  //public class CustCreDitDicJob extends IJobHandler{
  //    private static final Logger logger = LoggerFactory.getLogger(CustCreDitDicJob.class);
  //    @Autowired
  //    private CustPersonCreditService custPersonCreditService;
  //
  //    @Override
  //    public ReturnT<String> execute(String... params) throws Exception {
  //
  //        this.logger("---begin开始更新用户信用积分:");
  //        CustPersonCreditRequest request = new CustPersonCreditRequest();
  //        request.setSysCode(BasicEnum.SYS_CODE.getValue());
  //
  //        BizResult<List<CustPersonCreditDTO>> rsList = custPersonCreditService.queryCustPersonCredit(request);
  //        this.logger("本次查询需要更新等级条数=" +(CollectionUtils.isNotEmpty(rsList.getData())));
  //        if(rsList.isSuccess() && rsList.getData()!=null && CollectionUtils.isNotEmpty(rsList.getData())) {
  //            int index = 1;
  //            for(CustPersonCreditDTO dto :rsList.getData()) {
  //                this.logger("begin开始处理第"+(index++)+"条信息="+JSONObject.toJSON(dto));
  //                if(dto == null ||  !dto.getExamineState().equals(ExamineStateEnum.ReviewPass.getValue())){
  //                    this.logger("未审核通过的不更新信用积分!"+dto.getCustId());
  //                    continue;
  //                }
  //                CustPersonCreditRequest custPersonCreditRequest = new CustPersonCreditRequest();
  //                BeanUtils.copyProperties(dto,custPersonCreditRequest);
  //                custPersonCreditRequest.setCustName(dto.getCustName());
  //                custPersonCreditRequest.setCerNumber(dto.getCerNumber());
  //                custPersonCreditRequest.setSysCode(BasicEnum.SYS_CODE.getValue());
  //
  ////                BizResult<CustPersonCreditWebserviceDTO> userCreditFromWebservice = custPersonCreditService.getUserCreditFromWebservice(custPersonCreditRequest);
  ////                CustPersonCreditWebserviceDTO webserviceDTO = ResultUtils.getBizResultData(userCreditFromWebservice);
  ////                this.logger("webservice获取到的信用积分:"+JSONObject.toJSON(webserviceDTO));
  ////                if(webserviceDTO!=null){
  ////                    CustPersonCreditWebserviceDTO.Data dtoData = webserviceDTO.getData();
  ////                    dto.setCreditScore(Integer.parseInt(dtoData.getPdfs()));
  ////                    dto.setCreditRating(dtoData.getPddj());
  ////                    dto.setCreditDic(CustUserCreditCacheUtil.getCreditDic(dtoData.getPddj()));
  ////                    dto.setModfiyDate(new Date());
  ////                }
  //                Integer creditDic = CustUserCreditCacheUtil.getCreditDic(dto.getCreditRating());
  //                this.logger(dto.getCustId()+" 获取等级:"+creditDic);
  //
  //                if(creditDic !=null){
  //                    custPersonCreditRequest.setCreditDic(creditDic);
  //                    dto.setCreditDic(creditDic);
  //                }else {
  //                    custPersonCreditRequest.setCreditDic(100);
  //                    dto.setCreditDic(100);
  //                }
  //                BizResult<Boolean> booleanBizResult = custPersonCreditService.updateByPrimaryKeySelective(custPersonCreditRequest);
  //                if(booleanBizResult.getData()){
  //                    CustUserCreditCacheUtil.setUserCredit(dto);
  //                }
  //            }
  //        }
  //        return ReturnT.SUCCESS;
  //    }
  //
  //
  //    private void logger(String msg){
  //        XxlJobLogger.log(msg);
  //        logger.info(msg);
  //    }
  //}