| | |
| | | |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.dto.ApiCheckTraceInfoDto; |
| | | import cc.mrbird.febs.mall.entity.AppVersion; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.mapper.AppVersionMapper; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.service.ICommonService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.best.javaSdk.Client; |
| | | import com.best.javaSdk.kdTraceQuery.request.KdTraceQueryReq; |
| | | import com.best.javaSdk.kdTraceQuery.request.MailNos; |
| | | import com.best.javaSdk.kdTraceQuery.response.KdTraceQueryRsp; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public List<DataDictionaryCustom> findDataDicByType(String type) { |
| | | List<DataDictionaryCustom> dataDictionaryCustoms = dataDictionaryCustomMapper.selectDicByType(type); |
| | | if(type.equals("KEFU_SET")){ |
| | | if(CollUtil.isEmpty(dataDictionaryCustoms)){ |
| | | DataDictionaryCustom dataDictionaryCustom = new DataDictionaryCustom(); |
| | | dataDictionaryCustom.setType(type); |
| | | dataDictionaryCustom.setCode("WEIXIN"); |
| | | dataDictionaryCustom.setDescription("微信客服"); |
| | | dataDictionaryCustomMapper.insert(dataDictionaryCustom); |
| | | DataDictionaryCustom dataDictionaryCustom2 = new DataDictionaryCustom(); |
| | | dataDictionaryCustom2.setType(type); |
| | | dataDictionaryCustom2.setCode("WHATSAPP"); |
| | | dataDictionaryCustom2.setDescription("WhatsApp客服"); |
| | | dataDictionaryCustomMapper.insert(dataDictionaryCustom2); |
| | | } |
| | | } |
| | | |
| | | return dataDictionaryCustomMapper.selectDicByType(type); |
| | | } |
| | | |
| | |
| | | dic.setDescription(description); |
| | | dataDictionaryCustomMapper.insert(dic); |
| | | } |
| | | |
| | | @Override |
| | | public KdTraceQueryRsp checkTraceInfo(ApiCheckTraceInfoDto checkTraceInfoDto) { |
| | | /** |
| | | * 正式环境 |
| | | * MY_LEADING 生产环境参数 |
| | | * partnerID : MY_LEADING |
| | | * partnerKey : ER5DFRT320D4ed6FAFs3G410Fs977 |
| | | * Endpoint :http://sgp-seaedi.800best.com/Malaysia/kdapi/api/proces |
| | | */ |
| | | String url = "http://sgp-seaedi.800best.com/Malaysia/kdapi/api/process"; |
| | | String partnerID = "MY_LEADING"; |
| | | String partnerKey = "ER5DFRT320D4ed6FAFs3G410Fs977"; |
| | | String format = "JSON"; |
| | | /** |
| | | * 测试环境 |
| | | * 测试物流编号 66660451238000 |
| | | */ |
| | | // String url = "http://sea-edi-hxtest.800best.com/Malaysia/kdapi/api/process"; |
| | | // String partnerID = "M_TEST"; |
| | | // String partnerKey = "TEST12345"; |
| | | // String format = "JSON"; |
| | | |
| | | Client client = new Client(url, partnerID, partnerKey, format); |
| | | |
| | | KdTraceQueryReq tdTraceQueryReq = new KdTraceQueryReq(); |
| | | MailNos mailNos = new MailNos(); |
| | | List<String> mailNo = new ArrayList<>(); |
| | | mailNo.add(checkTraceInfoDto.getTraceNo()); |
| | | mailNos.setMailNo(mailNo); |
| | | tdTraceQueryReq.setMailNos(mailNos); |
| | | tdTraceQueryReq.setLangType("zh-CN"); |
| | | |
| | | KdTraceQueryRsp kdTraceQueryRsp = client.executed(tdTraceQueryReq); |
| | | return kdTraceQueryRsp; |
| | | } |
| | | } |