自动化立体仓库 - WMS系统
#
18516761980
2022-04-07 8e41c3abbae355b626158a276c08ee68d9afd0f5
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
38
39
40
package com.zy.ints.task.handler;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.ints.entity.WaitMatout;
import com.zy.ints.service.WaitMatoutLogService;
import com.zy.ints.service.WaitMatoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
@Service
public class WaitMatoutLogHandler extends AbstractHandler<String> {
 
    @Autowired
    private WaitMatoutLogService waitMatoutLogService;
 
    @Autowired
    private WaitMatoutService waitMatoutService;
 
    public ReturnT<String> start(WaitMatout waitMatout) {
 
        try {
            // 保存出库通知历史档
            if (!waitMatoutLogService.save(waitMatout.getBillNo(),waitMatout.getSeqNo())) {
                exceptionHandle("保存出库通知历史档[billNo={0},seqNo={1}]失败", waitMatout.getBillNo());
            }
            // 删除出库通知档
            if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatout.getBillNo()).eq("seq_no", waitMatout.getSeqNo()))) {
                exceptionHandle("删除出库通知档[billNo={0},seqNo={1}]失败", waitMatout.getBillNo());
            }
        } catch (Exception e) {
            e.printStackTrace();
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return FAIL.setMsg(e.getMessage());
        }
        return SUCCESS;
    }
}