|
@@ -1,8 +1,10 @@
|
|
|
package com.persagy.dc.digital.handler;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
+import com.persagy.dc.common.context.AppContext;
|
|
|
import com.persagy.dc.common.lang.PsDateTime;
|
|
|
import com.persagy.dc.digital.entity.ObjectDigital;
|
|
|
import lombok.Data;
|
|
@@ -107,9 +109,9 @@ public class ProjectMessageVO {
|
|
|
project.setVirtualCodes(Collections.emptyList());
|
|
|
project.setValid(valid);
|
|
|
if("create".equalsIgnoreCase(type)) {
|
|
|
- project.setCreateApp("bmp");
|
|
|
+ project.setCreateApp(AppContext.getContext().getAppId());
|
|
|
} else {
|
|
|
- project.setUpdateApp("bmp");
|
|
|
+ project.setUpdateApp(AppContext.getContext().getAppId());
|
|
|
}
|
|
|
project.setInfos(toObjectInfos());
|
|
|
return project;
|
|
@@ -120,18 +122,38 @@ public class ProjectMessageVO {
|
|
|
* @return
|
|
|
*/
|
|
|
public ObjectNode toObjectInfos() {
|
|
|
- // 构建infos
|
|
|
+ // 构建infos - 为空不写入
|
|
|
ObjectNode infos = JsonNodeFactory.instance.objectNode();
|
|
|
- infos.put("province", provinceCode);
|
|
|
- infos.put("city", cityCode);
|
|
|
- infos.put("urbanZone", zoneCode);
|
|
|
- infos.put("longitude", longitude);
|
|
|
- infos.put("latitude", latitude);
|
|
|
- infos.put("address", location);
|
|
|
- infos.put("businessOpeningTime", openTime.toString("yyyyMMdd"));
|
|
|
- infos.put("projFuncType", projectFun);
|
|
|
- infos.put("climateZone", projectWeather);
|
|
|
- infos.put("groupManageZone", manageZone);
|
|
|
+ if(StrUtil.isNotBlank(provinceCode)) {
|
|
|
+ infos.put("province", provinceCode);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotBlank(cityCode)) {
|
|
|
+ infos.put("city", cityCode);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotBlank(zoneCode)) {
|
|
|
+ infos.put("urbanZone", zoneCode);
|
|
|
+ }
|
|
|
+ if(longitude != null) {
|
|
|
+ infos.put("longitude", longitude);
|
|
|
+ }
|
|
|
+ if(latitude != null) {
|
|
|
+ infos.put("latitude", latitude);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotBlank(location)) {
|
|
|
+ infos.put("address", location);
|
|
|
+ }
|
|
|
+ if(openTime != null) {
|
|
|
+ infos.put("businessOpeningTime", openTime.toString("yyyyMMdd"));
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotBlank(projectFun)) {
|
|
|
+ infos.put("projFuncType", projectFun);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotBlank(projectWeather)) {
|
|
|
+ infos.put("climateZone", projectWeather);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotBlank(manageZone)) {
|
|
|
+ infos.put("groupManageZone", manageZone);
|
|
|
+ }
|
|
|
// 添加图片
|
|
|
if(CollUtil.isNotEmpty(projectImage)) {
|
|
|
projectImage.forEach(p -> infos.withArray("projPic").addPOJO(p));
|