订单支持更多状态
This commit is contained in:
@@ -270,7 +270,7 @@ dubbo:
|
|||||||
bxg:
|
bxg:
|
||||||
shop:
|
shop:
|
||||||
# API_URL: http://192.168.10.113:48080/bxgApp
|
# API_URL: http://192.168.10.113:48080/bxgApp
|
||||||
API_URL: http://719e20d2.r5.cpolar.top
|
API_URL: http://78871492.r2.cpolar.top
|
||||||
SITE_URL: http://192.168.10.113:48080/bxgApp
|
SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||||
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||||
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
||||||
|
|||||||
+17
-1
@@ -93,10 +93,26 @@ public class AppStoreBargainController {
|
|||||||
@ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int",dataTypeClass = Integer.class)
|
@ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int",dataTypeClass = Integer.class)
|
||||||
})
|
})
|
||||||
@ApiOperation(value = "砍价产品列表",notes = "砍价产品列表")
|
@ApiOperation(value = "砍价产品列表",notes = "砍价产品列表")
|
||||||
public ApiResult<Map<String,List<YxStoreBargainQueryVo>>> getYxStoreBargainPageList(@RequestParam(value = "page",defaultValue = "1") int page,
|
public ApiResult<List<YxStoreBargainQueryVo>> getYxStoreBargainPageList(@RequestParam(value = "page",defaultValue = "1") int page,
|
||||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||||
return ApiResult.ok(storeBargainService.getList(page, limit));
|
return ApiResult.ok(storeBargainService.getList(page, limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前用户参加的砍价活动的列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/bargainUser/list")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "page", value = "页码,默认为1", paramType = "query", dataType = "int",dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int",dataTypeClass = Integer.class)
|
||||||
|
})
|
||||||
|
@ApiOperation(value = "当前用户参加的砍价活动的列表",notes = "当前用户参加的砍价活动的列表")
|
||||||
|
public ApiResult<List<YxStoreBargainQueryVo>> getYxStoreBargainIngList(@RequestParam(value = "page",defaultValue = "1") int page,
|
||||||
|
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
||||||
|
return ApiResult.ok(storeBargainService.getUserBargainList(page, limit));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 砍价详情
|
* 砍价详情
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class IndexVo implements Serializable {
|
|||||||
private List<HotListDTO> hotListDTOS;
|
private List<HotListDTO> hotListDTOS;
|
||||||
|
|
||||||
@ApiModelProperty("首页需要的砍价列表")
|
@ApiModelProperty("首页需要的砍价列表")
|
||||||
private Map<String,List<YxStoreBargainQueryVo>> bargainList;
|
private List<YxStoreBargainQueryVo> bargainList;
|
||||||
|
|
||||||
@ApiModelProperty("首页秒杀配置")
|
@ApiModelProperty("首页秒杀配置")
|
||||||
private SeckillConfigVo seckillConfigVo;
|
private SeckillConfigVo seckillConfigVo;
|
||||||
|
|||||||
+11
-2
@@ -91,9 +91,17 @@ public interface YxStoreBargainService extends BaseService<YxStoreBargain>{
|
|||||||
* @param limit limit
|
* @param limit limit
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
Map<String,List<YxStoreBargainQueryVo>> getList(int page, int limit);
|
List<YxStoreBargainQueryVo>getList(int page, int limit);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户参加中的砍价商品列表
|
||||||
|
* @param page page
|
||||||
|
* @param limit limit
|
||||||
|
* @return List
|
||||||
|
*/
|
||||||
|
List<YxStoreBargainQueryVo> getUserBargainList(int page, int limit);
|
||||||
|
|
||||||
// List<YxStoreBargainQueryVo> getUserBargainList(int page, int limit);
|
|
||||||
/**
|
/**
|
||||||
* 查询数据分页
|
* 查询数据分页
|
||||||
* @param criteria 条件
|
* @param criteria 条件
|
||||||
@@ -124,4 +132,5 @@ public interface YxStoreBargainService extends BaseService<YxStoreBargain>{
|
|||||||
void deleteBargainImg(String id);
|
void deleteBargainImg(String id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ public class YxStoreBargainDto implements Serializable {
|
|||||||
/** 砍价活动图片 */
|
/** 砍价活动图片 */
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
|
/** 砍价活动图片 */
|
||||||
|
private String linkImage;
|
||||||
|
|
||||||
/** 单位名称 */
|
/** 单位名称 */
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
|
|||||||
+40
-13
@@ -349,6 +349,33 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<YxStoreBargainQueryVo> getUserBargainList(int page, int limit) {
|
||||||
|
Map<String,List<YxStoreBargainQueryVo>> map=new HashMap<>();
|
||||||
|
Page<YxStoreBargain> pageModel = new Page<>(page, limit);
|
||||||
|
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
Date nowTime = new Date();
|
||||||
|
wrapper.eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
|
||||||
|
.lt(YxStoreBargain::getStartTime,nowTime)
|
||||||
|
.gt(YxStoreBargain::getStopTime,nowTime);
|
||||||
|
List<YxStoreBargainQueryVo> yxStoreBargainQueryVos = generator.convert(
|
||||||
|
yxStoreBargainMapper.selectPage(pageModel,wrapper).getRecords(),
|
||||||
|
YxStoreBargainQueryVo.class);
|
||||||
|
long uid = LocalUser.getUidByToken();
|
||||||
|
List<YxStoreBargainQueryVo> isParticipation=new ArrayList<>();
|
||||||
|
yxStoreBargainQueryVos.forEach(item->{
|
||||||
|
item.setPeople(storeBargainUserService.getBargainUserCount(item.getId(), OrderInfoEnum.BARGAIN_STATUS_1.getValue()));
|
||||||
|
item.setIsParticipation(storeBargainUserService.getUserIsParticipation(uid, item.getId()));
|
||||||
|
if (item.getIsParticipation()){
|
||||||
|
isParticipation.add(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return isParticipation;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取砍价商品列表
|
* 获取砍价商品列表
|
||||||
* @param page page
|
* @param page page
|
||||||
@@ -356,8 +383,7 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
|
|||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Map<String,List<YxStoreBargainQueryVo>> getList(int page, int limit) {
|
public List<YxStoreBargainQueryVo> getList(int page, int limit) {
|
||||||
Map<String,List<YxStoreBargainQueryVo>> map=new HashMap<>();
|
|
||||||
Page<YxStoreBargain> pageModel = new Page<>(page, limit);
|
Page<YxStoreBargain> pageModel = new Page<>(page, limit);
|
||||||
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>();
|
||||||
Date nowTime = new Date();
|
Date nowTime = new Date();
|
||||||
@@ -369,21 +395,22 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
|
|||||||
yxStoreBargainMapper.selectPage(pageModel,wrapper).getRecords(),
|
yxStoreBargainMapper.selectPage(pageModel,wrapper).getRecords(),
|
||||||
YxStoreBargainQueryVo.class);
|
YxStoreBargainQueryVo.class);
|
||||||
long uid = LocalUser.getUidByToken();
|
long uid = LocalUser.getUidByToken();
|
||||||
List<YxStoreBargainQueryVo> isParticipation=new ArrayList<>();
|
// List<YxStoreBargainQueryVo> isParticipation=new ArrayList<>();
|
||||||
List<YxStoreBargainQueryVo> isNotParticipation=new ArrayList<>();
|
// List<YxStoreBargainQueryVo> isNotParticipation=new ArrayList<>();
|
||||||
yxStoreBargainQueryVos.forEach(item->{
|
yxStoreBargainQueryVos.forEach(item->{
|
||||||
item.setPeople(storeBargainUserService.getBargainUserCount(item.getId(), OrderInfoEnum.BARGAIN_STATUS_1.getValue()));
|
item.setPeople(storeBargainUserService.getBargainUserCount(item.getId(), OrderInfoEnum.BARGAIN_STATUS_1.getValue()));
|
||||||
item.setIsParticipation(storeBargainUserService.getUserIsParticipation(uid, item.getId()));
|
item.setIsParticipation(storeBargainUserService.getUserIsParticipation(uid, item.getId()));
|
||||||
if (item.getIsParticipation()){
|
// if (item.getIsParticipation()){
|
||||||
isParticipation.add(item);
|
// isParticipation.add(item);
|
||||||
}else {
|
// }else {
|
||||||
isNotParticipation.add(item);
|
// isNotParticipation.add(item);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
map.put("yxStoreBargainQueryVos",yxStoreBargainQueryVos);
|
// map.put("yxStoreBargainQueryVos",yxStoreBargainQueryVos);
|
||||||
map.put("isParticipation",isParticipation);
|
// map.put("isParticipation",isParticipation);
|
||||||
map.put("isNotParticipation",isNotParticipation);
|
// map.put("isNotParticipation",isNotParticipation);
|
||||||
return map;
|
// return map;
|
||||||
|
return yxStoreBargainQueryVos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+4
@@ -394,8 +394,12 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|||||||
YxStoreSeckillQueryVo.class);
|
YxStoreSeckillQueryVo.class);
|
||||||
yxStoreSeckillQueryVos.forEach(item->{
|
yxStoreSeckillQueryVos.forEach(item->{
|
||||||
Integer sum = item.getSales() + item.getStock();
|
Integer sum = item.getSales() + item.getStock();
|
||||||
|
if(sum==0){
|
||||||
|
item.setPercent(100);
|
||||||
|
}else{
|
||||||
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum),
|
item.setPercent(NumberUtil.round(NumberUtil.mul(NumberUtil.div(item.getSales(),sum),
|
||||||
100),0).intValue());
|
100),0).intValue());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return yxStoreSeckillQueryVos;
|
return yxStoreSeckillQueryVos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,8 @@ public class OrderUtil {
|
|||||||
if (paid == 0 && status == 0) {
|
if (paid == 0 && status == 0) {
|
||||||
statusName = "未支付";
|
statusName = "未支付";
|
||||||
} else if (paid == 1 && status == 0 && shipping_type == 1 && refund_status == 0) {
|
} else if (paid == 1 && status == 0 && shipping_type == 1 && refund_status == 0) {
|
||||||
|
statusName = "未审核";
|
||||||
|
}else if (paid == 1 && status == 5 && shipping_type == 1 && refund_status == 0) {
|
||||||
statusName = "未发货";
|
statusName = "未发货";
|
||||||
} else if (paid == 1 && status == 0 && shipping_type == 2 && refund_status == 0) {
|
} else if (paid == 1 && status == 0 && shipping_type == 2 && refund_status == 0) {
|
||||||
statusName = "未核销";
|
statusName = "未核销";
|
||||||
@@ -209,7 +211,7 @@ public class OrderUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static int orderStatus(int paid, int status, int refund_status) {
|
public static int orderStatus(int paid, int status, int refund_status) {
|
||||||
//todo 1-未付款 2-(已付款但未审核)未发货 3-退款中 4-待收货 5-待评价 6-已完成 7-已退款 8-审核通过未发货
|
//todo 1-未付款 2-(已付款但未审核)待审核 3-退款中 4-待收货 5-待评价 6-已完成 7-已退款 8-审核通过未发货
|
||||||
int _status = 0;
|
int _status = 0;
|
||||||
|
|
||||||
if (paid == 0 && status == 0 && refund_status == 0) {
|
if (paid == 0 && status == 0 && refund_status == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user