|
@ -0,0 +1,142 @@
|
|
|
package com.yihu.iot.controller.device;
|
|
|
|
|
|
import com.yihu.iot.service.device.IotDeviceSimService;
|
|
|
import com.yihu.jw.entity.iot.device.IotDeviceOrderDO;
|
|
|
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
|
|
|
import com.yihu.jw.entity.iot.platform.IotInterfaceAuditDO;
|
|
|
import com.yihu.jw.restmodel.iot.company.IotCompanyVO;
|
|
|
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
import com.yihu.jw.rm.iot.IotRequestMapping;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* @author HZY
|
|
|
* @vsrsion 1.0
|
|
|
* Created at 2020/5/7
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(IotRequestMapping.Common.sim)
|
|
|
@Api(tags = "SIM卡管理相关操作", description = "SIM卡管理相关操作")
|
|
|
public class IotDeviceSimController extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
|
private IotDeviceSimService iotDeviceSimService;
|
|
|
|
|
|
|
|
|
@PostMapping(value = IotRequestMapping.DeviceSim.editSIM)
|
|
|
@ApiOperation(value = "编辑SIM卡管理", notes = "编辑SIM卡管理")
|
|
|
public MixEnvelop<IotOrderVO, IotOrderVO> editSIM(@ApiParam(name = "id", value = "ID", defaultValue = "")
|
|
|
@RequestParam(value = "id",required = true) String id,
|
|
|
@ApiParam(name = "advancePayment", value = "预缴金额", defaultValue = "")
|
|
|
@RequestParam(value = "advancePayment",required = true) String advancePayment,
|
|
|
@ApiParam(name = "payment", value = "套餐资费", defaultValue = "")
|
|
|
@RequestParam(value = "payment",required = true) String payment,
|
|
|
@ApiParam(name = "remainingBalance", value = "余额", defaultValue = "")
|
|
|
@RequestParam(value = "remainingBalance",required = true) String remainingBalance,
|
|
|
@ApiParam(name = "status", value = "状态", defaultValue = "1")
|
|
|
@RequestParam(value = "status",required = true) Integer status) {
|
|
|
try {
|
|
|
iotDeviceSimService.editSIM(id,advancePayment,payment,remainingBalance,status);
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.DeviceSim.message_success_add);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping(value = IotRequestMapping.DeviceSim.addSIM)
|
|
|
@ApiOperation(value = "添加SIM卡", notes = "添加SIM卡")
|
|
|
public MixEnvelop<IotOrderVO, IotOrderVO> addSIM(@ApiParam(name = "json", value = "json", defaultValue = "")
|
|
|
@RequestParam(value = "json",required = true) String json) {
|
|
|
try {
|
|
|
|
|
|
return iotDeviceSimService.addSIM(json);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping(value = IotRequestMapping.DeviceSim.conditionQueryPage)
|
|
|
@ApiOperation(value = "条件查找SIM卡", notes = "条件查找SIM卡")
|
|
|
public MixEnvelop<IotDeviceSimDO, IotDeviceSimDO> conditionQueryPage(@ApiParam(name = "sim", value = "SIM卡", defaultValue = "")
|
|
|
@RequestParam(value = "sim", required = false) String sim,
|
|
|
@ApiParam(name = "sn", value = "SN码", defaultValue = "")
|
|
|
@RequestParam(value = "sn", required = false) String sn,
|
|
|
@ApiParam(name = "status", value = "状态", defaultValue = "")
|
|
|
@RequestParam(value = "status", required = false) String status,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
try {
|
|
|
if(page == null|| page < 0){
|
|
|
page = 1;
|
|
|
}
|
|
|
if(size == null){
|
|
|
size = 10;
|
|
|
}
|
|
|
|
|
|
return iotDeviceSimService.conditionQueryPage(page,size,status,sim,sn);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = IotRequestMapping.DeviceSim.findAllSim)
|
|
|
@ApiOperation(value = "分页查询所有SIM卡信息",notes = "分页查询所有SIM卡信息")
|
|
|
public MixEnvelop<IotDeviceSimDO,IotDeviceSimDO> findAllSim(@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = false) Integer page,
|
|
|
@ApiParam(name = "size", value = "每页记录数", defaultValue = "")
|
|
|
@RequestParam(value = "size", required = false) Integer size){
|
|
|
|
|
|
try {
|
|
|
if(page == null|| page < 0){
|
|
|
page = 1;
|
|
|
}
|
|
|
if(size == null){
|
|
|
size = 10;
|
|
|
}
|
|
|
return iotDeviceSimService.findAllSim(page,size);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = IotRequestMapping.DeviceSim.remind)
|
|
|
@ApiOperation(value = "分页查询所有SIM卡信息",notes = "分页查询所有SIM卡信息")
|
|
|
public MixEnvelop<IotDeviceSimDO,IotDeviceSimDO> remind(@ApiParam(name = "time", value = "提醒时间", defaultValue = "")
|
|
|
@RequestParam(value = "time", required = false) String time,
|
|
|
@ApiParam(name = "money", value = "提醒金额", defaultValue = "")
|
|
|
@RequestParam(value = "money", required = false) String money,
|
|
|
@ApiParam(name = "status", value = "是否欠费提醒", defaultValue = "0")
|
|
|
@RequestParam(value = "status", required = false) String status){
|
|
|
|
|
|
try {
|
|
|
|
|
|
iotDeviceSimService.remind(time,money,status);
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.DeviceSim.message_success_remind);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return MixEnvelop.getError(e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|