云立方接口
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:06
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AttachmentsDTO {
|
||||
|
||||
private String title;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String path;
|
||||
|
||||
private String create;
|
||||
|
||||
private String createDate;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:17
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class BudgetDTO {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String vzHj;
|
||||
private String totalAmount;
|
||||
private String totalCost;
|
||||
private String createDate;
|
||||
private String createBy;
|
||||
private List<BudgetDetailDTO> details;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class BudgetDetailDTO {
|
||||
private Long id;
|
||||
private String nodeType;
|
||||
private String number;
|
||||
private String name;
|
||||
private String unitName;
|
||||
private String amount;
|
||||
private String unitPrice;
|
||||
private String totalPrice;
|
||||
private String labour;
|
||||
private String material;
|
||||
private String mainMaterialCostPrice;
|
||||
private String auxiliaryMaterialCostPrice;
|
||||
private String labourCostPrice;
|
||||
private String remark;
|
||||
private BigDecimal loss;
|
||||
private BigDecimal totalCost;
|
||||
private BigDecimal cost;
|
||||
private BigDecimal lossPrice;
|
||||
private String planProfit;
|
||||
private BigDecimal profitRate;
|
||||
private String supplierName;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:02
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ConstructionScheduleDTO {
|
||||
private String id;
|
||||
private String name;
|
||||
private String planBeginDate;
|
||||
private String planEndDate;
|
||||
private String actualBeginDate;
|
||||
private String actualEndDate;
|
||||
private Integer duration;
|
||||
private Integer state;
|
||||
private List<AttachmentsDTO> attachments;
|
||||
private List<TrackDataDTO> trackData;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:21
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DecorationDTO {
|
||||
private String projectId;
|
||||
private String clientCode;
|
||||
private String clientName;
|
||||
private String pCode;
|
||||
private String clientContractCode;
|
||||
private String address;
|
||||
private List<BudgetDTO> proposedBookBudget;
|
||||
private List<DesignSchemeDTO> designScheme;
|
||||
private List<PaymentDTO> payment;
|
||||
private List<ConstructionScheduleDTO> constructionSchedule;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DesignSchemeDTO {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String remark;
|
||||
private String date;
|
||||
private String planBeginDate;
|
||||
private String planEndDate;
|
||||
private String beginDate;
|
||||
private String endDate;
|
||||
private Integer status;
|
||||
private List<AttachmentsDTO> attachments;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 14:53
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class FileDTO {
|
||||
|
||||
private Long id;
|
||||
private String path;
|
||||
private String title;
|
||||
private String create;
|
||||
private String createDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 15:14
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PaymentDTO {
|
||||
private String id;
|
||||
private String billDate;
|
||||
private String billNo;
|
||||
private String userName;
|
||||
private BigDecimal amount;
|
||||
private BigDecimal bDeAmount;
|
||||
private String typeCategory;
|
||||
private String accountName;
|
||||
private Integer state;
|
||||
private String auditTime;
|
||||
private String auditUser;
|
||||
private List<AttachmentsDTO> attachments;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.dto.decoration;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 14:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class TrackDataDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String person;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String date;
|
||||
|
||||
private Integer RepalyId;
|
||||
|
||||
private List<FileDTO> file;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.decoration.DecorationDTO;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 14:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface YlfService {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
DecorationDTO getDecoration(Long id) ;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.decoration.DecorationDTO;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/4/28 14:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class YlfServiceImpl implements YlfService {
|
||||
|
||||
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) {
|
||||
url = String.format("%s%d", url, id);
|
||||
try {
|
||||
String forObject = httpRestTemplateService.getForObject(url, String.class, new HashMap<>());
|
||||
Integer status = (Integer) JSONObject.parseObject(forObject, JSONObject.class).get("status");
|
||||
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){
|
||||
return null;
|
||||
}
|
||||
List<DecorationDTO> list = (List<DecorationDTO>) ((JSONObject) JSONObject.parseObject(forObject, JSONObject.class).get("data")).get("rows");
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
return list.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user