mirror of
https://gitee.com/sdyunze/iotlink.git
synced 2026-10-31 02:01:46 +08:00
补充轮询业务
This commit is contained in:
@@ -1360,7 +1360,26 @@ public class YzCardController extends MyBaseController {
|
||||
return Myerr("物联卡 公开查询简要信息 操作失败!");
|
||||
}
|
||||
|
||||
@Log(title = "添加卡至自动轮训", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('yunze:card:showhistoryUsed')")
|
||||
@PostMapping(value = "/addAutoPolling", produces = {"application/json;charset=utf-8"})
|
||||
public String addAutoPolling(@RequestBody String Pstr) {
|
||||
HashMap<String, Object> Parammap = new HashMap<String, Object>();
|
||||
if (Pstr != null) {
|
||||
Pstr = Pstr.replace("%2F", "/");//转义 /
|
||||
}
|
||||
try {
|
||||
Pstr = AesEncryptUtil.desEncrypt(Pstr);
|
||||
Parammap.putAll(JSON.parseObject(Pstr));
|
||||
return MyRetunSuccess(null, yzCardServiceImpl.addAutoPolling(Parammap));
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
|
||||
logger.error("<br/> updPwd <br/> Pstr = " + Pstr + " <br/> ip = " + ip + " <br/> ", e.getCause().toString());
|
||||
}
|
||||
return Myerr("添加卡至自动轮训 操作失败!");
|
||||
}
|
||||
/**
|
||||
* 获取 上游单卡订购套餐列表
|
||||
*
|
||||
|
||||
@@ -582,7 +582,8 @@ public interface YzCardMapper
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> findSynIsExist(Map map);
|
||||
|
||||
void addAutoPolling(Map<String,Object> map);
|
||||
String selCardIsInAuto(Map<String,Object> map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2244,7 +2244,13 @@
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="addAutoPolling" parameterType="java.util.Map">
|
||||
insert into yz_auto_polling(iccid,route_id)values(#{iccid},#{channel_id})
|
||||
</insert>
|
||||
|
||||
<select id="selCardIsInAuto" parameterType="java.util.Map" resultType="java.lang.String">
|
||||
select iccid from yz_auto_polling where iccid =#{iccid}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1279,8 +1279,24 @@ public class YzCardServiceImpl implements IYzCardService {
|
||||
return retMap;
|
||||
}
|
||||
|
||||
public String addAutoPolling(HashMap<String, Object> parammap) {
|
||||
try{
|
||||
String iccid = yzCardMapper.selCardIsInAuto(parammap);
|
||||
if (iccid == null) {
|
||||
yzCardMapper.addAutoPolling(parammap);
|
||||
return "添加成功!";
|
||||
}else{
|
||||
return "卡已添加至自动轮训!请勿重复操作!";
|
||||
}
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
return "添加失败!:"+e.getMessage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public boolean isClose(String ip, String method, int times) {
|
||||
String key = ip + "_api" + method;
|
||||
Long count = redisCache.increment(key, 1);
|
||||
|
||||
Reference in New Issue
Block a user