#
野心家
2023-04-18 a2c10587b4621e1bf9ef928dc043cf71ad84bbcf
#
6个文件已修改
81 ■■■■ 已修改文件
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/WrkMastService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkMastServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/BarcodeThread.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
@@ -114,5 +114,8 @@
    WrkMast selectPakoutEmpty(@Param("staNo")Integer outSite);
    /**
     * 查询是否是盘点出库,检料出库
     */
    WrkMast selectpj(@Param("staNo")Integer staNo,@Param("barcode")String barcode);
}
src/main/java/com/zy/asrs/service/WrkMastService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.service.IService;
import com.zy.asrs.entity.WrkMast;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -15,4 +16,5 @@
    int getOutToStn182(Integer devpNo);
    WrkMast selectpj(Integer staNo,String barcode);
}
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -102,29 +102,58 @@
            for (DevpSlave.Sta inSta : devp.getInSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                BarcodeThread barcodeThread1 = null;
                BarcodeThread barcodeThread2 = null;
                if (barcodeThread == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                String barcode1 = "";
                String barcode2 = "";
                //101站有3个扫码器,当0扫码器没有数据时,获取9、10两个扫码器数据
                if((inSta.getStaNo().equals(101) || inSta.getStaNo().equals(104)) && ( "NoRead".equals(barcode) || Cools.isEmpty(barcode) )){
                    BarcodeThread barcodeThread1 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode1());
                if((inSta.getStaNo().equals(101) || inSta.getStaNo().equals(104))){
                    barcodeThread1 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode1());
                    if (barcodeThread1 != null) {
                        barcode = barcodeThread1.getBarcode();
                        barcode1 = barcodeThread1.getBarcode();
                    }
                    if("NoRead".equals(barcode) || Cools.isEmpty(barcode)) {
                        BarcodeThread barcodeThread2 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode2());
                        if (barcodeThread2 != null) {
                            barcode = barcodeThread2.getBarcode();
                    barcodeThread2 = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode2());
                    if (barcodeThread2 != null) {
                        barcode2 = barcodeThread2.getBarcode();
                        }
                    }
                    Integer len1=0 , len2=0, len3=0;
                    if(barcode != null) {
                        String b[]=barcode.split(";");
                        barcode=b[b.length-1];
                        len1 = barcode.length();
                    }
                    if(barcode1 != null) {
                        String b[]=barcode1.split(";");
                        barcode1=b[b.length-1];
                        len2 = barcode1.length();
                    }
                    if(barcode2 != null) {
                        String b[]=barcode2.split(";");
                        barcode2=b[b.length-1];
                        len3 = barcode2.length();
                    }
                    if(len2 > len1 && len2 >= len3){
                        barcode = barcode1;
                    } else if (len3 > len1 && len3 >= len2){
                        barcode = barcode2;
                    }
                }
                    //判断101和104是否是拣料、并板、盘点再入库
                    WrkMast wrkMast1=wrkMastMapper.selectpj(inSta.getStaNo(),barcode);
                    if((inSta.getStaNo().equals(101) || inSta.getStaNo().equals(104)) &&!Cools.isEmpty(barcode)&&!Cools.isEmpty(wrkMast1)){
                        log.error("101或104拣料、并板、盘点再入库", wrkMast1.getWrkNo());
                        continue;
                    }
                if (!Cools.isEmpty(barcode)) {
                    log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
@@ -224,7 +253,7 @@
                        param.setFull(staProtocol.isFull());
                        String response = new HttpHandler.Builder()
                                .setUri(wmsUrl)
                                .setPath("/rpc/pakin/loc/v1")
                                .setPath("/rpc/ ")
                                .setJson(JSON.toJSONString(param))
                                .build()
                                .doPost();
@@ -235,6 +264,12 @@
                            StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                            barcodeThread.setBarcode("");
                            if(barcodeThread1 !=null){
                                barcodeThread1.setBarcode("");
                            }
                            if(barcodeThread2 !=null){
                                barcodeThread2.setBarcode("");
                            }
                            staProtocol.setWorkNo(dto.getWorkNo().shortValue());
                            staProtocol.setStaNo(dto.getStaNo().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
src/main/java/com/zy/asrs/service/impl/WrkMastServiceImpl.java
@@ -31,4 +31,10 @@
    public int getOutToStn182(Integer devpNo) {
        return selectCount(new EntityWrapper<WrkMast>().eq("sta_no", devpNo).in("wrk_sts",11,12));
    }
    @Override
    public WrkMast selectpj(Integer staNo, String barcode) {
        return this.baseMapper.selectpj(staNo,barcode);
    }
}
src/main/java/com/zy/core/thread/BarcodeThread.java
@@ -65,7 +65,7 @@
        connect();
        while (true) {
            try {
                byte[] read = read(16, 200);
                byte[] read = read(50, 200);
                if (null != read) {
                    String s = new String(read);
                    if (!Cools.isEmpty(s)) {
@@ -79,10 +79,14 @@
                        }
                        OutputQueue.BARCODE.offer(jsonObject);
                    }
                }else{
                    barcode = "";
                }
                Thread.sleep(50);
            } catch (SocketTimeoutException ignore) {
//                barcode="";
            } catch (Exception e) {
                barcode="";
//                e.printStackTrace();
            }
        }
src/main/resources/mapper/WrkMastMapper.xml
@@ -192,4 +192,7 @@
    <select id="selectPakoutEmpty" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where  io_type = 110 and sta_no = #{staNo} order by io_time,wrk_no
    </select>
    <select id="selectpj" resultMap="BaseResultMap">
        select * from dbo.asr_wrk_mast where sta_no=#{staNo} and wrk_sts =14 and barcode=#{barcode}
    </select>
</mapper>