|
@@ -0,0 +1,75 @@
|
|
|
|
|
+package com.zksy.controller.info;
|
|
|
|
|
+
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
|
|
+import com.zksy.info.domain.EEnterpriseElectricityAnnualStatistics;
|
|
|
|
|
+import com.zksy.info.domain.EQuarterlyElectricityBill;
|
|
|
|
|
+import com.zksy.info.service.EEnterpriseElectricityAnnualStatisticsService;
|
|
|
|
|
+import com.zksy.info.service.EQuarterlyElectricityBillService;
|
|
|
|
|
+import com.zksy.utils.AjaxResult;
|
|
|
|
|
+import com.zksy.utils.ExcelExportUtil;
|
|
|
|
|
+import com.zksy.utils.ExcelImportUtil;
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
+
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @author Administrator
|
|
|
|
|
+ * @version 1.0
|
|
|
|
|
+ * @project enterprise-assets-service
|
|
|
|
|
+ * @description 用电控制层
|
|
|
|
|
+ * @date 2025/6/24 14:33:13
|
|
|
|
|
+ */
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/eenterpriseElectricityAnnualStatistics")
|
|
|
|
|
+@Api(tags = "企业年度用电",description = "企业年度用电desc")
|
|
|
|
|
+public class EEnterpriseElectricityAnnualStatisticsController {
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private EEnterpriseElectricityAnnualStatisticsService service;
|
|
|
|
|
+ @GetMapping("/findByPage")
|
|
|
|
|
+ @ApiOperation(value = "企业年度用电查询分页")
|
|
|
|
|
+ public AjaxResult findByPage(long pageNum, long pageSize, String enterpriseName,String unifiedSocialCreditCode,String accountNumber,String year){
|
|
|
|
|
+ return AjaxResult.success(service.findByPage(pageNum, pageSize, enterpriseName,unifiedSocialCreditCode,accountNumber,year));
|
|
|
|
|
+ }
|
|
|
|
|
+ @GetMapping("/getEEnterpriseElectricityAnnualStatisticsList")
|
|
|
|
|
+ @ApiOperation(value = "企业年度用电查询")
|
|
|
|
|
+ public AjaxResult getEEnterpriseElectricityAnnualStatisticsList(String enterpriseName,String unifiedSocialCreditCode,String accountNumber,String year){
|
|
|
|
|
+ return AjaxResult.success(service.getEEnterpriseElectricityAnnualStatisticsList(enterpriseName,unifiedSocialCreditCode,accountNumber,year));
|
|
|
|
|
+ }
|
|
|
|
|
+ @GetMapping("/getById/{id}")
|
|
|
|
|
+ @ApiOperation(value = "根据Id查询企业年度用电")
|
|
|
|
|
+ public AjaxResult getById(@PathVariable String id){
|
|
|
|
|
+ return AjaxResult.success(service.getById(id));
|
|
|
|
|
+ }
|
|
|
|
|
+ @PostMapping("/save")
|
|
|
|
|
+ @ApiOperation(value = "企业年度用电保存")
|
|
|
|
|
+ public AjaxResult save(@RequestBody EEnterpriseElectricityAnnualStatistics entity) {
|
|
|
|
|
+ return service.save(entity) ? AjaxResult.success(entity) : AjaxResult.error("保存失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ @PostMapping("/update")
|
|
|
|
|
+ @ApiOperation(value = "企业年度用电修改")
|
|
|
|
|
+ public AjaxResult update(@RequestBody EEnterpriseElectricityAnnualStatistics entity) {
|
|
|
|
|
+ entity.setUpdateTime(new DateTime());
|
|
|
|
|
+ return service.updateById(entity) ? AjaxResult.success(entity) : AjaxResult.error("修改失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ @PostMapping("/deleteBatch")
|
|
|
|
|
+ @ApiOperation(value = "企业年度用电删除")
|
|
|
|
|
+ public AjaxResult delete(@RequestBody String[] ids) {
|
|
|
|
|
+ return service.removeBatchByIds(Arrays.asList(ids)) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ @PostMapping("/importData")
|
|
|
|
|
+ @ApiOperation(value = "导入数据")
|
|
|
|
|
+ public AjaxResult importData(MultipartFile file) {
|
|
|
|
|
+ return AjaxResult.success(service.saveOrUpdateBatch(ExcelImportUtil.importExcel(file, EEnterpriseElectricityAnnualStatistics.class)));
|
|
|
|
|
+ }
|
|
|
|
|
+ @GetMapping("/exportData")
|
|
|
|
|
+ @ApiOperation(value = "导出数据")
|
|
|
|
|
+ public void exportData(HttpServletResponse response,String enterpriseName,String unifiedSocialCreditCode,String accountNumber,String year) {
|
|
|
|
|
+ ExcelExportUtil.exportExcel(response,service.getEEnterpriseElectricityAnnualStatisticsList(enterpriseName,unifiedSocialCreditCode,accountNumber,year), EEnterpriseElectricityAnnualStatistics.class, "企业年度用电","企业年度用电");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|