#
luxiaotao1123
2020-07-07 39055848f739b024b4d1d3bcb856cf470f8c2f82
#
2个文件已添加
3个文件已修改
82 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/task/NotifyLogScheduler.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/PlcLogScheduler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/NotifyLogHandler.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/UpdateThread.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/NotifyLogScheduler.java
New file
@@ -0,0 +1,30 @@
package com.zy.asrs.task;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.NotifyLogHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
 * Created by vincent on 2020/7/7
 */
@Component
public class NotifyLogScheduler {
    private static final Logger log = LoggerFactory.getLogger(NotifyLogScheduler.class);
    @Autowired
    private NotifyLogHandler notifyLogHandler;
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        ReturnT<String> returnT = notifyLogHandler.start();
        if (!returnT.isSuccess()) {
            log.error(returnT.getMsg());
        }
    }
}
src/main/java/com/zy/asrs/task/PlcLogScheduler.java
@@ -23,7 +23,7 @@
    private void execute(){
        ReturnT<String> returnT = plcLogHandler.start();
        if (!returnT.isSuccess()) {
            log.error( returnT.getMsg());
            log.error(returnT.getMsg());
        }
    }
src/main/java/com/zy/asrs/task/handler/NotifyLogHandler.java
New file
@@ -0,0 +1,43 @@
package com.zy.asrs.task.handler;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
/**
 * Created by vincent on 2020/7/7
 */
@Service
public class NotifyLogHandler extends AbstractHandler<String> {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Transactional
    public ReturnT<String> start() {
        try {
            // 入库通知档转历史档
            int pakInLog = jdbcTemplate.update("insert into cust_wait_pakin_log select * from cust_wait_pakin where status = 'Y';");
            if (pakInLog > 0) {
                int pakInDelete = jdbcTemplate.update("delete from cust_wait_pakin where status = 'Y';");
                if (pakInDelete <= 0) {
                    exceptionHandle("入库通知档转历史档失败");
                }
            }
            // 出库通知档转历史档
            // 盘点通知档转历史档
        } catch (Exception e) {
            e.printStackTrace();
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return FAIL.setMsg(e.getMessage());
        }
        return SUCCESS;
    }
}
src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java
@@ -20,6 +20,7 @@
    @Transactional
    public ReturnT<String> start() {
        try {
            // 下位机命令转历史档
            int updateCount = jdbcTemplate.update("insert into asr_stk_hplc select * from asr_stk_plcm where dateadd(day,7,appe_time) <= getdate();");
            if (updateCount > 0) {
                int deleteCount = jdbcTemplate.update("delete from asr_stk_plcm where dateadd(day,7,io_time) <= getdate();");
src/main/resources/UpdateThread.cs
@@ -1699,13 +1699,13 @@
                    ProcLocToWorkData("11");
                    //处理工作档状态4、14、6的资料
                    ProcWorkMast("2");
                    ProcWorkMast("2"); // done
                    //工作档转历史档
                    //工作档转历史档 // done
                    ProcWorkToLog("3");
                    //堆垛机&PLC命令转历史档
                    ProcDevCommandToLog("4");
                    ProcDevCommandToLog("4"); // done
                    //转已完成物料信息到历史档
                    //ProcMatCodeToLog("5");