Compare commits
2 Commits
b539f77b70
...
124db16329
Author | SHA1 | Date |
---|---|---|
|
124db16329 | |
|
bddf97a9a1 |
|
@ -47,10 +47,10 @@ public class CouponController extends AbstractController {
|
||||||
|
|
||||||
@ApiOperation("管理端赠送用户优惠券")
|
@ApiOperation("管理端赠送用户优惠券")
|
||||||
@GetMapping(value = "/giveCoupon")
|
@GetMapping(value = "/giveCoupon")
|
||||||
public Result giveCoupon(Long couponId, String userIds, Long shopId){
|
public Result giveCoupon(Long couponId, String userIds, Long shopId,@RequestParam(value = "amount",required = false) Integer amount){
|
||||||
String[] userId = userIds.split(",");
|
String[] userId = userIds.split(",");
|
||||||
List<String> userIdList = Arrays.asList(userId);
|
List<String> userIdList = Arrays.asList(userId);
|
||||||
return couponService.giveCoupon(couponId, userIdList, shopId);
|
return couponService.giveCoupon(couponId, userIdList, shopId,amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,6 @@ public interface CouponService extends IService<Coupon> {
|
||||||
|
|
||||||
Result selectCouponList(Integer page, Integer limit);
|
Result selectCouponList(Integer page, Integer limit);
|
||||||
|
|
||||||
Result giveCoupon(Long couponId, List<String> userIdList, Long shopId);
|
Result giveCoupon(Long couponId, List<String> userIdList, Long shopId, Integer amount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponDao, Coupon> implements
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public Result giveCoupon(Long couponId, List<String> userIdList, Long shopId) {
|
public Result giveCoupon(Long couponId, List<String> userIdList, Long shopId, Integer amount) {
|
||||||
Coupon coupon = couponDao.selectById(couponId);
|
Coupon coupon = couponDao.selectById(couponId);
|
||||||
//计算优惠券过期时间
|
//计算优惠券过期时间
|
||||||
Integer endDate = coupon.getEndDate();
|
Integer endDate = coupon.getEndDate();
|
||||||
|
@ -70,8 +70,11 @@ public class CouponServiceImpl extends ServiceImpl<CouponDao, Coupon> implements
|
||||||
Date date = calendar.getTime();
|
Date date = calendar.getTime();
|
||||||
String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||||
String expirationTime = new SimpleDateFormat("yyyy-MM-dd").format(date);
|
String expirationTime = new SimpleDateFormat("yyyy-MM-dd").format(date);
|
||||||
couponUserDao.giveCoupon(userIdList, coupon.getCouponName(), coupon.getCouponPicture(), createTime, expirationTime, coupon.getMinMoney(),
|
if(amount == null) amount = 3;
|
||||||
coupon.getMoney(), 0,coupon.getEndDate().toString());
|
for (Integer i = 0; i < amount; i++) {
|
||||||
|
couponUserDao.giveCoupon(userIdList, coupon.getCouponName(), coupon.getCouponPicture(), createTime, expirationTime, coupon.getMinMoney(),
|
||||||
|
coupon.getMoney(), 0, coupon.getEndDate().toString());
|
||||||
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.sqx.common.utils.PageUtils;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.message.entity.MessageInfo;
|
import com.sqx.modules.message.entity.MessageInfo;
|
||||||
import com.sqx.modules.message.service.MessageService;
|
import com.sqx.modules.message.service.MessageService;
|
||||||
|
import com.sqx.modules.shipinquan.entity.BlShipinquan;
|
||||||
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;
|
||||||
|
@ -195,4 +196,12 @@ public class MessageController {
|
||||||
return messageService.selectArtificerList(page, limit, artificerName, phone);
|
return messageService.selectArtificerList(page, limit, artificerName, phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@GetMapping("/dataSelectXxzx")
|
||||||
|
@ApiOperation("获取消息中心未读数据")
|
||||||
|
public Result dataSelectXxzx(){
|
||||||
|
QueryWrapper<MessageInfo> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("state",2);
|
||||||
|
qw.and(q->q.isNull("is_see").or().eq("is_see",1));
|
||||||
|
return Result.success().put("data",messageService.count(qw));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -136,4 +136,4 @@ public class AppMessageController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class MessageInfo implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分类
|
* 分类
|
||||||
|
* 2 消息
|
||||||
* 4 开通会员、取消会员
|
* 4 开通会员、取消会员
|
||||||
* 5 系统通知(系统通知、提现通知)
|
* 5 系统通知(系统通知、提现通知)
|
||||||
* 6 举报
|
* 6 举报
|
||||||
|
@ -107,4 +108,8 @@ public class MessageInfo implements Serializable {
|
||||||
|
|
||||||
public MessageInfo() {}
|
public MessageInfo() {}
|
||||||
|
|
||||||
}
|
//投诉类型时,记录被举报对象类型,技师:null,平台:PT
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String obj;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class MessageServiceImpl extends
|
||||||
for(String id:ids.split(",")){
|
for(String id:ids.split(",")){
|
||||||
MessageInfo messageInfo = baseMapper.selectById(Long.parseLong(id));
|
MessageInfo messageInfo = baseMapper.selectById(Long.parseLong(id));
|
||||||
if("0".equals(messageInfo.getType())){
|
if("0".equals(messageInfo.getType())){
|
||||||
if(status==1){
|
if(status==1 && !"-1".equals(messageInfo.getByUserId())){
|
||||||
Artificer artificer = artificerService.selectArtificerByUserId(Long.parseLong(messageInfo.getByUserId()));
|
Artificer artificer = artificerService.selectArtificerByUserId(Long.parseLong(messageInfo.getByUserId()));
|
||||||
MessageInfo type = baseMapper.selectById(messageInfo.getTypeId());
|
MessageInfo type = baseMapper.selectById(messageInfo.getTypeId());
|
||||||
BigDecimal subtract = artificer.getCreditScore().subtract(new BigDecimal(type.getContent()));
|
BigDecimal subtract = artificer.getCreditScore().subtract(new BigDecimal(type.getContent()));
|
||||||
|
@ -132,7 +132,7 @@ public class MessageServiceImpl extends
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
messageInfo.setCreateAt(sdf.format(now));
|
messageInfo.setCreateAt(sdf.format(now));
|
||||||
if(StringUtils.isNotBlank(messageInfo.getState()) && "7".equals(messageInfo.getState())){
|
if(StringUtils.isNotBlank(messageInfo.getState()) && "7".equals(messageInfo.getState()) && messageInfo.getObj() == null){
|
||||||
Risk risk=new Risk();
|
Risk risk=new Risk();
|
||||||
risk.setUserId(Long.parseLong(messageInfo.getByUserId()));
|
risk.setUserId(Long.parseLong(messageInfo.getByUserId()));
|
||||||
risk.setContent("用户被举报:"+messageInfo.getContent());
|
risk.setContent("用户被举报:"+messageInfo.getContent());
|
||||||
|
|
Loading…
Reference in New Issue