运营加入物联网 门禁 道闸 进出记录 车辆进出记录等数据
| New file |
| | |
| | | package com.java110.job.cmd.iot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "iot.listAdminAccessControlInout") |
| | | public class ListAdminAccessControlInoutCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private ISendIot sendIotImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | String iotSwitch = MappingCache.getValue("IOT", "IOT_SWITCH"); |
| | | if (!"ON".equals(iotSwitch)) { |
| | | throw new CmdException("物联网系统未部署"); |
| | | } |
| | | |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | String storeId = CmdContextUtils.getStoreId(context); |
| | | |
| | | reqJson.put("adminUserId", userDtos.get(0).getUserId()); |
| | | reqJson.put("adminUserTel", userDtos.get(0).getTel()); |
| | | reqJson.put("adminStoreId", storeId); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | ResultVo resultVo = sendIotImpl.postAdmin("listAdminAccessControlInoutBmoImpl", reqJson); |
| | | |
| | | if (resultVo.getCode() != ResultVo.CODE_OK) { |
| | | throw new CmdException(resultVo.getMsg()); |
| | | } |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(resultVo)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.cmd.iot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "iot.listAdminCarInoutDetail") |
| | | public class ListAdminCarInoutDetailCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private ISendIot sendIotImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | String iotSwitch = MappingCache.getValue("IOT", "IOT_SWITCH"); |
| | | if (!"ON".equals(iotSwitch)) { |
| | | throw new CmdException("物联网系统未部署"); |
| | | } |
| | | |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | String storeId = CmdContextUtils.getStoreId(context); |
| | | |
| | | reqJson.put("adminUserId", userDtos.get(0).getUserId()); |
| | | reqJson.put("adminUserTel", userDtos.get(0).getTel()); |
| | | reqJson.put("adminStoreId", storeId); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | ResultVo resultVo = sendIotImpl.postAdmin("listAdminCarInoutDetailBmoImpl", reqJson); |
| | | |
| | | if (resultVo.getCode() != ResultVo.CODE_OK) { |
| | | throw new CmdException(resultVo.getMsg()); |
| | | } |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(resultVo)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.cmd.iot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "iot.listAdminChargeMachineOrder") |
| | | public class ListAdminChargeMachineOrderCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private ISendIot sendIotImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | String iotSwitch = MappingCache.getValue("IOT", "IOT_SWITCH"); |
| | | if (!"ON".equals(iotSwitch)) { |
| | | throw new CmdException("物联网系统未部署"); |
| | | } |
| | | |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | String storeId = CmdContextUtils.getStoreId(context); |
| | | |
| | | reqJson.put("adminUserId", userDtos.get(0).getUserId()); |
| | | reqJson.put("adminUserTel", userDtos.get(0).getTel()); |
| | | reqJson.put("adminStoreId", storeId); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | ResultVo resultVo = sendIotImpl.postAdmin("listAdminChargeMachineOrderBmoImpl", reqJson); |
| | | |
| | | if (resultVo.getCode() != ResultVo.CODE_OK) { |
| | | throw new CmdException(resultVo.getMsg()); |
| | | } |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(resultVo)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.cmd.iot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "iot.listAdminMeterCharge") |
| | | public class ListAdminMeterChargeCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private ISendIot sendIotImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | String iotSwitch = MappingCache.getValue("IOT", "IOT_SWITCH"); |
| | | if (!"ON".equals(iotSwitch)) { |
| | | throw new CmdException("物联网系统未部署"); |
| | | } |
| | | |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | String storeId = CmdContextUtils.getStoreId(context); |
| | | |
| | | reqJson.put("adminUserId", userDtos.get(0).getUserId()); |
| | | reqJson.put("adminUserTel", userDtos.get(0).getTel()); |
| | | reqJson.put("adminStoreId", storeId); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | ResultVo resultVo = sendIotImpl.postAdmin("listAdminMeterChargeBmoImpl", reqJson); |
| | | |
| | | if (resultVo.getCode() != ResultVo.CODE_OK) { |
| | | throw new CmdException(resultVo.getMsg()); |
| | | } |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(resultVo)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.job.cmd.iot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "iot.listAdminMeterMachine") |
| | | public class ListAdminMeterMachineCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private ISendIot sendIotImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | super.validatePageInfo(reqJson); |
| | | super.validateAdmin(context); |
| | | String iotSwitch = MappingCache.getValue("IOT", "IOT_SWITCH"); |
| | | if (!"ON".equals(iotSwitch)) { |
| | | throw new CmdException("物联网系统未部署"); |
| | | } |
| | | |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | String storeId = CmdContextUtils.getStoreId(context); |
| | | |
| | | reqJson.put("adminUserId", userDtos.get(0).getUserId()); |
| | | reqJson.put("adminUserTel", userDtos.get(0).getTel()); |
| | | reqJson.put("adminStoreId", storeId); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | ResultVo resultVo = sendIotImpl.postAdmin("listAdminMeterMachineBmoImpl", reqJson); |
| | | |
| | | if (resultVo.getCode() != ResultVo.CODE_OK) { |
| | | throw new CmdException(resultVo.getMsg()); |
| | | } |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(resultVo)); |
| | | } |
| | | } |