Explorar o código

库位信息、任务管理页面

zhangx hai 1 ano
pai
achega
dc8c60dad8

+ 0 - 3
warewms-ams/src/main/java/com/warewms/ams/ndc/AciService.java

@@ -135,7 +135,6 @@ public class AciService {
                 if (taskBeans != null && taskBeans.size() > 0) {
 
                     for (AmsTask t : taskBeans) {
-                        t.init();
                         List<AmsHexdefineDetail> basTask = amsHexdefineDetailService.selectAmsHexdefineDetailByBusinessType(t.getBusinessType());
                         if (basTask == null || basTask.size() == 0) {
                             t.setIsDelete(1);
@@ -144,7 +143,6 @@ public class AciService {
                             continue;
                         }
 
-//                        try {
                             String order = amsHexdefineDetailService.concatOrder(t, basTask);
                             log.info("writeOrder:" + order);
                             if (t.getBusinessType().equals("m") ||
@@ -231,7 +229,6 @@ public class AciService {
                             iterator.remove();
                         }
                     }
-//                    Thread.currentThread().sleep(3000);
                 } catch (Exception e) {
                     throw new BaseException(e.getMessage());
                 }

+ 33 - 0
warewms-ams/src/main/java/com/warewms/ams/ndc/controller/AmsTaskController.java

@@ -1,16 +1,25 @@
 package com.warewms.ams.ndc.controller;
 
 import com.warewms.ams.ndc.dto.AmsTaskCancelDTO;
+import com.warewms.ams.ndc.dto.AmsTaskDTO;
 import com.warewms.ams.ndc.dto.AmsTaskInfoDTO;
 import com.warewms.ams.ndc.dto.AmsTaskInsertDTO;
 import com.warewms.ams.ndc.service.IAmsTaskService;
 import com.warewms.common.base.controller.BaseController;
 import com.warewms.common.base.domain.AjaxResult;
+import com.warewms.common.base.page.PageData;
+import com.warewms.common.constant.Constants;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import kotlin.Result;
 import org.assertj.core.util.Maps;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
+import java.util.Map;
 
 /**
  * AGV任务Controller
@@ -24,12 +33,36 @@ public class AmsTaskController extends BaseController {
     @Autowired
     private IAmsTaskService amsTaskService;
 
+    @GetMapping("page")
+    @ApiOperation("分页")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = Constants.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
+            @ApiImplicitParam(name = Constants.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
+            @ApiImplicitParam(name = Constants.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = Constants.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "taskNo", value = "任务编号", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "aciIndex", value = "aci主键", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "stFrom", value = "起点", paramType = "query", dataType = "Long"),
+            @ApiImplicitParam(name = "stTo", value = "终点", paramType = "query", dataType = "Long")
+    })
+    public AjaxResult page(@ApiIgnore @RequestParam Map<String, Object> params){
+        PageData<AmsTaskDTO> page = amsTaskService.page(params);
+        return AjaxResult.success(page);
+    }
+
     @PostMapping(value = "/wcsTask/taskInsert")
     public AjaxResult taskInsert(@RequestBody @Valid AmsTaskInsertDTO amsTaskInsertDTO) {
         Long taskNo = amsTaskService.amsTaskInsert(amsTaskInsertDTO);
         return AjaxResult.success("任务生成成功", Maps.newHashMap("taskNo", taskNo));
     }
 
+    @GetMapping("{id}")
+    @ApiOperation("信息")
+    public AjaxResult get(@PathVariable("id") Long id){
+        AmsTaskDTO data = amsTaskService.get(id);
+        return AjaxResult.success(data);
+    }
+
     @GetMapping(value = "/wcsTask/getTaskInfo")
     public AjaxResult getTaskInfo(@RequestParam String businessNo) {
         AmsTaskInfoDTO AmsTaskInfoDTO = amsTaskService.getAmsTaskInfo(businessNo);

+ 39 - 23
warewms-ams/src/main/java/com/warewms/ams/ndc/controller/BaseLocationInfoController.java

@@ -2,18 +2,28 @@ package com.warewms.ams.ndc.controller;
 
 
 import com.warewms.ams.ndc.domain.BaseLocationInfo;
+import com.warewms.ams.ndc.dto.AmsTaskDTO;
+import com.warewms.ams.ndc.dto.BaseLocationInfoDTO;
 import com.warewms.ams.ndc.service.IBaseLocationInfoService;
 import com.warewms.common.annotation.Log;
 import com.warewms.common.base.controller.BaseController;
 import com.warewms.common.base.domain.AjaxResult;
+import com.warewms.common.base.page.PageData;
 import com.warewms.common.base.page.TableDataInfo;
+import com.warewms.common.constant.Constants;
 import com.warewms.common.enums.BusinessType;
 import com.warewms.common.utils.poi.ExcelUtil;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 库位信息Controller
@@ -27,32 +37,48 @@ public class BaseLocationInfoController extends BaseController {
     @Autowired
     private IBaseLocationInfoService baseLocationInfoService;
 
-    /**
-     * 查询库位信息列表
-     */
-    @GetMapping("/list")
-    public TableDataInfo list(BaseLocationInfo baseLocationInfo) {
-        startPage();
-        List<BaseLocationInfo> list = baseLocationInfoService.selectBaseLocationInfoList(baseLocationInfo);
-        return getDataTable(list);
+    @GetMapping("page")
+    @ApiOperation("分页")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = Constants.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
+            @ApiImplicitParam(name = Constants.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
+            @ApiImplicitParam(name = Constants.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = Constants.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "zoneId", value = "区域id", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "locationNo", value = "库位编码", paramType = "query", dataType = "String"),
+            @ApiImplicitParam(name = "rowNo", value = "巷道", paramType = "query", dataType = "Long"),
+            @ApiImplicitParam(name = "agvStation", value = "agv点位", paramType = "query", dataType = "Long")
+    })
+    public AjaxResult page(@ApiIgnore @RequestParam Map<String, Object> params){
+        PageData<BaseLocationInfoDTO> page = baseLocationInfoService.page(params);
+        return AjaxResult.success(page);
     }
 
+    @PostMapping("/save")
+    @ApiOperation("保存")
+    public AjaxResult save(@RequestBody BaseLocationInfoDTO dto){
+
+        baseLocationInfoService.save(dto);
+
+        return AjaxResult.success();
+    }
 
     /**
      * 获取库位信息详细信息
      */
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
-        return AjaxResult.success(baseLocationInfoService.selectBaseLocationInfoById(id));
+        return AjaxResult.success(baseLocationInfoService.get(id));
     }
 
     /**
      * 修改库位信息
      */
     @Log(title = "库位信息", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody BaseLocationInfo baseLocationInfo) {
-        return toAjax(baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo));
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody BaseLocationInfoDTO baseLocationInfoDTO) {
+        baseLocationInfoService.update(baseLocationInfoDTO);
+        return AjaxResult.success();
     }
 
     /**
@@ -61,19 +87,9 @@ public class BaseLocationInfoController extends BaseController {
     @Log(title = "库位信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(baseLocationInfoService.deleteBaseLocationInfoByIds(ids));
+        return toAjax(baseLocationInfoService.deleteBatchIds(Arrays.asList(ids)));
     }
 
-    /**
-     * 获取库位字典
-     */
-    @GetMapping("/queryDict/{zoneId}")
-    public AjaxResult queryDict(@PathVariable("zoneId") Long zoneId) {
-        List<BaseLocationInfo> locationInfoList = baseLocationInfoService.selectSortedLocatinListByZoneId(zoneId, 1L,null);
-        return AjaxResult.success("", locationInfoList);
-    }
-
-
     @PostMapping("/importTemplate")
     public void importTemplate(HttpServletResponse response)
     {

+ 6 - 292
warewms-ams/src/main/java/com/warewms/ams/ndc/domain/AmsTask.java

@@ -1,8 +1,11 @@
 package com.warewms.ams.ndc.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.warewms.common.annotation.Excel;
 import com.warewms.common.base.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -16,39 +19,11 @@ import java.util.Map;
  * @author andy
  * @date 2022-08-08
  */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("ams_task")
 public class AmsTask extends BaseEntity {
     private static final long serialVersionUID = 1L;
-    //属性
-    @TableField(exist = false)
-    private Map<String, Object> attr = new HashMap<>();
-
-    public AmsTask() {
-        attr.put("id", getId());
-        attr.put("task_no", getTaskNo());
-        attr.put("iKey", getIkey());
-        attr.put("aci_index", getAciIndex());
-        attr.put("st_from", getStFrom());
-        attr.put("st_to", getStTo());
-        attr.put("priority", getPriority());
-        attr.put("system_status", getSystemStatus());
-        attr.put("event", getEvent());
-        attr.put("server_ack", getServerAck());
-        attr.put("aci_accept", getAciAccept());
-        attr.put("is_delete", getIsDelete());
-        attr.put("callBackUrl", getCallbackurl());
-        attr.put("addtime", getAddtime());
-        attr.put("addwho", getAddwho());
-        attr.put("sys_name", getSysName());
-        attr.put("device_name", getDeviceName());
-        attr.put("business_type", getBusinessType());
-        attr.put("ext1", getExt1());
-        attr.put("ext2", getExt2());
-        attr.put("ext3", getExt3());
-        attr.put("height_level", getHeightLevel());
-        attr.put("remark", getRemark());
-        attr.put("roadway", getRoadway());
-        attr.put("tier", getTier());
-    }
 
     /**
      * $column.columnComment
@@ -192,265 +167,4 @@ public class AmsTask extends BaseEntity {
      */
     @Excel(name = "层")
     private String tier;
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setTaskNo(String taskNo) {
-        this.taskNo = taskNo;
-    }
-
-    public String getTaskNo() {
-        return taskNo;
-    }
-
-    public void setIkey(Long ikey) {
-        this.ikey = ikey;
-    }
-
-    public Long getIkey() {
-        return ikey;
-    }
-
-    public void setAciIndex(Integer aciIndex) {
-        this.aciIndex = aciIndex;
-    }
-
-    public Integer getAciIndex() {
-        return aciIndex;
-    }
-
-    public void setStFrom(Integer stFrom) {
-        this.stFrom = stFrom;
-    }
-
-    public Integer getStFrom() {
-        return stFrom;
-    }
-
-    public void setStTo(Integer stTo) {
-        this.stTo = stTo;
-    }
-
-    public Integer getStTo() {
-        return stTo;
-    }
-
-    public void setPriority(Integer priority) {
-        this.priority = priority;
-    }
-
-    public Integer getPriority() {
-        return priority;
-    }
-
-    public void setSystemStatus(Integer systemStatus) {
-        this.systemStatus = systemStatus;
-    }
-
-    public Integer getSystemStatus() {
-        return systemStatus;
-    }
-
-    public void setEvent(Integer event) {
-        this.event = event;
-    }
-
-    public Integer getEvent() {
-        return event;
-    }
-
-    public void setServerAck(Integer serverAck) {
-        this.serverAck = serverAck;
-    }
-
-    public Integer getServerAck() {
-        return serverAck;
-    }
-
-    public void setAciAccept(Integer aciAccept) {
-        this.aciAccept = aciAccept;
-    }
-
-    public Integer getAciAccept() {
-        return aciAccept;
-    }
-
-    public void setIsDelete(Integer isDelete) {
-        this.isDelete = isDelete;
-    }
-
-    public Integer getIsDelete() {
-        return isDelete;
-    }
-
-    public void setCallbackurl(String callbackurl) {
-        this.callbackurl = callbackurl;
-    }
-
-    public String getCallbackurl() {
-        return callbackurl;
-    }
-
-    public void setAddtime(Date addtime) {
-        this.addtime = addtime;
-    }
-
-    public Date getAddtime() {
-        return addtime;
-    }
-
-    public void setAddwho(String addwho) {
-        this.addwho = addwho;
-    }
-
-    public String getAddwho() {
-        return addwho;
-    }
-
-    public void setSysName(String sysName) {
-        this.sysName = sysName;
-    }
-
-    public String getSysName() {
-        return sysName;
-    }
-
-    public void setDeviceName(String deviceName) {
-        this.deviceName = deviceName;
-    }
-
-    public String getDeviceName() {
-        return deviceName;
-    }
-
-    public void setBusinessType(String businessType) {
-        this.businessType = businessType;
-    }
-
-    public String getBusinessType() {
-        return businessType;
-    }
-
-    public void setExt1(String ext1) {
-        this.ext1 = ext1;
-    }
-
-    public String getExt1() {
-        return ext1;
-    }
-
-    public void setExt2(String ext2) {
-        this.ext2 = ext2;
-    }
-
-    public String getExt2() {
-        return ext2;
-    }
-
-    public void setExt3(String ext3) {
-        this.ext3 = ext3;
-    }
-
-    public String getExt3() {
-        return ext3;
-    }
-
-    public void setHeightLevel(String heightLevel) {
-        this.heightLevel = heightLevel;
-    }
-
-    public String getHeightLevel() {
-        return heightLevel;
-    }
-
-    public void setRoadway(String roadway) {
-        this.roadway = roadway;
-    }
-
-    public String getRoadway() {
-        return roadway;
-    }
-
-    public void setTier(String tier) {
-        this.tier = tier;
-    }
-
-    public String getTier() {
-        return tier;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("id", getId())
-                .append("taskNo", getTaskNo())
-                .append("ikey", getIkey())
-                .append("aciIndex", getAciIndex())
-                .append("stFrom", getStFrom())
-                .append("stTo", getStTo())
-                .append("priority", getPriority())
-                .append("systemStatus", getSystemStatus())
-                .append("event", getEvent())
-                .append("serverAck", getServerAck())
-                .append("aciAccept", getAciAccept())
-                .append("isDelete", getIsDelete())
-                .append("callbackurl", getCallbackurl())
-                .append("addtime", getAddtime())
-                .append("addwho", getAddwho())
-                .append("sysName", getSysName())
-                .append("deviceName", getDeviceName())
-                .append("businessType", getBusinessType())
-                .append("ext1", getExt1())
-                .append("ext2", getExt2())
-                .append("ext3", getExt3())
-                .append("heightLevel", getHeightLevel())
-                .append("remark", getRemark())
-                .append("roadway", getRoadway())
-                .append("tier", getTier())
-                .toString();
-    }
-
-    public String getStr(String feild) {
-        Object obj = attr.get(feild);
-        if (obj != null) {
-            return obj.toString();
-        } else {
-            return "";
-        }
-    }
-
-    public void init(){
-        attr.put("id", getId());
-        attr.put("task_no", getTaskNo());
-        attr.put("iKey", getIkey());
-        attr.put("aci_index", getAciIndex());
-        attr.put("st_from", getStFrom());
-        attr.put("st_to", getStTo());
-        attr.put("priority", getPriority());
-        attr.put("system_status", getSystemStatus());
-        attr.put("event", getEvent());
-        attr.put("server_ack", getServerAck());
-        attr.put("aci_accept", getAciAccept());
-        attr.put("is_delete", getIsDelete());
-        attr.put("callBackUrl", getCallbackurl());
-        attr.put("addtime", getAddtime());
-        attr.put("addwho", getAddwho());
-        attr.put("sys_name", getSysName());
-        attr.put("device_name", getDeviceName());
-        attr.put("business_type", getBusinessType());
-        attr.put("ext1", getExt1());
-        attr.put("ext2", getExt2());
-        attr.put("ext3", getExt3());
-        attr.put("height_level", getHeightLevel());
-        attr.put("remark", getRemark());
-        attr.put("roadway", getRoadway());
-        attr.put("tier", getTier());
-    }
-
 }

+ 5 - 1
warewms-ams/src/main/java/com/warewms/ams/ndc/domain/BaseLocationInfo.java

@@ -1,8 +1,10 @@
 package com.warewms.ams.ndc.domain;
 
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.warewms.common.annotation.Excel;
 import com.warewms.common.base.domain.BaseEntity;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 /**
  * 库位信息对象 base_location_info
@@ -11,6 +13,8 @@ import lombok.Data;
  * @date 2022-02-18
  */
 @Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("base_location_info")
 public class BaseLocationInfo extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
@@ -36,7 +40,7 @@ public class BaseLocationInfo extends BaseEntity {
     /**
      * 排号
      */
-    @Excel(name = "排号")
+    @Excel(name = "巷道")
     private String rowNo;
 
     /**

+ 124 - 0
warewms-ams/src/main/java/com/warewms/ams/ndc/dto/BaseLocationInfoDTO.java

@@ -0,0 +1,124 @@
+package com.warewms.ams.ndc.dto;
+
+import com.warewms.common.annotation.Excel;
+import com.warewms.common.base.domain.BaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 库位信息对象 base_location_info
+ *
+ * @author andy
+ * @date 2022-02-18
+ */
+@Data
+public class BaseLocationInfoDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    private Long warehouseId;
+
+    /**
+     * 区域id
+     */
+    @Excel(name = "区域id")
+    private Long zoneId;
+
+    /**
+     * 库位编码
+     */
+    @Excel(name = "库位编码")
+    private String locationNo;
+
+    /**
+     * 排号
+     */
+    @Excel(name = "排号")
+    private String rowNo;
+
+    /**
+     * 排序号
+     */
+    @Excel(name = "排序号")
+    private Long rowIndex;
+
+    /**
+     * 列号
+     */
+    @Excel(name = "列号")
+    private String colNo;
+
+    /**
+     * 列序号
+     */
+    @Excel(name = "列序号")
+    private Long colIndex;
+
+    /**
+     * 层号
+     */
+    @Excel(name = "层号")
+    private String shiftNo;
+
+    /**
+     * 层序号
+     */
+    @Excel(name = "层序号")
+    private Long shiftIndex;
+
+    /**
+     * 储位状态(00)空闲,(10)占用,(20)完成,(90)合格,(99)不合格(80封存)
+     */
+    private String stockStatus;
+
+    /**
+     * 是否为空(Y空/N非空)
+     */
+    @Excel(name = "是否为空")
+    private String isEmpty;
+
+    /**
+     * 指定产品
+     */
+//    @Excel(name = "指定产品")
+    private String bindSku;
+
+    /**
+     * 储位类型(1货架2地堆3流离货架)
+     */
+    @Excel(name = "储位类型(1=货架,2=地堆)")
+    private String locationType;
+
+    /**
+     * 盘架编号
+     */
+    private String rackId;
+
+    /**
+     * AGV点位
+     */
+    @Excel(name = "AGV点位")
+    private Long agvStation;
+
+    /**
+     * 车号(标识这个库位是几号车做任务)
+     */
+    @Excel(name = "车号(输入1或者2)")
+    private String foldedTag;
+
+    /**
+     * 叠空托盘上限(当folded_tag为1时有效)
+     */
+    private Long foldedCount;
+
+    private Double heightLimit;
+
+    private Double weightLimit;
+
+
+}

+ 0 - 48
warewms-ams/src/main/java/com/warewms/ams/ndc/mapper/BaseLocationInfoMapper.java

@@ -14,53 +14,5 @@ import java.util.List;
  */
 @Mapper
 public interface BaseLocationInfoMapper extends BaseMapper<BaseLocationInfo> {
-    /**
-     * 查询库位信息
-     *
-     * @param id 库位信息主键
-     * @return 库位信息
-     */
-    BaseLocationInfo selectBaseLocationInfoById(Long id);
-
-    /**
-     * 查询库位信息列表
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 库位信息集合
-     */
-    List<BaseLocationInfo> selectBaseLocationInfoList(BaseLocationInfo baseLocationInfo);
-
-    /**
-     * 新增库位信息
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 结果
-     */
-    int insertBaseLocationInfo(BaseLocationInfo baseLocationInfo);
-
-    /**
-     * 修改库位信息
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 结果
-     */
-    int updateBaseLocationInfo(BaseLocationInfo baseLocationInfo);
-
-    /**
-     * 批量删除库位信息
-     *
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    int deleteBaseLocationInfoByIds(Long[] ids);
-
-    /**
-     * 根据zoneId查询库位信息
-     * 返回结果会根据排列层进行排序
-     *
-     * @param baseLocationInfo
-     * @return
-     */
-    List<BaseLocationInfo> selectSortedLocationListByZoneId(BaseLocationInfo baseLocationInfo);
 
 }

+ 0 - 55
warewms-ams/src/main/java/com/warewms/ams/ndc/service/IAmsHexdefineDetailService.java

@@ -12,13 +12,6 @@ import java.util.List;
  * @date 2022-08-12
  */
 public interface IAmsHexdefineDetailService {
-    /**
-     * 查询任务定义(lp0-lp30)
-     *
-     * @param id 任务定义(lp0-lp30)主键
-     * @return 任务定义(lp0-lp30)
-     */
-    AmsHexdefineDetail selectAmsHexdefineDetailById(Long id);
 
     /**
      * 根据businessType查询指令明细
@@ -28,54 +21,6 @@ public interface IAmsHexdefineDetailService {
      */
     List<AmsHexdefineDetail> selectAmsHexdefineDetailByBusinessType(String businessType);
 
-    /**
-     * 查询任务定义(lp0-lp30)列表
-     *
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 任务定义(lp0-lp30)集合
-     */
-    List<AmsHexdefineDetail> selectAmsHexdefineDetailList(AmsHexdefineDetail amsHexdefineDetail);
-
-    /**
-     * 查询任务定义(lp0-lp30)
-     *
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 任务定义(lp0-lp30)集合
-     */
-    AmsHexdefineDetail selectAmsHexdefineDetailByModel(AmsHexdefineDetail amsHexdefineDetail);
-
-    /**
-     * 新增任务定义(lp0-lp30)
-     *
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 结果
-     */
-    int insertAmsHexdefineDetail(AmsHexdefineDetail amsHexdefineDetail);
-
-    /**
-     * 修改任务定义(lp0-lp30)
-     *
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 结果
-     */
-    int updateAmsHexdefineDetail(AmsHexdefineDetail amsHexdefineDetail);
-
-    /**
-     * 批量删除任务定义(lp0-lp30)
-     *
-     * @param ids 需要删除的任务定义(lp0-lp30)主键集合
-     * @return 结果
-     */
-    int deleteAmsHexdefineDetailByIds(Long[] ids);
-
-    /**
-     * 删除任务定义(lp0-lp30)信息
-     *
-     * @param id 任务定义(lp0-lp30)主键
-     * @return 结果
-     */
-    int deleteAmsHexdefineDetailById(Long id);
-
     /**
      * 指令拼接
      * @param amsTask

+ 3 - 43
warewms-ams/src/main/java/com/warewms/ams/ndc/service/IBaseLocationInfoService.java

@@ -1,6 +1,8 @@
 package com.warewms.ams.ndc.service;
 
 import com.warewms.ams.ndc.domain.BaseLocationInfo;
+import com.warewms.ams.ndc.dto.BaseLocationInfoDTO;
+import com.warewms.framework.service.CrudService;
 
 import java.util.List;
 
@@ -10,50 +12,8 @@ import java.util.List;
  * @author andy
  * @date 2022-02-18
  */
-public interface IBaseLocationInfoService {
+public interface IBaseLocationInfoService extends CrudService<BaseLocationInfo, BaseLocationInfoDTO> {
 
     List<BaseLocationInfo> queryBaseLocationInfoList(Integer zoneId, String rowNo);
 
-    /**
-     * 查询库位信息
-     *
-     * @param id 库位信息主键
-     * @return 库位信息
-     */
-    BaseLocationInfo selectBaseLocationInfoById(Long id);
-
-    /**
-     * 查询库位信息列表
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 库位信息集合
-     */
-    List<BaseLocationInfo> selectBaseLocationInfoList(BaseLocationInfo baseLocationInfo);
-
-    /**
-     * 修改库位信息
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 结果
-     */
-    int updateBaseLocationInfo(BaseLocationInfo baseLocationInfo);
-
-    /**
-     * 批量删除库位信息
-     *
-     * @param ids 需要删除的库位信息主键集合
-     * @return 结果
-     */
-    int deleteBaseLocationInfoByIds(Long[] ids);
-
-
-    /**
-     * 根据zoneId查询库位信息
-     * 返回结果会根据排列层进行排序
-     *
-     * @param zoneId
-     * @param warehouseId
-     * @return
-     */
-    List<BaseLocationInfo> selectSortedLocatinListByZoneId(Long zoneId, Long warehouseId,String orderBy);
 }

+ 17 - 93
warewms-ams/src/main/java/com/warewms/ams/ndc/service/impl/AmsHexdefineDetailServiceImpl.java

@@ -1,13 +1,20 @@
 package com.warewms.ams.ndc.service.impl;
 
+import cn.hutool.core.util.ClassUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.warewms.ams.ndc.common.ValType;
 import com.warewms.ams.ndc.domain.AmsHexdefineDetail;
 import com.warewms.ams.ndc.domain.AmsTask;
 import com.warewms.ams.ndc.mapper.AmsHexdefineDetailMapper;
 import com.warewms.ams.ndc.service.IAmsHexdefineDetailService;
+import com.warewms.common.utils.reflect.ReflectUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.reflect.FieldUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.lang.reflect.Field;
 import java.util.List;
 
 /**
@@ -17,115 +24,32 @@ import java.util.List;
  * @date 2022-08-12
  */
 @Service
+@Slf4j
 public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
 {
     @Autowired
     private AmsHexdefineDetailMapper amsHexdefineDetailMapper;
 
-    /**
-     * 查询任务定义(lp0-lp30)
-     * 
-     * @param id 任务定义(lp0-lp30)主键
-     * @return 任务定义(lp0-lp30)
-     */
-    @Override
-    public AmsHexdefineDetail selectAmsHexdefineDetailById(Long id)
-    {
-        return amsHexdefineDetailMapper.selectAmsHexdefineDetailById(id);
-    }
-
     @Override
     public List<AmsHexdefineDetail> selectAmsHexdefineDetailByBusinessType(String businessType) {
         return amsHexdefineDetailMapper.selectAmsHexdefineDetailByBusinessType(businessType);
     }
 
-    /**
-     * 查询任务定义(lp0-lp30)列表
-     * 
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 任务定义(lp0-lp30)
-     */
-    @Override
-    public List<AmsHexdefineDetail> selectAmsHexdefineDetailList(AmsHexdefineDetail amsHexdefineDetail)
-    {
-        return amsHexdefineDetailMapper.selectAmsHexdefineDetailList(amsHexdefineDetail);
-    }
-
-    /**
-     * 查询任务定义(lp0-lp30)
-     *
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 任务定义(lp0-lp30)
-     */
-    @Override
-    public AmsHexdefineDetail selectAmsHexdefineDetailByModel(AmsHexdefineDetail amsHexdefineDetail)
-    {
-        List<AmsHexdefineDetail> list = amsHexdefineDetailMapper.selectAmsHexdefineDetailList(amsHexdefineDetail);
-        if (list!=null && list.size()>0) {
-            return list.get(0);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * 新增任务定义(lp0-lp30)
-     * 
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 结果
-     */
-    @Override
-    public int insertAmsHexdefineDetail(AmsHexdefineDetail amsHexdefineDetail)
-    {
-        return amsHexdefineDetailMapper.insertAmsHexdefineDetail(amsHexdefineDetail);
-    }
-
-    /**
-     * 修改任务定义(lp0-lp30)
-     * 
-     * @param amsHexdefineDetail 任务定义(lp0-lp30)
-     * @return 结果
-     */
-    @Override
-    public int updateAmsHexdefineDetail(AmsHexdefineDetail amsHexdefineDetail)
-    {
-        return amsHexdefineDetailMapper.updateAmsHexdefineDetail(amsHexdefineDetail);
-    }
-
-    /**
-     * 批量删除任务定义(lp0-lp30)
-     * 
-     * @param ids 需要删除的任务定义(lp0-lp30)主键
-     * @return 结果
-     */
-    @Override
-    public int deleteAmsHexdefineDetailByIds(Long[] ids)
-    {
-        return amsHexdefineDetailMapper.deleteAmsHexdefineDetailByIds(ids);
-    }
-
-    /**
-     * 删除任务定义(lp0-lp30)信息
-     * 
-     * @param id 任务定义(lp0-lp30)主键
-     * @return 结果
-     */
-    @Override
-    public int deleteAmsHexdefineDetailById(Long id)
-    {
-        return amsHexdefineDetailMapper.deleteAmsHexdefineDetailById(id);
-    }
-
     @Override
     public String concatOrder(AmsTask amsTask, List<AmsHexdefineDetail> amsHexdefineDetails) {
         StringBuffer sb = new StringBuffer();
         for (AmsHexdefineDetail basTask : amsHexdefineDetails) {
+            String fieldValue = (String) ReflectUtils.getFieldValue(amsTask, basTask.getColVal());
+            if (ObjectUtil.isNull(fieldValue)) {
+                fieldValue = StringUtils.EMPTY;
+                log.error("AmsHexdefineDetailServiceImpl - concatOrder amsTask field {} is null", basTask.getColVal());
+            }
             //System.out.println(basTask.getColName());
             //字符串直接取数据库保存值
             if (basTask.getColType() == ValType.TEXT.getCode()) {
                 //如果是数字需要进行转换
                 if (basTask.getValType() == 2) {
-                    sb.append(String.format("%04X", Integer.parseInt(amsTask.getStr(basTask.getColVal()))));
+                    sb.append(String.format("%04X", Integer.parseInt(fieldValue)));
                 } else {
                     sb.append(basTask.getColVal());
                 }
@@ -134,12 +58,12 @@ public class AmsHexdefineDetailServiceImpl implements IAmsHexdefineDetailService
                 if (basTask.getValType() == 1) {
                     //如果是数字需要进行转换,Priority为2位其余4位
                     if (basTask.getColName().equals("Priority")) {
-                        sb.append(String.format("%02X", Integer.parseInt(amsTask.getStr(basTask.getColVal()))+ 0x80));
+                        sb.append(String.format("%02X", Integer.parseInt(fieldValue)+ 0x80));
                     }else {
-                        sb.append(String.format("%04X", Integer.parseInt(amsTask.getStr(basTask.getColVal()))));
+                        sb.append(String.format("%04X", Integer.parseInt(fieldValue)));
                     }
                 } else {
-                    sb.append(amsTask.getStr(basTask.getColVal()));
+                    sb.append(fieldValue);
                 }
             }
         }

+ 20 - 51
warewms-ams/src/main/java/com/warewms/ams/ndc/service/impl/BaseLocationInfoServiceImpl.java

@@ -1,12 +1,18 @@
 package com.warewms.ams.ndc.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.warewms.ams.common.AmsConstant;
+import com.warewms.ams.ndc.domain.AmsTask;
 import com.warewms.ams.ndc.domain.BaseLocationInfo;
+import com.warewms.ams.ndc.dto.AmsTaskDTO;
+import com.warewms.ams.ndc.dto.BaseLocationInfoDTO;
+import com.warewms.ams.ndc.mapper.AmsTaskMapper;
 import com.warewms.ams.ndc.mapper.BaseLocationInfoMapper;
 import com.warewms.ams.ndc.service.IBaseLocationInfoService;
 import com.warewms.common.utils.redis.RedisCache;
+import com.warewms.framework.service.impl.CrudServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,6 +20,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 库位信息Service业务层处理
@@ -23,7 +30,7 @@ import java.util.List;
  */
 @Slf4j
 @Service
-public class BaseLocationInfoServiceImpl implements IBaseLocationInfoService {
+public class BaseLocationInfoServiceImpl extends CrudServiceImpl<BaseLocationInfoMapper, BaseLocationInfo, BaseLocationInfoDTO>  implements IBaseLocationInfoService {
 
     @Autowired
     private BaseLocationInfoMapper baseLocationInfoMapper;
@@ -56,62 +63,24 @@ public class BaseLocationInfoServiceImpl implements IBaseLocationInfoService {
     }
 
     private List<BaseLocationInfo> queryBaseLocationInfoList(Integer zoneId, String locationNo, String rowNo) {
-        return baseLocationInfoMapper.selectList(Wrappers.<BaseLocationInfo>lambdaQuery()
+        return baseDao.selectList(Wrappers.<BaseLocationInfo>lambdaQuery()
                 .eq(ObjectUtil.isNotNull(zoneId), BaseLocationInfo::getZoneId, zoneId)
                 .eq(StringUtils.isNotBlank(locationNo), BaseLocationInfo::getLocationNo, locationNo)
                 .eq(StringUtils.isNotBlank(rowNo), BaseLocationInfo::getRowNo, rowNo));
     }
 
-    /**
-     * 查询库位信息
-     *
-     * @param id 库位信息主键
-     * @return 库位信息
-     */
-    @Override
-    public BaseLocationInfo selectBaseLocationInfoById(Long id) {
-        return baseLocationInfoMapper.selectBaseLocationInfoById(id);
-    }
 
-    /**
-     * 查询库位信息列表
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 库位信息
-     */
-    @Override
-    public List<BaseLocationInfo> selectBaseLocationInfoList(BaseLocationInfo baseLocationInfo) {
-        return baseLocationInfoMapper.selectBaseLocationInfoList(baseLocationInfo);
-    }
-
-    /**
-     * 修改库位信息
-     *
-     * @param baseLocationInfo 库位信息
-     * @return 结果
-     */
     @Override
-    public int updateBaseLocationInfo(BaseLocationInfo baseLocationInfo) {
-        return baseLocationInfoMapper.updateBaseLocationInfo(baseLocationInfo);
-    }
-
-    /**
-     * 批量删除库位信息
-     *
-     * @param ids 需要删除的库位信息主键
-     * @return 结果
-     */
-    @Override
-    public int deleteBaseLocationInfoByIds(Long[] ids) {
-        return baseLocationInfoMapper.deleteBaseLocationInfoByIds(ids);
-    }
-
-    @Override
-    public List<BaseLocationInfo> selectSortedLocatinListByZoneId(Long zoneId, Long warehouseId,String orderBy) {
-        BaseLocationInfo query = new BaseLocationInfo();
-        query.setWarehouseId(warehouseId);
-        query.setZoneId(zoneId);
-        return baseLocationInfoMapper.selectSortedLocationListByZoneId(query);
+    public QueryWrapper<BaseLocationInfo> getWrapper(Map<String, Object> params) {
+        QueryWrapper<BaseLocationInfo> queryWrapper = new QueryWrapper<>();
+        String zoneId = (String) params.get("zoneId");
+        String locationNo = (String) params.get("locationNo");
+        String rowNo = (String) params.get("rowNo");
+        String agvStation = (String) params.get("agvStation");
+        queryWrapper.lambda().eq(StringUtils.isNotBlank(zoneId), BaseLocationInfo::getZoneId, Long.parseLong(zoneId))
+                .eq(StringUtils.isNotBlank(locationNo), BaseLocationInfo::getLocationNo, locationNo)
+                .eq(StringUtils.isNotBlank(rowNo), BaseLocationInfo::getRowNo, rowNo)
+                .eq(StringUtils.isNotBlank(agvStation), BaseLocationInfo::getAgvStation, Long.parseLong(agvStation));
+        return queryWrapper;
     }
-
 }

+ 0 - 4
warewms-ams/src/main/java/com/warewms/ams/ndc/service/impl/StatusUpdateServiceImpl.java

@@ -28,10 +28,6 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
 
     private final String WMS_URL = "localhost:28080/erp/execResult";
 
-    @Retryable(
-            maxAttempts = 4,
-            backoff = @Backoff(delay = 2000, multiplier = 2)
-    )
     @Override
     public void taskStateResponse(Integer state, Integer carNo, Integer aciIndex) {
         AmsTask amsTask = amsTaskService.getAmsTaskByAciIndex(aciIndex);

+ 96 - 7
warewms-ams/src/main/java/com/warewms/framework/config/RestTemplateConfig.java

@@ -1,21 +1,110 @@
 package com.warewms.framework.config;
 
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpEntityEnclosingRequest;
+import org.apache.http.HttpRequest;
+import org.apache.http.NoHttpResponseException;
+import org.apache.http.client.HttpRequestRetryHandler;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.http.conn.UnsupportedSchemeException;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.http.client.ClientHttpRequestFactory;
 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
 import org.springframework.web.client.RestTemplate;
 
+import javax.net.ssl.SSLException;
+import java.io.InterruptedIOException;
+import java.net.SocketException;
+import java.net.SocketTimeoutException;
+import java.net.UnknownHostException;
+import java.util.concurrent.TimeUnit;
+
 @Configuration
+@Slf4j
 public class RestTemplateConfig {
 
     @Bean
-    public RestTemplate restTemplate() {
-        //配置HTTP超时时间
-        HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory();
-        httpRequestFactory.setConnectionRequestTimeout(6000);
-        httpRequestFactory.setConnectTimeout(6000);
-        httpRequestFactory.setReadTimeout(6000);
-        return new RestTemplate(httpRequestFactory);
+    public ClientHttpRequestFactory apacheHttpRequestFactory() {
+        // 重试配置
+        HttpRequestRetryHandler retryHandler = (e, count, context) -> {
+            log.error("连接失败次数| :{}", count);
+            e.printStackTrace();
+
+            if (count >= 5) {       // 假设已经重试了5次,就放弃
+                return false;
+            }
+            // 返回true需要重试
+            if (e instanceof NoHttpResponseException            // 请求无响应就重试
+                    || e instanceof ConnectTimeoutException     // 连接超时
+                    || e instanceof SocketException             // 连接异常
+                    || e instanceof SocketTimeoutException      // socket超时
+            ) {
+                try {
+                    // 重试时间间隔:1s
+                    TimeUnit.MILLISECONDS.sleep(1000);
+                } catch (InterruptedException ex) {
+                    e.printStackTrace();
+                }
+                return true;
+            }
+            // 返回false不需要重试
+            if (e instanceof SSLException                       // SSL握手异常不要重试
+                    || e instanceof InterruptedIOException      // 中断
+                    || e instanceof UnknownHostException        // 目标server不可达
+                    || e instanceof UnsupportedSchemeException  // 协议不支持
+            ) {
+                return false;
+            }
+
+            HttpClientContext clientContext = HttpClientContext.adapt(context);
+            HttpRequest request = clientContext.getRequest();
+            // 假设请求是幂等的,就再次尝试
+            return !(request instanceof HttpEntityEnclosingRequest);
+        };
+
+        Registry<ConnectionSocketFactory> registry = RegistryBuilder
+                .<ConnectionSocketFactory>create()
+                .register("http", PlainConnectionSocketFactory.INSTANCE)
+                .register("https", SSLConnectionSocketFactory.getSocketFactory())
+                .build();
+
+        // 连接池配置
+        PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(registry);
+        // 最大连接数
+        connManager.setMaxTotal(1000);
+        // 每个路由最大连接数
+        connManager.setDefaultMaxPerRoute(200);
+
+        // 超时配置:都为5s
+        RequestConfig reqConfig = RequestConfig.custom()
+                .setConnectionRequestTimeout(5000)      // 从连接池中获取连接超时时间
+                .setConnectTimeout(5000)                // 连接建立超时时间,也就是三次握手完成时间
+                .setSocketTimeout(5000)                 // 等待服务器响应超时时间
+                .build();
+
+        // 构建httpclient
+        CloseableHttpClient client = HttpClients.custom()
+                .setConnectionManager(connManager)
+                .setDefaultRequestConfig(reqConfig)
+                .setRetryHandler(retryHandler)
+                .build();
+
+        return new HttpComponentsClientHttpRequestFactory(client);
     }
 
+    @Bean
+    public RestTemplate restTemplate() {
+        return new RestTemplate(apacheHttpRequestFactory());
+    }
 }

+ 0 - 191
warewms-ams/src/main/resources/mapper/ams/BaseLocationInfoMapper.xml

@@ -4,195 +4,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.warewms.ams.ndc.mapper.BaseLocationInfoMapper">
 
-    <resultMap type="BaseLocationInfo" id="BaseLocationInfoResult">
-        <result property="id"    column="id"    />
-        <result property="warehouseId"    column="warehouse_id"    />
-        <result property="zoneId"    column="zone_id"    />
-        <result property="locationNo"    column="location_no"    />
-        <result property="rowNo"    column="row_no"    />
-        <result property="rowIndex"    column="row_index"    />
-        <result property="colNo"    column="col_no"    />
-        <result property="colIndex"    column="col_index"    />
-        <result property="shiftNo"    column="shift_no"    />
-        <result property="shiftIndex"    column="shift_index"    />
-        <result property="stockStatus"    column="stock_status"    />
-        <result property="isEmpty"    column="is_empty"    />
-        <result property="bindSku"    column="bind_sku"    />
-        <result property="locationType"    column="location_type"    />
-        <result property="rackId"    column="rack_id"    />
-        <result property="agvStation"    column="agv_station"    />
-        <result property="foldedTag"    column="folded_tag"    />
-        <result property="heightLimit"    column="height_limit"    />
-        <result property="weightLimit"    column="weight_limit"    />
-    </resultMap>
-
-    <sql id="selectBaseLocationInfoVo">
-        select id, warehouse_id, zone_id, location_no, location_barcode, row_no, row_index, col_no, col_index, shift_no, shift_index, stock_status, is_empty, bind_sku, location_type, rack_id, agv_station, folded_tag, folded_count,height_limit,weight_limit, userdefine1, userdefine2, userdefine3, userdefine4, userdefine5, userdefine6, userdefine7, userdefine8, userdefine9, userdefine10, create_by, create_time, update_by, update_time, remark from base_location_info
-    </sql>
-
-    <select id="selectBaseLocationInfoList" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
-        select t1.*,t2.zone_name
-        from base_location_info t1
-        left join base_location_zone t2 on t2.zone_id=t1.zone_id
-        <where>
-            <if test="id != null "> and id like concat('%', #{id}, '%')</if>
-            <if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</if>
-            <if test="zoneId != null "> and t1.zone_id = #{zoneId}</if>
-            <if test="zoneName != null "> and zone_name = #{zoneName}</if>
-            <if test="locationNo != null  and locationNo != ''"> and location_no like concat('%', #{locationNo}, '%')</if>
-            <if test="agvStation != null  and agvStation != ''"> and agv_station like concat('%', #{agvStation}, '%')</if>
-            <if test="stockStatus != null  and stockStatus != ''"> and stock_status = #{stockStatus}</if>
-            <if test="isEmpty != null  and isEmpty != ''"> and is_empty = #{isEmpty}</if>
-            <if test="locationType != null  and locationType != ''"> and location_type = #{locationType}</if>
-        </where>
-        order by location_no
-    </select>
-
-    <select id="selectBaseLocationInfoById" parameterType="Long" resultMap="BaseLocationInfoResult">
-        <include refid="selectBaseLocationInfoVo"/>
-        where id = #{id}
-    </select>
-
-    <insert id="insertBaseLocationInfo" parameterType="BaseLocationInfo" useGeneratedKeys="true" keyProperty="id">
-        insert into base_location_info
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="warehouseId != null">warehouse_id,</if>
-            <if test="zoneId != null">zone_id,</if>
-            <if test="locationNo != null">location_no,</if>
-            <if test="locationBarcode != null">location_barcode,</if>
-            <if test="rowNo != null">row_no,</if>
-            <if test="rowIndex != null">row_index,</if>
-            <if test="colNo != null">col_no,</if>
-            <if test="colIndex != null">col_index,</if>
-            <if test="shiftNo != null">shift_no,</if>
-            <if test="shiftIndex != null">shift_index,</if>
-            <if test="stockStatus != null">stock_status,</if>
-            <if test="isEmpty != null">is_empty,</if>
-            <if test="bindSku != null">bind_sku,</if>
-            <if test="locationType != null">location_type,</if>
-            <if test="rackId != null">rack_id,</if>
-            <if test="agvStation != null">agv_station,</if>
-            <if test="foldedTag != null">folded_tag,</if>
-            <if test="foldedCount != null">folded_count,</if>
-            <if test="heightLimit != null">height_limit,</if>
-            <if test="weightLimit != null">weight_limit,</if>
-            <if test="userdefine1 != null">userdefine1,</if>
-            <if test="userdefine2 != null">userdefine2,</if>
-            <if test="userdefine3 != null">userdefine3,</if>
-            <if test="userdefine4 != null">userdefine4,</if>
-            <if test="userdefine5 != null">userdefine5,</if>
-            <if test="userdefine6 != null">userdefine6,</if>
-            <if test="userdefine7 != null">userdefine7,</if>
-            <if test="userdefine8 != null">userdefine8,</if>
-            <if test="userdefine9 != null">userdefine9,</if>
-            <if test="userdefine10 != null">userdefine10,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="remark != null">remark,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="warehouseId != null">#{warehouseId},</if>
-            <if test="zoneId != null">#{zoneId},</if>
-            <if test="locationNo != null">#{locationNo},</if>
-            <if test="locationBarcode != null">#{locationBarcode},</if>
-            <if test="rowNo != null">#{rowNo},</if>
-            <if test="rowIndex != null">#{rowIndex},</if>
-            <if test="colNo != null">#{colNo},</if>
-            <if test="colIndex != null">#{colIndex},</if>
-            <if test="shiftNo != null">#{shiftNo},</if>
-            <if test="shiftIndex != null">#{shiftIndex},</if>
-            <if test="stockStatus != null">#{stockStatus},</if>
-            <if test="isEmpty != null">#{isEmpty},</if>
-            <if test="bindSku != null">#{bindSku},</if>
-            <if test="locationType != null">#{locationType},</if>
-            <if test="rackId != null">#{rackId},</if>
-            <if test="agvStation != null">#{agvStation},</if>
-            <if test="foldedTag != null">#{foldedTag},</if>
-            <if test="foldedCount != null">#{foldedCount},</if>
-            <if test="heightLimit != null">#{heightLimit},</if>
-            <if test="weightLimit != null">#{weightLimit},</if>
-            <if test="userdefine1 != null">#{userdefine1},</if>
-            <if test="userdefine2 != null">#{userdefine2},</if>
-            <if test="userdefine3 != null">#{userdefine3},</if>
-            <if test="userdefine4 != null">#{userdefine4},</if>
-            <if test="userdefine5 != null">#{userdefine5},</if>
-            <if test="userdefine6 != null">#{userdefine6},</if>
-            <if test="userdefine7 != null">#{userdefine7},</if>
-            <if test="userdefine8 != null">#{userdefine8},</if>
-            <if test="userdefine9 != null">#{userdefine9},</if>
-            <if test="userdefine10 != null">#{userdefine10},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="remark != null">#{remark},</if>
-         </trim>
-    </insert>
-
-    <update id="updateBaseLocationInfo" parameterType="BaseLocationInfo">
-        update base_location_info
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
-            <if test="zoneId != null">zone_id = #{zoneId},</if>
-            <if test="locationNo != null">location_no = #{locationNo},</if>
-            <if test="locationBarcode != null">location_barcode = #{locationBarcode},</if>
-            <if test="rowNo != null">row_no = #{rowNo},</if>
-            <if test="rowIndex != null">row_index = #{rowIndex},</if>
-            <if test="colNo != null">col_no = #{colNo},</if>
-            <if test="colIndex != null">col_index = #{colIndex},</if>
-            <if test="shiftNo != null">shift_no = #{shiftNo},</if>
-            <if test="shiftIndex != null">shift_index = #{shiftIndex},</if>
-            <if test="stockStatus != null">stock_status = #{stockStatus},</if>
-            <if test="isEmpty != null">is_empty = #{isEmpty},</if>
-            <if test="bindSku != null">bind_sku = #{bindSku},</if>
-            <if test="locationType != null">location_type = #{locationType},</if>
-            <if test="rackId != null">rack_id = #{rackId},</if>
-            <if test="agvStation != null">agv_station = #{agvStation},</if>
-            <if test="foldedTag != null">folded_tag = #{foldedTag},</if>
-            <if test="foldedCount != null">folded_count = #{foldedCount},</if>
-            <if test="heightLimit != null">height_limit = #{heightLimit},</if>
-            <if test="weightLimit != null">weight_limit = #{weightLimit},</if>
-            <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
-            <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
-            <if test="userdefine3 != null">userdefine3 = #{userdefine3},</if>
-            <if test="userdefine4 != null">userdefine4 = #{userdefine4},</if>
-            <if test="userdefine5 != null">userdefine5 = #{userdefine5},</if>
-            <if test="userdefine6 != null">userdefine6 = #{userdefine6},</if>
-            <if test="userdefine7 != null">userdefine7 = #{userdefine7},</if>
-            <if test="userdefine8 != null">userdefine8 = #{userdefine8},</if>
-            <if test="userdefine9 != null">userdefine9 = #{userdefine9},</if>
-            <if test="userdefine10 != null">userdefine10 = #{userdefine10},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="remark != null">remark = #{remark},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteBaseLocationInfoById" parameterType="Long">
-        delete from base_location_info where id = #{id}
-    </delete>
-
-    <delete id="deleteBaseLocationInfoByIds" parameterType="String">
-        delete from base_location_info where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <select id="selectSortedLocationListByZoneId" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
-        <include refid="selectBaseLocationInfoVo"/>
-        where warehouse_id = #{warehouseId} and zone_id = #{zoneId}
-        <if test="orderByClause != null and orderByClause != ''" >
-            order by  ${orderByClause}
-        </if>
-        <if test="orderByClause == null or orderByClause == ''">
-            order by shift_no + 0,shift_index
-        </if>
-    </select>
-
 </mapper>