|
|
@ -48,6 +48,7 @@ import com.dayu.daf.core.boot.ctrl.DafController; |
|
|
|
import springfox.documentation.annotations.ApiIgnore; |
|
|
|
import springfox.documentation.annotations.ApiIgnore; |
|
|
|
|
|
|
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.net.URLEncoder; |
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
@ -155,6 +156,19 @@ public class InspectionTasksController extends DafController { |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入inspectionTasks") |
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入inspectionTasks") |
|
|
|
public R submit(@Valid @RequestBody InspectionTasks inspectionTasks) { |
|
|
|
public R submit(@Valid @RequestBody InspectionTasks inspectionTasks) { |
|
|
|
|
|
|
|
inspectionTasks.setTaskStatus(1L); |
|
|
|
|
|
|
|
String date = LocalDate.now().toString().replace("-",""); |
|
|
|
|
|
|
|
String maxTaskNo = inspectionTasksService.getMaxTaskNo("'%" + date + "%'"); |
|
|
|
|
|
|
|
int number; |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(maxTaskNo)){ |
|
|
|
|
|
|
|
number = Integer.parseInt(maxTaskNo.substring(9)); |
|
|
|
|
|
|
|
number++; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
number = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String numFormat = String.format("%04d", number); |
|
|
|
|
|
|
|
String taskNo = "R" + date + numFormat; |
|
|
|
|
|
|
|
inspectionTasks.setTaskNo(taskNo); |
|
|
|
return R.status(inspectionTasksService.saveOrUpdate(inspectionTasks)); |
|
|
|
return R.status(inspectionTasksService.saveOrUpdate(inspectionTasks)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|