在小程序后台返回订单时候添加返回项目号与耳机订单名称

上级 bb21775c
......@@ -119,4 +119,10 @@ public class ServiceOrderFormDetailsDTO {
@ApiModelProperty(value = "订单对应的项目号")
private String projectCode;
@ApiModelProperty(value = "二级服务id")
private Integer inspectionId;
@ApiModelProperty(value = "二级服务名称")
private String inspectionName;
}
......@@ -201,4 +201,13 @@ public class RequirementsInfoVO implements Serializable {
@ApiModelProperty(value = "管理员操作")
private int teamStatus;
@ApiModelProperty(value = "二级分类id")
private int inspectionId;
@ApiModelProperty(value = "项目号")
private String projectCode;
@ApiModelProperty(value = "二级分类名称")
private String inspectionName;
}
......@@ -35,4 +35,6 @@ public class IndustryTypeDTO implements Serializable {
private Date createTime;
@ApiModelProperty(value = "服务列表")
private List<InspectionDTO> inspectionDTOS;
@ApiModelProperty(value = "二级分类名称")
private String inspectionName;
}
......@@ -189,6 +189,12 @@ public class RequirementsInfoDO implements Serializable {
@ApiModelProperty(value = "管理员操作")
private int teamStatus;
@ApiModelProperty(value = "二级分类id")
private int inspectionId;
@ApiModelProperty(value = "项目号")
private String projectCode;
public RequirementsInfoVO buildRequirementsInfoVO() {
return RequirementsInfoVO.builder().id(this.id).requirementTypeId(this.requirementTypeId).userAccountId(this.userAccountId).publishName(this.publishName)
.publishPhone(this.publishPhone).requireDescription(this.requireDescription).solved(this.solved).taskStartTime(this.taskStartTime).taskEndTime(this.taskEndTime)
......@@ -228,6 +234,8 @@ public class RequirementsInfoDO implements Serializable {
.serviceFlowId(this.serviceFlowId)
.teamStatus(this.teamStatus)
.tempId(this.tempId)
.inspectionId(this.inspectionId)
.projectCode(this.projectCode)
.build();
}
......
......@@ -116,6 +116,9 @@ public class ServiceOrderFormDetailsDO {
@ApiModelProperty(value = "订单对应的项目号")
private String projectCode;
@ApiModelProperty(value = "二级服务id")
private Integer inspectionId;
public ServiceOrderFormDetailsDTO buildOrderFormDetails() {
return ServiceOrderFormDetailsDTO.builder()
......@@ -146,6 +149,7 @@ public class ServiceOrderFormDetailsDO {
.duty(this.duty)
.decisionContent(this.decisionContent)
.projectCode(this.projectCode)
.inspectionId(this.inspectionId)
.build();
}
}
package com.mmc.csf.release.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.config.IsNullConvertZeroUtil;
......@@ -16,11 +17,15 @@ import com.mmc.csf.release.entity.requirements.ServiceOrderFormDO;
import com.mmc.csf.release.entity.requirements.ServiceOrderFormDetailsDO;
import com.mmc.csf.release.enums.ServiceIdEnum;
import com.mmc.csf.release.feign.UserAppApi;
import com.mmc.csf.release.industry.IndustryTypeDTO;
import com.mmc.csf.release.service.BackRequirementsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.util.List;
......@@ -43,11 +48,15 @@ public class BackRequirementsServiceImpl implements BackRequirementsService {
private RequirementsDao requirementsDao;
@Autowired
private RestTemplate restTemplate;
@Autowired
private UserAppApi userAppApi;
@Autowired
private OrderAmountDetailDao orderAmountDetailDao;
@Value("${iuav.pmsapp.url}")
private String pmsApp;
@Override
public PageResult serviceOrderFormList(ServiceOrderQO param, LoginSuccessDTO userLoginInfoFromRedis) {
......@@ -145,6 +154,11 @@ public class BackRequirementsServiceImpl implements BackRequirementsService {
}
ServiceOrderFormDetailsDO orderFormDetailsDO = backRequirementsDao.serviceOrderFormDetails(requirementsInfoId);
ServiceOrderFormDetailsDTO serviceOrderFormDetailsDTO = orderFormDetailsDO.buildOrderFormDetails();
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(serviceOrderFormDetailsDTO.getServiceId(),serviceOrderFormDetailsDTO.getInspectionId());
serviceOrderFormDetailsDTO.setInspectionName(industryTypeDTO.getInspectionName());
IsNullConvertZeroUtil.checkIsNull(serviceOrderFormDetailsDTO);
requireEveryStatusVO.setServiceOrderFormDetailsDTO(serviceOrderFormDetailsDTO);
......@@ -193,4 +207,20 @@ public class BackRequirementsServiceImpl implements BackRequirementsService {
orderAmountDetailDao.batchInsert(list);
return ResultBody.success();
}
public IndustryTypeDTO getIndustryTypeById(Integer serviceId, Integer inspectionId) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<>(null, headers);
String url = null;
if(inspectionId!=null){
url = String.format("%s/pms/industry/getIndustryTypeById?id=%s&inspectionId=%s", pmsApp, serviceId, inspectionId);
}else {
url = String.format("%s/pms/industry/getIndustryTypeById?id=%s", pmsApp, serviceId);
}
ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
String body = exchange.getBody();
IndustryTypeDTO industryTypeDTO = JSONObject.parseObject(body, IndustryTypeDTO.class);
return industryTypeDTO;
}
}
......@@ -249,8 +249,9 @@ public class RequirementsServiceImpl implements RequirementsService {
requirementsInfoVO.setPublishAccountId(requirementsInfoDO.getUserAccountId());
requirementsInfoVO.setRequirementsInfoId(requirementsInfoDO.getId());
//IndustryTypeDTO industryTypeDTO = pmsAppApi.feignQquerygetIndustryTypeById(requirementsInfoVO.getServiceId());
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsInfoVO.getServiceId());
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsInfoVO.getServiceId(),requirementsInfoVO.getInspectionId());
requirementsInfoVO.setServiceName(industryTypeDTO.getTypeName());
requirementsInfoVO.setInspectionName(industryTypeDTO.getInspectionName());
//已经支付
String s = stringRedisTemplate.opsForValue().get(requirementsInfoDO.getId().toString());
RequirementsInfoVO orderVO = JSON.parseObject(s, RequirementsInfoVO.class);
......@@ -2318,7 +2319,7 @@ public class RequirementsServiceImpl implements RequirementsService {
if (tempTotalAmount.compareTo(BigDecimal.ZERO) == 0) {
requirementsDao.InsertRequirementsAmountLog(requirementsInfoDO);
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsEditVO.getServiceId());
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsEditVO.getServiceId(),null);
infoDO.setServiceName(industryTypeDTO.getTypeName());
requirementsDao.updateRequirementsInfo(infoDO);
BigDecimal add = amountDO.getOrderAmount().add(requirementsInfoDO.getOrderLevelAmount());
......@@ -2819,7 +2820,7 @@ public class RequirementsServiceImpl implements RequirementsService {
}
}
}
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsInfoDO.getServiceId());
IndustryTypeDTO industryTypeDTO = getIndustryTypeById(requirementsInfoDO.getServiceId(),null);
requirementsInfoDO.setServiceName(industryTypeDTO.getTypeName());
requirementsInfoDO.setOpenid(openid);
// sum是1说明订单只需一个人 sum>1 说明是多人需要创建子订单
......@@ -3768,11 +3769,17 @@ public class RequirementsServiceImpl implements RequirementsService {
}
public IndustryTypeDTO getIndustryTypeById(Integer serviceId) {
public IndustryTypeDTO getIndustryTypeById(Integer serviceId,Integer inspectionId) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<>(null, headers);
ResponseEntity<String> exchange = restTemplate.exchange(pmsApp + "/pms/industry/getIndustryTypeById?id=+" + serviceId, HttpMethod.GET, entity, String.class);
String url = null;
if(inspectionId!=null){
url = String.format("%s/pms/industry/getIndustryTypeById?id=%s&inspectionId=%s", pmsApp, serviceId, inspectionId);
}else {
url = String.format("%s/pms/industry/getIndustryTypeById?id=%s", pmsApp, serviceId);
}
ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
String body = exchange.getBody();
IndustryTypeDTO industryTypeDTO = JSONObject.parseObject(body, IndustryTypeDTO.class);
return industryTypeDTO;
......
......@@ -201,7 +201,8 @@
sf.doing,
ra.order_earnings,
csi.decision_content,
csi.duty
csi.duty,
ri.inspection_id
FROM
requirements_info ri
LEFT JOIN requirements_amount ra ON ri.id = ra.requirements_info_id
......
......@@ -501,7 +501,9 @@
rau.url AS afterModificationUrl,
rs.pilot_certification_user_id AS pilotCertificationUserId,
rs.preempt_phone AS preemptPhone,
rs.pilot_certification_id
rs.pilot_certification_id,
ri.inspection_id,
ri.project_code
FROM requirements_info ri
LEFT JOIN requirements_type rt
ON rt.id = ri.requirement_type_id
......@@ -1787,7 +1789,9 @@
rau.url AS afterModificationUrl,
rs.pilot_certification_user_id AS pilotCertificationUserId,
rs.preempt_phone AS preemptPhone,
rs.pilot_certification_id
rs.pilot_certification_id,
ri.inspection_id,
ri.project_code
FROM requirements_info ri
LEFT JOIN requirements_type rt
ON rt.id = ri.requirement_type_id
......@@ -2141,7 +2145,9 @@
rau.url AS afterModificationUrl,
rs.pilot_certification_user_id AS pilotCertificationUserId,
rs.pilot_certification_id,
rs.team_status
rs.team_status,
ri.inspection_id,
ri.project_code
FROM requirements_info ri
LEFT JOIN requirements_type rt
ON rt.id = ri.requirement_type_id
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论