自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-07-07 ab2b8ef5df5edf24cf158dbcfc1a43b0629d644e
src/main/java/com/zy/asrs/task/handler/WorkLogHandler.java
@@ -8,6 +8,8 @@
import com.zy.asrs.service.WrkMastLogService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.ReturnT;
import com.zy.system.entity.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -17,7 +19,7 @@
 * Created by vincent on 2020/7/6
 */
@Service
public class WorkLogHandler extends AbstractHandler {
public class WorkLogHandler extends AbstractHandler<Config> {
    @Autowired
    private WrkMastService wrkMastService;
@@ -30,19 +32,19 @@
    @Override
    @Transactional
    public boolean start() {
    public ReturnT<Config> start() {
        try {
            WrkMast wrkMast = wrkMastService.selectToBeHistoryData();
            if (null == wrkMast) {
                return true;
                return SUCCESS;
            }
            // 保存工作主档历史档
            if (!wrkMastLogService.save(wrkMast.getWrkNo())) {
                exceptionHandle(""); // todo
            }
            // 删除工作主档
            if (wrkMastService.deleteById(wrkMast)) {
                exceptionHandle(""); // todo
            if (!wrkMastService.deleteById(wrkMast)) {
                exceptionHandle("1111"); // todo
            }
            // 保存工作明细档历史档
            if (!wrkDetlLogService.save(wrkMast.getWrkNo())) {
@@ -55,9 +57,16 @@
        } catch (Exception e) {
            e.printStackTrace();
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return false;
            Config config = new Config(
                    "name",    // 名称[非空]
                    "code",    // 编码[非空]
                    "val",    // 对应值[非空]
                    (short)1,    // 类型[非空]
                    (short)1    // 状态[非空]
            );
            return FAIL.setMsg(e.getMessage()).setContent(config);
        }
        return true;
        return SUCCESS;
    }
}