| | |
| | | import com.zt.life.modules.configAuditReport.dto.ConfigAuditDto; |
| | | import com.zt.life.modules.configAuditReport.model.ConfigAuditReport; |
| | | import com.zt.life.modules.configAuditReport.service.ConfigAuditReportService; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private ConfigAuditReportService configAuditReportService; |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "code", value = "编号", dataType = Constant.QT.STRING, format = "code^LK"), |
| | | @ApiImplicitParam(name = "libraryType", value = "库类型", dataType = Constant.QT.STRING, format = "a.library_type^EQ") |
| | | }) |
| | | @ApiImplicitParam(name = "code", value = "编号", dataType = Constant.QT.STRING, format = "a.code^LK"), |
| | | @ApiImplicitParam(name = "softwareIdentity", value = "项目标识", dataType = Constant.QT.STRING, format = "p.software_identity^LK"), |
| | | @ApiImplicitParam(name = "softwareName", value = "项目名称", dataType = Constant.QT.STRING, format = "p.software_name^LK"), |
| | | }) |
| | | public PageResult<ConfigAuditReport> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(configAuditReportService.page(queryFilter)); |
| | | } |
| | | /* @GetMapping("getDto") |
| | | |
| | | @GetMapping("getDto") |
| | | @ApiOperation("信息") |
| | | public Result<ConfigAuditDto> getDto(Long projectId, Long reportId) { |
| | | //ConfigAuditDto data =configAuditReportService.getDto(projectId, reportId); |
| | | if (reportId!=null) { |
| | | for (WarehouseConfigItem configItem : data.getConfigItemList()) { |
| | | Long configItemId = configItem.getId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(configItemId, "config_item_warehouse"); |
| | | if (ossDto != null) { |
| | | configItem.setFiles(ossDto); |
| | | } |
| | | ConfigAuditDto data =configAuditReportService.getDto(projectId, reportId); |
| | | if (reportId!=null) { |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(reportId, "config_audit_report"); |
| | | if (ossDto != null) { |
| | | data.setFiles(ossDto); |
| | | } |
| | | } |
| | | return Result.ok(data); |
| | | }*/ |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | |
| | | map.put("funCode", "config_audit_report"); |
| | | map.put("projectId",configAuditDto.getProjectId().toString()); |
| | | configAuditDto.getAuditReport().setCode(sysCodeRuleService.getNewCode(map)); |
| | | // Boolean result = configAuditReportService.save(configAuditDto); |
| | | Boolean result = configAuditReportService.save(configAuditDto); |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | public Result update(@RequestBody ConfigAuditDto configAuditDto){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(configAuditDto, UpdateGroup.class, DefaultGroup.class); |
| | | // Boolean result = configAuditReportService.save(configAuditDto); |
| | | |
| | | Boolean result = configAuditReportService.save(configAuditDto); |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | configAuditReportService.delete(ids); |
| | | projectService.deleteItem(ids,"config_audit_report_content","report_id"); |
| | | projectService.deleteItem(ids,"config_audit_report_problem","report_id"); |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("exportConfigAudit") |
| | | @ApiOperation("打印审核报告") |
| | | @LogOperation("打印审核报告") |
| | | public void exportConfigAudit(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | configAuditReportService.exportConfigAudit(id, request, response); |
| | | } |
| | | |
| | | } |