自动化立体仓库 - WMS系统
ZY
2025-02-07 9ae7c6a2d11b1fcf9fef01b310a543414c7b427e
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.utils;
 
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.LocRule;
import com.zy.asrs.service.LocRuleService;
import com.zy.common.entity.LocRuleExcel;
 
import java.util.Date;
 
public class LocRuleExcelListener extends AnalysisEventListener<LocRuleExcel> {
    private int total = 0;
    @Override
    public void invoke(LocRuleExcel excel, AnalysisContext ctx) {
        LocRuleService locRuleService = SpringUtils.getBean(LocRuleService.class);
        Date now = new Date();
        LocRule locRule = new LocRule();
        locRule = excel;
        //BeanUtils.copyProperties(excel,locRule);
        locRule.setCreateTime(now);
        locRule.setUpdateTime(now);
        locRule.setCstmr("1");
        locRule.setStatus(1);
        locRuleService.insert(locRule);
        total++;
    }
 
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
 
    }
 
    public int getTotal() {
        return total;
    }
}