123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- package com.fdkankan.manage.inner.controller;
- import cn.hutool.log.Log;
- import com.fdkankan.common.util.SecurityUtil;
- import com.fdkankan.manage.common.ResultCode;
- import com.fdkankan.manage.common.ResultData;
- import com.fdkankan.manage.controller.BaseController;
- import com.fdkankan.manage.entity.RtkInfo;
- import com.fdkankan.manage.exception.BusinessException;
- import com.fdkankan.manage.service.ICommonService;
- import com.fdkankan.manage.service.IRtkInfoService;
- import com.fdkankan.manage.service.ISceneProService;
- import com.fdkankan.manage.service.IServiceUpTipService;
- import com.fdkankan.manage.util.RsaUtils;
- import com.fdkankan.manage.vo.request.SceneParam;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import org.springframework.web.multipart.MultipartFile;
- import java.util.Date;
- /**
- * <p>
- * TODO
- * </p>
- *
- * @author dengsixing
- * @since 2022/6/7
- **/
- @RestController
- @RequestMapping("/service/manage/inner")
- public class InnerController extends BaseController {
- @Autowired
- private ISceneProService sceneProService;
- @Autowired
- IServiceUpTipService serviceUpTipService;
- @PostMapping("/move")
- public ResultData move(@RequestBody SceneParam param){
- if(!checkSign()){
- return ResultData.error(-1,"签名错误");
- }
- if(StringUtils.isEmpty(param.getNum()) || StringUtils.isEmpty(param.getSnCode())){
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
- }
- sceneProService.move(param);
- return ResultData.ok();
- }
- @GetMapping("/copyScene")
- public ResultData copyScene(@RequestParam(required = false) String num){
- if(!checkSign()){
- return ResultData.error(-1,"签名错误");
- }
- if(StringUtils.isEmpty(num)){
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
- }
- sceneProService.copy(num);
- return ResultData.ok();
- }
- @GetMapping("/getServiceUpTip")
- public ResultData getServiceUpTip(@RequestParam(required = false) Integer type){
- return ResultData.ok( serviceUpTipService.getServiceUpTipByType(type));
- }
- @GetMapping("/rebuildScene")
- public ResultData rebuild(@RequestParam(required = false) String num,@RequestParam(required = false) String from){
- sceneProService.rebuildScene(num,from);
- return ResultData.ok( );
- }
- @Autowired
- IRtkInfoService rtkInfoService;
- /**
- *
- */
- @GetMapping("/info/{rtkSnCode}")
- public ResultData info(@PathVariable String rtkSnCode){
- if(StringUtils.isBlank(rtkSnCode)){
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
- }
- // String token = getSign();
- // if(StringUtils.isBlank(token)){
- // throw new BusinessException(ResultCode.RTK_TOKEN_NOT_EXIT);
- // }
- // try {
- // String deTxt = RsaUtils.decipher(token, RsaUtils.privateKey);
- // if(!deTxt.equals(rtkSnCode)){
- // throw new BusinessException(ResultCode.RTK_TOKEN_ERROR);
- // }
- // }catch (Exception e){
- // throw new BusinessException(ResultCode.RTK_TOKEN_ERROR);
- // }
- RtkInfo rtkInfo = rtkInfoService.getByRtkSnCode(rtkSnCode);
- if(rtkInfo == null){
- throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
- }
- // if(rtkInfo.getStatus() == 0){
- // throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AC);
- // }
- return ResultData.ok(rtkInfo);
- }
- }
|