Commit 8e73aaf6 authored by mlchun's avatar mlchun

1.查询订单ID详情返回添加图片List等

parent 4e4af1d1
package io.hmit.modules.serviceOrder.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
......
......@@ -72,5 +72,5 @@ mybatis-plus:
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
QR:
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/bl_workorder/myfile/
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/
download-path: /home/websoft/java_jar/pension_service/myfile/
......@@ -13,6 +13,7 @@ import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.dto.ReservationDTO;
import io.hmit.modules.serviceOrder.service.PensionOrderDocumentService;
import io.hmit.modules.serviceOrder.service.PensionOrderService;
import io.hmit.service.UserService;
import io.swagger.annotations.Api;
......@@ -42,6 +43,9 @@ public class PensionOrderController {
@Autowired
private UserService userService;
@Autowired
private PensionOrderDocumentService pensionOrderDocumentService;
@Login
@GetMapping("page")
@ApiOperation("全部订单(志愿者)")
......@@ -289,7 +293,9 @@ public class PensionOrderController {
@ApiOperation("信息")
public Result<PensionOrderDTO> get(@PathVariable("id") Long id){
PensionOrderDTO data = pensionOrderService.get(id);
data.setStaffImages(pensionOrderDocumentService.findByOrderIdAndRemark(id, "1"));
data.setStaffVoiceMessage(pensionOrderDocumentService.findStaffVoiceId(id));
data.setUserImages(pensionOrderDocumentService.findByOrderIdAndRemark(id, "3"));
return new Result<PensionOrderDTO>().ok(data);
}
......
package io.hmit.modules.serviceOrder.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderDocumentEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 订单及相关图片附件关联表
*
......@@ -12,5 +15,9 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface PensionOrderDocumentDao extends BaseDao<PensionOrderDocumentEntity> {
List<PensionOrderDocumentDTO> findByOrderIdAndRemark(Long orderId, String remark);
PensionOrderDocumentDTO findStaffVoiceId(Long orderId);
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.hmit.common.constant.Constant;
import io.hmit.entity.UserEntity;
import io.swagger.annotations.ApiModel;
......@@ -9,6 +10,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.UUID;
......@@ -56,6 +58,7 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "预约时间")
private Date appointmentTime;
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModelProperty(value = "取消原因")
private String cancelReason;
......@@ -77,7 +80,6 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "服务内容描述")
private String content;
@JsonIgnore
@ApiModelProperty(value = "实际金额")
private String actPrice;
......@@ -111,6 +113,18 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "所属社区Id")
private Long communityId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModelProperty(value = "用户评论照片")
private List<PensionOrderDocumentDTO> userImages;
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModelProperty(value = "服务人员评论照片")
private List<PensionOrderDocumentDTO> staffImages;
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModelProperty(value = "服务人员语音")
private PensionOrderDocumentDTO staffVoiceMessage;
public PensionOrderDTO assemblePensionOrder(ReservationDTO reservationDTO, UserEntity user){
PensionOrderDTO pensionOrder = new PensionOrderDTO();
pensionOrder.setOrderNum("");
......
......@@ -4,6 +4,8 @@ import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderDocumentEntity;
import java.util.List;
/**
* 订单及相关图片附件关联表
*
......@@ -12,4 +14,8 @@ import io.hmit.modules.serviceOrder.entity.PensionOrderDocumentEntity;
*/
public interface PensionOrderDocumentService extends CrudService<PensionOrderDocumentEntity, PensionOrderDocumentDTO> {
List<PensionOrderDocumentDTO> findByOrderIdAndRemark(Long id, String reamrk);
PensionOrderDocumentDTO findStaffVoiceId(Long orderId);
}
\ No newline at end of file
......@@ -7,8 +7,10 @@ import io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderDocumentEntity;
import io.hmit.modules.serviceOrder.service.PensionOrderDocumentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
......@@ -30,5 +32,16 @@ public class PensionOrderDocumentServiceImpl extends CrudServiceImpl<PensionOrde
return wrapper;
}
@Autowired
private PensionOrderDocumentDao dao;
@Override
public List<PensionOrderDocumentDTO> findByOrderIdAndRemark(Long id, String remark) {
return dao.findByOrderIdAndRemark(id, remark);
}
@Override
public PensionOrderDocumentDTO findStaffVoiceId(Long orderId) {
return dao.findStaffVoiceId(orderId);
}
}
\ No newline at end of file
......@@ -16,5 +16,14 @@
<result property="updateDate" column="update_date"/>
</resultMap>
<select id="findByOrderIdAndRemark" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO">
SELECT * FROM pension_order_document
WHERE order_id = #{orderId} AND remark = #{remark}
</select>
<select id="findStaffVoiceId" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO">
SELECT * FROM pension_order_document
WHERE order_id = #{orderId} AND remark = '2'
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment