自动化立体仓库 - WMS系统
cl
昨天 c664c49f8e211b7b791a5ff1e63cda53c1b1264e
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
41
42
43
44
45
46
package com.zy.asrs.service.impl;
 
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.zy.asrs.entity.WrkDetl;
import com.zy.asrs.entity.WrkDetlLog;
import com.zy.asrs.mapper.WrkDetlLogMapper;
import com.zy.asrs.service.WrkDetlLogService;
import com.zy.asrs.service.WrkDetlService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
@Service("wrkDetlLogService")
public class WrkDetlLogServiceImpl extends ServiceImpl<WrkDetlLogMapper, WrkDetlLog> implements WrkDetlLogService {
    @Resource
    private WrkDetlLogMapper wrkDetlLogMapper;
    @Resource
    private WrkDetlService wrkDetlService;
 
    @Override
    @Transactional
    public boolean save(Integer workNo) {
        List<WrkDetl> detls = wrkDetlService.selectByWrkNo(workNo);
        if (Cools.isEmpty(detls)) {
            return false;
        }
        Integer num = 0;
        try {
            for (WrkDetl d : detls) {
                WrkDetlLog detlLog = new WrkDetlLog(d);
                num += wrkDetlLogMapper.insert(detlLog);
            }
            return num > 0;
        } catch (Exception e) {
            System.out.println("转明细失败");
            e.printStackTrace();
            return false;
        }
 
//        return wrkDetlLogMapper.save(workNo) > 0;
    }
}