|
@@ -1,6 +1,7 @@
|
|
|
package com.persagy.proxy.object.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.persagy.proxy.object.model.AdmISpace;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateRequest;
|
|
|
import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
@@ -49,6 +50,7 @@ public class AdmISpaceController {
|
|
|
@PostMapping("/create")
|
|
|
public AdmResponse create(@RequestBody AdmCreateRequest<AdmISpace> AdmISpace) throws Exception {
|
|
|
List<AdmISpace> vos = CollUtil.newArrayList(AdmISpace.getContent());
|
|
|
+ ensureDataInfos(vos);
|
|
|
vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmISpace.class, vos);
|
|
|
return AdmResponse.success(vos);
|
|
|
}
|
|
@@ -74,11 +76,28 @@ public class AdmISpaceController {
|
|
|
@PostMapping("/update")
|
|
|
public AdmResponse update(@RequestBody AdmCreateRequest<AdmISpace> AdmISpace) throws Exception {
|
|
|
List<AdmISpace> vos = CollUtil.newArrayList(AdmISpace.getContent());
|
|
|
+ ensureDataInfos(vos);
|
|
|
vos = service.doUpdate(AdmContextUtil.toDmpContext(), AdmISpace.class, vos);
|
|
|
return AdmResponse.success(vos);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ * 补偿处理对象属性
|
|
|
+ * @param vos
|
|
|
+ */
|
|
|
+ private void ensureDataInfos(List<AdmISpace> vos) {
|
|
|
+ if(CollUtil.isEmpty(vos)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for(AdmISpace vo:vos) {
|
|
|
+ if(StrUtil.isBlank(vo.getName())) {
|
|
|
+ vo.setName(vo.getLocalName());
|
|
|
+ }
|
|
|
+ vo.setClassCode(AdmISpace.OBJ_TYPE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
* 查询
|
|
|
*
|
|
|
* @param request
|