You've already forked FrameTour-BE
修改bug
This commit is contained in:
@ -81,4 +81,10 @@ public class AppMemberController {
|
|||||||
|
|
||||||
return ApiResponse.success("");
|
return ApiResponse.success("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("新增或修改景区服务通知状态")
|
||||||
|
public ApiResponse updateScenicServiceNoticeStatus(Long scenicId) {
|
||||||
|
return memberService.updateScenicServiceNoticeStatus(scenicId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,9 @@ package com.ycwl.basic.mapper.pc;
|
|||||||
import com.ycwl.basic.model.pc.member.entity.MemberEntity;
|
import com.ycwl.basic.model.pc.member.entity.MemberEntity;
|
||||||
import com.ycwl.basic.model.pc.member.req.MemberReqQuery;
|
import com.ycwl.basic.model.pc.member.req.MemberReqQuery;
|
||||||
import com.ycwl.basic.model.pc.member.resp.MemberRespVO;
|
import com.ycwl.basic.model.pc.member.resp.MemberRespVO;
|
||||||
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -19,4 +21,28 @@ public interface MemberMapper {
|
|||||||
int add(MemberEntity member);
|
int add(MemberEntity member);
|
||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
int update(MemberEntity member);
|
int update(MemberEntity member);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改景区服务通知状态
|
||||||
|
* @param scenicId 景区id
|
||||||
|
* @param memberId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateScenicServiceNoticeStatus(@Param("scenicId") Long scenicId,@Param("memberId") Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户当前景区服务通知状态
|
||||||
|
* @param scenicId 景区id
|
||||||
|
* @param memberId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getScenicServiceNoticeStatus(@Param("scenicId") Long scenicId,@Param("memberId") Long memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加景区服务通知状态
|
||||||
|
* @param scenicId
|
||||||
|
* @param memberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int addScenicServiceNoticeStatus(@Param("scenicId") Long scenicId,@Param("memberId") Long memberId);
|
||||||
}
|
}
|
||||||
|
@ -75,4 +75,6 @@ public class MemberRespVO {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date updateAt;
|
private Date updateAt;
|
||||||
private Integer orderCount;
|
private Integer orderCount;
|
||||||
|
@ApiModelProperty("是否开启服务通知 0关闭 1开启")
|
||||||
|
private Integer isServiceNotification;
|
||||||
}
|
}
|
||||||
|
@ -139,4 +139,27 @@ public class AppMemberServiceImpl implements AppMemberService {
|
|||||||
memberEntity.setAgreement(AgreementEnum.AGREE.getType());
|
memberEntity.setAgreement(AgreementEnum.AGREE.getType());
|
||||||
return ApiResponse.success(memberMapper.update(memberEntity));
|
return ApiResponse.success(memberMapper.update(memberEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse updateScenicServiceNoticeStatus(Long scenicId) {
|
||||||
|
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||||
|
Integer scenicServiceNoticeStatus = memberMapper.getScenicServiceNoticeStatus(scenicId, worker.getUserId());
|
||||||
|
//没有就初始化为开启
|
||||||
|
if(scenicServiceNoticeStatus==null){
|
||||||
|
int i = memberMapper.addScenicServiceNoticeStatus(scenicId, worker.getUserId());
|
||||||
|
if(i>0){
|
||||||
|
return ApiResponse.success("成功");
|
||||||
|
}else {
|
||||||
|
return ApiResponse.fail("失败");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
// 有就修改
|
||||||
|
int i = memberMapper.updateScenicServiceNoticeStatus(scenicId, worker.getUserId());
|
||||||
|
if (i == 0) {
|
||||||
|
return ApiResponse.fail("失败");
|
||||||
|
}
|
||||||
|
return ApiResponse.success("成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());
|
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());
|
||||||
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
goodsDetailVO.setTemplateCoverUrl(videoRespVO.getTemplateCoverUrl());
|
||||||
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
|
goodsDetailVO.setCreateTime(videoRespVO.getCreateTime());
|
||||||
goodsDetailVO.setPrice(videoRespVO.getTemplatePrice());
|
BigDecimal templatePrice = videoRespVO.getTemplatePrice();
|
||||||
|
goodsDetailVO.setPrice(templatePrice==null ? null : templatePrice.setScale(2));
|
||||||
goodsDetailVO.setIsBuy(videoRespVO.getIsBuy());
|
goodsDetailVO.setIsBuy(videoRespVO.getIsBuy());
|
||||||
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(videoRespVO.getScenicId(), -1L);
|
ScenicDeviceCountVO scenicDeviceCountVO = deviceMapper.deviceCountByScenicId(videoRespVO.getScenicId(), -1L);
|
||||||
goodsDetailVO.setLensNum(scenicDeviceCountVO.getTotalDeviceCount());
|
goodsDetailVO.setLensNum(scenicDeviceCountVO.getTotalDeviceCount());
|
||||||
|
@ -51,5 +51,5 @@ public interface AppMemberService {
|
|||||||
ApiResponse<?> agreement();
|
ApiResponse<?> agreement();
|
||||||
|
|
||||||
|
|
||||||
|
ApiResponse updateScenicServiceNoticeStatus(Long scenicId);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
values (#{id}, #{openId}, #{avatarUrl},#{nickname}, #{realName}, #{promoCode}, #{brokerId}, #{agreement}, #{phone},
|
values (#{id}, #{openId}, #{avatarUrl},#{nickname}, #{realName}, #{promoCode}, #{brokerId}, #{agreement}, #{phone},
|
||||||
#{country}, #{province}, #{city})
|
#{country}, #{province}, #{city})
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="addScenicServiceNoticeStatus">
|
||||||
|
insert into scenic_notification(member_id, scenic_id, `status`)
|
||||||
|
values (#{memberId}, #{scenicId}, 1)
|
||||||
|
</insert>
|
||||||
<update id="update">
|
<update id="update">
|
||||||
update member
|
update member
|
||||||
<set>
|
<set>
|
||||||
@ -46,6 +50,17 @@
|
|||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateScenicServiceNoticeStatus">
|
||||||
|
update scenic_notification
|
||||||
|
set status = (
|
||||||
|
case status
|
||||||
|
when 0 then 1
|
||||||
|
when 1 then 0
|
||||||
|
else status
|
||||||
|
end
|
||||||
|
)
|
||||||
|
where member_id = #{memberId} and scenic_id = #{scenicId}
|
||||||
|
</update>
|
||||||
<delete id="deleteById">
|
<delete id="deleteById">
|
||||||
delete
|
delete
|
||||||
from member
|
from member
|
||||||
@ -105,4 +120,9 @@
|
|||||||
from member
|
from member
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getScenicServiceNoticeStatus" resultType="java.lang.Integer">
|
||||||
|
select status
|
||||||
|
from scenic_notification
|
||||||
|
where member_id = #{memberId} and scenic_id = #{scenicId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Reference in New Issue
Block a user