自动化立体仓库 - WMS系统
luxiaotao1123
2020-07-29 03e5ff030c6883df3daec952b7bc9af13ecd130c
src/main/java/com/zy/asrs/controller/MatCodeController.java
@@ -15,13 +15,16 @@
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.entity.MatCodePrint;
import com.zy.asrs.service.MatCodeService;
import com.zy.asrs.utils.VersionUtils;
import com.zy.common.CodeRes;
import com.zy.common.config.AdminInterceptor;
import com.zy.common.utils.BarcodeUtils;
import com.zy.common.utils.QrCode;
import com.zy.common.utils.excel.matcode.MatCodeExcel;
import com.zy.common.utils.excel.matcode.MatCodeExcelListener;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -127,11 +130,7 @@
        List<MatCode> list = matCodeService.selectList(new EntityWrapper<>());
        List<MatCodeExcel> excels = new ArrayList<>();
        for (MatCode matCode : list) {
            MatCodeExcel excel = new MatCodeExcel();
            excel.setMatNo(matCode.getMatNo());
            excel.setBarcode(matCode.getBarcode());
            excel.setMatName(matCode.getMatName());
            excel.setStr1(matCode.getStr1());
            MatCodeExcel excel = VersionUtils.getExcel(matCode);
            excels.add(excel);
            if (rowCount != null && excels.size() >= rowCount){
                break;
@@ -150,6 +149,7 @@
    // 导入
    @RequestMapping(value = "/matCode/import/auth")
    @ManagerAuth(memo = "物料编码数据导入")
    @Transactional
    public R matCodeImport(MultipartFile file) throws IOException, InterruptedException {
        MatCodeExcelListener listener = new MatCodeExcelListener(getUserId());
        EasyExcel.read(file.getInputStream(), MatCodeExcel.class, listener).sheet().doRead();
@@ -157,7 +157,7 @@
    }
    // 打印
    @RequestMapping(value = "/macCode/print/auth")
    @RequestMapping(value = "/matCode/print/auth")
    @ManagerAuth(memo = "物料编码打印")
    public R matCodePrint(@RequestParam(value = "param[]") String[] param) {
        if(Cools.isEmpty(param)) {
@@ -183,6 +183,7 @@
    public R matCodeBarcode(@RequestParam(defaultValue = "1") Integer type
                        , @RequestParam String param
                        , HttpServletResponse response) throws Exception {
        AdminInterceptor.cors(response);
        if (Cools.isEmpty(param)){
            return R.parse(BaseRes.EMPTY);
        }