fix:装修验收回调时覆盖建店资料里的门头照和内景照;建店资料门头照或内景照为空时取装修验收的图;平台账号门头照内景照兼容逗号隔开和json格式
This commit is contained in:
@@ -5,7 +5,10 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
@@ -18,6 +21,9 @@ import javax.validation.constraints.NotBlank;
|
|||||||
*/
|
*/
|
||||||
@Table(name = "xfsg_build_information")
|
@Table(name = "xfsg_build_information")
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
public class BuildInformationDO {
|
public class BuildInformationDO {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ public class BuildInformationServiceImpl implements BuildInformationService {
|
|||||||
private OrderSysInfoDAO orderSysInfoDAO;
|
private OrderSysInfoDAO orderSysInfoDAO;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BigRegionDAO bigRegionDAO;
|
private BigRegionDAO bigRegionDAO;
|
||||||
|
@Resource
|
||||||
|
private AcceptanceInfoDAO acceptanceInfoDAO;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -252,7 +254,14 @@ public class BuildInformationServiceImpl implements BuildInformationService {
|
|||||||
if (StringUtils.isBlank(response.getAddresseeAddress())) {
|
if (StringUtils.isBlank(response.getAddresseeAddress())) {
|
||||||
response.setAddresseeAddress(shopInfo.getDetailAddress());
|
response.setAddresseeAddress(shopInfo.getDetailAddress());
|
||||||
}
|
}
|
||||||
|
// 不存在的情况下从装修验收中获取
|
||||||
|
if (StringUtils.isBlank(response.getDoorPhoto()) || StringUtils.isBlank(response.getInStorePhoto())) {
|
||||||
|
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
|
||||||
|
if (Objects.nonNull(acceptanceInfoDO)) {
|
||||||
|
response.setDoorPhoto(StringUtils.isNotBlank(response.getDoorPhoto()) ? response.getDoorPhoto() : acceptanceInfoDO.getShopDoorwayPhoto());
|
||||||
|
response.setInStorePhoto(StringUtils.isNotBlank(response.getInStorePhoto()) ? response.getInStorePhoto() : acceptanceInfoDO.getShopInteriorPhoto());
|
||||||
|
}
|
||||||
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
@@ -10,14 +12,12 @@ import com.cool.store.exception.ServiceException;
|
|||||||
import com.cool.store.request.*;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.service.DecorationDesignInfoService;
|
import com.cool.store.service.DecorationDesignInfoService;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,6 +40,8 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|||||||
private ShopStageInfoDAO shopStageInfoDAO;
|
private ShopStageInfoDAO shopStageInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
private LineInfoDAO lineInfoDAO;
|
private LineInfoDAO lineInfoDAO;
|
||||||
|
@Resource
|
||||||
|
private BuildInformationDAO buildInformationDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -277,8 +279,28 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
|||||||
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus())) {
|
if (shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus())) {
|
||||||
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
shopStageInfoDAO.updateShopStageInfo(shopInfoDO.getId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123);
|
||||||
}
|
}
|
||||||
|
// 覆盖建店资料中的门头照和内景照
|
||||||
|
BuildInformationDO buildInformation = BuildInformationDO.builder().shopId(request.getShopId()).doorPhoto(buildJson(request.getShopDoorwayPhotoUrl()))
|
||||||
|
.inStorePhoto(buildJson(request.getShopInteriorPhotoUrl())).build();
|
||||||
|
buildInformationDAO.updateByShopIdSelective(buildInformation);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String buildJson(List<String> urls) {
|
||||||
|
if (CollectionUtils.isEmpty(urls)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
for (String url : urls) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("url", url);
|
||||||
|
jsonObject.put("type", extractImageSuffix(url));
|
||||||
|
jsonArray.add(jsonObject);
|
||||||
|
}
|
||||||
|
return jsonArray.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String extractImageSuffix(String url) {
|
||||||
|
return url.substring(url.lastIndexOf(".") + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -273,6 +273,18 @@ public class SyncDataServiceImpl implements SyncDataService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("getUrl error:{},JSON:{}", e.getMessage(), json);
|
log.info("getUrl error:{},JSON:{}", e.getMessage(), json);
|
||||||
}
|
}
|
||||||
|
return getUrlListByComma(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<String> getUrlListByComma(String str) {
|
||||||
|
if (StringUtils.isBlank(str)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Arrays.asList(str.split(","));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("getUrlListByComma error:{},str:{}", e.getMessage(), str);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user