| | |
| | | package com.fzzy.push.sh2023; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.ApiParam; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.entity.ApiConfs; |
| | | import com.fzzy.api.utils.RedisConst; |
| | | import com.fzzy.api.utils.RedisUtil; |
| | | import com.fzzy.order.OrderApiService; |
| | | import com.fzzy.order.data.OrderConstant; |
| | | import com.fzzy.order.data.OrderData; |
| | |
| | | public class SH2023OrderApiServiceImpl implements OrderApiService { |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private SH2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private SH2023PushService11 sh2023PushService11; |
| | |
| | | |
| | | |
| | | @Override |
| | | public void execute(OrderData req, String orderType, ApiConfs conf) throws ParseException { |
| | | public void execute(OrderData req, String orderType, ApiConfs conf, String orderid) throws ParseException { |
| | | |
| | | // 若指令类型不为1,则返回 |
| | | if(!OrderConstant.ORDER_TYPE_1.equals(orderType)){ |
| | | log.error("指令类型不为1,不进行数据上报={}", req); |
| | | return; |
| | | } |
| | | String ids = req.getContent(); |
| | | if(StringUtils.isEmpty(ids)){ |
| | | log.error("指令接口为空,不进行数据上报={}", req); |
| | | return; |
| | | } |
| | | |
| | | //指令存入缓存,时效24小时 |
| | | String key = RedisConst.buildKey(RedisConst.KYE_ORDER, conf.getKqdm()); |
| | | redisUtil.set(key, orderid, 59 * 60 * 24); |
| | | |
| | | ApiParam param = new ApiParam(); |
| | | param.setPushProtocol(conf.getPushProtocol()); |
| | |
| | | param.setEnd(DateUtils.parseDate(req.getEndtime(), new String[]{"yyyy-MM-dd HH:mm:ss"})); |
| | | param.setDeptId(conf.getDeptId()); |
| | | |
| | | String[] interfaces = ids.split(","); |
| | | log.info("接收的指令中接口内容为={}", req.getContent()); |
| | | String[] interfaces = ids.split(";"); |
| | | for (String inteId : interfaces) { |
| | | log.info("还是执行接口={}的数据上报", inteId); |
| | | param.setInteId(inteId); |
| | | getDataToPush(param, inteId); |
| | | } |