| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZfDoctor; |
| | | import com.ruoyi.domain.ZfEconomy; |
| | | import com.ruoyi.domain.excel.ZfEconomyExcelBean; |
| | | import com.ruoyi.service.ZfEconomyService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取导入模板 |
| | | */ |
| | | @PostMapping("/model") |
| | | public void getExportModel(HttpServletResponse response){ |
| | | List<ZfEconomyExcelBean> list = Collections.singletonList(new ZfEconomyExcelBean()); |
| | | ExcelUtil<ZfEconomyExcelBean> util = new ExcelUtil<>(ZfEconomyExcelBean.class); |
| | | util.exportExcel(response,list,"家庭收支台账导入模板"); |
| | | } |
| | | |
| | | /** |
| | | * 导出家庭收支台账记录列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')") |
| | |
| | | public void export(HttpServletResponse response, ZfEconomy zfEconomy) |
| | | { |
| | | List<ZfEconomy> list = zfEconomyService.selectByCondition(zfEconomy); |
| | | log.info("导出记录为:{}",list); |
| | | ExcelUtil<ZfEconomy> util = new ExcelUtil<>(ZfEconomy.class); |
| | | util.exportExcel(response, list, "家庭收支台账记录数据"); |
| | | } |
| | | /** |
| | | * 导出家庭收支台账记录列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')") |
| | | @Log(title = "家庭收支台账记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export1/{ids}") |
| | | public void export(HttpServletResponse response, @PathVariable Long[] ids) |
| | | { |
| | | List<ZfEconomy> list = zfEconomyService.selectByIds(ids); |
| | | log.info("导出记录为:{}",list); |
| | | ExcelUtil<ZfEconomy> util = new ExcelUtil<>(ZfEconomy.class); |
| | | util.exportExcel(response, list, "家庭收支台账记录数据"); |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ZfEconomy zfEconomy) |
| | | { |
| | | return zfEconomyService.addData2(zfEconomy); |
| | | return zfEconomyService.addData(zfEconomy); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ZfEconomy zfEconomy) |
| | | { |
| | | return toAjax(zfEconomyService.updateById(zfEconomy)); |
| | | return zfEconomyService.updateData(zfEconomy); |
| | | } |
| | | // |
| | | /** |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(zfEconomyService.removeByIds(Arrays.asList(ids))); |
| | | return zfEconomyService.deleteData(ids); |
| | | } |
| | | |
| | | |