diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java index 23ea4d49e..f88e33fab 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java @@ -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, "取货点位绑定不存在"); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointBindingController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointBindingController.java new file mode 100644 index 000000000..9711e99f9 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointBindingController.java @@ -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 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 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 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 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> getHouseTakePointBindingPage(@Valid WareHouseTakePointBindingPageReqVO pageReqVO) { + PageResult 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 list = houseTakePointBindingService.getHouseTakePointBindingPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "取货点位绑定.xls", "数据", WareHouseTakePointBindingRespVO.class, + BeanUtils.toBean(list, WareHouseTakePointBindingRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointController.java index 9dcff8ede..5c0ea2835 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/WareHouseTakePointController.java @@ -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> getHouseTakePointList() { - List list = houseTakePointService.getHouseTakePointList(); + public CommonResult> getHouseTakePointList(@RequestBody WareHouseTakePointSaveReqVO updateReqVO) { + List list = houseTakePointService.getHouseTakePointList(updateReqVO); return success(BeanUtils.toBean(list, WareHouseTakePointRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingPageReqVO.java new file mode 100644 index 000000000..af8db8825 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingRespVO.java new file mode 100644 index 000000000..5eefdfe1c --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingSaveReqVO.java new file mode 100644 index 000000000..add228d66 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointBindingSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointPageReqVO.java index 0746cb6a4..d210a6820 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointPageReqVO.java @@ -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 = "总高度") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointRespVO.java index b31064337..f14d9cf5d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointRespVO.java @@ -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 = "总高度") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointSaveReqVO.java index 2caa3d509..9a3e22067 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/houselocation/vo/WareHouseTakePointSaveReqVO.java @@ -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 ids; + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/DeviceInformationController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/DeviceInformationController.java index b63e4f3b6..ebeba7df5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/DeviceInformationController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/DeviceInformationController.java @@ -71,8 +71,8 @@ public class DeviceInformationController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('device:information:query')") public CommonResult 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") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationRespVO.java index 530d5b117..40fdd8736 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationRespVO.java @@ -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 checkPointIds; + + /*@Schema(description = "取货点位") + private WareHouseTakePointDO takeWareHouseTakePointDO; + + @Schema(description = "检测区的取货点位") + private List checkPointBindingList;*/ } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationSaveReqVO.java index aebfdacf7..b7a843ac0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/information/vo/DeviceInformationSaveReqVO.java @@ -103,4 +103,7 @@ public class DeviceInformationSaveReqVO { @Schema(description = "ware_house_take_point的id") private Long takePointId; + + @Schema(description = "检测点的id") + private List checkPointIds; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/houselocation/WareHouseTakePointBindingDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/houselocation/WareHouseTakePointBindingDO.java new file mode 100644 index 000000000..8d60e170c --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/houselocation/WareHouseTakePointBindingDO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointBindingMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointBindingMapper.java new file mode 100644 index 000000000..5f5353416 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointBindingMapper.java @@ -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 { + + default PageResult selectPage(WareHouseTakePointBindingPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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); +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointMapper.java index 67606f2ce..00a31996e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/houselocation/WareHouseTakePointMapper.java @@ -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 ids); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/enums/map/PointTypeEnum.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/enums/map/PointTypeEnum.java new file mode 100644 index 000000000..7b6ea599f --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/enums/map/PointTypeEnum.java @@ -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; +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/map/MapConsumer.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/map/MapConsumer.java index 376ec277d..4f2214467 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/map/MapConsumer.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/map/MapConsumer.java @@ -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 devices = deviceInformationService.getDeviceInfoBindByMapId(mapId); + if (ObjectUtil.isEmpty(devices)) { + return; + } + + List takePointIds = new ArrayList<>(); + List 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 houseTakePointList = houseTakePointService.getHouseTakePointList(reqVO); + + Map 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); } } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/task/TaskDistributionConsumer.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/task/TaskDistributionConsumer.java index 4e525b0ae..10a7af92d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/task/TaskDistributionConsumer.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/task/TaskDistributionConsumer.java @@ -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()) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointBindingService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointBindingService.java new file mode 100644 index 000000000..b9a3ed928 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointBindingService.java @@ -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 { + + /** + * 创建取货点位绑定 + * + * @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 getHouseTakePointBindingPage(WareHouseTakePointBindingPageReqVO pageReqVO); + + void createHouseTakePointBindings(List list); + + void deleteByBindingId(Long id); + + List getByBindingId(Long id); +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointBindingServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointBindingServiceImpl.java new file mode 100644 index 000000000..df0046117 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointBindingServiceImpl.java @@ -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 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 getHouseTakePointBindingPage(WareHouseTakePointBindingPageReqVO pageReqVO) { + return houseTakePointBindingMapper.selectPage(pageReqVO); + } + + @Override + public void createHouseTakePointBindings(List list) { + houseTakePointBindingMapper.insert(list); + } + + @Override + public void deleteByBindingId(Long id) { + houseTakePointBindingMapper.deleteByBindingId(id); + } + + @Override + public List getByBindingId(Long bindingId) { + return houseTakePointBindingMapper.selectList(new LambdaQueryWrapperX() + .eq(WareHouseTakePointBindingDO::getBindingId, bindingId)); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointService.java index 89f8a3972..b63880df1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointService.java @@ -55,5 +55,8 @@ public interface WareHouseTakePointService extends IService getHouseTakePointPage(WareHouseTakePointPageReqVO pageReqVO); - List getHouseTakePointList(); + List getHouseTakePointList(WareHouseTakePointSaveReqVO updateReqVO); + + void setTakePointMapIdEmpty(Long mapId,List ids); + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointServiceImpl.java index 49df28080..c0ffdad1e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/houselocation/WareHouseTakePointServiceImpl.java @@ -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 getHouseTakePointList() { - return houseTakePointMapper.selectList(); + public List getHouseTakePointList(WareHouseTakePointSaveReqVO reqVO) { + return houseTakePointMapper.selectList(new LambdaQueryWrapperX() + .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 ids) { + houseTakePointMapper.setTakePointMapIdEmpty(mapId,ids); + } + + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationService.java index c820da361..b8ea7ef67 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationService.java @@ -49,7 +49,7 @@ public interface DeviceInformationService extends IService * @param id 编号 * @return 设备信息 */ - DeviceInformationDO getInformation(Long id); + DeviceInformationRespVO getInformation(Long id); /** * 获得设备信息分页 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationServiceImpl.java index 8cebd5b15..79dbf27c7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/information/DeviceInformationServiceImpl.java @@ -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 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 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 bindingDOS = houseTakePointBindingService.getByBindingId(id); + if (ObjectUtil.isNotEmpty(bindingDOS)) { + List pointIds = bindingDOS.stream().map(WareHouseTakePointBindingDO::getTakePointId).collect(Collectors.toList()); + /*WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO(); + reqVO.setIds(pointIds); + List 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 2) { - decimal = split[1].substring(0, 2); - } - return split[0] + "." + decimal; + return String.format("%.2f", Double.valueOf(str)); } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/job/DistributeTasksServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/job/DistributeTasksServiceImpl.java index b59af4705..c021b79c9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/job/DistributeTasksServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/job/DistributeTasksServiceImpl.java @@ -107,6 +107,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService { CommonConfigVO chargeConfig = JSONUtil.toBean(commonConfigDO.getConfigStr(), CommonConfigVO.class); + List 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 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); } /** diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/pathplanning/RobotPathPlanningServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/pathplanning/RobotPathPlanningServiceImpl.java index 27ed440b4..94e2e639d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/pathplanning/RobotPathPlanningServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/pathplanning/RobotPathPlanningServiceImpl.java @@ -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); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/houselocation/WareHouseTakePointBindingMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/houselocation/WareHouseTakePointBindingMapper.xml new file mode 100644 index 000000000..f838277bd --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/houselocation/WareHouseTakePointBindingMapper.xml @@ -0,0 +1,13 @@ + + + + + + + delete + from ware_house_take_point_binding + where binding_id = #{bindingId} + + + + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/houselocation/WareHouseTakePointMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/houselocation/WareHouseTakePointMapper.xml new file mode 100644 index 000000000..107cbe426 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/houselocation/WareHouseTakePointMapper.xml @@ -0,0 +1,29 @@ + + + + + + + update + ware_house_take_point + set + position_map_id = null, + position_map_item_id = null, + actual_location_x = null, + actual_location_y = null + + position_map_id = #{positionMapId} + and point_type = '0' + + AND id not in + + #{id} + + + + + + + +