| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.common.utils.excel.EnInitData; |
| | | import com.zy.common.utils.excel.EnInitDataListener; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class MatCodeController extends BaseController { |
| | |
| | | @RequestMapping(value = "/matCode/add/auth") |
| | | @ManagerAuth |
| | | public R add(MatCode matCode) { |
| | | matCode.setModiUser(getUserId()); |
| | | matCode.setModiTime(new Date()); |
| | | matCode.setAppeUser(getUserId()); |
| | | matCode.setAppeTime(new Date()); |
| | | matCodeService.insert(matCode); |
| | | return R.ok(); |
| | | } |
| | |
| | | if (Cools.isEmpty(matCode) || null==matCode.getMatNo()){ |
| | | return R.error(); |
| | | } |
| | | matCode.setModiUser(getUserId()); |
| | | matCode.setModiTime(new Date()); |
| | | matCodeService.updateById(matCode); |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 导出 |
| | | @RequestMapping(value = "/matCode/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | // 导入 |
| | | @RequestMapping(value = "/matCode/import/auth") |
| | | @ManagerAuth |
| | | public R matCodeImport(MultipartFile file) throws IOException, InterruptedException { |
| | | Thread.sleep(2000); |
| | | // EasyExcel.read(file.getInputStream(), EnInitData.class, new EnInitDataListener()).sheet().doRead(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matCodeQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |