自动化立体仓库 - WMS系统
zhangc
2024-12-09 e7d0bb7176bb8cb4966f5b32eb223285bd89426a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.zy.asrs.task.handler;
 
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
/**
 * Created by vincent on 2020/7/7
 */
@Service
@Slf4j
public class ErrorStockHandler extends AbstractHandler<String> {
 
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private LocMastService locMastService;
 
    //@Transactional
    public ReturnT<String> start() {
        try {
            int update = jdbcTemplate.update("DELETE asr_loc_detl FROM asr_loc_detl JOIN asr_loc_mast ON asr_loc_detl.loc_no = asr_loc_mast.loc_no WHERE asr_loc_mast.loc_sts = 'O'");
//            log.info("(ErrorStockHandler)删除条数为;" + update);
        } catch (Exception e) {
            e.printStackTrace();
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return FAIL.setMsg(e.getMessage());
        }
        return SUCCESS;
    }
 
}