累计购买数量
This commit is contained in:
@@ -27,5 +27,5 @@ public interface GbWareService extends IService<GbWare> {
|
|||||||
boolean deleteGbWare(Long id);
|
boolean deleteGbWare(Long id);
|
||||||
|
|
||||||
// 累计拼团数+1
|
// 累计拼团数+1
|
||||||
void upGbWareGroupedNum(Long id);
|
void upGbWareGroupedNum(Long id, Integer num);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,11 +83,11 @@ public class GbWareServiceImpl extends ServiceImpl<GbWareMapper, GbWare> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void upGbWareGroupedNum(Long id) {
|
public void upGbWareGroupedNum(Long id, Integer num) {
|
||||||
GbWare ware = getById(id);
|
GbWare ware = getById(id);
|
||||||
if (ware != null) {
|
if (ware != null) {
|
||||||
GbWare upWare = new GbWare();
|
GbWare upWare = new GbWare();
|
||||||
upWare.setGroupedNum(ware.getGroupedNum() == null ? 1 : ware.getGroupedNum() + 1);
|
upWare.setGroupedNum(ware.getGroupedNum() == null ? num : ware.getGroupedNum() + num);
|
||||||
update(upWare, query().eq(GbWare::getId, id));
|
update(upWare, query().eq(GbWare::getId, id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
|||||||
record.setPayOrderId(payOrderId);
|
record.setPayOrderId(payOrderId);
|
||||||
record.setPayTime(LocalDateTime.now());
|
record.setPayTime(LocalDateTime.now());
|
||||||
record.setVerifyCode(CzgRandomUtils.randomNumber(12, true));
|
record.setVerifyCode(CzgRandomUtils.randomNumber(12, true));
|
||||||
|
wareService.upGbWareGroupedNum(record.getWareId(), record.getNum());
|
||||||
if (StrUtil.isBlank(record.getGroupOrderNo())) {
|
if (StrUtil.isBlank(record.getGroupOrderNo())) {
|
||||||
GbWare ware = wareService.getById(record.getWareId());
|
GbWare ware = wareService.getById(record.getWareId());
|
||||||
if (ware == null || ware.getOnlineStatus() == 0 || ware.getIsDel()) {
|
if (ware == null || ware.getOnlineStatus() == 0 || ware.getIsDel()) {
|
||||||
@@ -304,7 +305,6 @@ public class GbOrderServiceImpl extends ServiceImpl<GbOrderMapper, GbOrder> impl
|
|||||||
if (order.getCurrentPeopleNum().equals(order.getGroupPeopleNum())) {
|
if (order.getCurrentPeopleNum().equals(order.getGroupPeopleNum())) {
|
||||||
order.setStatus("success");
|
order.setStatus("success");
|
||||||
order.setGroupEndTime(LocalDateTime.now());
|
order.setGroupEndTime(LocalDateTime.now());
|
||||||
wareService.upGbWareGroupedNum(order.getWareId());
|
|
||||||
record.setStatus("待核销");
|
record.setStatus("待核销");
|
||||||
GbOrderDetail upRecord = new GbOrderDetail();
|
GbOrderDetail upRecord = new GbOrderDetail();
|
||||||
upRecord.setStatus("待核销");
|
upRecord.setStatus("待核销");
|
||||||
|
|||||||
Reference in New Issue
Block a user