设备类型添加翻转机并绑定取放货点位
This commit is contained in:
parent
035c8d6096
commit
8c48e8431d
@ -168,6 +168,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode INFORMATION_MAC_EXIST = new ErrorCode(1_002_029_002, "此Mac地址已经存在");
|
||||
ErrorCode INFORMATION_MAC_INPUT = new ErrorCode(1_002_029_003, "请输入Mac地址");
|
||||
ErrorCode INFORMATION_BIND_MAP = new ErrorCode(1_002_029_004, "设备已经绑定在地图上,请先在地图上解绑");
|
||||
ErrorCode INFORMATION_FLIP_BINDING = new ErrorCode(1_002_029_005, "翻转机需要绑定取货点位");
|
||||
ErrorCode INFORMATION_FLIP_NEED_BINDING_CHECK = new ErrorCode(1_002_029_006, "翻转机需要绑定检测区取放货点位");
|
||||
|
||||
// ========== 线库/巷道 1-002-030-000 ==========
|
||||
ErrorCode HOUSE_LANE_NOT_EXISTS = new ErrorCode(1-002-030-001, "线库不存在");
|
||||
@ -341,4 +343,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 取货点位 1_002_062_001 ==========
|
||||
ErrorCode HOUSE_TAKE_POINT_NOT_EXISTS = new ErrorCode(1_002_062_001, "取货点位不存在");
|
||||
|
||||
// ========== 取货点位绑定 1_002_063_001 ==========
|
||||
ErrorCode HOUSE_TAKE_POINT_BINDING_NOT_EXISTS = new ErrorCode(1_002_063_001, "取货点位绑定不存在");
|
||||
}
|
||||
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointBindingService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 取货点位绑定")
|
||||
@RestController
|
||||
@RequestMapping("/system/ware/house-take-point-binding")
|
||||
@Validated
|
||||
public class WareHouseTakePointBindingController {
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointBindingService houseTakePointBindingService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建取货点位绑定")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:create')")
|
||||
public CommonResult<Long> createHouseTakePointBinding(@Valid @RequestBody WareHouseTakePointBindingSaveReqVO createReqVO) {
|
||||
return success(houseTakePointBindingService.createHouseTakePointBinding(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新取货点位绑定")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:update')")
|
||||
public CommonResult<Boolean> updateHouseTakePointBinding(@Valid @RequestBody WareHouseTakePointBindingSaveReqVO updateReqVO) {
|
||||
houseTakePointBindingService.updateHouseTakePointBinding(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除取货点位绑定")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:delete')")
|
||||
public CommonResult<Boolean> deleteHouseTakePointBinding(@RequestParam("id") Long id) {
|
||||
houseTakePointBindingService.deleteHouseTakePointBinding(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得取货点位绑定")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:query')")
|
||||
public CommonResult<WareHouseTakePointBindingRespVO> getHouseTakePointBinding(@RequestParam("id") Long id) {
|
||||
WareHouseTakePointBindingDO houseTakePointBinding = houseTakePointBindingService.getHouseTakePointBinding(id);
|
||||
return success(BeanUtils.toBean(houseTakePointBinding, WareHouseTakePointBindingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得取货点位绑定分页")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:query')")
|
||||
public CommonResult<PageResult<WareHouseTakePointBindingRespVO>> getHouseTakePointBindingPage(@Valid WareHouseTakePointBindingPageReqVO pageReqVO) {
|
||||
PageResult<WareHouseTakePointBindingDO> pageResult = houseTakePointBindingService.getHouseTakePointBindingPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WareHouseTakePointBindingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出取货点位绑定 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportHouseTakePointBindingExcel(@Valid WareHouseTakePointBindingPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WareHouseTakePointBindingDO> list = houseTakePointBindingService.getHouseTakePointBindingPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "取货点位绑定.xls", "数据", WareHouseTakePointBindingRespVO.class,
|
||||
BeanUtils.toBean(list, WareHouseTakePointBindingRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -81,11 +81,11 @@ public class WareHouseTakePointController {
|
||||
return success(BeanUtils.toBean(pageResult, WareHouseTakePointRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "获得取货点位集合")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:list')")
|
||||
public CommonResult<List<WareHouseTakePointRespVO>> getHouseTakePointList() {
|
||||
List<WareHouseTakePointDO> list = houseTakePointService.getHouseTakePointList();
|
||||
public CommonResult<List<WareHouseTakePointRespVO>> getHouseTakePointList(@RequestBody WareHouseTakePointSaveReqVO updateReqVO) {
|
||||
List<WareHouseTakePointDO> list = houseTakePointService.getHouseTakePointList(updateReqVO);
|
||||
return success(BeanUtils.toBean(list, WareHouseTakePointRespVO.class));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位绑定分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WareHouseTakePointBindingPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型, 0:设备", example = "2")
|
||||
private Integer bindingType;
|
||||
|
||||
@Schema(description = "设备id", example = "3876")
|
||||
private Long bindingId;
|
||||
|
||||
@Schema(description = "取货点位表id", example = "20371")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位绑定 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WareHouseTakePointBindingRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16028")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型, 0:设备", example = "2")
|
||||
@ExcelProperty("类型, 0:设备")
|
||||
private Integer bindingType;
|
||||
|
||||
@Schema(description = "设备id", example = "3876")
|
||||
@ExcelProperty("设备id")
|
||||
private Long bindingId;
|
||||
|
||||
@Schema(description = "取货点位表id", example = "20371")
|
||||
@ExcelProperty("取货点位表id")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位绑定新增/修改 Request VO")
|
||||
@Data
|
||||
public class WareHouseTakePointBindingSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16028")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型, 0:设备", example = "2")
|
||||
private Integer bindingType;
|
||||
|
||||
@Schema(description = "设备id", example = "3876")
|
||||
private Long bindingId;
|
||||
|
||||
@Schema(description = "取货点位表id", example = "20371")
|
||||
private Long takePointId;
|
||||
|
||||
}
|
@ -19,7 +19,7 @@ public class WareHouseTakePointPageReqVO extends PageParam {
|
||||
@Schema(description = "点位类型名称", example = "李四")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型(备用)", example = "2")
|
||||
@Schema(description = "点位类型, 0:翻转机设备, 1:普通取放货点位'", example = "2")
|
||||
private Integer pointType;
|
||||
|
||||
@Schema(description = "总高度")
|
||||
|
@ -21,8 +21,8 @@ public class WareHouseTakePointRespVO {
|
||||
@ExcelProperty("点位类型名称")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型(备用)", example = "2")
|
||||
@ExcelProperty("点位类型(备用)")
|
||||
@Schema(description = "点位类型, 0:翻转机设备, 1:普通取放货点位'", example = "2")
|
||||
@ExcelProperty("点位类型, 0:翻转机设备, 1:普通取放货点位'")
|
||||
private Integer pointType;
|
||||
|
||||
@Schema(description = "总高度")
|
||||
|
@ -16,7 +16,7 @@ public class WareHouseTakePointSaveReqVO {
|
||||
@Schema(description = "点位类型名称", example = "李四")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型(备用)", example = "2")
|
||||
@Schema(description = "点位类型, 0:翻转机设备, 1:普通取放货点位'", example = "2")
|
||||
private Integer pointType;
|
||||
|
||||
@Schema(description = "总高度")
|
||||
@ -40,4 +40,7 @@ public class WareHouseTakePointSaveReqVO {
|
||||
@Schema(description = "实际坐标y轴")
|
||||
private String actualLocationY;
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11573")
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
@ -71,8 +71,8 @@ public class DeviceInformationController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('device:information:query')")
|
||||
public CommonResult<DeviceInformationRespVO> getInformation(@RequestParam("id") Long id) {
|
||||
DeviceInformationDO information = informationService.getInformation(id);
|
||||
return success(BeanUtils.toBean(information, DeviceInformationRespVO.class));
|
||||
DeviceInformationRespVO information = informationService.getInformation(id);
|
||||
return success(information);
|
||||
}
|
||||
|
||||
@GetMapping("/getCameraCode")
|
||||
|
@ -139,4 +139,13 @@ public class DeviceInformationRespVO {
|
||||
@Schema(description = "ware_house_take_point的id")
|
||||
@ExcelProperty("ware_house_take_point的id")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "检测点的id")
|
||||
private List<Long> checkPointIds;
|
||||
|
||||
/*@Schema(description = "取货点位")
|
||||
private WareHouseTakePointDO takeWareHouseTakePointDO;
|
||||
|
||||
@Schema(description = "检测区的取货点位")
|
||||
private List<WareHouseTakePointDO> checkPointBindingList;*/
|
||||
}
|
||||
|
@ -103,4 +103,7 @@ public class DeviceInformationSaveReqVO {
|
||||
|
||||
@Schema(description = "ware_house_take_point的id")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "检测点的id")
|
||||
private List<Long> checkPointIds;
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.houselocation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 DO
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@TableName("ware_house_take_point_binding")
|
||||
@KeySequence("ware_house_take_point_binding_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WareHouseTakePointBindingDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 类型, 0:设备
|
||||
*/
|
||||
private Integer bindingType;
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long bindingId;
|
||||
/**
|
||||
* 取货点位表id
|
||||
*/
|
||||
private Long takePointId;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.houselocation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 Mapper
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Mapper
|
||||
public interface WareHouseTakePointBindingMapper extends BaseMapperX<WareHouseTakePointBindingDO> {
|
||||
|
||||
default PageResult<WareHouseTakePointBindingDO> selectPage(WareHouseTakePointBindingPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WareHouseTakePointBindingDO>()
|
||||
.eqIfPresent(WareHouseTakePointBindingDO::getBindingType, reqVO.getBindingType())
|
||||
.eqIfPresent(WareHouseTakePointBindingDO::getBindingId, reqVO.getBindingId())
|
||||
.eqIfPresent(WareHouseTakePointBindingDO::getTakePointId, reqVO.getTakePointId())
|
||||
.betweenIfPresent(WareHouseTakePointBindingDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WareHouseTakePointBindingDO::getId));
|
||||
}
|
||||
|
||||
void deleteByBindingId(@Param("bindingId") Long bindingId);
|
||||
}
|
@ -1,13 +1,14 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.houselocation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 取货点位 Mapper
|
||||
@ -32,4 +33,6 @@ public interface WareHouseTakePointMapper extends BaseMapperX<WareHouseTakePoint
|
||||
.orderByDesc(WareHouseTakePointDO::getId));
|
||||
}
|
||||
|
||||
void setTakePointMapIdEmpty(@Param("positionMapId") Long positionMapId,
|
||||
@Param("ids") List<Long> ids);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.system.enums.map;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PointTypeEnum {
|
||||
FLIP(0,"翻转机设备"),
|
||||
TAKE(1,"普通取放货点位");
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
private final String msg;
|
||||
}
|
@ -2,10 +2,15 @@ package cn.iocoder.yudao.module.system.mq.consumer.map;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.system.api.path.PathApi;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.information.DeviceInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.remote.RemoteControllerInformationDO;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.map.PointTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.map.MapMessage;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.information.DeviceInformationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.event.EventListener;
|
||||
@ -13,7 +18,10 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@ -24,15 +32,57 @@ public class MapConsumer {
|
||||
private PathApi pathApi;
|
||||
|
||||
@Resource
|
||||
private DeviceInformationService informationService;
|
||||
private DeviceInformationService deviceInformationService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
//更新翻转机
|
||||
@EventListener
|
||||
@Async
|
||||
public void onMessage(MapMessage message) {
|
||||
if (EventTypeEnum.MAP_UPDATE.getType().equals(message.getEventType())) {
|
||||
pathApi.pathInitData();
|
||||
Long mapId = Long.valueOf(message.getMessage());
|
||||
List<DeviceInformationDO> devices = deviceInformationService.getDeviceInfoBindByMapId(mapId);
|
||||
if (ObjectUtil.isEmpty(devices)) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Long> takePointIds = new ArrayList<>();
|
||||
List<WareHouseTakePointDO> takePointDOS = new ArrayList<>();
|
||||
for (DeviceInformationDO device : devices) {
|
||||
if (!DeviceTypeEnum.FLIP.getType().equals(device.getDeviceType()) || ObjectUtil.isNotEmpty(device.getTakePointId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
takePointIds.add(device.getTakePointId());
|
||||
|
||||
}
|
||||
houseTakePointService.setTakePointMapIdEmpty(mapId, takePointIds);
|
||||
|
||||
if (ObjectUtil.isEmpty(takePointIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO();
|
||||
reqVO.setIds(takePointIds);
|
||||
List<WareHouseTakePointDO> houseTakePointList = houseTakePointService.getHouseTakePointList(reqVO);
|
||||
|
||||
Map<Long, WareHouseTakePointDO> pointMap = houseTakePointList.stream().collect(Collectors.toMap(WareHouseTakePointDO::getId, Function.identity()));
|
||||
|
||||
for (DeviceInformationDO device : devices) {
|
||||
if (!DeviceTypeEnum.FLIP.getType().equals(device.getDeviceType()) || ObjectUtil.isEmpty(device.getTakePointId())) {
|
||||
continue;
|
||||
}
|
||||
WareHouseTakePointDO wareHouseTakePointDO = pointMap.get(device.getId());
|
||||
wareHouseTakePointDO.setPositionMapId(mapId);
|
||||
wareHouseTakePointDO.setActualLocationX(device.getActualLocationX());
|
||||
wareHouseTakePointDO.setActualLocationY(device.getActualLocationY());
|
||||
takePointDOS.add(wareHouseTakePointDO);
|
||||
}
|
||||
houseTakePointService.updateBatchById(takePointDOS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public class TaskDistributionConsumer {
|
||||
*/
|
||||
private void addTaskTimeLog(RobotWorkStatusDTO data) {
|
||||
if (CommandTypeEnum.WORK_PICK_UP_GOODS.getType().equals(data.getCommandType())
|
||||
&& WorkProgressEnum.FORK_AND_TILT_INIT.getType().equals(data.getWorkProgress())
|
||||
&& WorkProgressEnum.FORK_AND_TILT.getType().equals(data.getWorkProgress())
|
||||
&& RobotExecutionStateConstant.DOING.equals(Integer.valueOf(data.getExecutionState()))) {
|
||||
startPickUp(data);
|
||||
} else if (CommandTypeEnum.WORK_PICK_UP_GOODS.getType().equals(data.getCommandType())
|
||||
|
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface WareHouseTakePointBindingService extends IService<WareHouseTakePointBindingDO> {
|
||||
|
||||
/**
|
||||
* 创建取货点位绑定
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createHouseTakePointBinding(@Valid WareHouseTakePointBindingSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新取货点位绑定
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateHouseTakePointBinding(@Valid WareHouseTakePointBindingSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除取货点位绑定
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteHouseTakePointBinding(Long id);
|
||||
|
||||
/**
|
||||
* 获得取货点位绑定
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 取货点位绑定
|
||||
*/
|
||||
WareHouseTakePointBindingDO getHouseTakePointBinding(Long id);
|
||||
|
||||
/**
|
||||
* 获得取货点位绑定分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 取货点位绑定分页
|
||||
*/
|
||||
PageResult<WareHouseTakePointBindingDO> getHouseTakePointBindingPage(WareHouseTakePointBindingPageReqVO pageReqVO);
|
||||
|
||||
void createHouseTakePointBindings(List<WareHouseTakePointBindingDO> list);
|
||||
|
||||
void deleteByBindingId(Long id);
|
||||
|
||||
List<WareHouseTakePointBindingDO> getByBindingId(Long id);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseTakePointBindingMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.HOUSE_TAKE_POINT_BINDING_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 Service 实现类
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class WareHouseTakePointBindingServiceImpl extends ServiceImpl<WareHouseTakePointBindingMapper, WareHouseTakePointBindingDO> implements WareHouseTakePointBindingService {
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointBindingMapper houseTakePointBindingMapper;
|
||||
|
||||
@Override
|
||||
public Long createHouseTakePointBinding(WareHouseTakePointBindingSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
WareHouseTakePointBindingDO houseTakePointBinding = BeanUtils.toBean(createReqVO, WareHouseTakePointBindingDO.class);
|
||||
houseTakePointBindingMapper.insert(houseTakePointBinding);
|
||||
// 返回
|
||||
return houseTakePointBinding.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHouseTakePointBinding(WareHouseTakePointBindingSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateHouseTakePointBindingExists(updateReqVO.getId());
|
||||
// 更新
|
||||
WareHouseTakePointBindingDO updateObj = BeanUtils.toBean(updateReqVO, WareHouseTakePointBindingDO.class);
|
||||
houseTakePointBindingMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteHouseTakePointBinding(Long id) {
|
||||
// 校验存在
|
||||
validateHouseTakePointBindingExists(id);
|
||||
// 删除
|
||||
houseTakePointBindingMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateHouseTakePointBindingExists(Long id) {
|
||||
if (houseTakePointBindingMapper.selectById(id) == null) {
|
||||
throw exception(HOUSE_TAKE_POINT_BINDING_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WareHouseTakePointBindingDO getHouseTakePointBinding(Long id) {
|
||||
return houseTakePointBindingMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WareHouseTakePointBindingDO> getHouseTakePointBindingPage(WareHouseTakePointBindingPageReqVO pageReqVO) {
|
||||
return houseTakePointBindingMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createHouseTakePointBindings(List<WareHouseTakePointBindingDO> list) {
|
||||
houseTakePointBindingMapper.insert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByBindingId(Long id) {
|
||||
houseTakePointBindingMapper.deleteByBindingId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WareHouseTakePointBindingDO> getByBindingId(Long bindingId) {
|
||||
return houseTakePointBindingMapper.selectList(new LambdaQueryWrapperX<WareHouseTakePointBindingDO>()
|
||||
.eq(WareHouseTakePointBindingDO::getBindingId, bindingId));
|
||||
}
|
||||
|
||||
}
|
@ -55,5 +55,8 @@ public interface WareHouseTakePointService extends IService<WareHouseTakePointDO
|
||||
*/
|
||||
PageResult<WareHouseTakePointDO> getHouseTakePointPage(WareHouseTakePointPageReqVO pageReqVO);
|
||||
|
||||
List<WareHouseTakePointDO> getHouseTakePointList();
|
||||
List<WareHouseTakePointDO> getHouseTakePointList(WareHouseTakePointSaveReqVO updateReqVO);
|
||||
|
||||
void setTakePointMapIdEmpty(Long mapId,List<Long> ids);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
@ -7,11 +8,9 @@ import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseTakePoint
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@ -74,8 +73,20 @@ public class WareHouseTakePointServiceImpl extends ServiceImpl<WareHouseTakePoin
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WareHouseTakePointDO> getHouseTakePointList() {
|
||||
return houseTakePointMapper.selectList();
|
||||
public List<WareHouseTakePointDO> getHouseTakePointList(WareHouseTakePointSaveReqVO reqVO) {
|
||||
return houseTakePointMapper.selectList(new LambdaQueryWrapperX<WareHouseTakePointDO>()
|
||||
.likeIfPresent(WareHouseTakePointDO::getPointName, reqVO.getPointName())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPointType, reqVO.getPointType())
|
||||
.inIfPresent(WareHouseTakePointDO::getId, reqVO.getIds())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPointStatus, reqVO.getPointStatus())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPositionMapId, reqVO.getPositionMapId())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPositionMapItemId, reqVO.getPositionMapItemId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTakePointMapIdEmpty(Long mapId,List<Long> ids) {
|
||||
houseTakePointMapper.setTakePointMapIdEmpty(mapId,ids);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public interface DeviceInformationService extends IService<DeviceInformationDO>
|
||||
* @param id 编号
|
||||
* @return 设备信息
|
||||
*/
|
||||
DeviceInformationDO getInformation(Long id);
|
||||
DeviceInformationRespVO getInformation(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备信息分页
|
||||
|
@ -16,17 +16,21 @@ import cn.iocoder.yudao.module.system.controller.admin.information.vo.DeviceInfo
|
||||
import cn.iocoder.yudao.module.system.controller.admin.log.vo.UserOperationLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.information.DeviceInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.information.DeviceInformationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceAttributeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.PictureConfigEnum;
|
||||
import cn.iocoder.yudao.module.system.service.config.CommonConfigService;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointBindingService;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotWarnMsgService;
|
||||
@ -96,6 +100,12 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
@Autowired
|
||||
private ZnConfigConstant znConfigConstant;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointBindingService houseTakePointBindingService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
public Long createInformation(DeviceInformationSaveReqVO createReqVO) {
|
||||
// -- 先判断库里是否有相通的mac地址数据
|
||||
@ -114,11 +124,20 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
createReqVO.setUrl(dictDataDO.getRemark());
|
||||
}
|
||||
|
||||
List<WareHouseTakePointBindingDO> list = new ArrayList<>();
|
||||
if (DeviceTypeEnum.CAMERA.getType().equals(createReqVO.getDeviceType())) {
|
||||
try {
|
||||
createReqVO.setCameraCode(AESEncryptionUtil.getEncrypt(createReqVO.getCameraCode(), znConfigConstant.getCameraSecretKey()));
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}else if (DeviceTypeEnum.FLIP.getType().equals(createReqVO.getDeviceType())) {
|
||||
if (ObjectUtil.isEmpty(createReqVO.getTakePointId())) {
|
||||
throw exception(INFORMATION_FLIP_BINDING);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(createReqVO.getCheckPointIds())) {
|
||||
throw exception(INFORMATION_FLIP_NEED_BINDING_CHECK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 插入
|
||||
@ -126,6 +145,16 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
information.setDeviceStatus(1);
|
||||
informationMapper.insert(information);
|
||||
|
||||
|
||||
for (Long takePointId : createReqVO.getCheckPointIds()) {
|
||||
WareHouseTakePointBindingDO data = new WareHouseTakePointBindingDO();
|
||||
data.setBindingId(information.getId());
|
||||
data.setBindingType(ZeroOneEnum.ZERO.getType());
|
||||
data.setTakePointId(takePointId);
|
||||
list.add(data);
|
||||
}
|
||||
|
||||
houseTakePointBindingService.createHouseTakePointBindings(list);
|
||||
UserOperationLogSaveReqVO operationLog = UserOperationLogSaveReqVO.builder()
|
||||
.operateAction("新增设备 " + createReqVO.getDeviceNo())
|
||||
.nickName(SecurityFrameworkUtils.getLoginUserNickname()).build();
|
||||
@ -178,6 +207,18 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
positionMapItemService.updateById(positionMapItem);
|
||||
}
|
||||
|
||||
List<WareHouseTakePointBindingDO> list = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getCheckPointIds())) {
|
||||
for (Long takePointId : updateReqVO.getCheckPointIds()) {
|
||||
WareHouseTakePointBindingDO data = new WareHouseTakePointBindingDO();
|
||||
data.setBindingId(updateReqVO.getId());
|
||||
data.setBindingType(ZeroOneEnum.ZERO.getType());
|
||||
data.setTakePointId(takePointId);
|
||||
list.add(data);
|
||||
}
|
||||
}
|
||||
houseTakePointBindingService.deleteByBindingId(updateReqVO.getId());
|
||||
houseTakePointBindingService.createHouseTakePointBindings(list);
|
||||
UserOperationLogSaveReqVO operationLog = UserOperationLogSaveReqVO.builder()
|
||||
.operateAction("更新设备信息 " + updateReqVO.getDeviceNo())
|
||||
.nickName(SecurityFrameworkUtils.getLoginUserNickname()).build();
|
||||
@ -210,15 +251,31 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceInformationDO getInformation(Long id) {
|
||||
public DeviceInformationRespVO getInformation(Long id) {
|
||||
// 校验存在
|
||||
validateInformationExists(id);
|
||||
DeviceInformationDO deviceInformationDO = informationMapper.selectById(id);
|
||||
String deviceKey = DeviceChcheConstant.DEVICE_LAST_TIME + deviceInformationDO.getMacAddress();
|
||||
Object object = redisUtil.get(deviceKey);
|
||||
DeviceInformationRespVO device = BeanUtils.toBean(deviceInformationDO, DeviceInformationRespVO.class);
|
||||
|
||||
if (DeviceTypeEnum.FLIP.getType().equals(deviceInformationDO.getDeviceType())) {
|
||||
// WareHouseTakePointDO takeWareHouseTakePointDO = houseTakePointService.getById(deviceInformationDO.getTakePointId());
|
||||
device.setTakePointId(deviceInformationDO.getTakePointId());
|
||||
List<WareHouseTakePointBindingDO> bindingDOS = houseTakePointBindingService.getByBindingId(id);
|
||||
if (ObjectUtil.isNotEmpty(bindingDOS)) {
|
||||
List<Long> pointIds = bindingDOS.stream().map(WareHouseTakePointBindingDO::getTakePointId).collect(Collectors.toList());
|
||||
/*WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO();
|
||||
reqVO.setIds(pointIds);
|
||||
List<WareHouseTakePointDO> houseTakePointList = houseTakePointService.getHouseTakePointList(reqVO);
|
||||
device.setCheckPointBindingList(houseTakePointList);*/
|
||||
device.setCheckPointIds(pointIds);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
deviceInformationDO.setDeviceStatus(DeviceStatusEnum.OFF_LINE.getType());
|
||||
return deviceInformationDO;
|
||||
return device;
|
||||
}
|
||||
try {
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
@ -228,7 +285,7 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
} catch (Exception e) {
|
||||
log.info("查询设备最后通讯时间异常 :{}", e.getMessage());
|
||||
}
|
||||
return deviceInformationDO;
|
||||
return device;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,7 +105,7 @@ public class RobotTaskLineTimeConsumingServiceImpl extends ServiceImpl<RobotTask
|
||||
line.setTaskNo(taskNo);
|
||||
line.setTaskDetailId(orderId);
|
||||
line.setRobotNo(taskDetail.getRobotNo());
|
||||
line.setTotalTimeConsuming(v.getTimeConsuming());
|
||||
line.setTotalTimeConsuming(String.format("%.2f", Double.valueOf(v.getTimeConsuming())));
|
||||
line.setFromSortNum(getSpit(line.getFromSortNum()));
|
||||
line.setToSortNum(getSpit(line.getToSortNum()));
|
||||
if (ObjectUtil.isNotEmpty(v.getTimeConsuming()) && ObjectUtil.isNotEmpty(v.getTotalDistance())) {
|
||||
|
@ -32,11 +32,6 @@ public class PlanningRobotWalkingDistanceServiceImpl implements MqttService {
|
||||
if (!str.contains(".")) {
|
||||
return str;
|
||||
}
|
||||
String[] split = str.split("\\.");
|
||||
String decimal = split[1];
|
||||
if (split[1].length() > 2) {
|
||||
decimal = split[1].substring(0, 2);
|
||||
}
|
||||
return split[0] + "." + decimal;
|
||||
return String.format("%.2f", Double.valueOf(str));
|
||||
}
|
||||
}
|
@ -107,6 +107,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
|
||||
CommonConfigVO chargeConfig = JSONUtil.toBean(commonConfigDO.getConfigStr(), CommonConfigVO.class);
|
||||
|
||||
List<RobotInformationDO> taskRobots = new ArrayList<>();
|
||||
for (RobotInformationDO robot : robots) {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(remoteRobotNos) && remoteRobotNos.contains(robot.getRobotNo())) {
|
||||
@ -163,6 +164,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
Boolean b = remainingElectricityBigger(chargeConfig, robot);
|
||||
if (b) {
|
||||
robot.setRobotStatus(RobotStatusEnum.STAND_BY.getType());
|
||||
taskRobots.add(robot);
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,10 +173,10 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
|| RobotStatusEnum.LAST_TASK_IS_TAKE.getType().equals(v.getRobotStatus())))
|
||||
.collect(Collectors.toList());*/
|
||||
|
||||
/*if (robots.isEmpty()) {
|
||||
if (taskRobots.isEmpty()) {
|
||||
log.info("暂无可用的机器人,可能正在充电,可能车机上报不允许接任务");
|
||||
return pair;
|
||||
}*/
|
||||
}
|
||||
|
||||
log.info("完成查找车子");
|
||||
|
||||
@ -197,16 +199,16 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
|
||||
if (ObjectUtil.isEmpty(montageTaskIds) && ObjectUtil.isEmpty(singleTaskIds)) {
|
||||
log.info("暂无需要处理的主任务");
|
||||
return ImmutablePair.of(robots, null);
|
||||
return ImmutablePair.of(taskRobots, null);
|
||||
}
|
||||
|
||||
List<RobotTaskDetailDO> taskDetails = getTaskDetail(montageTaskIds, singleTaskIds);
|
||||
|
||||
if (taskDetails.isEmpty()) {
|
||||
log.info("暂无需要处理的明细任务");
|
||||
return ImmutablePair.of(robots, null);
|
||||
return ImmutablePair.of(taskRobots, null);
|
||||
}
|
||||
return ImmutablePair.of(robots, taskDetails);
|
||||
return ImmutablePair.of(taskRobots, taskDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -560,7 +560,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
.last("limit 1"));
|
||||
if (ObjectUtil.isNotEmpty(nextLocation) && ObjectUtil.isNotEmpty(nextLocation.getLocationTotalHeight())) {
|
||||
|
||||
BigDecimal d1 = new BigDecimal("0.12");
|
||||
BigDecimal d1 = new BigDecimal("0.4");
|
||||
BigDecimal d2 = nextLocation.getLocationTotalHeight();
|
||||
double detectHeight = d2.subtract(d1).doubleValue();
|
||||
pathPlanning.setDetectHeight(detectHeight);
|
||||
@ -569,7 +569,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
|
||||
Integer locationStorey = fromLocation.getLocationStorey() - 1;
|
||||
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
|
||||
BigDecimal d1 = new BigDecimal("0.12");
|
||||
BigDecimal d1 = new BigDecimal("0.4");
|
||||
BigDecimal d2 = new BigDecimal(height + "");
|
||||
double detectHeight = d2.subtract(d1).doubleValue();
|
||||
log.info("设置取货默认抬叉高度 :{}", detectHeight);
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?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="cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseTakePointBindingMapper">
|
||||
|
||||
|
||||
<delete id="deleteByBindingId">
|
||||
delete
|
||||
from ware_house_take_point_binding
|
||||
where binding_id = #{bindingId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,29 @@
|
||||
<?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="cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseTakePointMapper">
|
||||
|
||||
|
||||
<update id="setTakePointMapIdEmpty">
|
||||
update
|
||||
ware_house_take_point
|
||||
set
|
||||
position_map_id = null,
|
||||
position_map_item_id = null,
|
||||
actual_location_x = null,
|
||||
actual_location_y = null
|
||||
<where>
|
||||
position_map_id = #{positionMapId}
|
||||
and point_type = '0'
|
||||
<if test= " ids != null and ids.size() > 0">
|
||||
AND id not in
|
||||
<foreach collection="ids" item="id" index="index" open="(" close=")"
|
||||
separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user