|
@@ -10,6 +10,9 @@ import cn.hutool.poi.excel.ExcelWriter;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
import com.txz.cif.dto.AccountDTO;
|
|
import com.txz.cif.dto.AccountDTO;
|
|
import com.txz.cif.dto.Result;
|
|
import com.txz.cif.dto.Result;
|
|
import com.txz.cif.dto.UserDTO;
|
|
import com.txz.cif.dto.UserDTO;
|
|
@@ -20,6 +23,7 @@ import com.txz.mall.core.AbstractService;
|
|
import com.txz.mall.core.RedisUtil;
|
|
import com.txz.mall.core.RedisUtil;
|
|
import com.txz.mall.core.ResultCode;
|
|
import com.txz.mall.core.ResultCode;
|
|
import com.txz.mall.core.ServiceException;
|
|
import com.txz.mall.core.ServiceException;
|
|
|
|
+import com.txz.mall.dao.StorePinkMapper;
|
|
import com.txz.mall.dubbo.client.CifAccountDubboServiceClient;
|
|
import com.txz.mall.dubbo.client.CifAccountDubboServiceClient;
|
|
import com.txz.mall.dubbo.client.CifUserDubboServiceClient;
|
|
import com.txz.mall.dubbo.client.CifUserDubboServiceClient;
|
|
import com.txz.mall.enums.OrderEventsEnum;
|
|
import com.txz.mall.enums.OrderEventsEnum;
|
|
@@ -27,6 +31,7 @@ import com.txz.mall.enums.PinkOrderStatusEnum;
|
|
import com.txz.mall.model.*;
|
|
import com.txz.mall.model.*;
|
|
import com.txz.mall.service.*;
|
|
import com.txz.mall.service.*;
|
|
import com.txz.mall.util.EasyExcelUtil;
|
|
import com.txz.mall.util.EasyExcelUtil;
|
|
|
|
+import com.txz.mall.util.EasyToUseUtil;
|
|
import com.txz.mall.util.OrderStateMachine;
|
|
import com.txz.mall.util.OrderStateMachine;
|
|
import com.txz.mall.util.OrderUtils;
|
|
import com.txz.mall.util.OrderUtils;
|
|
import dto.*;
|
|
import dto.*;
|
|
@@ -35,6 +40,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.apache.ibatis.session.RowBounds;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -45,6 +51,7 @@ import tk.mybatis.mapper.entity.Condition;
|
|
import tk.mybatis.mapper.entity.Example;
|
|
import tk.mybatis.mapper.entity.Example;
|
|
import vo.*;
|
|
import vo.*;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -69,6 +76,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
private final ProductAttrValueService productAttrValueService;
|
|
private final ProductAttrValueService productAttrValueService;
|
|
private final StoreProductService storeProductService;
|
|
private final StoreProductService storeProductService;
|
|
private final StorePinkService storePinkService;
|
|
private final StorePinkService storePinkService;
|
|
|
|
+
|
|
|
|
+ private final StorePinkSummaryService storePinkSummaryService;
|
|
private final CifUserDubboServiceClient userDubboServiceClient;
|
|
private final CifUserDubboServiceClient userDubboServiceClient;
|
|
private final StoreOrderStatusService storeOrderStatusService;
|
|
private final StoreOrderStatusService storeOrderStatusService;
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
@@ -130,7 +139,31 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
storePink.setUid(storeOrder.getUid());
|
|
storePink.setUid(storeOrder.getUid());
|
|
storePink.setIsRefund(0);
|
|
storePink.setIsRefund(0);
|
|
storePink.setStatus(1);
|
|
storePink.setStatus(1);
|
|
|
|
+
|
|
|
|
+ //插入拼团汇总表
|
|
|
|
+ StorePinkSummary storePinkSummary = new StorePinkSummary();
|
|
|
|
+ storePinkSummary.setTotalPrice(storeOrder.getTotalPrice());
|
|
|
|
+ storePinkSummary.setCid(storeCombination.getId());
|
|
|
|
+ storePinkSummary.setPid(storeCombination.getProductId());
|
|
|
|
+ storePinkSummary.setPeople(storeCombination.getPeople());
|
|
|
|
+ storePinkSummary.setAddTime(date);
|
|
|
|
+ storePinkSummary.setStopTime(DateUtils.addMinutes(date, effectiveTime));
|
|
|
|
+ storePinkSummary.setIsRefund(0);
|
|
|
|
+ storePinkSummary.setPeopleCount(1);
|
|
|
|
+ storePinkSummary.setStatus(1);
|
|
|
|
+ // storePinkSummary.setlId();'//天选 默认0 1为天选',
|
|
|
|
+ // storePinkSummary.setkId(); // '团长id',
|
|
|
|
+ // storePinkSummary.setIsRefund(); //是否退款 0未退款 1已退款',
|
|
|
|
+ storePinkSummary.setIsRefund(0);
|
|
|
|
+ storePinkSummary.setStatus(1);
|
|
|
|
+
|
|
|
|
+ EasyToUseUtil.appCreateAssignment(date,storePinkSummary);
|
|
|
|
+ storePinkSummaryService.save(storePinkSummary);
|
|
|
|
+
|
|
|
|
+ //插入拼团详情表
|
|
|
|
+ storePink.setSpsId(storePinkSummary.getId());
|
|
storePinkService.save(storePink);
|
|
storePinkService.save(storePink);
|
|
|
|
+
|
|
// 如果是开团,需要更新订单数据
|
|
// 如果是开团,需要更新订单数据
|
|
storeOrder.setPinkId(storePink.getId());
|
|
storeOrder.setPinkId(storePink.getId());
|
|
update(storeOrder);
|
|
update(storeOrder);
|
|
@@ -152,8 +185,10 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
criteria.andEqualTo("isDelete", 0);
|
|
criteria.andEqualTo("isDelete", 0);
|
|
criteria.andEqualTo("isShow", 1);
|
|
criteria.andEqualTo("isShow", 1);
|
|
|
|
+ criteria.andEqualTo("id", dto.getCid());
|
|
criteria.andLessThanOrEqualTo("startTime", date);
|
|
criteria.andLessThanOrEqualTo("startTime", date);
|
|
criteria.andGreaterThanOrEqualTo("stopTime", date);
|
|
criteria.andGreaterThanOrEqualTo("stopTime", date);
|
|
|
|
+
|
|
List<StoreCombination> combinationList = storeCombinationService.findByCondition(condition);
|
|
List<StoreCombination> combinationList = storeCombinationService.findByCondition(condition);
|
|
if (CollUtil.isEmpty(combinationList)) {
|
|
if (CollUtil.isEmpty(combinationList)) {
|
|
throw new ServiceException("拼团商品不存在或未开启");
|
|
throw new ServiceException("拼团商品不存在或未开启");
|
|
@@ -162,7 +197,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
Condition pinkCondition = new Condition(StorePink.class);
|
|
Condition pinkCondition = new Condition(StorePink.class);
|
|
Example.Criteria pinkCriteria = pinkCondition.createCriteria();
|
|
Example.Criteria pinkCriteria = pinkCondition.createCriteria();
|
|
pinkCriteria.andEqualTo("isDelete", 0);
|
|
pinkCriteria.andEqualTo("isDelete", 0);
|
|
- pinkCriteria.andEqualTo("orderId", dto.getOrderId());
|
|
|
|
|
|
+ pinkCriteria.andEqualTo("spsId", dto.getSpsId());
|
|
pinkCriteria.andEqualTo("status", 1);
|
|
pinkCriteria.andEqualTo("status", 1);
|
|
List<StorePink> pinkList = storePinkService.findByCondition(pinkCondition);
|
|
List<StorePink> pinkList = storePinkService.findByCondition(pinkCondition);
|
|
int count = teamPink.getPeople() - (CollUtil.isEmpty(pinkList) ? 0 : pinkList.size());
|
|
int count = teamPink.getPeople() - (CollUtil.isEmpty(pinkList) ? 0 : pinkList.size());
|
|
@@ -173,17 +208,30 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
if (uidList.contains(dto.getUserId())) {
|
|
if (uidList.contains(dto.getUserId())) {
|
|
throw new ServiceException("您已加入该拼团");
|
|
throw new ServiceException("您已加入该拼团");
|
|
}
|
|
}
|
|
- joinGroup(teamPink, dto, count);
|
|
|
|
|
|
+ joinGroup(teamPink, dto, count,pinkList.size());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void joinGroup(StorePink teamPink, GoPinkDTO dto, int count) {
|
|
|
|
|
|
+ private void joinGroup(StorePink teamPink, GoPinkDTO dto, int count,int pinkSize) {
|
|
//拼团剩余人数
|
|
//拼团剩余人数
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
|
+
|
|
|
|
+ //修改拼团汇总表 这块得上分布式锁
|
|
|
|
+ StorePinkSummary storePinkSummary = new StorePinkSummary();
|
|
|
|
+
|
|
|
|
+ storePinkSummary.setPeopleCount(pinkSize+1);
|
|
|
|
+ EasyToUseUtil.appCreateAssignment(date,storePinkSummary);
|
|
|
|
+ if (count == 1) {
|
|
|
|
+ storePinkSummary.setStatus(1);
|
|
|
|
+ }
|
|
|
|
+ storePinkSummaryService.update(storePinkSummary);
|
|
|
|
+
|
|
|
|
+
|
|
// 加入拼团
|
|
// 加入拼团
|
|
StorePink storePink = new StorePink();
|
|
StorePink storePink = new StorePink();
|
|
BeanUtils.copyProperties(teamPink, storePink);
|
|
BeanUtils.copyProperties(teamPink, storePink);
|
|
storePink.setId(null);
|
|
storePink.setId(null);
|
|
|
|
+ storePink.setSpsId(storePinkSummary.getId());
|
|
// storePink.setOrderId(null);
|
|
// storePink.setOrderId(null);
|
|
// storePink.setOrderIdKey(null);
|
|
// storePink.setOrderIdKey(null);
|
|
storePink.setUid(dto.getUserId());
|
|
storePink.setUid(dto.getUserId());
|
|
@@ -195,6 +243,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
storePinkService.save(storePink);
|
|
storePinkService.save(storePink);
|
|
if (count == 1) {
|
|
if (count == 1) {
|
|
storePinkService.pinkSuccess(teamPink.getId());
|
|
storePinkService.pinkSuccess(teamPink.getId());
|
|
|
|
+
|
|
|
|
+
|
|
// 考虑是否回写主订单
|
|
// 考虑是否回写主订单
|
|
|
|
|
|
}
|
|
}
|
|
@@ -209,16 +259,32 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
if (ObjectUtil.isNull(storeCombination) || storeCombination.getIsDelete().equals(1)) {
|
|
if (ObjectUtil.isNull(storeCombination) || storeCombination.getIsDelete().equals(1)) {
|
|
throw new ServiceException("对应拼团商品不存在");
|
|
throw new ServiceException("对应拼团商品不存在");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ PageHelper.startPage(1, 10);
|
|
|
|
+ Condition pinkSummaryCondition = new Condition(StorePinkSummary.class);
|
|
|
|
+ Example.Criteria pinkSummaryCriteria = pinkSummaryCondition.createCriteria();
|
|
|
|
+ pinkSummaryCriteria.andEqualTo("isDelete", 0);
|
|
|
|
+ pinkSummaryCriteria.andEqualTo("cid", dto.getCid());
|
|
|
|
+ pinkSummaryCriteria.andEqualTo("status", 1);
|
|
|
|
+ pinkSummaryCondition.setOrderByClause("people_count DESC");
|
|
|
|
+ List<StorePinkSummary> pinkSummaryList = storePinkSummaryService.findByCondition(pinkSummaryCondition);
|
|
|
|
+ List<StorePinkSummary> pinkSummaryListResult = ((Page<StorePinkSummary>) pinkSummaryList).getRecords();
|
|
|
|
+
|
|
|
|
+ if (CollUtil.isEmpty(pinkSummaryListResult)) {
|
|
|
|
+ throw new ServiceException("暂时没有可加入的团");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<Long> storePinkSummaryId = pinkSummaryListResult.stream().map(StorePinkSummary::getId).collect(Collectors.toList());
|
|
Condition pinkCondition = new Condition(StorePink.class);
|
|
Condition pinkCondition = new Condition(StorePink.class);
|
|
Example.Criteria pinkCriteria = pinkCondition.createCriteria();
|
|
Example.Criteria pinkCriteria = pinkCondition.createCriteria();
|
|
pinkCriteria.andEqualTo("isDelete", 0);
|
|
pinkCriteria.andEqualTo("isDelete", 0);
|
|
pinkCriteria.andEqualTo("cid", dto.getCid());
|
|
pinkCriteria.andEqualTo("cid", dto.getCid());
|
|
- pinkCriteria.andEqualTo("status", 1);
|
|
|
|
|
|
+// pinkCriteria.andEqualTo("status", 1);
|
|
|
|
+ pinkCriteria.andIn("sps_id",storePinkSummaryId);
|
|
List<StorePink> pinkList = storePinkService.findByCondition(pinkCondition);
|
|
List<StorePink> pinkList = storePinkService.findByCondition(pinkCondition);
|
|
|
|
|
|
- if (CollUtil.isEmpty(pinkList)) {
|
|
|
|
- throw new ServiceException("暂时没有可加入的团");
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
Map<String, List<StorePink>> collect = pinkList.stream().collect(Collectors.groupingBy(StorePink::getOrderId));
|
|
Map<String, List<StorePink>> collect = pinkList.stream().collect(Collectors.groupingBy(StorePink::getOrderId));
|
|
|
|
|
|
List<List<StorePink>> availableGroups = collect.values().stream()
|
|
List<List<StorePink>> availableGroups = collect.values().stream()
|
|
@@ -239,7 +305,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
StorePink pink = maxPinkList.stream().filter(i -> i.getKId().equals(0L)).collect(Collectors.toList()).get(0);
|
|
StorePink pink = maxPinkList.stream().filter(i -> i.getKId().equals(0L)).collect(Collectors.toList()).get(0);
|
|
int count = pink.getPeople() - (CollUtil.isEmpty(pinkList) ? 0 : pinkList.size());
|
|
int count = pink.getPeople() - (CollUtil.isEmpty(pinkList) ? 0 : pinkList.size());
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
- joinGroup(pink, dto, count);
|
|
|
|
|
|
+ joinGroup(pink, dto, count,pinkList.size());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -941,6 +1007,21 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
return arrayList;
|
|
return arrayList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @ApiModelProperty(value = "类型 0-全部all 1-待支付topay 2-拼团成功success 3-拼团失败failed 4-拼团奖励reward")
|
|
|
|
+ * private Integer type;
|
|
|
|
+ * ****************************
|
|
|
|
+ *GROUP_ORDER_TO_PAY(1, "拼团待支付"),
|
|
|
|
+ * GROUP_ORDER_CANCELLATION(2, "拼团订单取消"),
|
|
|
|
+ * GROUP_ORDER_PAID(3, "拼团已支付"),
|
|
|
|
+ * GROUP_ORDER_REFUND(4, "拼团失败已退款"),
|
|
|
|
+ * GROUP_ORDER_TO_SHIP(5, "拼团待发货"),
|
|
|
|
+ * GROUP_ORDER_TO_CLOSED(6, "拼团未中奖关闭"),
|
|
|
|
+ * GROUP_ORDER_TO_RECEVIE(7, "拼团待收货"),
|
|
|
|
+ * GROUP_ORDER_COMPLETED(8, "拼团订单完成")
|
|
|
|
+ * *****************************
|
|
|
|
+ * `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '状态 1进行中 2已完成 3未完成',
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
public List<StoreOrderVO> appList(StoreOrderAppDTO dto) {
|
|
public List<StoreOrderVO> appList(StoreOrderAppDTO dto) {
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
@@ -962,10 +1043,12 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
case 0:
|
|
case 0:
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- criteria.andEqualTo("paid", 0);
|
|
|
|
|
|
+ criteria.andEqualTo("status", 1);
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
- pinkCriteria.andEqualTo("status", 1);
|
|
|
|
|
|
+ pinkCriteria.andEqualTo("status", 2);
|
|
|
|
+ pinkCriteria.andEqualTo("lId", 1);
|
|
|
|
+ pinkCriteria.andIn("order_status", Arrays.asList(3));
|
|
pinkList = storePinkService.findByCondition(pinkCondition);
|
|
pinkList = storePinkService.findByCondition(pinkCondition);
|
|
if (CollUtil.isNotEmpty(pinkList)) {
|
|
if (CollUtil.isNotEmpty(pinkList)) {
|
|
criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
@@ -973,13 +1056,16 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
pinkCriteria.andEqualTo("status", 2);
|
|
pinkCriteria.andEqualTo("status", 2);
|
|
|
|
+ pinkCriteria.andEqualTo("lId", 0);
|
|
|
|
+ pinkCriteria.andIn("order_status", Arrays.asList(3));
|
|
pinkList = storePinkService.findByCondition(pinkCondition);
|
|
pinkList = storePinkService.findByCondition(pinkCondition);
|
|
if (CollUtil.isNotEmpty(pinkList)) {
|
|
if (CollUtil.isNotEmpty(pinkList)) {
|
|
criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
- pinkCriteria.andIn("status", Arrays.asList(0, 0));
|
|
|
|
|
|
+ pinkCriteria.andEqualTo("status", 2);
|
|
|
|
+ pinkCriteria.andIn("order_status", Arrays.asList(5,7,8));
|
|
pinkList = storePinkService.findByCondition(pinkCondition);
|
|
pinkList = storePinkService.findByCondition(pinkCondition);
|
|
if (CollUtil.isNotEmpty(pinkList)) {
|
|
if (CollUtil.isNotEmpty(pinkList)) {
|
|
criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
criteria.andIn("id", pinkList.stream().map(StorePink::getOrderIdKey).collect(Collectors.toList()));
|
|
@@ -1312,7 +1398,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
|
|
|
|
// 检验余额够不够
|
|
// 检验余额够不够
|
|
Result result = accountDubboServiceClient.getWalletAccount(storeOrder.getUid());
|
|
Result result = accountDubboServiceClient.getWalletAccount(storeOrder.getUid());
|
|
- if (result.getCode().equals(ResultCode.SUCCESS)) {
|
|
|
|
|
|
+ if (result.getCode().equals(ResultCode.SUCCESS.getCode())) {
|
|
AccountDTO accountDTO = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), AccountDTO.class);
|
|
AccountDTO accountDTO = JSONObject.parseObject(JSONObject.toJSONString(result.getData()), AccountDTO.class);
|
|
if (accountDTO.getBalance().compareTo(storeOrder.getPayPrice()) < 0) {
|
|
if (accountDTO.getBalance().compareTo(storeOrder.getPayPrice()) < 0) {
|
|
throw new ServiceException(ResultCode.INSUFFICIENT_BALANCE);
|
|
throw new ServiceException(ResultCode.INSUFFICIENT_BALANCE);
|
|
@@ -1366,7 +1452,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- // 中奖回收状态逻辑还没加
|
|
|
|
|
|
+ // 中奖回收状态逻辑还没加 关闭指系统层面的自动结束 如活动时间超时或者拼团超时由定时任务触发
|
|
@Override
|
|
@Override
|
|
public void close(Long id) {
|
|
public void close(Long id) {
|
|
StoreOrder storeOrder = findById(id);
|
|
StoreOrder storeOrder = findById(id);
|
|
@@ -1375,7 +1461,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
if (ObjectUtils.isEmpty(pinkOrderStatusEnum)) {
|
|
if (ObjectUtils.isEmpty(pinkOrderStatusEnum)) {
|
|
throw new ServiceException("当前状态不支持关闭");
|
|
throw new ServiceException("当前状态不支持关闭");
|
|
}
|
|
}
|
|
- updateOrderStatus(storeOrder.getId(), PinkOrderStatusEnum.GROUP_ORDER_TO_CLOSED.getKey());
|
|
|
|
|
|
+ updateOrderStatus(storeOrder.getId(), pinkOrderStatusEnum.getKey());
|
|
|
|
+
|
|
|
|
|
|
// if (storeOrder.getStatus().equals(Constants.ORDER_STATUS_H5_COMPLETE)) {
|
|
// if (storeOrder.getStatus().equals(Constants.ORDER_STATUS_H5_COMPLETE)) {
|
|
// updateOrderStatus(storeOrder.getId(), PinkOrderStatusEnum.CLOSE.getKey());
|
|
// updateOrderStatus(storeOrder.getId(), PinkOrderStatusEnum.CLOSE.getKey());
|
|
@@ -1441,12 +1528,22 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private StorePinkMapper storePinkMapper;
|
|
@Override
|
|
@Override
|
|
public void updateOrderStatus(Long id, Integer status) {
|
|
public void updateOrderStatus(Long id, Integer status) {
|
|
StoreOrder storeOrder = findById(id);
|
|
StoreOrder storeOrder = findById(id);
|
|
storeOrder.setStatus(status);
|
|
storeOrder.setStatus(status);
|
|
update(storeOrder);
|
|
update(storeOrder);
|
|
|
|
+
|
|
|
|
+ StorePink storePink = new StorePink();
|
|
|
|
+ Example example = new Example(StorePink.class);
|
|
|
|
+ example.createCriteria().andEqualTo("orderIdKey",id);
|
|
|
|
+ storePink.setOrderStatus(status);
|
|
|
|
+ storePinkMapper.updateByConditionSelective(storePink,example);
|
|
|
|
+
|
|
storeOrderStatusService.createLog(id, "", PinkOrderStatusEnum.getEnum(status).getValue());
|
|
storeOrderStatusService.createLog(id, "", PinkOrderStatusEnum.getEnum(status).getValue());
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|