|
|
@ -1,4 +1,4 @@ |
|
|
package com.thing.cqc.CqcCarbonReport.controller; |
|
|
|
|
|
|
|
|
package com.thing.cqc.cqcCarbonReport.controller; |
|
|
|
|
|
|
|
|
import com.thing.common.core.annotation.LogOperation; |
|
|
import com.thing.common.core.annotation.LogOperation; |
|
|
import com.thing.common.core.constants.Constant; |
|
|
import com.thing.common.core.constants.Constant; |
|
|
@ -9,9 +9,10 @@ import com.thing.common.core.validator.group.DefaultGroup; |
|
|
import com.thing.common.core.validator.group.UpdateGroup; |
|
|
import com.thing.common.core.validator.group.UpdateGroup; |
|
|
import com.thing.common.core.web.response.PageData; |
|
|
import com.thing.common.core.web.response.PageData; |
|
|
import com.thing.common.core.web.response.Result; |
|
|
import com.thing.common.core.web.response.Result; |
|
|
import com.thing.cqc.CqcCarbonReport.dto.CqcCarbonReportDTO; |
|
|
|
|
|
import com.thing.cqc.CqcCarbonReport.service.CqcCarbonReportService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.thing.cqc.cqcCarbonReport.dto.CqcCarbonReportDTO; |
|
|
|
|
|
import com.thing.cqc.cqcCarbonReport.service.CqcCarbonReportService; |
|
|
|
|
|
import com.thing.cqc.rpcService.service.CqcRpcService; |
|
|
|
|
|
import com.thing.sys.security.context.UserContext; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
import io.swagger.v3.oas.annotations.Parameter; |
|
|
import io.swagger.v3.oas.annotations.Parameter; |
|
|
import io.swagger.v3.oas.annotations.Parameters; |
|
|
import io.swagger.v3.oas.annotations.Parameters; |
|
|
@ -36,6 +37,8 @@ public class CqcCarbonReportController { |
|
|
|
|
|
|
|
|
private final CqcCarbonReportService cqcCarbonReportService; |
|
|
private final CqcCarbonReportService cqcCarbonReportService; |
|
|
|
|
|
|
|
|
|
|
|
private final CqcRpcService cqcRpcService; |
|
|
|
|
|
|
|
|
@GetMapping("page") |
|
|
@GetMapping("page") |
|
|
@Operation(summary="分页") |
|
|
@Operation(summary="分页") |
|
|
@Parameters({ |
|
|
@Parameters({ |
|
|
@ -50,7 +53,6 @@ public class CqcCarbonReportController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("{id}") |
|
|
@GetMapping("{id}") |
|
|
@Operation(summary="信息") |
|
|
|
|
|
public Result<CqcCarbonReportDTO> get(@PathVariable("id") Long id){ |
|
|
public Result<CqcCarbonReportDTO> get(@PathVariable("id") Long id){ |
|
|
CqcCarbonReportDTO data = cqcCarbonReportService.getByIdAs(id, CqcCarbonReportDTO.class); |
|
|
CqcCarbonReportDTO data = cqcCarbonReportService.getByIdAs(id, CqcCarbonReportDTO.class); |
|
|
return new Result<CqcCarbonReportDTO>().ok(data); |
|
|
return new Result<CqcCarbonReportDTO>().ok(data); |
|
|
@ -58,18 +60,19 @@ public class CqcCarbonReportController { |
|
|
|
|
|
|
|
|
@PostMapping |
|
|
@PostMapping |
|
|
@Operation(summary="保存") |
|
|
@Operation(summary="保存") |
|
|
@LogOperation("保存") |
|
|
|
|
|
public Result<Object> save(@RequestBody CqcCarbonReportDTO dto){ |
|
|
public Result<Object> save(@RequestBody CqcCarbonReportDTO dto){ |
|
|
//效验数据 |
|
|
//效验数据 |
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
dto.setApplyNo(String.valueOf(UUID.randomUUID())); |
|
|
dto.setApplyNo(String.valueOf(UUID.randomUUID())); |
|
|
|
|
|
dto.setCreateDate(System.currentTimeMillis()); |
|
|
|
|
|
dto.setCompanyId(UserContext.getCompanyId()); |
|
|
|
|
|
dto.setTenantCode(UserContext.getTenantCode()); |
|
|
cqcCarbonReportService.saveDto(dto); |
|
|
cqcCarbonReportService.saveDto(dto); |
|
|
return new Result<Object>().ok(dto.getApplyNo()); |
|
|
return new Result<Object>().ok(dto.getApplyNo()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PutMapping |
|
|
@PutMapping |
|
|
@Operation(summary="修改") |
|
|
@Operation(summary="修改") |
|
|
@LogOperation("修改") |
|
|
|
|
|
public Result<Object> update(@RequestBody CqcCarbonReportDTO dto){ |
|
|
public Result<Object> update(@RequestBody CqcCarbonReportDTO dto){ |
|
|
//效验数据 |
|
|
//效验数据 |
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
@ -79,7 +82,6 @@ public class CqcCarbonReportController { |
|
|
|
|
|
|
|
|
@DeleteMapping |
|
|
@DeleteMapping |
|
|
@Operation(summary="删除") |
|
|
@Operation(summary="删除") |
|
|
@LogOperation("删除") |
|
|
|
|
|
public Result<Void> delete(@RequestBody Long[] ids){ |
|
|
public Result<Void> delete(@RequestBody Long[] ids){ |
|
|
//效验数据 |
|
|
//效验数据 |
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
@ -87,14 +89,9 @@ public class CqcCarbonReportController { |
|
|
return new Result<>(); |
|
|
return new Result<>(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
*@GetMapping("export") |
|
|
|
|
|
*@Operation(summary="导出") |
|
|
|
|
|
*@LogOperation("导出") |
|
|
|
|
|
*public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|
|
|
|
|
* List<CqcCarbonReportDTO> list = cqcCarbonReportService.listAs(params, CqcCarbonReportDTO.class); |
|
|
|
|
|
* //ExcelUtils.exportExcelToTarget(response, null, "申请表基础数据", list, CqcCarbonReportExcel.class); |
|
|
|
|
|
*} |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@GetMapping("uploadReport/{id}") |
|
|
|
|
|
private Result<String> uploadReport(@PathVariable("id") Long id){ |
|
|
|
|
|
return cqcCarbonReportService.uploadReport(id); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |