#
luxiaotao1123
2020-09-12 c88db5e02d675f2a877ec484dd39ad5baab0d0b8
#
1个文件已修改
1个文件已添加
2个文件已删除
109 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/TestController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/channel/CrnChannel.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/channel/TestController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/TestController.java
New file
@@ -0,0 +1,22 @@
package com.zy.asrs.controller;
import com.zy.asrs.service.impl.MainServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by vincent on 2020/9/12
 */
@RestController
public class TestController {
    @Autowired
    private MainServiceImpl mainService;
    @GetMapping("/test")
    public String test(){
        mainService.test();
        return "ok";
    }
}
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -35,8 +35,12 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
@@ -47,6 +51,27 @@
@Service("mainService")
@Transactional
public class MainServiceImpl {
    @Autowired
    private RowLastnoService rowLastnoService;
    public void test(){
        try {
            // 工作号
            int workNo = commonService.getWorkNo(0);
            System.out.println(workNo);
            if (workNo > 0) {
                throw new CoolException("21321");
            }
            RowLastno rowLastno = rowLastnoService.selectById(1);
            rowLastno.setCurrentRow(rowLastno.getCurrentRow() + 1);
            rowLastnoService.updateById(rowLastno);
            System.out.println(rowLastno.getCurrentRow());
        } catch (Exception e) {
            e.printStackTrace();
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
        }
    }
    @Autowired
    private CommonService commonService;
@@ -103,6 +128,8 @@
                        log.error("无此入库条码数据。条码号={}", barcode);
                        continue;
                    }
                    try {
                    // 工作号
                    int workNo = commonService.getWorkNo(0);
                    // 检索库位
@@ -158,6 +185,10 @@
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    if (!result) {
                        throw new CoolException("更新plc站点信息失败");
                        }
                    } catch (Exception e) {
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    }
                }
@@ -259,8 +290,7 @@
                        continue;
                    }
                    // todo:luxiaotao
                    try {
                    // 保存工作明细档历史档
                    if (wrkMastMapper.saveWrkDetlLog(wrkMast.getWrkNo()) == 0) {
                        throw new CoolException("保存工作明细档历史档失败");
@@ -290,8 +320,10 @@
                    if (!locMastService.updateById(locMast)) {
                        throw new CoolException("修改库位状态失败");
                    }
                    } catch (Exception e) {
                        e.printStackTrace();
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    }
                }
@@ -686,8 +718,7 @@
                    // 检索库位
                    StartupDto startupDto = commonService.getLocNo(1, 10, emptyInSta.getStaNo(), null);
                    // todo:luxiaotao
                    try {
                    // 插入工作主档
                    WrkMast wrkMast = new WrkMast();
                    wrkMast.setWrkNo(workNo);
@@ -729,7 +760,10 @@
                    if (!result) {
                        throw new CoolException("更新plc站点信息失败");
                    }
                    } catch (Exception e) {
                        e.printStackTrace();
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    }
                }
@@ -806,8 +840,7 @@
                }
            }
            // todo:luxiaotao
            try {
            // 修改主档led标记
            for (WrkMast wrkMast : wrkMasts) {
                wrkMast.setOveMk("Y");
@@ -820,6 +853,11 @@
            // 更新线程当前工作号集合
            ledThread.setWorkNos(workNos);
            } catch (Exception e) {
                e.printStackTrace();
                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            }
        }
    }
src/main/java/com/zy/core/channel/CrnChannel.java
File was deleted
src/main/java/com/zy/core/channel/TestController.java
File was deleted