| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.jcdm.common.core.domain.entity.SysUser; |
| | | import com.jcdm.main.bs.workshop.service.IBsWorkshopInfoService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.jcdm.main.bs.workshop.domain.BsWorkshopInfo; |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 车间信息Controller123 |
| | |
| | | { |
| | | return toAjax(bsWorkshopInfoService.deleteBsWorkshopInfoByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) |
| | | { |
| | | ExcelUtil<BsWorkshopInfo> util = new ExcelUtil<>(BsWorkshopInfo.class); |
| | | util.importTemplateExcel(response, "车间数据"); |
| | | } |
| | | |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception |
| | | { |
| | | ExcelUtil<BsWorkshopInfo> util = new ExcelUtil<BsWorkshopInfo>(BsWorkshopInfo.class); |
| | | List<BsWorkshopInfo> workshopList = util.importExcel(file.getInputStream()); |
| | | String operName = getUsername(); |
| | | String message = bsWorkshopInfoService.importWrokshop(workshopList, updateSupport, operName); |
| | | return success(message); |
| | | } |
| | | } |