|
|
|
@ -20,6 +20,7 @@ import com.hfkj.service.gas.BsGasService; |
|
|
|
|
import com.hfkj.service.merchant.BsMerchantService; |
|
|
|
|
import com.hfkj.sysenum.agent.AgentTypeEnum; |
|
|
|
|
import com.hfkj.sysenum.merchant.MerchantSourceTypeEnum; |
|
|
|
|
import com.hfkj.sysenum.merchant.MerchantStatusEnum; |
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -166,6 +167,38 @@ public class BsAgentMerServiceImpl implements BsAgentMerService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (agent.getType().equals(AgentTypeEnum.type2.getCode())) { |
|
|
|
|
// 通知
|
|
|
|
|
BsAgentApiParam apiParam = agentApiParamService.getParam(agentId); |
|
|
|
|
if (apiParam != null && StringUtils.isNotBlank(apiParam.getMerInfoNotify())) { |
|
|
|
|
// 创建一个单线程的线程池
|
|
|
|
|
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); |
|
|
|
|
// 异步记录登录信息
|
|
|
|
|
singleThreadExecutor.submit(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
try { |
|
|
|
|
for (String merNo : merNoArray) { |
|
|
|
|
try { |
|
|
|
|
// 查询油站
|
|
|
|
|
ResponseQueryGasInfoModel gasInfo = apiGasService.queryGasInfo(merNo); |
|
|
|
|
gasInfo.setGasStatus(MerchantStatusEnum.status2.getNumber()); |
|
|
|
|
JSONObject notifyParam = JSONObject.parseObject(JSONObject.toJSONString(gasInfo), JSONObject.class); |
|
|
|
|
notifyParam.put("sign", SignatureUtil.createSign(notifyParam, apiParam.getAppSecret())); |
|
|
|
|
// 通知代理提供的URL
|
|
|
|
|
HttpsUtils.doApiPost(apiParam.getMerInfoNotify(), notifyParam); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
System.out.println("通知代理商:"+apiParam.getAgentId()+"失败"+e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
System.out.println("通知代理商:"+apiParam.getAgentId()+"失败"+e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|