| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.domain.ArchiveRecords; |
| | | import com.ruoyi.domain.vo.AnalysisResult; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.ruoyi.service.IArchiveRecordsService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; |
| | |
| | | @Autowired |
| | | private IArchiveRecordsService archiveRecordsService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询档案完成情况 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:records:list')") |
| | | @GetMapping("/analysisRes") |
| | | public AjaxResult analysis() |
| | | { |
| | | System.out.println("009099"); |
| | | return new AjaxResult(200, "查询成功", archiveRecordsService.statisticAya()); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:records:export')") |
| | | @Log(title = "档案分析结果导出", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportAllStatis") |
| | | public void exportAllStatis(HttpServletResponse response) |
| | | { |
| | | List<AnalysisResult> list = archiveRecordsService.statisticAya(); |
| | | ExcelUtil<AnalysisResult> util = new ExcelUtil<AnalysisResult>(AnalysisResult.class); |
| | | util.exportExcel(response, list, "档案分析结果"); |
| | | } |
| | | |
| | | /** |
| | | * 查询档案记录列表 |
| | | */ |
| | |
| | | return archiveRecordsService.selectDataList(archiveRecords, pageNum, pageSize); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 拿到最大id |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:records:list')") |
| | | @GetMapping("/getMaxId") |
| | | public AjaxResult getMaxId() |
| | | { |
| | | return success(archiveRecordsService.getMaxId()+1); |
| | | } |
| | | /** |
| | | * 导出档案记录列表 |
| | | */ |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArchiveRecords archiveRecords) |
| | | { |
| | | return toAjax(archiveRecordsService.insertArchiveRecords(archiveRecords)); |
| | | int res = archiveRecordsService.insertArchiveRecords(archiveRecords); |
| | | System.out.println(res); |
| | | if(res==0) { |
| | | System.out.println(res); |
| | | |
| | | return new AjaxResult(0, "档案号已经存在了!"); |
| | | } |
| | | else |
| | | return new AjaxResult(200, "添加成功了!"); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | return toAjax(archiveRecordsService.updateArchiveRecords(archiveRecords)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:records:edit')") |
| | | @Log(title = "档案记录", businessType = BusinessType.UPDATE) |
| | | @PostMapping(value = "/updateSByIds") |
| | | public AjaxResult updateStatusByIds(@RequestBody Long[] ids) |
| | | { |
| | | System.out.println(ids); |
| | | System.out.println("090sdfsdf"); |
| | | return new AjaxResult(0, archiveRecordsService.updateStatusByIds(ids)+""); |
| | | } |
| | | /** |
| | | * 删除档案记录 |
| | | */ |
| | |
| | | { |
| | | return toAjax(archiveRecordsService.deleteArchiveRecordsByIds(ids)); |
| | | } |
| | | @PreAuthorize("@ss.hasPermi('system:records:edit')") |
| | | @Log(title = "档案记录导入", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception |
| | | { |
| | | return archiveRecordsService.importExcel(file); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:records:edit')") |
| | | @Log(title = "修改状态", businessType = BusinessType.IMPORT) |
| | | @GetMapping(value = "/updateStatusById/{id}") |
| | | public AjaxResult updateStatusById(@PathVariable("id") String id) |
| | | { |
| | | return new AjaxResult(200, archiveRecordsService.updateArchiveById(Long.parseLong(id))+""); |
| | | } |
| | | } |