作者 张晓杰

机器人

正在显示 25 个修改的文件 包含 2026 行增加21 行删除
package org.jeecg.modules.erp.depot.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
... ... @@ -15,9 +14,10 @@ import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.erp.depot.entity.TblDepot;
import org.jeecg.modules.erp.depot.mapper.TblDepotMapper;
import org.jeecg.modules.erp.depot.form.TblDepotForm;
import org.jeecg.modules.erp.depot.mapper.TblDepotTestMapper;
import org.jeecg.modules.erp.depot.service.ITblDepotService;
import org.jeecg.modules.erp.robot.service.impl.YjRobotService;
import org.jeecg.modules.erp.meterial.entity.TblMaterial;
import org.jeecg.modules.erp.meterial.service.ITblMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -26,12 +26,9 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
/**
* @Description: tbl_depot
* @Author: jeecg-boot
* @Date: 2022-07-06
... ... @@ -48,6 +45,9 @@ public class TblDepotController extends JeecgController<TblDepot, ITblDepotServi
private ITblMaterialService tblMaterialService;
@Autowired
private YjRobotService yjRobotService;
@Autowired
TblDepotTestMapper tblDepotMapper;
@GetMapping("/updateData")
... ... @@ -77,15 +77,15 @@ public class TblDepotController extends JeecgController<TblDepot, ITblDepotServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Map<String,String[]> map = new HashMap<>(req.getParameterMap());
System.out.println(JSONUtil.toJsonStr(map));
// Map<String,String[]> map = new HashMap<>(req.getParameterMap());
// System.out.println(JSONUtil.toJsonStr(map));
// if (!(map.containsKey("operTime_begin") || map.containsKey("operTime_end"))){
// String[] time_begin = new String[]{DateUtil.formatDate(DateUtil.beginOfMonth(DateUtil.date()))};
// map.put("operTime_begin",time_begin);
// map.put("operTime_end",new String[]{DateUtil.now()});
// }
// System.out.println(JSONUtil.toJsonStr(map));
QueryWrapper<TblDepot> queryWrapper = QueryGenerator.initQueryWrapper(tblDepot, map);
QueryWrapper<TblDepot> queryWrapper = QueryGenerator.initQueryWrapper(tblDepot, req.getParameterMap());
Page<TblDepot> page = new Page<TblDepot>(pageNo, pageSize);
IPage<TblDepot> pageList = tblDepotService.page(page, queryWrapper);
return Result.OK(pageList);
... ... @@ -108,13 +108,13 @@ public class TblDepotController extends JeecgController<TblDepot, ITblDepotServi
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Map<String,String[]> map = new HashMap<>(req.getParameterMap());
// Map<String,String[]> map = new HashMap<>(req.getParameterMap());
// if (!(map.containsKey("operTime_begin") || map.containsKey("operTime_end"))){
// String[] time_begin = new String[]{DateUtil.formatDate(DateUtil.beginOfMonth(DateUtil.date()))};
// map.put("operTime_begin",time_begin);
// map.put("operTime_end",new String[]{DateUtil.now()});
// }
QueryWrapper<TblDepot> queryWrapper = QueryGenerator.initQueryWrapper(tblDepot, map);
QueryWrapper<TblDepot> queryWrapper = QueryGenerator.initQueryWrapper(tblDepot, req.getParameterMap());
Page<TblDepot> page = new Page<TblDepot>(pageNo, pageSize);
IPage<TblDepot> pageList = tblDepotService.page(page, queryWrapper);
return Result.OK(pageList);
... ... @@ -146,15 +146,16 @@ public class TblDepotController extends JeecgController<TblDepot, ITblDepotServi
/**
* 添加
*
* @param tblDepot
* @param tblDepotForm
* @return
*/
@AutoLog(value = "tbl_depot-添加")
@ApiOperation(value="tbl_depot-添加", notes="tbl_depot-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TblDepot tblDepot) {
TblDepot tblDepot1 = tblDepotService.selectByPartNumber(tblDepot.getPartNumber());
public Result<String> add(@RequestBody TblDepotForm tblDepotForm) {
TblDepot tblDepot = new TblDepot();
BeanUtil.copyProperties(tblDepotForm, tblDepot);
TblDepot tblDepot1 = tblDepotService.selectByPartNumber(tblDepotForm.getPartNumber());
if(tblDepot.getDepotType().equals("入库")){
tblDepot.setCurrentInventory((tblDepot1 != null && tblDepot1.getCurrentInventory() != null) ? tblDepot1.getCurrentInventory() + tblDepot.getOperNumber() : tblDepot.getOperNumber());
tblDepotService.save(tblDepot);
... ... @@ -180,11 +181,21 @@ public class TblDepotController extends JeecgController<TblDepot, ITblDepotServi
tblDepotService.save(tblDepot);
}
}
// int code = 0;
// if(tblDepot.getDepotType().equals("入库") || (tblDepot.getDepotType().equals("出库") && "1".equals(tblDepotForm.getIsCallRobot()))) {
// Map<String, Object> returnMap = yjRobotService.movetoTarget(tblDepotForm.getTemplateId(), tblDepotForm.getRobotName(), tblDepotForm.getPointId());
// code = Integer.parseInt(returnMap.get("code").toString());
// }
// if(code ==0){
// return Result.OK("添加成功!召唤机器人送物成功");
// }
return Result.OK("添加成功!");
// return Result.OK("添加成功!召唤机器人送物失败,再次召唤机器人");
return Result.OK("操作成功");
}
/**
* 获取数据
* @return
... ... @@ -206,6 +217,21 @@ public class TblDepotController extends JeecgController<TblDepot, ITblDepotServi
@AutoLog(value = "tbl_depot-编辑")
@ApiOperation(value="tbl_depot-编辑", notes="tbl_depot-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
// public Result<String> edit(@RequestBody TblDepotForm tblDepotForm) {
// TblDepot tblDepot = new TblDepot();
// BeanUtil.copyProperties(tblDepotForm, tblDepot);
// tblDepotService.updateById(tblDepot);
// int code = 0;
// if(tblDepot.getDepotType().equals("出库") && "1".equals(tblDepotForm.getIsCallRobot())) {
// Map<String, Object> returnMap = yjRobotService.movetoTarget(tblDepotForm.getTemplateId(), tblDepotForm.getRobotName(), tblDepotForm.getPointId());
// code = Integer.parseInt(returnMap.get("code").toString());
// }
// if(code ==0){
// return Result.OK("编辑成功!召唤机器人送物成功");
// }
// return Result.OK("编辑成功!召唤机器人送物失败,再次召唤机器人");
// }
public Result<String> edit(@RequestBody TblDepot tblDepot) {
tblDepotService.updateById(tblDepot);
return Result.OK("编辑成功!");
... ...
package org.jeecg.modules.erp.depot.form;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: tbl_depot
* @Author: jeecg-boot
* @Date: 2022-07-06
* @Version: V1.0
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbl_depot对象", description="tbl_depot")
public class TblDepotForm implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
private java.lang.String id;
/**创建人*/
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date createTime;
/**更新人*/
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date updateTime;
/**领料人*/
private java.lang.String ling;
/**领料环节*/
private java.lang.String lingSysOrgCode;
/**所属部门*/
private java.lang.String sysOrgCode;
/**零件编号*/
private java.lang.String partNumber;
/**品名*/
private java.lang.String productName;
/**规格*/
private java.lang.String spec;
/**型号*/
private java.lang.String type;
/**采购性质*/
@Dict(dicCode = "buying_classify")
private java.lang.String buyingClassify;
/**数量*/
private java.lang.Integer operNumber;
/**类型(出库/入库)*/
private java.lang.String depotType;
private java.lang.String workOrder;
/**出入库时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date operTime;
/**当前库存量*/
private java.lang.Integer currentInventory;
private String isCallRobot;
private String robotName;
private String pointId;
private String templateId;
}
... ...
/**
*
*/
package org.jeecg.modules.erp.depot.service.impl;
import java.net.URI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@Service
public class RestTempService {
private final RestTemplate restTemplate;
@Autowired
public RestTempService(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
public String getWithHeaderAuth(String apiUrl, String authToken) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Authorization", "Bearer " + authToken); // 假设使用Bearer Token认证
HttpEntity<String> entity = new HttpEntity<>("", headers);
ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.GET, entity, String.class);
if (response.getStatusCode().is2xxSuccessful()) {
return response.getBody();
} else {
throw new RuntimeException("Failed to call API: " + response.getStatusCode());
}
// return response.getBody();
}
public String postWithHeaderAuth(String apiUrl, String authToken, Object requestBody) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Authorization", "Bearer " + authToken);
HttpEntity<Object> entity = new HttpEntity<>(requestBody, headers);
ResponseEntity<String> response = restTemplate.postForEntity(apiUrl, entity, String.class);
return response.getBody();
}
public String postWithHeaderAuth3(String apiUrl, String authToken, Object requestBody) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("token", authToken);
HttpEntity<Object> entity = new HttpEntity<>(requestBody, headers);
ResponseEntity<String> response = restTemplate.postForEntity(apiUrl, entity, String.class);
return response.getBody();
}
public String postWithHeaderAuth2(String apiUrl, Object requestBody) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
// headers.set("Custom-Header", "XXXX-TESTXXXX");
HttpEntity<Object> entity = new HttpEntity<>(requestBody, headers);
ResponseEntity<String> response = restTemplate.postForEntity(apiUrl, entity, String.class);
return response.getBody();
}
/**
* @param entity
* @return
*/
public String getWithHeaderAuth(String apiUrl, HttpEntity<Object> entity) {
ResponseEntity<String> response = restTemplate.getForEntity(apiUrl, String.class);
return response.getBody();
}
/**
* @param uri
* @return
*/
public String getWithHeaderAuth(URI uri) {
ResponseEntity<String> response = restTemplate.getForEntity(uri, String.class);
return response.getBody();
}
/**
* @param url
* @param entity
* @return
*/
public String postWithHeaderAuth3(String url, HttpEntity<Object> entity) {
ResponseEntity<String> response = restTemplate.postForEntity(url, entity, String.class);
return response.getBody();
}
/**
* @param url
* @param entity
* @return
*/
public String putWithHeaderAuth(String url, HttpEntity<Object> entity) {
// ResponseEntity<String> response = restTemplate.put(url, entity, String.class);
//
// return response.getBody();
// 发送 PUT 请求
ResponseEntity<String> responseEntity = restTemplate.exchange(
url,
HttpMethod.PUT,
entity,
String.class // 这里假设你期望的响应体是 String 类型的,你可以根据需要更改
);
// 检查响应状态码并处理
if (responseEntity.getStatusCode().is2xxSuccessful()) {
// 请求成功,返回响应体
return responseEntity.getBody();
} else {
// 请求失败,可以抛出异常或者返回错误信息等
throw new RuntimeException("PUT 请求失败: " + responseEntity.getStatusCode());
}
}
}
... ...
package org.jeecg.modules.erp.robot.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.erp.robot.entity.TblRobotCabin;
import org.jeecg.modules.erp.robot.service.ITblRobotCabinService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: tbl_robot_cabin
* @Author: jeecg-boot
* @Date: 2024-10-24
* @Version: V1.0
*/
@Api(tags="tbl_robot_cabin")
@RestController
@RequestMapping("/robotCabin/tblRobotCabin")
@Slf4j
public class TblRobotCabinController extends JeecgController<TblRobotCabin, ITblRobotCabinService> {
@Autowired
private ITblRobotCabinService tblRobotCabinService;
@GetMapping(value = "/queryList")
public Result<List<Map<String,Object>>> queryList(HttpServletRequest req) {
List<Map<String, Object>> list = tblRobotCabinService.getList();
return Result.OK(list);
}
/**
* 分页列表查询
*
* @param tblRobotCabin
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tbl_robot_cabin-分页列表查询")
@ApiOperation(value="tbl_robot_cabin-分页列表查询", notes="tbl_robot_cabin-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TblRobotCabin>> queryPageList(TblRobotCabin tblRobotCabin,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TblRobotCabin> queryWrapper = QueryGenerator.initQueryWrapper(tblRobotCabin, req.getParameterMap());
Page<TblRobotCabin> page = new Page<TblRobotCabin>(pageNo, pageSize);
IPage<TblRobotCabin> pageList = tblRobotCabinService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param tblRobotCabin
* @return
*/
@AutoLog(value = "tbl_robot_cabin-添加")
@ApiOperation(value="tbl_robot_cabin-添加", notes="tbl_robot_cabin-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TblRobotCabin tblRobotCabin) {
tblRobotCabinService.save(tblRobotCabin);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param tblRobotCabin
* @return
*/
@AutoLog(value = "tbl_robot_cabin-编辑")
@ApiOperation(value="tbl_robot_cabin-编辑", notes="tbl_robot_cabin-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TblRobotCabin tblRobotCabin) {
tblRobotCabinService.updateById(tblRobotCabin);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "tbl_robot_cabin-通过id删除")
@ApiOperation(value="tbl_robot_cabin-通过id删除", notes="tbl_robot_cabin-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
tblRobotCabinService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "tbl_robot_cabin-批量删除")
@ApiOperation(value="tbl_robot_cabin-批量删除", notes="tbl_robot_cabin-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.tblRobotCabinService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "tbl_robot_cabin-通过id查询")
@ApiOperation(value="tbl_robot_cabin-通过id查询", notes="tbl_robot_cabin-通过id查询")
@GetMapping(value = "/queryById")
public Result<TblRobotCabin> queryById(@RequestParam(name="id",required=true) String id) {
TblRobotCabin tblRobotCabin = tblRobotCabinService.getById(id);
if(tblRobotCabin==null) {
return Result.error("未找到对应数据");
}
return Result.OK(tblRobotCabin);
}
/**
* 导出excel
*
* @param request
* @param tblRobotCabin
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TblRobotCabin tblRobotCabin) {
return super.exportXls(request, tblRobotCabin, TblRobotCabin.class, "tbl_robot_cabin");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TblRobotCabin.class);
}
}
... ...
package org.jeecg.modules.erp.robot.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.erp.robot.entity.TblRobot;
import org.jeecg.modules.erp.robot.service.ITblRobotService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: tbl_robot
* @Author: jeecg-boot
* @Date: 2024-11-06
* @Version: V1.0
*/
@Api(tags="tbl_robot")
@RestController
@RequestMapping("/robot/tblRobot")
@Slf4j
public class TblRobotController extends JeecgController<TblRobot, ITblRobotService> {
@Autowired
private ITblRobotService tblRobotService;
/**
* 分页列表查询
*
* @param tblRobot
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "tbl_robot-分页列表查询")
@ApiOperation(value="tbl_robot-分页列表查询", notes="tbl_robot-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TblRobot>> queryPageList(TblRobot tblRobot,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TblRobot> queryWrapper = QueryGenerator.initQueryWrapper(tblRobot, req.getParameterMap());
Page<TblRobot> page = new Page<TblRobot>(pageNo, pageSize);
IPage<TblRobot> pageList = tblRobotService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param tblRobot
* @return
*/
@AutoLog(value = "tbl_robot-添加")
@ApiOperation(value="tbl_robot-添加", notes="tbl_robot-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TblRobot tblRobot) {
tblRobotService.save(tblRobot);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param tblRobot
* @return
*/
@AutoLog(value = "tbl_robot-编辑")
@ApiOperation(value="tbl_robot-编辑", notes="tbl_robot-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TblRobot tblRobot) {
tblRobotService.updateById(tblRobot);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "tbl_robot-通过id删除")
@ApiOperation(value="tbl_robot-通过id删除", notes="tbl_robot-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
tblRobotService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "tbl_robot-批量删除")
@ApiOperation(value="tbl_robot-批量删除", notes="tbl_robot-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.tblRobotService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "tbl_robot-通过id查询")
@ApiOperation(value="tbl_robot-通过id查询", notes="tbl_robot-通过id查询")
@GetMapping(value = "/queryById")
public Result<TblRobot> queryById(@RequestParam(name="id",required=true) String id) {
TblRobot tblRobot = tblRobotService.getById(id);
if(tblRobot==null) {
return Result.error("未找到对应数据");
}
return Result.OK(tblRobot);
}
/**
* 导出excel
*
* @param request
* @param tblRobot
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TblRobot tblRobot) {
return super.exportXls(request, tblRobot, TblRobot.class, "tbl_robot");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TblRobot.class);
}
}
... ...
package org.jeecg.modules.erp.robot.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.erp.robot.service.impl.YjRobotService;
import org.jeecg.modules.erp.robot.entity.TblRobotPoints;
import org.jeecg.modules.erp.robot.service.ITblRobotPointsService;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
/**
* @Description: 机器人点位设置
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Api(tags="机器人点位设置")
@RestController
@RequestMapping("/robotPoints/tblRobotPoints")
@Slf4j
public class TblRobotPointsController extends JeecgController<TblRobotPoints, ITblRobotPointsService> {
@Autowired
private ITblRobotPointsService tblRobotPointsService;
@Autowired
private YjRobotService yjRobotService;
// /**
// * 分页列表查询
// *
// * @param tblRobotPoints
// * @param pageNo
// * @param pageSize
// * @param req
// * @return
// */
//@AutoLog(value = "机器人点位设置-分页列表查询")
// @ApiOperation(value="机器人点位设置-分页列表查询", notes="机器人点位设置-分页列表查询")
// @GetMapping(value = "/list")
// public Result<IPage<TblRobotPoints>> queryPageList(TblRobotPoints tblRobotPoints,
// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
// HttpServletRequest req) {
// QueryWrapper<TblRobotPoints> queryWrapper = QueryGenerator.initQueryWrapper(tblRobotPoints, req.getParameterMap());
// Page<TblRobotPoints> page = new Page<TblRobotPoints>(pageNo, pageSize);
// IPage<TblRobotPoints> pageList = tblRobotPointsService.page(page, queryWrapper);
// return Result.OK(pageList);
// }
@GetMapping(value = "/queryList")
public Result<List<Map<String,Object>>> queryList(HttpServletRequest req) {
List<Map<String, Object>> list = tblRobotPointsService.getList();
return Result.OK(list);
}
@Value("${robot.yunji.storeId}")
private String storeId;
@Value("${robot.yunji.deviceName}")
private String deviceName;
@Value("${robot.yunji.pointId}")
private String pointId;
@Value("${robot.yunji.deviceId}")
private String deviceId;
/**
* 召唤机器人送物
* @return
*/
@PostMapping(value = "/movetoTarget")
public Result<String> movetoTarget(@RequestBody Map<String,Object> map) {
String robotName = map.get("robotName").toString();
String pointId = map.get("pointId").toString();
Map<String, Object> returnMap = null;
if(robotName.startsWith("SCWM")){
String templateId = map.get("templateId").toString();
int overtime = Integer.parseInt(map.get("overtime").toString());
returnMap = yjRobotService.movetoTarget(templateId,robotName, pointId,overtime);
}else if(robotName.startsWith("SCSK")){
String via = map.get("via").toString();
returnMap = yjRobotService.callAndDelivery(pointId,via);
}
int code = Integer.parseInt(returnMap.get("code").toString());
if(code==0){
return Result.OK("召唤成功!");
}else{
return Result.error("召唤失败,请重试!");
}
}
@PostMapping(value = "/returnToCabin")
public Result<String> returnToCabin(@RequestBody Map<String,Object> map) {
String robotName = map.get("robotName").toString();
String cabinId = map.get("cabinId").toString();
Map<String, Object> map1 = yjRobotService.dockingCabinAndDockingDown(robotName,cabinId);
int code = Integer.parseInt(map1.get("code").toString());
if(code == 0){
return Result.OK("操作成功");
}
return Result.error("操作失败");
}
@GetMapping(value = "/getRobotGoCharge")
public Result<String> getRobotGoCharge(HttpServletRequest req) {
Map<String, Object> gochargeMap = yjRobotService.gocharge(deviceId);
int code1 = Integer.parseInt(gochargeMap.get("code").toString());
if(code1 == 0) {
return Result.OK("操作成功");
}
return Result.error("操作失败");
}
@PostMapping(value = "/cancleMove")
public Result<Map<String,Object>> cancleMove(@RequestBody Map<String,Object> map) {
String option = map.get("option").toString();
Map<String, Object> gochargeMap = yjRobotService.canceltask(option);
int code1 = Integer.parseInt(gochargeMap.get("code").toString());
if(code1 == 0) {
return Result.OK("操作成功",gochargeMap);
}else if(code1 == 501) {
return Result.OK("机器人暂时没有进行中的任务",gochargeMap);
}
return Result.error("操作失败");
}
/**
* 添加
*
* @param tblRobotPoints
* @return
*/
// @AutoLog(value = "机器人点位设置-添加")
// @ApiOperation(value="机器人点位设置-添加", notes="机器人点位设置-添加")
// @PostMapping(value = "/add")
// public Result<String> add(@RequestBody TblRobotPoints tblRobotPoints) {
// tblRobotPointsService.save(tblRobotPoints);
// return Result.OK("添加成功!");
// }
/**
* 编辑
*
* @param tblRobotPoints
* @return
*/
// @AutoLog(value = "机器人点位设置-编辑")
// @ApiOperation(value="机器人点位设置-编辑", notes="机器人点位设置-编辑")
// @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
// public Result<String> edit(@RequestBody TblRobotPoints tblRobotPoints) {
// tblRobotPointsService.updateById(tblRobotPoints);
// return Result.OK("编辑成功!");
// }
/**
* 通过id删除
*
* @param id
* @return
*/
// @AutoLog(value = "机器人点位设置-通过id删除")
// @ApiOperation(value="机器人点位设置-通过id删除", notes="机器人点位设置-通过id删除")
// @DeleteMapping(value = "/delete")
// public Result<String> delete(@RequestParam(name="id",required=true) String id) {
// tblRobotPointsService.removeById(id);
// return Result.OK("删除成功!");
// }
/**
* 批量删除
*
* @param ids
* @return
*/
// @AutoLog(value = "机器人点位设置-批量删除")
// @ApiOperation(value="机器人点位设置-批量删除", notes="机器人点位设置-批量删除")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
// this.tblRobotPointsService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "机器人点位设置-通过id查询")
// @ApiOperation(value="机器人点位设置-通过id查询", notes="机器人点位设置-通过id查询")
// @GetMapping(value = "/queryById")
// public Result<TblRobotPoints> queryById(@RequestParam(name="id",required=true) String id) {
// TblRobotPoints tblRobotPoints = tblRobotPointsService.getById(id);
// if(tblRobotPoints==null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(tblRobotPoints);
// }
/**
* 导出excel
*
* @param request
* @param tblRobotPoints
*/
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, TblRobotPoints tblRobotPoints) {
// return super.exportXls(request, tblRobotPoints, TblRobotPoints.class, "机器人点位设置");
// }
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, TblRobotPoints.class);
// }
}
... ...
/**
*
*/
package org.jeecg.modules.erp.robot.entity;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
*
*/
@Component
public class ApiConfigYJ {
@Value("${robot.yunji.storeId}")
private String storeId;
@Value("${robot.yunji.accessKeyId}")
private String accessKeyId;
@Value("${robot.yunji.accessKeySecret}")
private String accessKeySecret;
@Value("${robot.yunji.deviceId}")
private String deviceId;
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
/**
* @return
*/
public String getStoreId() {
return storeId;
}
/**
* @param storeId
*/
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getAccessKeyId() {
return accessKeyId;
}
public void setAccessKeyId(String accessKeyId) {
this.accessKeyId = accessKeyId;
}
/**
* @return
*/
public String getAccessKeySecret() {
return accessKeySecret;
}
/**
* @param accessKeySecret
*/
public void setAccessKeySecret(String accessKeySecret) {
this.accessKeySecret = accessKeySecret;
}
}
... ...
package org.jeecg.modules.erp.robot.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tbl_robot
* @Author: jeecg-boot
* @Date: 2024-11-06
* @Version: V1.0
*/
@Data
@TableName("tbl_robot")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbl_robot对象", description="tbl_robot")
public class TblRobot implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private String id;
/**设备id*/
@Excel(name = "设备id", width = 15)
@ApiModelProperty(value = "设备id")
private String deviceId;
/**设备编号*/
@Excel(name = "设备编号", width = 15)
@ApiModelProperty(value = "设备编号")
private String devicename;
/**产品名称*/
@Excel(name = "产品名称", width = 15)
@ApiModelProperty(value = "产品名称")
private String productName;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
}
... ...
package org.jeecg.modules.erp.robot.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: tbl_robot_cabin
* @Author: jeecg-boot
* @Date: 2024-10-24
* @Version: V1.0
*/
@Data
@TableName("tbl_robot_cabins")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbl_robot_cabin对象", description="tbl_robot_cabin")
public class TblRobotCabin implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**点位id*/
@Excel(name = "点位id", width = 15)
@ApiModelProperty(value = "点位id")
private java.lang.String cabinId;
/**点位名称*/
@Excel(name = "点位名称", width = 15)
@ApiModelProperty(value = "点位名称")
private java.lang.String cabinName;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
}
... ...
package org.jeecg.modules.erp.robot.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 机器人点位设置
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Data
@TableName("tbl_robot_points")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbl_robot_points对象", description="机器人点位设置")
public class TblRobotPoints implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**点位id*/
@Excel(name = "点位id", width = 15)
@ApiModelProperty(value = "点位id")
private java.lang.String pointId;
/**点位名称*/
@Excel(name = "点位名称", width = 15)
@ApiModelProperty(value = "点位名称")
private java.lang.String pointName;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
}
... ...
package org.jeecg.modules.erp.robot.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.erp.robot.entity.TblRobotCabin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tbl_robot_cabin
* @Author: jeecg-boot
* @Date: 2024-10-24
* @Version: V1.0
*/
@Mapper
public interface TblRobotCabinMapper extends BaseMapper<TblRobotCabin> {
List<Map<String, Object>> getList();
}
... ...
package org.jeecg.modules.erp.robot.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.erp.robot.entity.TblRobot;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: tbl_robot
* @Author: jeecg-boot
* @Date: 2024-11-06
* @Version: V1.0
*/
public interface TblRobotMapper extends BaseMapper<TblRobot> {
}
... ...
package org.jeecg.modules.erp.robot.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.erp.robot.entity.TblRobotPoints;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 机器人点位设置
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Mapper
public interface TblRobotPointsMapper extends BaseMapper<TblRobotPoints> {
List<Map<String, Object>> getList();
}
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.erp.robot.mapper.TblRobotCabinMapper">
<select id="getList" resultType="java.util.HashMap">
SELECT cabin_id cabinId,cabin_name cabinName FROM tbl_robot_cabins
</select>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.erp.robot.mapper.TblRobotMapper">
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.erp.robot.mapper.TblRobotPointsMapper">
<select id="getList" resultType="java.util.HashMap">
SELECT point_id pointId,point_name pointName FROM tbl_robot_points
</select>
</mapper>
\ No newline at end of file
... ...
package org.jeecg.modules.erp.robot.service;
import org.jeecg.modules.erp.robot.entity.TblRobotCabin;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* @Description: tbl_robot_cabin
* @Author: jeecg-boot
* @Date: 2024-10-24
* @Version: V1.0
*/
public interface ITblRobotCabinService extends IService<TblRobotCabin> {
List<Map<String,Object>> getList();
}
... ...
package org.jeecg.modules.erp.robot.service;
import org.jeecg.modules.erp.robot.entity.TblRobotPoints;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* @Description: 机器人点位设置
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
public interface ITblRobotPointsService extends IService<TblRobotPoints> {
List<Map<String,Object>> getList();
}
... ...
package org.jeecg.modules.erp.robot.service;
import org.jeecg.modules.erp.robot.entity.TblRobot;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: tbl_robot
* @Author: jeecg-boot
* @Date: 2024-11-06
* @Version: V1.0
*/
public interface ITblRobotService extends IService<TblRobot> {
}
... ...
package org.jeecg.modules.erp.robot.service.impl;
import org.jeecg.modules.erp.robot.entity.TblRobotCabin;
import org.jeecg.modules.erp.robot.mapper.TblRobotCabinMapper;
import org.jeecg.modules.erp.robot.service.ITblRobotCabinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Map;
/**
* @Description: tbl_robot_cabin
* @Author: jeecg-boot
* @Date: 2024-10-24
* @Version: V1.0
*/
@Service
public class TblRobotCabinServiceImpl extends ServiceImpl<TblRobotCabinMapper, TblRobotCabin> implements ITblRobotCabinService {
@Autowired
private TblRobotCabinMapper tblRobotCabinMapper;
@Override
public List<Map<String, Object>> getList() {
return tblRobotCabinMapper.getList();
}
}
... ...
package org.jeecg.modules.erp.robot.service.impl;
import org.jeecg.modules.erp.robot.entity.TblRobotPoints;
import org.jeecg.modules.erp.robot.mapper.TblRobotPointsMapper;
import org.jeecg.modules.erp.robot.service.ITblRobotPointsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Map;
/**
* @Description: 机器人点位设置
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Service
public class TblRobotPointsServiceImpl extends ServiceImpl<TblRobotPointsMapper, TblRobotPoints> implements ITblRobotPointsService {
@Autowired
private TblRobotPointsMapper tblRobotPointsMapper;
@Override
public List<Map<String, Object>> getList() {
return tblRobotPointsMapper.getList();
}
}
... ...
package org.jeecg.modules.erp.robot.service.impl;
import org.jeecg.modules.erp.robot.entity.TblRobot;
import org.jeecg.modules.erp.robot.mapper.TblRobotMapper;
import org.jeecg.modules.erp.robot.service.ITblRobotService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: tbl_robot
* @Author: jeecg-boot
* @Date: 2024-11-06
* @Version: V1.0
*/
@Service
public class TblRobotServiceImpl extends ServiceImpl<TblRobotMapper, TblRobot> implements ITblRobotService {
}
... ...
package org.jeecg.modules.erp.robot.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.erp.depot.service.impl.RestTempService;
import org.jeecg.modules.erp.robot.entity.ApiConfigYJ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.util.UriComponentsBuilder;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@Service
@Slf4j
public class YjRobotService {
@Autowired
private ApiConfigYJ apiConfigYJ;
private final RestTempService restTempService;
public YjRobotService(RestTempService restTempService) {
this.restTempService = restTempService;
}
/**
* 获取点位
* @param storeId
* @return
*/
public Map<String, Object> getPoints(@RequestParam String storeId) {
log.info("开始获取点位");
HashMap<String, Object> r = new HashMap<>();
String tk = getaccessToken();
if(StrUtil.isBlank(tk)){
r.put("code", 501);
r.put("message", "获取token失败");
return r;
}
log.info("token: " + tk);
String tempUrl1 = "https://open-api.yunjiai.cn/v3/stores/";
String tempUrl2 = "/points";
StringBuilder stringBuilder = new StringBuilder();
String url = stringBuilder.append(tempUrl1).append(storeId).append(tempUrl2).toString();
String p1 = "accessToken";
String v1 = tk;
// 使用UriComponentsBuilder构建完整的URL
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url)
.queryParam(p1, v1);
// 构建完整的URI
URI uri = builder.build().toUri();
log.info("url:" + uri);
String response = restTempService.getWithHeaderAuth(uri);
log.info("response:" + response);
JSONObject jsonObject = JSON.parseObject(response);
int code = jsonObject.getIntValue("code");
r.put("code", code);
if (code == 0) {
} else {
log.info("设备列表获取异常");
r.put("message", "设备列表获取异常");
return r;
}
// 取出data数组并遍历
JSONArray dataArray = jsonObject.getJSONArray("data");
if (code == 0) {
r.put("message", "SUCCESS");
} else {
r.put("message", "FAILED");
}
r.put("data", dataArray);
return r;
}
@Autowired
private RedisUtil redisUtil;
public Map<String, Object> movetoTarget(@RequestParam String templateId,
@RequestParam String deviceId,
@RequestParam String pointId,
@RequestParam int overtime) {
log.info("机器人任务流:{}",templateId);
// 创建一个ObjectMapper实例(如果尚未创建)
ObjectMapper objectMapper = new ObjectMapper();
log.info("店铺-->{}", apiConfigYJ.getStoreId());
log.info("上舱-->{}", deviceId);
log.info("目标位置-->{}", pointId);
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info("outTaskId-->" + outTaskId);
taskMap.put("outTaskId", outTaskId);
taskMap.put("templateId", templateId);
taskMap.put("storeId", apiConfigYJ.getStoreId());
Map<String, Object> params = new HashMap<>();
params.put("dockCabinId", deviceId);
params.put("target", pointId);
if("dock_cabin_and_move_target_with_wait_action".equals(templateId)){
params.put("overtime", overtime);
params.put("overtimeEvent", "back");
}
taskMap.put("params", params);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjiai.cn/v3/rcs/task/flow/execute";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
String response = restTempService.postWithHeaderAuth3(url, entity);
log.info("url:" + url);
log.info("response:" + response);
Map<String, Object> map = JSONUtil.toBean(response, Map.class);
int code = Integer.parseInt(map.get("code").toString());
if(code == 0){
String data = map.get("data").toString();
Map<String, Object> map1 = JSONUtil.toBean(data, Map.class);
String taskId = map1.get("taskId").toString();
redisUtil.set(apiConfigYJ.getDeviceId(),taskId,3600);
}
return map;
}
/**
* 取消移动
* @param option
* @return
*/
// @PutMapping("/canceltask")
public Map<String,Object> canceltask(@RequestParam String option) {
// 创建一个ObjectMapper实例(如果尚未创建)
ObjectMapper objectMapper = new ObjectMapper();
Object object = redisUtil.get(apiConfigYJ.getDeviceId());
if(null == object){
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("code", 501);
return returnMap;
}
String taskId = object.toString();
log.info("取消任务的taskId: {}", taskId);
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
taskMap.put("newStatus", "cancelled");
taskMap.put("robotId", apiConfigYJ.getDeviceId());
taskMap.put("option", option);
// 将Map转换为JSON字符串
String taskRequest = null;
try {
taskRequest = objectMapper.writeValueAsString(taskMap);
} catch (JsonProcessingException e) {
e.printStackTrace();
// 处理异常或返回错误消息
}
String url = "https://open-api.yunjiai.cn/v3/stores/" + apiConfigYJ.getStoreId() + "/tasks/" + taskId+"/status";
HttpHeaders headers = getHttpHeaders();
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
String response = restTempService.putWithHeaderAuth(url, entity);
log.info("url: {}",url);
log.info("response: {}",response);
Map<String, Object> map = JSONUtil.toBean(response, Map.class);
return map;
}
public Map<String, Object> callAndDelivery(@RequestParam String target,
@RequestParam String via) {
// 创建一个ObjectMapper实例(如果尚未创建)
ObjectMapper objectMapper = new ObjectMapper();
log.info("店铺-->{}", apiConfigYJ.getStoreId());
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info("outTaskId-->" + outTaskId);
taskMap.put("storeId", apiConfigYJ.getStoreId());
taskMap.put("outTaskId", outTaskId);
taskMap.put("target", target);
taskMap.put("via", via);
Map<String, Object> goodMap = new HashMap<>();
goodMap.put("goodsId","take-out-goods-"+ DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN));
goodMap.put("goodsName","外卖商品");
goodMap.put("quantity",2);
List<Map> maps = new ArrayList<>();
maps.add(goodMap);
taskMap.put("goods", maps);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjiai.cn/v3/rcs/task/create/merchant-call";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
String response = restTempService.postWithHeaderAuth3(url, entity);
log.info("url:" + url);
log.info("response:" + response);
Map<String, Object> map = JSONUtil.toBean(response, Map.class);
// int code = Integer.parseInt(map.get("code").toString());
// if(code == 0){
// String data = map.get("data").toString();
// Map<String, Object> map1 = JSONUtil.toBean(data, Map.class);
// String taskId = map1.get("taskId").toString();
// redisUtil.set(apiConfigYJ.getDeviceId(),taskId,3600);
// }
return map;
}
/**
* dock_cabin_to_move_and_lift_down
* 调度底盘(具体调哪个底盘云迹自己调度系统分配)去某个上仓举起并移动到另外点位放下
*
* @param deviceId
* @param pointId
* @return
*/
// @PostMapping("/dockCabinToMoveAndLiftDown")
public Map<String,Object> dockCabinToMoveAndLiftDown( String deviceId,
String pointId) {
Map<String, Object> r = new HashMap<>();
log.info("=============dock_cabin_to_move_and_lift_down==============");
String tk = getaccessToken();
if("".equals(tk)) {
r.put("code", 501);
r.put("message", "获取token失败");
return r;
}
log.info("店铺-->" + apiConfigYJ.getStoreId());
log.info("上舱-->" + deviceId);
log.info("目标位置-->" + pointId);
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info("outTaskId-->" + outTaskId);
taskMap.put("outTaskId", outTaskId);
taskMap.put("templateId", "dock_cabin_to_move_and_lift_down");
taskMap.put("storeId", apiConfigYJ.getStoreId());
Map<String, Object> params = new HashMap<>();
//执行任务中需要对接的上舱设备 ID
params.put("dockCabinId", deviceId);
params.put("target", pointId);
taskMap.put("params", params);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjiai.cn/v3/rcs/task/flow/execute";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
log.info("url:" + url);
String response = restTempService.postWithHeaderAuth3(url, entity);
log.info("response:" + response);
Map<String, Object> map = JSONUtil.toBean(response, Map.class);
return map;
}
/**
* docking_cabin_and_docking_down
* 调度底盘(具体调哪个底盘云迹自己调度系统分配,以直线距离最近的空闲底盘优先)移动上舱举起并移动到另外一个舱位放下
* @param deviceId
* @param pointId
* @return
*/
// @PostMapping("/dockingCabinAndDockingDown")
public Map<String, Object> dockingCabinAndDockingDown(
@RequestParam String deviceId,
@RequestParam String pointId) {
Map<String, Object> r = new HashMap<>();
log.info("=============docking_cabin_and_docking_down==============");
// 创建一个ObjectMapper实例(如果尚未创建)
log.info("店铺: {}", apiConfigYJ.getStoreId());
log.info("上舱: {}", deviceId);
log.info("目标位置: {}", pointId);
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info("outTaskId: {}", outTaskId);
taskMap.put("outTaskId", outTaskId);
taskMap.put("templateId", "docking_cabin_and_docking_down");
taskMap.put("storeId", apiConfigYJ.getStoreId());
Map<String, Object> params = new HashMap<>();
params.put("dockCabinId", deviceId);
params.put("target", pointId);
taskMap.put("params", params);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjiai.cn/v3/rcs/task/flow/execute";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
String response = restTempService.postWithHeaderAuth3(url, entity);
log.info("url:{}", url);
log.info("response:{}", response);
Map<String, Object> map = JSONUtil.toBean(response, Map.class);
return map;
}
/**
* docking_cabin_and_move_target
* 调度底盘(具体调哪个底盘云迹自己调度系统分配,以直线距离最近的空闲底盘优先)移动上舱举起并移动到目标点
* @param httpServletRequest
* @param storeId
* @param deviceId
* @param pointId
* @return
*/
// @PostMapping("/dockingCabinAndMoveTarget")
public Map<String, Object> dockingCabinAndMoveTarget(HttpServletRequest httpServletRequest,
@RequestParam String storeId, @RequestParam String deviceId,
@RequestParam String pointId) {
log.info("=============docking_cabin_and_move_target==============");
Map<String, Object> r = new HashMap<>();
// 创建一个ObjectMapper实例(如果尚未创建)
log.info("店铺-->" + storeId);
log.info("上舱-->" + deviceId);
log.info("目标位置-->" + pointId);
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info("outTaskId-->" + outTaskId);
taskMap.put("outTaskId", outTaskId);
taskMap.put("templateId", "docking_cabin_and_move_target");
taskMap.put("storeId", storeId);
Map<String, Object> params = new HashMap<>();
params.put("dockCabinId", deviceId);
params.put("target", pointId);
taskMap.put("params", params);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjiai.cn/v3/rcs/task/flow/execute";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
log.info("taskRequest-->" + taskRequest);
log.info("url:" + url);
String response = restTempService.postWithHeaderAuth3(url, entity);
log.info("response:" + response);
JSONObject jsonObject2 = JSON.parseObject(response);
r.put("data", jsonObject2);
return r;
}
/**
* move_target_and_lift_down
* 托举上舱移动到目的地并且放下上舱
* @param httpServletRequest
* @param storeId
* @param deviceId
* @param pointId
* @return
*/
// @PostMapping("/moveTargetAndLiftDown")
public Map<String, Object> moveTargetAndLiftDown(HttpServletRequest httpServletRequest,
@RequestParam String storeId, @RequestParam String deviceId,
@RequestParam String pointId) {
log.info("=============move_target_and_lift_down==============");
Map<String, Object> r = new HashMap<>();
// 创建一个ObjectMapper实例(如果尚未创建)
log.info("店铺-->" + storeId);
log.info("上舱-->" + deviceId);
log.info("目标位置-->" + pointId);
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info("outTaskId-->" + outTaskId);
taskMap.put("outTaskId", outTaskId);
taskMap.put("templateId", "move_target_and_lift_down");
taskMap.put("storeId", storeId);
Map<String, Object> params = new HashMap<>();
params.put("dockCabinId", deviceId);
params.put("target", pointId);
taskMap.put("params", params);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjiai.cn/v3/rcs/task/flow/execute";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
log.info("=============url==============" + url);
String response1 = restTempService.postWithHeaderAuth3(url, entity);
log.info("=============response==============" + response1);
System.out.println("url----------- -----\n" + url);
System.out.println("response1-----------restemp-----\n" + response1);
JSONObject jsonObject2 = JSON.parseObject(response1);
r.put("data", jsonObject2);
return r;
}
/**
* 让某舱到某目的地
* dock_cabin_and_move_target_with_wait_action
* @param httpServletRequest
* @param storeId
* @param deviceId
* @param pointId
* @param overtime
* @param overtimeEvent
* @return
*/
// @PostMapping("/dockCabinAndMoveTargetWithWaitAction")
public Map<String, Object> dockCabinAndMoveTargetWithWaitAction(HttpServletRequest httpServletRequest,
@RequestParam String storeId, @RequestParam String deviceId,
@RequestParam String pointId, @RequestParam String overtime, @RequestParam String overtimeEvent) {
log.info("=============dock_cabin_and_move_target_with_wait_action==============");
Map<String, Object> r = new HashMap<>();
// 创建一个ObjectMapper实例(如果尚未创建)
ObjectMapper objectMapper = new ObjectMapper();
log.info("店铺: " + storeId);
log.info("上舱: " + deviceId);
log.info("目标位置: " + pointId);
// 您的JSON对象
Map<String, Object> taskMap = new HashMap<>();
String outTaskId = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
log.info( "outTaskId: " + outTaskId);
taskMap.put("outTaskId", outTaskId);
taskMap.put("templateId", "dock_cabin_and_move_target_with_wait_action");
taskMap.put("storeId", storeId);
Map<String, Object> params = new HashMap<>();
params.put("dockCabinId", deviceId);
params.put("target", pointId);
params.put("overtime", overtime);
params.put("overtimeEvent", overtimeEvent);
taskMap.put("params", params);
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
//组装header
HttpHeaders headers = getHttpHeaders();
String url = "https://open-api.yunjibot.com/v3/rcs/task/flow/execute";
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
log.info("taskRequest-->" + taskRequest);
log.info("=============url==============" + url);
String response1 = restTempService.postWithHeaderAuth3(url, entity);
log.info("=============response==============" + response1);
System.out.println("url----------- -----\n" + url);
System.out.println("response1-----------restemp-----\n" + response1);
JSONObject jsonObject2 = JSON.parseObject(response1);
r.put("data", jsonObject2);
return r;
}
/**
* 返回充电
* @param deviceId
* @return
*/
// @PostMapping("/gocharge")
public Map<String,Object> gocharge(@RequestParam String deviceId) {
String baseUrl = "https://open-api.yunjiai.cn/v3/robot/" + deviceId + "/goto-charge";
String p1 = "accessToken";
String v1 = getaccessToken();
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUrl)
.queryParam(p1, v1); // 添加查询参数
// 构建完整的URI
URI uri = builder.build().toUri();
Map<String, Object> taskMap = new HashMap<>();
taskMap.put("chargeId", "");
ObjectMapper objectMapper = new ObjectMapper();
//taskMap转String
String taskRequest = getTaskRequest(taskMap);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<Object> entity = new HttpEntity<>(taskRequest, headers);
String response = restTempService.postWithHeaderAuth3(uri.toString(), entity);
log.info("response: {}", response);
Map<String, Object> map = JSONUtil.toBean(response, Map.class);
return map;
}
private String getaccessToken() {
String url = "https://open-api.yunjiai.cn/v3/auth/accessToken";//中国
String accessKeyId = apiConfigYJ.getAccessKeyId();
String key = apiConfigYJ.getAccessKeySecret();
List<String> paraAllList = new java.util.ArrayList<>();
// 获取当前的中国时间(东八区)
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Shanghai"));
// 定义ISO 8601格式,包含时区信息
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX");
// 格式化时间
String timestamp = now.format(formatter);
UUID uuid = UUID.randomUUID();
paraAllList.add("signatureNonce=" + uuid);
paraAllList.add("accessKeyId=" + accessKeyId);
paraAllList.add("timestamp=" + timestamp);
// 排序
Object[] params = paraAllList.toArray();
java.util.Arrays.sort(params);
// 签名
StringBuffer paramBuffer = new StringBuffer();
for (Object param : params) {
if (paramBuffer.length() > 0) {
paramBuffer.append("&");
}
paramBuffer.append(String.valueOf(param));
}
String MAC_NAME = "HmacSHA1";
String ENCODING = "UTF-8";
byte[] data = null;
byte[] text = null;
String signatureStr = "";
try {
data = (key + "&").getBytes(ENCODING);
javax.crypto.SecretKey secretKey = new javax.crypto.spec.SecretKeySpec(
data, MAC_NAME);
javax.crypto.Mac mac = null;
mac = javax.crypto.Mac.getInstance(MAC_NAME);
mac.init(secretKey);
text = paramBuffer.toString().getBytes(ENCODING);
byte[] bytes = mac.doFinal(text);
signatureStr = java.util.Base64.getEncoder().encodeToString(bytes);
log.info("签名值: {}", signatureStr);
} catch (NoSuchAlgorithmException e) {
log.error("异常: " + e.getMessage());
return "NG";
} catch (InvalidKeyException e) {
log.error("异常: " + e.getMessage());
return "NG";
} catch (UnsupportedEncodingException e) {
log.error("异常: " + e.getMessage());
return "NG";
}
Map<String, Object> requestBody = new HashMap<>();
requestBody.put("signature", signatureStr);
requestBody.put("accessKeyId", accessKeyId);
requestBody.put("signatureNonce", uuid);
requestBody.put("timestamp", timestamp);
// 你可以通过键来获取值
Integer code = null;
String message = null;
String accessToken = null;
try {
String response1 = restTempService.postWithHeaderAuth2(url,
requestBody);
log.info("response: " + response1);
// 使用fastjson2的JSON类来解析JSON字符串为Map
Map<String, Object> map = JSON.parseObject(response1, Map.class);
code = (Integer) map.get("code");
message = (String) map.get("message");
if(code==0){
// 如果JSON字符串中还嵌套了其他JSON对象,你也可以相应地处理它们
Map<String, Object> dataMap = (Map<String, Object>) map.get("data");
accessToken = (String) dataMap.get("accessToken");
}
} catch (Exception e) {
log.error("异常: " + e.getMessage());
return "NG";
}
// // 输出结果
log.info("Code: {}", code);
log.info("Message: {}", message);
log.info("Access Token: {}", accessToken);
return accessToken;
}
private HttpHeaders getHttpHeaders() {
UUID uuid = UUID.randomUUID();
HttpHeaders headers = new HttpHeaders();
//获取token
String tk = getaccessToken();
// 获取当前的中国时间(东八区)
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Shanghai"));
// 定义ISO 8601格式,包含时区信息
DateTimeFormatter formatter = DateTimeFormatter
.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX");
// 格式化时间
String timestamp = now.format(formatter);
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("token", tk);
headers.set("signatureNonce", uuid.toString());
headers.set("timestamp", timestamp);
headers.set("accessKeyId",apiConfigYJ.getAccessKeyId());
return headers;
}
private String getTaskRequest(Map<String, Object> taskMap) {
// 创建一个ObjectMapper实例
ObjectMapper objectMapper = new ObjectMapper();
String taskRequest = null;
try {
taskRequest = objectMapper.writeValueAsString(taskMap);
} catch (JsonProcessingException e) {
e.printStackTrace();
// 处理异常或返回错误消息
}
log.info("taskRequest-->" + taskRequest);
return taskRequest;
}
}
... ...
... ... @@ -136,7 +136,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://rm-2zeiuncjm75qti641.mysql.rds.aliyuncs.com:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://rm-2zeiuncjm75qti641ho.mysql.rds.aliyuncs.com:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: ntsd_root
password: L3bHRJwg6lJ2SC4WFfGA
driver-class-name: com.mysql.cj.jdbc.Driver
... ...
... ... @@ -2,4 +2,16 @@ spring:
application:
name: jeecg-system
profiles:
active: '@profile.name@'
\ No newline at end of file
active: '@profile.name@'
robot:
yunji:
storeId: '202412982974802314947855922176'
accessKeyId: 'imn2zcWgsA6QU1w2'
accessKeySecret: 'bejziWxAhX8vYG9k4x8N0uH760ddlWtm'
# 开放舱deviceName
deviceName: 'SCWM00JS48YF01635'
# 开放舱点位
pointId: 'standby_1F_SCWM00JS48YF01635'
# 底盘deviceId
deviceId: '1283375168185569280'
... ...