|
|
|
@ -9,12 +9,14 @@ import com.xydl.cac.service.ParamIndexService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.data.repository.query.Param;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@ -49,6 +51,16 @@ public class ParamIndexController extends BasicController {
|
|
|
|
|
@PostMapping("updateRpt")
|
|
|
|
|
@ApiOperation("绑定")
|
|
|
|
|
public Response<String> updateRpt(@Validated @RequestBody BindingModel item) throws Exception {
|
|
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
|
|
for (Rptparamindex rpt : item.getRptList()) {
|
|
|
|
|
if (StringUtils.isNotBlank(rpt.getParamindex())) {
|
|
|
|
|
if (map.containsKey(rpt.getParamindex())) {
|
|
|
|
|
throw new BusinessException("不能有相同的" + rpt.getParamindex());
|
|
|
|
|
} else {
|
|
|
|
|
map.put(rpt.getParamindex(), "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
service.updateRpt(item);
|
|
|
|
|
return Response.success("OK");
|
|
|
|
|
}
|
|
|
|
|