Compare commits
2 Commits
0cbbd803b4
...
b539f77b70
Author | SHA1 | Date |
---|---|---|
|
b539f77b70 | |
|
2f07105a26 |
|
@ -550,7 +550,11 @@ public class UserController {
|
||||||
|
|
||||||
@PostMapping("/giveUserVip")
|
@PostMapping("/giveUserVip")
|
||||||
@ApiOperation("赠送用户会员")
|
@ApiOperation("赠送用户会员")
|
||||||
public Result giveUserVip(Long userId,Integer day){
|
public Result giveUserVip(Long userId,Integer type){
|
||||||
|
Integer day = 0;
|
||||||
|
if(type == 0) day = 30;
|
||||||
|
if(type == 1) day = 90;
|
||||||
|
if(type == 2) day = 360;
|
||||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
//查看用户是否是会员
|
//查看用户是否是会员
|
||||||
UserVip userVip = userVipDao.selectOne(new QueryWrapper<UserVip>().eq("user_id", userId));
|
UserVip userVip = userVipDao.selectOne(new QueryWrapper<UserVip>().eq("user_id", userId));
|
||||||
|
@ -568,7 +572,7 @@ public class UserController {
|
||||||
}else{
|
}else{
|
||||||
userVip=new UserVip();
|
userVip=new UserVip();
|
||||||
//设置会员类型
|
//设置会员类型
|
||||||
userVip.setVipNameType(1);
|
userVip.setVipNameType(type);
|
||||||
//设置开通会员的用户id
|
//设置开通会员的用户id
|
||||||
userVip.setUserId(userId);
|
userVip.setUserId(userId);
|
||||||
//设置会员的购买时间
|
//设置会员的购买时间
|
||||||
|
@ -673,4 +677,4 @@ public class UserController {
|
||||||
public Result integralPc(String type,Integer current,Integer size,String date,String artificerId) throws ParseException {
|
public Result integralPc(String type,Integer current,Integer size,String date,String artificerId) throws ParseException {
|
||||||
return Result.success(userService.integralPc(type,current,size,date,artificerId));
|
return Result.success(userService.integralPc(type,current,size,date,artificerId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.sqx.modules.shipinquan.content;
|
package com.sqx.modules.shipinquan.content;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.shipinquan.entity.BlShipinquan;
|
import com.sqx.modules.shipinquan.entity.BlShipinquan;
|
||||||
import com.sqx.modules.shipinquan.service.BlShipinquanService;
|
import com.sqx.modules.shipinquan.service.BlShipinquanService;
|
||||||
|
@ -25,6 +26,15 @@ public class BlShipinquanController {
|
||||||
return service.findPage(page,limit,entity);
|
return service.findPage(page,limit,entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/dataSelectSpq")
|
||||||
|
@ApiOperation("获取数据未审批数据")
|
||||||
|
public Result dataSelectSpq(){
|
||||||
|
QueryWrapper<BlShipinquan> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("status",0);
|
||||||
|
return Result.success().put("data",service.count(qw));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("添加")
|
@ApiOperation("添加")
|
||||||
public Result add(BlShipinquan BlShipinquan){
|
public Result add(BlShipinquan BlShipinquan){
|
||||||
|
|
|
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
|
import com.sqx.modules.shipinquan.entity.BlShipinquan;
|
||||||
import com.sqx.modules.shipinquan.entity.BlShipinquanPinglun;
|
import com.sqx.modules.shipinquan.entity.BlShipinquanPinglun;
|
||||||
import com.sqx.modules.shipinquan.service.BlShipinquanPinglunService;
|
import com.sqx.modules.shipinquan.service.BlShipinquanPinglunService;
|
||||||
|
import com.sqx.modules.shipinquan.service.BlShipinquanService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -23,6 +26,10 @@ public class BlShipinquanPinglunController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BlShipinquanPinglunService service;
|
private BlShipinquanPinglunService service;
|
||||||
|
@Autowired
|
||||||
|
private BlShipinquanPinglunService pinglunservice;
|
||||||
|
@Autowired
|
||||||
|
private BlShipinquanService spqService;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
|
@ -54,6 +61,15 @@ public class BlShipinquanPinglunController {
|
||||||
@ApiOperation("删除")
|
@ApiOperation("删除")
|
||||||
public Result delete(BlShipinquanPinglun BlShipinquanPinglun){
|
public Result delete(BlShipinquanPinglun BlShipinquanPinglun){
|
||||||
service.removeById(BlShipinquanPinglun.getId());
|
service.removeById(BlShipinquanPinglun.getId());
|
||||||
|
|
||||||
|
QueryWrapper<BlShipinquanPinglun> query = new QueryWrapper<BlShipinquanPinglun>();
|
||||||
|
query.eq("shipinquan_id", BlShipinquanPinglun.getShipinquanId());
|
||||||
|
List<BlShipinquanPinglun> list = pinglunservice.list(query);
|
||||||
|
|
||||||
|
BlShipinquan blShipinquan = spqService.getById(BlShipinquanPinglun.getShipinquanId());
|
||||||
|
blShipinquan.setPls(list.size());
|
||||||
|
spqService.updateById(blShipinquan);
|
||||||
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,9 @@ public class BlShipinquan implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long approveUser;
|
private Long approveUser;
|
||||||
|
|
||||||
|
//置顶排序 0为不置顶
|
||||||
|
private Integer topSort;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String artificerImg;
|
private String artificerImg;
|
||||||
|
|
||||||
|
@ -71,4 +74,6 @@ public class BlShipinquan implements Serializable {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer onLine;//在线状态
|
private Integer onLine;//在线状态
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer isTop;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
a.pic_path,
|
a.pic_path,
|
||||||
a.status,
|
a.status,
|
||||||
a.opinion,
|
a.opinion,
|
||||||
|
a.top_sort topSort,
|
||||||
b.status as onLine,
|
b.status as onLine,
|
||||||
b.artificer_id as create_by,
|
b.artificer_id as create_by,
|
||||||
b.artificer_name as artificer_name,
|
b.artificer_name as artificer_name,
|
||||||
|
@ -48,15 +49,21 @@
|
||||||
<if test="params.status!=null and params.status!=''">
|
<if test="params.status!=null and params.status!=''">
|
||||||
and a.status = #{params.status}
|
and a.status = #{params.status}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.isTop!=null and params.isTop == 0">
|
||||||
|
and a.top_sort = 0
|
||||||
|
</if>
|
||||||
|
<if test="params.isTop!=null and params.isTop == 1">
|
||||||
|
and a.top_sort > 0
|
||||||
|
</if>
|
||||||
<if test="params.artificerName!=null and params.artificerName!=''">
|
<if test="params.artificerName!=null and params.artificerName!=''">
|
||||||
and b.artificer_name like concat('%',#{params.artificerName},'%')
|
and b.artificer_name like concat('%',#{params.artificerName},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
<if test="params.longitude!=null and params.longitude!='' and params.latitude!=null and params.latitude!=''">
|
<if test="params.longitude!=null and params.longitude!='' and params.latitude!=null and params.latitude!=''">
|
||||||
order by (st_distance (point (b.longitude, b.latitude),point(#{params.longitude},#{params.longitude}) ) *111195) asc,a.create_time desc
|
order by a.top_sort desc, (st_distance (point (b.longitude, b.latitude),point(#{params.longitude},#{params.longitude}) ) *111195) asc,a.create_time desc
|
||||||
</if>
|
</if>
|
||||||
<if test="params.longitude==null or params.longitude=='' or params.latitude==null or params.latitude==''">
|
<if test="params.longitude==null or params.longitude=='' or params.latitude==null or params.latitude==''">
|
||||||
order by a.create_time desc
|
order by a.top_sort desc,a.create_time desc
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -69,4 +76,4 @@
|
||||||
where id=#{id}
|
where id=#{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
a.create_time,
|
a.create_time,
|
||||||
a.content,
|
a.content,
|
||||||
a.shipinquan_id,
|
a.shipinquan_id,
|
||||||
b.user_name as user_name,
|
IFNULL(b.user_name, '匿名') AS user_name,
|
||||||
b.avatar as user_photo
|
b.avatar as user_photo
|
||||||
from bl_shipinquan_pinglun a
|
from bl_shipinquan_pinglun a
|
||||||
LEFT JOIN tb_user b on a.create_by = b.user_id
|
LEFT JOIN tb_user b on a.create_by = b.user_id
|
||||||
|
@ -25,4 +25,4 @@
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue