From 0ab215622ebc3e97b5f4d2be9e23470af1d0a209 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 12 六月 2024 13:29:32 +0800
Subject: [PATCH] #

---
 /dev/null                                                                        |   12 ------
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java        |    6 +++
 zy-asrs-flow/src/pages/deviceConfig/deviceBarcode/index.jsx                      |    0 
 zy-asrs-flow/src/pages/deviceConfig/deviceBarcode/components/edit.jsx            |    0 
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/StaProtocol.java    |    8 ++--
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensDevpThread.java |   57 ++++++++++++++++------------
 6 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/zy-asrs-flow/src/pages/device/deviceBarcode/components/edit.jsx b/zy-asrs-flow/src/pages/deviceConfig/deviceBarcode/components/edit.jsx
similarity index 100%
rename from zy-asrs-flow/src/pages/device/deviceBarcode/components/edit.jsx
rename to zy-asrs-flow/src/pages/deviceConfig/deviceBarcode/components/edit.jsx
diff --git a/zy-asrs-flow/src/pages/device/deviceBarcode/index.jsx b/zy-asrs-flow/src/pages/deviceConfig/deviceBarcode/index.jsx
similarity index 100%
rename from zy-asrs-flow/src/pages/device/deviceBarcode/index.jsx
rename to zy-asrs-flow/src/pages/deviceConfig/deviceBarcode/index.jsx
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/StationController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/StationController.java
deleted file mode 100644
index 7897c46..0000000
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/StationController.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package com.zy.asrs.wcs.core.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.zy.asrs.framework.common.Cools;
-import com.zy.asrs.framework.common.R;
-import com.zy.asrs.wcs.common.annotation.OperationLog;
-import com.zy.asrs.wcs.common.domain.BaseParam;
-import com.zy.asrs.wcs.common.domain.KeyValVo;
-import com.zy.asrs.wcs.common.domain.PageParam;
-import com.zy.asrs.wcs.core.entity.Station;
-import com.zy.asrs.wcs.core.service.StationService;
-import com.zy.asrs.wcs.system.controller.BaseController;
-import com.zy.asrs.wcs.utils.ExcelUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-@RestController
-@RequestMapping("/api")
-public class StationController extends BaseController {
-
-    @Autowired
-    private StationService stationService;
-
-    @PreAuthorize("hasAuthority('core:station:list')")
-    @PostMapping("/station/page")
-    public R page(@RequestBody Map<String, Object> map) {
-        BaseParam baseParam = buildParam(map, BaseParam.class);
-        PageParam<Station, BaseParam> pageParam = new PageParam<>(baseParam, Station.class);
-        return R.ok().add(stationService.page(pageParam, pageParam.buildWrapper(true)));
-    }
-
-    @PreAuthorize("hasAuthority('core:station:list')")
-    @PostMapping("/station/list")
-    public R list(@RequestBody Map<String, Object> map) {
-        return R.ok().add(stationService.list());
-    }
-
-    @PreAuthorize("hasAuthority('core:station:list')")
-    @GetMapping("/station/{id}")
-    public R get(@PathVariable("id") Long id) {
-        return R.ok().add(stationService.getById(id));
-    }
-
-    @PreAuthorize("hasAuthority('core:station:save')")
-    @OperationLog("娣诲姞绔欑偣鍒楄〃")
-    @PostMapping("/station/save")
-    public R save(@RequestBody Station station) {
-        if (!stationService.save(station)) {
-            return R.error("娣诲姞澶辫触");
-        }
-        return R.ok("娣诲姞鎴愬姛");
-    }
-
-    @PreAuthorize("hasAuthority('core:station:update')")
-    @OperationLog("淇敼绔欑偣鍒楄〃")
-    @PostMapping("/station/update")
-    public R update(@RequestBody Station station) {
-        if (!stationService.updateById(station)) {
-            return R.error("淇敼澶辫触");
-        }
-        return R.ok("淇敼鎴愬姛");
-    }
-
-    @PreAuthorize("hasAuthority('core:station:remove')")
-    @OperationLog("鍒犻櫎绔欑偣鍒楄〃")
-    @PostMapping("/station/remove/{ids}")
-    public R remove(@PathVariable Long[] ids) {
-        if (!stationService.removeByIds(Arrays.asList(ids))) {
-            return R.error("鍒犻櫎澶辫触");
-        }
-        return R.ok("鍒犻櫎鎴愬姛");
-    }
-
-    @PreAuthorize("hasAuthority('core:station:list')")
-    @PostMapping("/station/query")
-    public R query(@RequestParam(required = false) String condition) {
-        List<KeyValVo> vos = new ArrayList<>();
-        LambdaQueryWrapper<Station> wrapper = new LambdaQueryWrapper<>();
-        if (!Cools.isEmpty(condition)) {
-            wrapper.like(Station::getStaNo, condition);
-        }
-        stationService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
-                item -> vos.add(new KeyValVo(item.getId(), item.getStaNo()))
-        );
-        return R.ok().add(vos);
-    }
-
-    @PreAuthorize("hasAuthority('core:station:list')")
-    @PostMapping("/station/export")
-    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
-        ExcelUtil.build(ExcelUtil.create(stationService.list(), Station.class), response);
-    }
-
-}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java
index a89c054..2a41008 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/BasConveyorSta.java
@@ -165,6 +165,12 @@
     @ApiModelProperty(value= "鍥涘悜绌挎杞︽墍璇嗗埆鐨勪簩缁寸爜")
     private String qrCodeValue;
 
+    /**
+     * 宸ヤ綔鍙�
+     */
+    @ApiModelProperty(value= "宸ヤ綔鍙�")
+    private Integer taskNo;
+
     public BasConveyorSta() {}
 
     public BasConveyorSta(Long conveyorId,Integer conveyorNo,Long updateBy,Long createBy,Date createTime,Date updateTime,String memo,Integer deleted,Long hostId,Integer siteNo,String inEnable,String outEnable,String autoing,String loading,String canining,String canouting,Integer locType1,Integer locType2,Integer locType3,String locNo,String qrCodeValue) {
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/Station.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/Station.java
deleted file mode 100644
index 7d0cce0..0000000
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/Station.java
+++ /dev/null
@@ -1,382 +0,0 @@
-package com.zy.asrs.wcs.core.entity;
-
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import com.zy.asrs.wcs.rcs.entity.Device;
-import com.zy.asrs.wcs.rcs.service.DeviceService;
-import com.zy.asrs.wcs.system.entity.Host;
-import com.zy.asrs.wcs.system.entity.User;
-import org.springframework.format.annotation.DateTimeFormat;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import com.zy.asrs.framework.common.Cools;
-import com.zy.asrs.framework.common.SpringUtils;
-import com.zy.asrs.wcs.system.service.UserService;
-import com.zy.asrs.wcs.system.service.HostService;
-
-import java.io.Serializable;
-
-@Data
-@TableName("wcs_station")
-public class Station implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * ID
-     */
-    @ApiModelProperty(value= "ID")
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 缂栧彿
-     */
-    @ApiModelProperty(value= "缂栧彿")
-    private String uuid;
-
-    /**
-     * 绔欑偣鍙�
-     */
-    @ApiModelProperty(value= "绔欑偣鍙�")
-    private String staNo;
-
-    /**
-     * 宸ヤ綔鍙�
-     */
-    @ApiModelProperty(value= "宸ヤ綔鍙�")
-    private String taskNo;
-
-    /**
-     * 鍙叆
-     */
-    @ApiModelProperty(value= "鍙叆")
-    private String inEnable;
-
-    /**
-     * 鍙嚭
-     */
-    @ApiModelProperty(value= "鍙嚭")
-    private String outEnable;
-
-    /**
-     * 鑷姩
-     */
-    @ApiModelProperty(value= "鑷姩")
-    private String autoing;
-
-    /**
-     * 鏈夌墿
-     */
-    @ApiModelProperty(value= "鏈夌墿")
-    private String loading;
-
-    /**
-     * 鑳藉叆
-     */
-    @ApiModelProperty(value= "鑳藉叆")
-    private String canining;
-
-    /**
-     * 鑳藉嚭
-     */
-    @ApiModelProperty(value= "鑳藉嚭")
-    private String canouting;
-
-    /**
-     * 楂樹綆绫诲瀷 0: 鏈煡  1: 浣庡簱浣�  2: 楂樺簱浣�  
-     */
-    @ApiModelProperty(value= "楂樹綆绫诲瀷 0: 鏈煡  1: 浣庡簱浣�  2: 楂樺簱浣�  ")
-    private Integer locType1;
-
-    /**
-     * 瀹界獎绫诲瀷 0: 鏈煡  1: 绐勫簱浣�  2: 瀹藉簱浣�  
-     */
-    @ApiModelProperty(value= "瀹界獎绫诲瀷 0: 鏈煡  1: 绐勫簱浣�  2: 瀹藉簱浣�  ")
-    private Integer locType2;
-
-    /**
-     * 杞婚噸绫诲瀷 0: 鏈煡  1: 杞诲簱浣�  2: 閲嶅簱浣�  
-     */
-    @ApiModelProperty(value= "杞婚噸绫诲瀷 0: 鏈煡  1: 杞诲簱浣�  2: 閲嶅簱浣�  ")
-    private Integer locType3;
-
-    /**
-     * 鍥涘悜绌挎杞︽墍璇嗗埆鐨勪簩缁寸爜
-     */
-    @ApiModelProperty(value= "鍥涘悜绌挎杞︽墍璇嗗埆鐨勪簩缁寸爜")
-    private String shuttleCode;
-
-    /**
-     * 搴撲綅鍙�
-     */
-    @ApiModelProperty(value= "搴撲綅鍙�")
-    private String locNo;
-
-    /**
-     * 杈撻�佺嚎妤煎眰
-     */
-    @ApiModelProperty(value= "杈撻�佺嚎妤煎眰")
-    private Integer lev;
-
-    /**
-     * 璁惧鍙�
-     */
-    @ApiModelProperty(value= "璁惧鍙�")
-    private Integer deviceId;
-
-    /**
-     * 杈撻�佺嚎缁戝畾鐨勫叾浠栬澶囧彿
-     */
-    @ApiModelProperty(value= "杈撻�佺嚎缁戝畾鐨勫叾浠栬澶囧彿")
-    private Integer deviceOtherId;
-
-    /**
-     * 鏍囪瘑
-     */
-    @ApiModelProperty(value= "鏍囪瘑")
-    private String flag;
-
-    /**
-     * 鎵�灞炴満鏋�
-     */
-    @ApiModelProperty(value= "鎵�灞炴満鏋�")
-    private Long hostId;
-
-    /**
-     * 鐘舵�� 1: 姝e父  0: 绂佺敤  
-     */
-    @ApiModelProperty(value= "鐘舵�� 1: 姝e父  0: 绂佺敤  ")
-    private Integer status;
-
-    /**
-     * 鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  
-     */
-    @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  ")
-    @TableLogic
-    private Integer deleted;
-
-    /**
-     * 娣诲姞鏃堕棿
-     */
-    @ApiModelProperty(value= "娣诲姞鏃堕棿")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
-
-    /**
-     * 娣诲姞浜哄憳
-     */
-    @ApiModelProperty(value= "娣诲姞浜哄憳")
-    private Long createBy;
-
-    /**
-     * 淇敼鏃堕棿
-     */
-    @ApiModelProperty(value= "淇敼鏃堕棿")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    private Date updateTime;
-
-    /**
-     * 淇敼浜哄憳
-     */
-    @ApiModelProperty(value= "淇敼浜哄憳")
-    private Long updateBy;
-
-    /**
-     * 澶囨敞
-     */
-    @ApiModelProperty(value= "澶囨敞")
-    private String memo;
-
-    public Station() {}
-
-    public Station(String uuid,String staNo,String taskNo,String inEnable,String outEnable,String autoing,String loading,String canining,String canouting,Integer locType1,Integer locType2,Integer locType3,String shuttleCode,String locNo,Integer lev,Integer deviceId,Integer deviceOtherId,String flag,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
-        this.uuid = uuid;
-        this.staNo = staNo;
-        this.taskNo = taskNo;
-        this.inEnable = inEnable;
-        this.outEnable = outEnable;
-        this.autoing = autoing;
-        this.loading = loading;
-        this.canining = canining;
-        this.canouting = canouting;
-        this.locType1 = locType1;
-        this.locType2 = locType2;
-        this.locType3 = locType3;
-        this.shuttleCode = shuttleCode;
-        this.locNo = locNo;
-        this.lev = lev;
-        this.deviceId = deviceId;
-        this.deviceOtherId = deviceOtherId;
-        this.flag = flag;
-        this.hostId = hostId;
-        this.status = status;
-        this.deleted = deleted;
-        this.createTime = createTime;
-        this.createBy = createBy;
-        this.updateTime = updateTime;
-        this.updateBy = updateBy;
-        this.memo = memo;
-    }
-
-//    Station station = new Station(
-//            null,    // 缂栧彿
-//            null,    // 绔欑偣鍙�
-//            null,    // 宸ヤ綔鍙�
-//            null,    // 鍙叆
-//            null,    // 鍙嚭
-//            null,    // 鑷姩
-//            null,    // 鏈夌墿
-//            null,    // 鑳藉叆
-//            null,    // 鑳藉嚭
-//            null,    // 楂樹綆绫诲瀷
-//            null,    // 瀹界獎绫诲瀷
-//            null,    // 杞婚噸绫诲瀷
-//            null,    // 鍥涘悜绌挎杞︽墍璇嗗埆鐨勪簩缁寸爜
-//            null,    // 搴撲綅鍙�
-//            null,    // 杈撻�佺嚎妤煎眰
-//            null,    // 璁惧鍙�
-//            null,    // 杈撻�佺嚎缁戝畾鐨勫叾浠栬澶囧彿
-//            null,    // 鏍囪瘑
-//            null,    // 鎵�灞炴満鏋�
-//            null,    // 鐘舵��
-//            null,    // 鏄惁鍒犻櫎
-//            null,    // 娣诲姞鏃堕棿
-//            null,    // 娣诲姞浜哄憳
-//            null,    // 淇敼鏃堕棿
-//            null,    // 淇敼浜哄憳
-//            null    // 澶囨敞
-//    );
-
-    public String getLocType1$(){
-        if (null == this.locType1){ return null; }
-        switch (this.locType1){
-            case 0:
-                return "鏈煡";
-            case 1:
-                return "浣庡簱浣�";
-            case 2:
-                return "楂樺簱浣�";
-            default:
-                return String.valueOf(this.locType1);
-        }
-    }
-
-    public String getLocType2$(){
-        if (null == this.locType2){ return null; }
-        switch (this.locType2){
-            case 0:
-                return "鏈煡";
-            case 1:
-                return "绐勫簱浣�";
-            case 2:
-                return "瀹藉簱浣�";
-            default:
-                return String.valueOf(this.locType2);
-        }
-    }
-
-    public String getLocType3$(){
-        if (null == this.locType3){ return null; }
-        switch (this.locType3){
-            case 0:
-                return "鏈煡";
-            case 1:
-                return "杞诲簱浣�";
-            case 2:
-                return "閲嶅簱浣�";
-            default:
-                return String.valueOf(this.locType3);
-        }
-    }
-
-    public String getDeviceId$(){
-        DeviceService service = SpringUtils.getBean(DeviceService.class);
-        Device device = service.getById(this.deviceId);
-        if (!Cools.isEmpty(device)){
-            return String.valueOf(device.getDeviceNo() + "-" + device.getDevicePlc$());
-        }
-        return null;
-    }
-
-    public String getDeviceOtherId$(){
-        DeviceService service = SpringUtils.getBean(DeviceService.class);
-        Device device = service.getById(this.deviceOtherId);
-        if (!Cools.isEmpty(device)){
-            return String.valueOf(device.getDeviceNo());
-        }
-        return null;
-    }
-
-    public String getHostId$(){
-        HostService service = SpringUtils.getBean(HostService.class);
-        Host host = service.getById(this.hostId);
-        if (!Cools.isEmpty(host)){
-            return String.valueOf(host.getName());
-        }
-        return null;
-    }
-
-    public String getStatus$(){
-        if (null == this.status){ return null; }
-        switch (this.status){
-            case 1:
-                return "姝e父";
-            case 0:
-                return "绂佺敤";
-            default:
-                return String.valueOf(this.status);
-        }
-    }
-
-    public String getDeleted$(){
-        if (null == this.deleted){ return null; }
-        switch (this.deleted){
-            case 1:
-                return "鏄�";
-            case 0:
-                return "鍚�";
-            default:
-                return String.valueOf(this.deleted);
-        }
-    }
-
-    public String getCreateTime$(){
-        if (Cools.isEmpty(this.createTime)){
-            return "";
-        }
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
-    }
-
-    public String getCreateBy$(){
-        UserService service = SpringUtils.getBean(UserService.class);
-        User user = service.getById(this.createBy);
-        if (!Cools.isEmpty(user)){
-            return String.valueOf(user.getNickname());
-        }
-        return null;
-    }
-
-    public String getUpdateTime$(){
-        if (Cools.isEmpty(this.updateTime)){
-            return "";
-        }
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
-    }
-
-    public String getUpdateBy$(){
-        UserService service = SpringUtils.getBean(UserService.class);
-        User user = service.getById(this.updateBy);
-        if (!Cools.isEmpty(user)){
-            return String.valueOf(user.getNickname());
-        }
-        return null;
-    }
-
-
-}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/StationMapper.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/StationMapper.java
deleted file mode 100644
index 5731a39..0000000
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/StationMapper.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.zy.asrs.wcs.core.mapper;
-
-import com.zy.asrs.wcs.core.entity.Station;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.springframework.stereotype.Repository;
-
-@Mapper
-@Repository
-public interface StationMapper extends BaseMapper<Station> {
-
-}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/StationService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/StationService.java
deleted file mode 100644
index 5c385df..0000000
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/StationService.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.zy.asrs.wcs.core.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.zy.asrs.wcs.core.entity.Station;
-
-public interface StationService extends IService<Station> {
-
-}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/StationServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/StationServiceImpl.java
deleted file mode 100644
index 22c99ae..0000000
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/StationServiceImpl.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.zy.asrs.wcs.core.service.impl;
-
-import com.zy.asrs.wcs.core.mapper.StationMapper;
-import com.zy.asrs.wcs.core.entity.Station;
-import com.zy.asrs.wcs.core.service.StationService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-@Service("stationService")
-public class StationServiceImpl extends ServiceImpl<StationMapper, Station> implements StationService {
-
-}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/StaProtocol.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/StaProtocol.java
index 0c0a429..d3d46e2 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/StaProtocol.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/protocol/StaProtocol.java
@@ -1,6 +1,6 @@
 package com.zy.asrs.wcs.rcs.model.protocol;
 
-import com.zy.asrs.wcs.core.entity.Station;
+import com.zy.asrs.wcs.core.entity.BasConveyorSta;
 import lombok.Data;
 
 /**
@@ -81,9 +81,9 @@
         return null;
     }
 
-    public Station toSqlModel(Station station){
-        station.setStaNo(String.valueOf(siteId));
-        station.setTaskNo(String.valueOf(workNo));
+    public BasConveyorSta toSqlModel(BasConveyorSta station){
+        station.setSiteNo(siteId);
+        station.setTaskNo(workNo.intValue());
         station.setAutoing(autoing?"Y":"N");
         station.setLoading(loading?"Y":"N");
         station.setInEnable(inEnable?"Y":"N");
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensDevpThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensDevpThread.java
index 6e8f537..9668756 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensDevpThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SiemensDevpThread.java
@@ -9,8 +9,10 @@
 import com.zy.asrs.framework.common.Cools;
 import com.zy.asrs.framework.common.DateUtils;
 import com.zy.asrs.framework.common.SpringUtils;
-import com.zy.asrs.wcs.core.entity.Station;
-import com.zy.asrs.wcs.core.service.StationService;
+import com.zy.asrs.wcs.core.entity.BasConveyor;
+import com.zy.asrs.wcs.core.entity.BasConveyorSta;
+import com.zy.asrs.wcs.core.service.BasConveyorService;
+import com.zy.asrs.wcs.core.service.BasConveyorStaService;
 import com.zy.asrs.wcs.core.utils.RedisUtil;
 import com.zy.asrs.wcs.rcs.News;
 import com.zy.asrs.wcs.rcs.cache.OutputQueue;
@@ -35,7 +37,7 @@
 
     private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
 
-    public static ArrayList<Station> stationList = new ArrayList<>();
+    public static ArrayList<BasConveyorSta> stationList = new ArrayList<>();
 
     /**
      * 鏉$爜鏁伴噺
@@ -47,15 +49,20 @@
         this.redisUtil = redisUtil;
     }
 
-    private ArrayList<Station> getStaNo() {
+    private ArrayList<BasConveyorSta> getStaNo() {
         try {
             if (stationList.isEmpty()) {
-                StationService stationService = SpringUtils.getBean(StationService.class);
-                List<Station> stations = stationService.list(new LambdaQueryWrapper<Station>()
-                        .eq(Station::getDeviceId, device.getId())
-                        .eq(Station::getStatus, 1)
-                        .eq(Station::getHostId, device.getHostId()));
-                stationList.addAll(stations);
+                BasConveyorService basConveyorService = SpringUtils.getBean(BasConveyorService.class);
+                BasConveyorStaService basConveyorStaService = SpringUtils.getBean(BasConveyorStaService.class);
+                BasConveyor basConveyor = basConveyorService.getOne(new LambdaQueryWrapper<BasConveyor>()
+                        .eq(BasConveyor::getDeviceId, device.getId())
+                        .eq(BasConveyor::getHostId, device.getHostId()));
+                if(basConveyor != null) {
+                    List<BasConveyorSta> stations = basConveyorStaService.list(new LambdaQueryWrapper<BasConveyorSta>()
+                            .eq(BasConveyorSta::getConveyorId, basConveyor.getId())
+                            .eq(BasConveyorSta::getHostId, device.getHostId()));
+                    stationList.addAll(stations);
+                }
             }
             return stationList;
         } catch (Exception e) {
@@ -79,13 +86,13 @@
     }
 
     private void read() throws InterruptedException {
-        ArrayList<Station> staNos = getStaNo();
+        ArrayList<BasConveyorSta> staNos = getStaNo();
         int staNoSize = staNos.size();
         OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (staNoSize*8));
         if (result.IsSuccess) {
             for (int i = 0; i < staNoSize; i++) {
-                Station siteStation = staNos.get(i);
-                int siteId = Integer.parseInt(siteStation.getStaNo());// 绔欑偣缂栧彿
+                BasConveyorSta siteStation = staNos.get(i);
+                int siteId = siteStation.getSiteNo();// 绔欑偣缂栧彿
                 StaProtocol staProtocol = station.get(siteId);
                 if (null == staProtocol) {
                     staProtocol = new StaProtocol();
@@ -113,12 +120,12 @@
         }
 
         Thread.sleep(200);
-        ArrayList<Station> errorStaNo = getStaNo();
+        ArrayList<BasConveyorSta> errorStaNo = getStaNo();
         OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB101.800.0", (short) (errorStaNo.size() * 4));
         if (result3.IsSuccess) {
             for (int i = 0; i < errorStaNo.size(); i++) {
-                Station siteStation = errorStaNo.get(i);
-                Integer siteId = Integer.parseInt(siteStation.getStaNo()); // 绔欑偣缂栧彿
+                BasConveyorSta siteStation = errorStaNo.get(i);
+                Integer siteId = siteStation.getSiteNo(); // 绔欑偣缂栧彿
                 StaProtocol staProtocol = station.get(siteId);
                 boolean[] status = siemensS7Net.getByteTransform().TransBool(result3.Content, (i * 4 + 2), 2);
                 staProtocol.setFrontErr(status[0]);//鍓嶈秴闄�
@@ -137,16 +144,16 @@
 
             // 鏍规嵁瀹炴椂淇℃伅鏇存柊鏁版嵁搴�
             try {
-                List<Station> stations = new ArrayList<>();
-                for (Station sta : getStaNo()) {
-                    StaProtocol staProtocol = station.get(Integer.parseInt(sta.getStaNo()));
-                    Station sqlModel = staProtocol.toSqlModel(sta);
+                List<BasConveyorSta> stations = new ArrayList<>();
+                for (BasConveyorSta sta : getStaNo()) {
+                    StaProtocol staProtocol = station.get(sta.getSiteNo());
+                    BasConveyorSta sqlModel = staProtocol.toSqlModel(sta);
                     stations.add(sqlModel);
                 }
 
                 if (!stations.isEmpty()) {
-                    StationService stationService = SpringUtils.getBean(StationService.class);
-                    if (null != stationService && !stationService.updateBatchById(stations)) {
+                    BasConveyorStaService basConveyorStaService = SpringUtils.getBean(BasConveyorStaService.class);
+                    if (null != basConveyorStaService && !basConveyorStaService.updateBatchById(stations)) {
                         throw new Exception("鏇存柊鏁版嵁搴撴暟鎹け璐�");
                     }
                 }
@@ -257,12 +264,12 @@
     }
 
     private int findStaNosIndex(int siteId) {
-        ArrayList<Station> staNos = getStaNo();
+        ArrayList<BasConveyorSta> staNos = getStaNo();
 
         int index = -1;
         for (int i = 0; i < staNos.size(); i++) {
-            Station sta = staNos.get(i);
-            if (Integer.parseInt(sta.getStaNo()) == siteId) {
+            BasConveyorSta sta = staNos.get(i);
+            if (sta.getSiteNo() == siteId) {
                 index = i;
                 break;
             }

--
Gitblit v1.9.1