| | |
| | | import com.zt.life.modules.project.service.SoftwareTestOrderMeasuredService; |
| | | import com.zt.life.modules.project.service.SoftwareTestOrderService; |
| | | import com.zt.life.modules.sysBaseInfo.service.TestAgencyInfoService; |
| | | 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 io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | private SoftwareTestOrderService softwareTestOrderService; |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | @Autowired |
| | | private SoftwareTestOrderDeliverableService softwareTestOrderDeliverableService; |
| | | @Autowired |
| | | private SoftwareTestOrderMeasuredService softwareTestOrderMeasuredService; |
| | | @Autowired |
| | | private TestAgencyInfoService testAgencyInfoService; |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | | private SysOssConfigService sysOssConfigService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | |
| | | @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 = "softwareName", value = "软件名称", dataType = Constant.QT.STRING, format = "software_name^EQ"), |
| | | @ApiImplicitParam(name = "testBasis", value = "测试依据", dataType = Constant.QT.STRING, format = "test_basis^EQ"), |
| | | @ApiImplicitParam(name = "testType", value = "测试类型", dataType = Constant.QT.STRING, format = "test_type^EQ"), |
| | | @ApiImplicitParam(name = "testStandard", value = "测试标准", dataType = Constant.QT.STRING, format = "test_standard^EQ"), |
| | |
| | | @ApiOperation("信息") |
| | | public Result<SoftwareTestOrderDto> getDto(Long projectId,Long orderId) { |
| | | SoftwareTestOrderDto data = softwareTestOrderService.getDto(projectId, orderId); |
| | | if (orderId!=null) { |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(orderId, "test_order"); |
| | | if (ossDto != null) { |
| | | data.setFiles(ossDto); |
| | | } |
| | | } |
| | | return Result.ok(data); |
| | | } |
| | | |
| | |
| | | //效验数据 |
| | | |
| | | ValidatorUtils.validateEntity(softwareTestOrderDto.getSoftwareTestOrder(), AddGroup.class, DefaultGroup.class); |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("funCode","software_test_order"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | String year = sdf.format(new Date()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("funCode", "software_test_order"); |
| | | map.put("year",year); |
| | | softwareTestOrderDto.getSoftwareTestOrder().setYear(year); |
| | | softwareTestOrderDto.getSoftwareTestOrder().setCode(sysCodeRuleService.getNewCode(map)); |
| | | Boolean result = softwareTestOrderService.save(softwareTestOrderDto); |
| | | return Result.ok(); |
| | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody SoftwareTestOrderDto softwareTestOrderDtor) { |
| | | public Result update(@RequestBody SoftwareTestOrderDto softwareTestOrderDto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(softwareTestOrderDtor.getSoftwareTestOrder(), UpdateGroup.class, DefaultGroup.class); |
| | | Boolean result = softwareTestOrderService.save(softwareTestOrderDtor); |
| | | ValidatorUtils.validateEntity(softwareTestOrderDto.getSoftwareTestOrder(), UpdateGroup.class, DefaultGroup.class); |
| | | Boolean result = softwareTestOrderService.save(softwareTestOrderDto); |
| | | return Result.ok(); |
| | | } |
| | | |