|
|
@ -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; |
|
|
@ -143,6 +144,19 @@ public class InspectionRouteController extends DafController { |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入inspectionRoute") |
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入inspectionRoute") |
|
|
|
public R submit(@Valid @RequestBody InspectionRoute inspectionRoute) { |
|
|
|
public R submit(@Valid @RequestBody InspectionRoute inspectionRoute) { |
|
|
|
|
|
|
|
inspectionRoute.setIstatus(1); |
|
|
|
|
|
|
|
String date = LocalDate.now().toString().replace("-",""); |
|
|
|
|
|
|
|
String maxNo = inspectionRouteService.getMaxNo("'%" + date + "%'"); |
|
|
|
|
|
|
|
int number; |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(maxNo)){ |
|
|
|
|
|
|
|
number = Integer.parseInt(maxNo.substring(9)); |
|
|
|
|
|
|
|
number++; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
number = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String numFormat = String.format("%04d", number); |
|
|
|
|
|
|
|
String no = "R" + date + numFormat; |
|
|
|
|
|
|
|
inspectionRoute.setRouteNo(no); |
|
|
|
return R.status(inspectionRouteService.saveOrUpdate(inspectionRoute)); |
|
|
|
return R.status(inspectionRouteService.saveOrUpdate(inspectionRoute)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|