我的发布--添加--查看发布详情
This commit is contained in:
parent
6c066f86e1
commit
ed247ff62e
@ -1189,9 +1189,25 @@ public class AppSystemController extends BaseController {
|
||||
@GetMapping("/getUserPublishWorkDetail/{workId}")
|
||||
public AjaxResult getUserPublishWorkDetail(@PathVariable("workId") Long workId) {
|
||||
|
||||
UserWork userWork = userWorkService.selectUserWorkByWorkId(workId);
|
||||
UserPublishWorkDetailDto userPublishWorkDetail = userWorkService.getUserPublishWorkDetail(workId);
|
||||
|
||||
return success();
|
||||
//----------------------------------查看该作品所属的资源位----------------------------------------------
|
||||
List<UserPublishWorkSourceListDto> sourceList = sysSourceService.getUserPublishWorkSourceList(workId);
|
||||
|
||||
for(UserPublishWorkSourceListDto userPublishWorkSourceListDto: sourceList){
|
||||
userPublishWorkSourceListDto.setSource(userPublishWorkSourceListDto.getCity()+userPublishWorkSourceListDto.getScenic()+userPublishWorkSourceListDto.getPart()+userPublishWorkSourceListDto.getCoordinate());
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
long daysBetween = ChronoUnit.DAYS.between(now, userPublishWorkSourceListDto.getEndTime());
|
||||
|
||||
|
||||
userPublishWorkSourceListDto.setrDays(daysBetween);
|
||||
}
|
||||
//-----------------------------------查看该作品所属资源位end---------------------------------------------
|
||||
|
||||
userPublishWorkDetail.setSourceList(sourceList);
|
||||
|
||||
return success(userPublishWorkDetail);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ public class UserPublishWorkDetailDto {
|
||||
private String nickName;
|
||||
private String avatar;
|
||||
|
||||
private List<SysSource> sourceList;
|
||||
private List<UserPublishWorkSourceListDto> sourceList;
|
||||
|
||||
|
||||
|
||||
@ -109,11 +109,11 @@ public class UserPublishWorkDetailDto {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public List<SysSource> getSourceList() {
|
||||
public List<UserPublishWorkSourceListDto> getSourceList() {
|
||||
return sourceList;
|
||||
}
|
||||
|
||||
public void setSourceList(List<SysSource> sourceList) {
|
||||
public void setSourceList(List<UserPublishWorkSourceListDto> sourceList) {
|
||||
this.sourceList = sourceList;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,96 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/*
|
||||
* 我的---我的--我的发布(在具体资源位上的作品)--点击详情中的作品位于那个资源位上的信息
|
||||
* */
|
||||
public class UserPublishWorkSourceListDto {
|
||||
|
||||
private Long sourceId;
|
||||
private String city;
|
||||
private String scenic;
|
||||
private String part;
|
||||
private String coordinate;
|
||||
private LocalDate startTime;
|
||||
private LocalDate endTime;
|
||||
|
||||
private String source;
|
||||
private Long rDays;
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getScenic() {
|
||||
return scenic;
|
||||
}
|
||||
|
||||
public void setScenic(String scenic) {
|
||||
this.scenic = scenic;
|
||||
}
|
||||
|
||||
public String getPart() {
|
||||
return part;
|
||||
}
|
||||
|
||||
public void setPart(String part) {
|
||||
this.part = part;
|
||||
}
|
||||
|
||||
public String getCoordinate() {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
public void setCoordinate(String coordinate) {
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
public LocalDate getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(LocalDate startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public LocalDate getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(LocalDate endTime) {
|
||||
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Long getrDays() {
|
||||
return rDays;
|
||||
}
|
||||
|
||||
public void setrDays(Long rDays) {
|
||||
this.rDays = rDays;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.ruoyi.system.domain.SysSource;
|
||||
import com.ruoyi.system.domain.dto.HotSourceDto;
|
||||
import com.ruoyi.system.domain.dto.SourceListDto;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import com.ruoyi.system.domain.dto.UserPublishWorkSourceListDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@ -75,4 +76,9 @@ public interface SysSourceMapper
|
||||
public List<HotSourceDto> getHotSource();
|
||||
|
||||
public int updateSysSourceByCP(SysSource sysSource);
|
||||
|
||||
/*
|
||||
* 查看我的发布资源位详情
|
||||
* */
|
||||
public List<UserPublishWorkSourceListDto> getUserPublishWorkSourceList(Long workId);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.UserWork;
|
||||
import com.ruoyi.system.domain.dto.UserPublishWorkDetailDto;
|
||||
import com.ruoyi.system.domain.dto.UserWorkReviewDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -72,4 +73,10 @@ public interface UserWorkMapper
|
||||
* 内容审核获取用户作品列表
|
||||
* */
|
||||
public List<UserWorkReviewDto> getAllUserWork(UserWork userWork);
|
||||
|
||||
/*
|
||||
*
|
||||
* 查看发布作品详情
|
||||
* */
|
||||
public UserPublishWorkDetailDto getUserPublishWorkDetail(Long workId);
|
||||
}
|
||||
|
||||
@ -2,10 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysSource;
|
||||
import com.ruoyi.system.domain.dto.ChangeSourcePriceDto;
|
||||
import com.ruoyi.system.domain.dto.HotSourceDto;
|
||||
import com.ruoyi.system.domain.dto.SourceListDto;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import com.ruoyi.system.domain.dto.*;
|
||||
|
||||
/**
|
||||
* 资源位Service接口
|
||||
@ -87,4 +84,9 @@ public interface ISysSourceService
|
||||
public List<HotSourceDto> getHotSource();
|
||||
|
||||
public int updateSysSourceByCP(SysSource sysSource);
|
||||
|
||||
/*
|
||||
* 查看我的发布资源位详情
|
||||
* */
|
||||
public List<UserPublishWorkSourceListDto> getUserPublishWorkSourceList(Long workId);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.system.service;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.UserWork;
|
||||
import com.ruoyi.system.domain.dto.UserPublishWorkDetailDto;
|
||||
import com.ruoyi.system.domain.dto.UserWorkReviewDto;
|
||||
|
||||
/**
|
||||
@ -73,4 +74,11 @@ public interface IUserWorkService
|
||||
* 内容审核获取用户作品列表
|
||||
* */
|
||||
public List<UserWorkReviewDto> getAllUserWork(UserWork userWork);
|
||||
|
||||
/*
|
||||
*
|
||||
* 查看发布作品详情
|
||||
* */
|
||||
public UserPublishWorkDetailDto getUserPublishWorkDetail(Long workId);
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
import com.ruoyi.system.domain.dto.HotSourceDto;
|
||||
import com.ruoyi.system.domain.dto.SourceListDto;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import com.ruoyi.system.domain.dto.UserPublishWorkSourceListDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysSourceMapper;
|
||||
@ -121,4 +122,12 @@ public class SysSourceServiceImpl implements ISysSourceService
|
||||
public int updateSysSourceByCP(SysSource sysSource){
|
||||
return sysSourceMapper.updateSysSourceByCP(sysSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*
|
||||
* 查看我的发布资源位详情
|
||||
* */
|
||||
public List<UserPublishWorkSourceListDto> getUserPublishWorkSourceList(Long workId){
|
||||
return sysSourceMapper.getUserPublishWorkSourceList(workId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.dto.UserPublishWorkDetailDto;
|
||||
import com.ruoyi.system.domain.dto.UserWorkReviewDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -110,4 +111,13 @@ public class UserWorkServiceImpl implements IUserWorkService
|
||||
public List<UserWorkReviewDto> getAllUserWork(UserWork userWork ){
|
||||
return userWorkMapper.getAllUserWork(userWork);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*
|
||||
*
|
||||
* 查看发布作品详情
|
||||
* */
|
||||
public UserPublishWorkDetailDto getUserPublishWorkDetail(Long workId){
|
||||
return userWorkMapper.getUserPublishWorkDetail(workId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +52,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="UserPublishWorkSourceListDtoResult" type="UserPublishWorkSourceListDto">
|
||||
<result property="sourceId" column="source_id" />
|
||||
<result property="city" column="city" />
|
||||
<result property="scenic" column="scenic" />
|
||||
<result property="part" column="part" />
|
||||
<result property="coordinate" column="coordinate" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectSysSourceVo">
|
||||
select source_id, city_id, city, scenic_id, scenic, part, scale, coordinate, price, source_status, work_address, start_time, end_time, b_bought, order_id from sys_source
|
||||
</sql>
|
||||
@ -113,6 +125,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by b_bought desc
|
||||
limit 6
|
||||
</select>
|
||||
<select id="getUserPublishWorkSourceList" resultMap="UserPublishWorkSourceListDtoResult">
|
||||
|
||||
select source_id, city, scenic, part, coordinate, start_time, end_time
|
||||
from sys_source
|
||||
where work_id = #{workId}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertSysSource" parameterType="SysSource" useGeneratedKeys="true" keyProperty="sourceId">
|
||||
insert into sys_source
|
||||
|
||||
@ -39,6 +39,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="part" column="part" />
|
||||
<result property="city" column="city" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="UserPublishWorkDetailDtoResult" type="UserPublishWorkDetailDto">
|
||||
<result property="workId" column="work_id" />
|
||||
<result property="workName" column="work_name" />
|
||||
<result property="workAddress" column="work_address" />
|
||||
<result property="detail" column="detail" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="receiveRockets" column="receive_rockets" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="avatar" column="avatar" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserWorkVo">
|
||||
select work_id, user_id, work_name, work_address, coordinate, create_time, post_time, work_status, audit_opinion, source_id, price, receive_rockets, detail, delete_flag, scenic, part, city from user_work
|
||||
@ -189,5 +202,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from user_work
|
||||
where work_status != "0" and user_id = #{userId}
|
||||
|
||||
</select>
|
||||
<select id="getUserPublishWorkDetail" resultMap="UserPublishWorkDetailDtoResult">
|
||||
|
||||
select w.work_id, w.work_name, w.work_address, w.detail, w.create_time, w.receive_rockets, u.user_id, u.nick_name, u.avatar
|
||||
from user_work w
|
||||
left join sys_user u
|
||||
on w.user_id = u.user_id
|
||||
where w.work_id = #{workId}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user