|
|
|
@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.cloud.kicc.common.core.api.R; |
|
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
|
import com.cloud.kicc.system.api.devtools.entity.GencodeCustomObj; |
|
|
|
|
import com.cloud.kicc.system.api.devtools.entity.GencodeScheme; |
|
|
|
|
import com.cloud.kicc.system.api.devtools.entity.*; |
|
|
|
|
import com.cloud.kicc.system.devtools.service.IGencodeCustomFieldService; |
|
|
|
|
import com.cloud.kicc.system.devtools.service.IGencodeCustomObjService; |
|
|
|
|
import com.cloud.kicc.system.devtools.service.IGencodeSchemeService; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
@ -30,6 +30,7 @@ import java.util.Arrays;
@@ -30,6 +30,7 @@ import java.util.Arrays;
|
|
|
|
|
public class GencodeCustomObjController { |
|
|
|
|
|
|
|
|
|
private final IGencodeCustomObjService iGencodeCustomObjService; |
|
|
|
|
private final IGencodeCustomFieldService iGencodeCustomFieldService; |
|
|
|
|
private final IGencodeSchemeService iGencodeSchemeService; |
|
|
|
|
|
|
|
|
|
private LambdaQueryWrapper<GencodeCustomObj> getQueryWrapper(GencodeCustomObj gencodeCustomObj) { |
|
|
|
@ -43,9 +44,19 @@ public class GencodeCustomObjController {
@@ -43,9 +44,19 @@ public class GencodeCustomObjController {
|
|
|
|
|
return R.ok(result.getRecords(), result.getTotal()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/selectListByValue/{value:\\w+}") |
|
|
|
|
public R selectListByValue(@PathVariable String value) { |
|
|
|
|
return R.ok(iGencodeCustomObjService.list(Wrappers.<GencodeCustomObj>lambdaUpdate().eq(GencodeCustomObj::getValue, value))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/{id:\\w+}") |
|
|
|
|
public R getById(@PathVariable("id") String id) { |
|
|
|
|
return R.ok(iGencodeCustomObjService.getById(id)); |
|
|
|
|
GencodeCustomObj gencodeCustomObj = iGencodeCustomObjService.getById(id); |
|
|
|
|
gencodeCustomObj.setGencodeCustomFieldList(iGencodeCustomFieldService.list(Wrappers.<GencodeCustomField>lambdaQuery() |
|
|
|
|
.eq(GencodeCustomField::getObjId, gencodeCustomObj.getId()) |
|
|
|
|
.orderByAsc(GencodeCustomField::getSort) |
|
|
|
|
)); |
|
|
|
|
return R.ok(gencodeCustomObj); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
@ -72,6 +83,12 @@ public class GencodeCustomObjController {
@@ -72,6 +83,12 @@ public class GencodeCustomObjController {
|
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PutMapping("/saveAndGencodeCustomField") |
|
|
|
|
public R saveAndGencodeCustomField(@RequestBody GencodeCustomObj gencodeCustomObj) { |
|
|
|
|
iGencodeCustomObjService.saveAndGencodeCustomField(gencodeCustomObj); |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/getByValue") |
|
|
|
|
public R getByValue(String value) { |
|
|
|
|
GencodeCustomObj gencodeCustomObj = iGencodeCustomObjService.getOne(Wrappers.<GencodeCustomObj>lambdaQuery().eq(GencodeCustomObj::getValue, value)); |
|
|
|
@ -80,7 +97,7 @@ public class GencodeCustomObjController {
@@ -80,7 +97,7 @@ public class GencodeCustomObjController {
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/remove/{id:[\\w,]+}") |
|
|
|
|
public R remove(@PathVariable String[] id) { |
|
|
|
|
iGencodeCustomObjService.removeByIds(Arrays.asList(id)); |
|
|
|
|
iGencodeCustomObjService.removeByIdsAndGencodeCustomField(Arrays.asList(id)); |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|