| New file |
| | |
| | | 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.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Service |
| | | public class WaitMatchkLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private WaitMatchkLogService waitMatchkLogService; |
| | | |
| | | public ReturnT<String> start(WaitMatchk waitMatchk){ |
| | | try { |
| | | // 保存盘点通知历史档 |
| | | if (!waitMatchkLogService.save(waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo())) { |
| | | exceptionHandle("保存盘点通知历史档[billNo={0},locNo={1},matNo={2}]失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | // 删除盘点通知档 |
| | | if (!waitMatchkService.delete(new EntityWrapper<WaitMatchk>().eq("bill_no", waitMatchk.getBillNo()).eq("loc_no", waitMatchk.getLocNo()) |
| | | .eq("mat_no", waitMatchk.getMatNo()))) { |
| | | exceptionHandle("删除盘点通知档[billNo={0},locNo={1},matNo={2}]失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |