getProjectList问题
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/28/下午5:37
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class ProjectDTO {
|
||||
private String projectId;
|
||||
private String clientCode;
|
||||
private String clientName;
|
||||
private String pCode;
|
||||
private String address;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import com.cool.store.vo.log.DesignLogVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/28/下午3:37
|
||||
* @Version 1.0
|
||||
* @注释:设计阶段信息
|
||||
*/
|
||||
@Data
|
||||
public class DesignInfoVo {
|
||||
|
||||
private String name;
|
||||
private Integer resultType;
|
||||
private String planTime;
|
||||
private List<DesignLogVo> logs;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.vo.log;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/28/下午4:02
|
||||
* @Version 1.0
|
||||
* @注释:设计阶段跟踪日志
|
||||
*/
|
||||
@Data
|
||||
public class DesignLogVo {
|
||||
|
||||
private String logTime;
|
||||
private String name;
|
||||
private String description;
|
||||
private String planTime;
|
||||
private String finishTime;
|
||||
private List<String> attachmentUrl;
|
||||
}
|
||||
@@ -25,19 +25,7 @@ public interface CoolStoreStartFlowService {
|
||||
* @return
|
||||
*/
|
||||
ResponseResult franchiseAgreement(FranchiseAgreementRequest request,Integer type);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/25
|
||||
* @description:项目列表
|
||||
*/
|
||||
ResponseResult getProjectList(String shopCode);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/25
|
||||
* @description:项目详情
|
||||
* @Param projectId:项目主键,clientCode:客户编号,pCode:项目编号
|
||||
*/
|
||||
ResponseResult getStoreDetail(Long projectId,String clientCode,String pCode);
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/25
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.vo.DesignInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/28/下午4:45
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public interface DecorationService {
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/28
|
||||
* @description:获取装修阶段子阶段信息
|
||||
*/
|
||||
List<DesignInfoVo> decorations();
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/28
|
||||
* @description:设计阶段信息
|
||||
*/
|
||||
List<DesignInfoVo> DesignInfo(String shopCode);
|
||||
}
|
||||
@@ -13,4 +13,11 @@ public interface YlfService {
|
||||
*
|
||||
*/
|
||||
DecorationDTO getDecoration(Long id) ;
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/25
|
||||
* @description:项目列表
|
||||
*/
|
||||
String getProjectList(String shopCode);
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseResult franchiseAgreement(FranchiseAgreementRequest request, Integer type) {
|
||||
log.info("newStore param:{}", JSONObject.toJSONString(request));
|
||||
@@ -81,53 +80,6 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult getProjectList(String shopCode) {
|
||||
log.info("getProjectList param:{}", shopCode);
|
||||
if (Objects.isNull(shopCode)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
String url = String.format(Constants.GET_PROJECT_LIST, shopCode);
|
||||
log.info("CoolStoreStartFlowServiceImpl#getOrder, url:{}", url);
|
||||
try {
|
||||
JSONObject jsonObject = httpRestTemplateService.getForObject(url, JSONObject.class, new HashMap<>());
|
||||
log.info("CoolStoreStartFlowServiceImpl#getOrder,jsonObject:{}", jsonObject.toJSONString());
|
||||
if (jsonObject.get("status").equals(Constants.SUCCESS)) {
|
||||
return new ResponseResult(200, jsonObject.get("data").toString(), jsonObject.get("msg").toString());
|
||||
} else {
|
||||
return new ResponseResult(500, jsonObject.get("msg").toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用鲜丰服务异常,getProjectList error:{}", e);
|
||||
throw new ServiceException(ErrorCodeEnum.XFSG_SERVICE_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult getStoreDetail(Long projectId, String clientCode, String pCode) {
|
||||
log.info("getStoreList projectId:{},clientCode:{},pCode:{}", projectId, clientCode, pCode);
|
||||
if (Objects.isNull(projectId) && Objects.isNull(clientCode) && Objects.isNull(pCode)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("projectId", projectId);
|
||||
requestMap.put("clientCode", clientCode);
|
||||
requestMap.put("pCode", pCode);
|
||||
try {
|
||||
JSONObject jsonObject = httpRestTemplateService.getForObject(Constants.GET_PROJECT_DETAIL, JSONObject.class, requestMap);
|
||||
log.info("FirstOrderServiceImp#getStoreDetail, jsonObject:{}", jsonObject.toJSONString());
|
||||
if (jsonObject.get("status").equals(Constants.SUCCESS)) {
|
||||
return new ResponseResult(200, jsonObject.get("data").toString(), jsonObject.get("msg").toString());
|
||||
} else {
|
||||
return new ResponseResult(500, jsonObject.get("msg").toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用鲜丰服务异常,getProjectList error:{}", e);
|
||||
throw new ServiceException(ErrorCodeEnum.XFSG_SERVICE_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getFirstOrder(String shopCode) {
|
||||
@@ -156,4 +108,5 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
requestMap.put("timestamp", timestamp);
|
||||
requestMap.put("signature", signature);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.decoration.DecorationDTO;
|
||||
import com.cool.store.service.DecorationService;
|
||||
import com.cool.store.service.YlfService;
|
||||
import com.cool.store.vo.DesignInfoVo;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/28/下午4:46
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Service
|
||||
public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
@Resource
|
||||
private YlfService ylfService;
|
||||
@Override
|
||||
public List<DesignInfoVo> decorations() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DesignInfoVo> DesignInfo(String shopCode) {
|
||||
String projectId = ylfService.getProjectList(shopCode);
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus())) {
|
||||
// ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
|
||||
// String shopCode = shopInfo.getShopCode();
|
||||
// Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
|
||||
//Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
|
||||
Boolean firstOrder =Boolean.TRUE;
|
||||
log.info("saveOrder,flag:{}", firstOrder);
|
||||
if (firstOrder) {
|
||||
|
||||
@@ -2,10 +2,12 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.decoration.DecorationDTO;
|
||||
import com.cool.store.dto.decoration.ProjectDTO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.service.YlfService;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -23,27 +26,27 @@ import java.util.List;
|
||||
@Slf4j
|
||||
public class YlfServiceImpl implements YlfService {
|
||||
|
||||
static String url = "https://hzly.cloudcubic.net/ajaxHandle/synchronization/JCallBackSynchronizationHandler.ashx?action=app&controller=GetProjectDetails&projectid=";
|
||||
static String url = "https://hzly.cloudcubic.net/ajaxHandle/synchronization/JCallBackSynchronizationHandler.ashx?action=app&controller=GetProjectDetails&projectid=";
|
||||
|
||||
@Resource
|
||||
private HttpRestTemplateService httpRestTemplateService;
|
||||
|
||||
@Override
|
||||
public DecorationDTO getDecoration(Long id) {
|
||||
public DecorationDTO getDecoration(Long id) {
|
||||
String detailUrl = String.format("%s%d", url, id);
|
||||
try {
|
||||
String forObject = httpRestTemplateService.getForObject(detailUrl, String.class, new HashMap<>());
|
||||
Integer status = (Integer) JSONObject.parseObject(forObject, JSONObject.class).get("status");
|
||||
if (status != 200){
|
||||
log.info("获取云立方装修公司信息失败,id:{}",id);
|
||||
if (status != 200) {
|
||||
log.info("获取云立方装修公司信息失败,id:{}", id);
|
||||
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
|
||||
}
|
||||
Object data = JSONObject.parseObject(forObject, JSONObject.class).get("data");
|
||||
if (data == null){
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
List<DecorationDTO> list = (List<DecorationDTO>) ((JSONObject) JSONObject.parseObject(forObject, JSONObject.class).get("data")).get("rows");
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
return list.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -52,11 +55,36 @@ public class YlfServiceImpl implements YlfService {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProjectList(String shopCode) {
|
||||
log.info("getProjectList param:{}", shopCode);
|
||||
if (Objects.isNull(shopCode)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
String url = String.format(Constants.GET_PROJECT_LIST, shopCode);
|
||||
log.info("CoolStoreStartFlowServiceImpl#getOrder, url:{}", url);
|
||||
try {
|
||||
String jsonString = httpRestTemplateService.getForObject(url, String.class, new HashMap<>());
|
||||
JSONObject jsonObject = JSONObject.parseObject(jsonString);
|
||||
log.info("CoolStoreStartFlowServiceImpl#getOrder,jsonObject:{}", jsonObject);
|
||||
if (jsonObject.get("status").equals(Constants.SUCCESS)) {
|
||||
if (jsonObject.get("data").toString() == null) {
|
||||
return null;
|
||||
}
|
||||
List<ProjectDTO> projectDTOS = (List<ProjectDTO>) ((JSONObject) JSONObject.parseObject(jsonString, JSONObject.class).get("data")).get("rows");
|
||||
|
||||
return ((ProjectDTO)projectDTOS.get(0)).getProjectId();
|
||||
} else {
|
||||
log.info("获取云立方装修公司信息失败,shopCode:{}", shopCode);
|
||||
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info("调用云立方获取项目列表异常,getProjectList error:{}", e);
|
||||
throw new ServiceException(ErrorCodeEnum.XFSG_SERVICE_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.YlfService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/28/下午4:19
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pc/decoration")
|
||||
@Api(tags = "PC装修阶段")
|
||||
@Slf4j
|
||||
public class PCDecorationController {
|
||||
@Resource
|
||||
private YlfService ylfService;
|
||||
@GetMapping("/get")
|
||||
private ResponseResult get(){
|
||||
String shopCode = "31310383";
|
||||
return new ResponseResult<>(200,ylfService.getProjectList(shopCode)) ;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user