袁野 3 months ago
parent e78b9dcc76
commit 70ad26394c
  1. 35
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 1
      order/src/main/java/com/order/controller/OrderController.java
  3. 11
      order/src/main/java/com/order/controller/business/BsOrderDownloadController.java
  4. 15
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  5. 2
      service/src/main/java/com/hfkj/entity/BsOrderGoods.java
  6. 1
      service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java
  7. 29
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java
  8. 2
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  9. 10
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  10. 15
      service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java
  11. 32
      service/src/main/java/com/hfkj/sysenum/order/OrderLogisticsStatusEnum.java

@ -5,15 +5,15 @@ import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.OrderUtil; import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.CouponDiscountGoodsRel; import com.hfkj.entity.*;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.service.discount.CouponDiscountService; import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.GoodsMsgService; import com.hfkj.service.goods.GoodsMsgService;
import com.hfkj.service.goods.GoodsSpecsService; import com.hfkj.service.goods.GoodsSpecsService;
import com.hfkj.service.hlt.HltCanteenService; import com.hfkj.service.hlt.HltCanteenService;
import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderChildService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -44,6 +44,11 @@ public class TestController {
@Resource @Resource
private CouponDiscountService couponDiscountService; private CouponDiscountService couponDiscountService;
@Resource
private BsOrderChildService orderChildService;
@Resource
private BsOrderGoodsService orderGoodsService;
@RequestMapping(value="/canteenConsume",method = RequestMethod.GET) @RequestMapping(value="/canteenConsume",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "食堂消费") @ApiOperation(value = "食堂消费")
@ -100,4 +105,28 @@ public class TestController {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value="/orderGoodsUpdate",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "商品更新")
public ResponseData orderGoodsUpdate() {
try {
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList();
for (BsOrderGoods goods : orderGoodsList) {
BsOrderChild child = orderChildService.getDetail(goods.getChildOrderNo());
goods.setStatus(child.getStatus());
goods.setUpdateTime(new Date());
orderGoodsService.update(goods);
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -87,7 +87,6 @@ public class OrderController {
body.setUserName(userSession.getUser().getName()); body.setUserName(userSession.getUser().getName());
body.setUserPhone(userSession.getUser().getPhone()); body.setUserPhone(userSession.getUser().getPhone());
return ResponseMsgUtil.success(orderService.create(body)); return ResponseMsgUtil.success(orderService.create(body));
} catch (Exception e) { } catch (Exception e) {

@ -0,0 +1,11 @@
package com.order.controller.business;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value="/orderDownload")
@Api(value="订单下载管理")
public class BsOrderDownloadController {
}

@ -19,6 +19,7 @@ import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.BsOrderService;
import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.order.OrderGoodsStatusEnum; import com.hfkj.sysenum.order.OrderGoodsStatusEnum;
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -62,6 +63,7 @@ public class BsOrderGoodsController {
@RequestParam(value = "userPhone" , required = false) String userPhone, @RequestParam(value = "userPhone" , required = false) String userPhone,
@RequestParam(value = "goodsSpecsName" , required = false) String goodsSpecsName, @RequestParam(value = "goodsSpecsName" , required = false) String goodsSpecsName,
@RequestParam(value = "goodsName" , required = false) String goodsName, @RequestParam(value = "goodsName" , required = false) String goodsName,
@RequestParam(value = "logisticsStatus" , required = false) String logisticsStatus,
@RequestParam(value = "payType" , required = false) Integer payType, @RequestParam(value = "payType" , required = false) Integer payType,
@RequestParam(value = "status" , required = false) Integer status, @RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "createTimeS" , required = false) Long createTimeS, @RequestParam(value = "createTimeS" , required = false) Long createTimeS,
@ -85,12 +87,12 @@ public class BsOrderGoodsController {
map.put("orderNo", orderNo); map.put("orderNo", orderNo);
map.put("childOrderNo", childOrderNo); map.put("childOrderNo", childOrderNo);
map.put("userPhone", userPhone); map.put("userPhone", userPhone);
map.put("logisticsStatus", logisticsStatus);
map.put("goodsSpecsName", goodsSpecsName); map.put("goodsSpecsName", goodsSpecsName);
map.put("goodsName", goodsName); map.put("goodsName", goodsName);
map.put("payType", payType); map.put("payType", payType);
map.put("createTimeS", createTimeS); map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE); map.put("createTimeE", createTimeE);
map.put("status", status); map.put("status", status);
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
@ -126,14 +128,12 @@ public class BsOrderGoodsController {
goodsOrder.setLogisticsNo(logisticsNo); goodsOrder.setLogisticsNo(logisticsNo);
goodsOrder.setUpdateTime(new Date()); goodsOrder.setUpdateTime(new Date());
if (goodsOrder.getStatus() == OrderGoodsStatusEnum.status1.getCode()) {
goodsOrder.setStatus(OrderGoodsStatusEnum.status2.getCode());
}
// 删除缓存 // 删除缓存
orderService.cacheDelete(goodsOrder.getOrderNo()); orderService.cacheDelete(goodsOrder.getOrderNo());
bsOrderGoodsService.cacheDelete(goodsOrder.getLogisticsNo()); bsOrderGoodsService.cacheDelete(goodsOrder.getLogisticsNo());
bsOrderGoodsService.update(goodsOrder); bsOrderGoodsService.update(goodsOrder);
getLogisticsMsg(goodsOrder.getId());
return ResponseMsgUtil.success("更新成功!"); return ResponseMsgUtil.success("更新成功!");
} catch (Exception e) { } catch (Exception e) {
@ -156,10 +156,15 @@ public class BsOrderGoodsController {
GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo()); GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo());
if (logistics.getLogisticsStatus() != null) {
orderGoods.setLogisticsStatus(logistics.getLogisticsStatus()); orderGoods.setLogisticsStatus(logistics.getLogisticsStatus());
orderGoods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); orderGoods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc());
bsOrderGoodsService.update(orderGoods); } else {
orderGoods.setLogisticsStatus(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getCode());
orderGoods.setLogisticsStatusDesc(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getName());
}
bsOrderGoodsService.update(orderGoods);
map.put("logistics", logistics); map.put("logistics", logistics);
JSONArray object = JSONArray.parseArray(logistics.getLogisticsTraceDetails()); JSONArray object = JSONArray.parseArray(logistics.getLogisticsTraceDetails());
map.put("logisticsTraceDetails", object); map.put("logisticsTraceDetails", object);

@ -165,7 +165,7 @@ public class BsOrderGoods implements Serializable {
private Integer payType; private Integer payType;
/** /**
* 1:待发货 2:已发货 3配送中 4已送达 5已取消 6退货中 7已退货 8待支付 0:删除 * bs_order_child订单表同步
*/ */
private Integer status; private Integer status;

@ -87,6 +87,7 @@ public interface BsOrderGoodsService {
* @return java.util.List<com.hfkj.entity.GoodsBrand> * @return java.util.List<com.hfkj.entity.GoodsBrand>
*/ */
List<BsOrderGoods> getList(Map<String , Object> map); List<BsOrderGoods> getList(Map<String , Object> map);
List<BsOrderGoods> getList();
/** /**
* @Author Sum1Dream * @Author Sum1Dream

@ -15,15 +15,13 @@ import com.hfkj.entity.GoodsLogisticsExample;
import com.hfkj.model.order.OrderModel; import com.hfkj.model.order.OrderModel;
import com.hfkj.service.goods.BsOrderGoodsService; import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.BsOrderService;
import com.hfkj.sysenum.order.OrderChildStatusEnum;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service("bsOrderGoodsService") @Service("bsOrderGoodsService")
public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
@ -31,7 +29,7 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
// 缓存前缀KEY // 缓存前缀KEY
public final static String CACHE_KEY = "LOGISTICS:"; public final static String CACHE_KEY = "LOGISTICS:";
// 订单缓存时间 7天 // 订单缓存时间 7天
public final static Integer CACHE_TIME = 60*60*6; public final static Integer CACHE_TIME = 60*30;
@Resource @Resource
private BsOrderGoodsMapper bsOrderGoodsMapper; private BsOrderGoodsMapper bsOrderGoodsMapper;
@ -84,7 +82,7 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
@Override @Override
public BsOrderGoods findGoodsOrderByChild(String orderChildNo) { public BsOrderGoods findGoodsOrderByChild(String orderChildNo) {
BsOrderGoodsExample example = new BsOrderGoodsExample(); BsOrderGoodsExample example = new BsOrderGoodsExample();
example.createCriteria().andStatusNotEqualTo(0).andChildOrderNoEqualTo(orderChildNo); example.createCriteria().andChildOrderNoEqualTo(orderChildNo);
List<BsOrderGoods> list = bsOrderGoodsMapper.selectByExample(example); List<BsOrderGoods> list = bsOrderGoodsMapper.selectByExample(example);
@ -125,6 +123,14 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) { if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) {
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone")); criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone"));
} }
if (StringUtils.isNotBlank(MapUtils.getString(map, "logisticsStatus"))) {
if (MapUtils.getString(map , "logisticsStatus").equals("待发货")) {
criteria.andLogisticsStatusIsNull();
} else {
criteria.andLogisticsStatusEqualTo(MapUtils.getString(map, "logisticsStatus"));
}
}
if (MapUtils.getLong(map, "goodsType") != null) { if (MapUtils.getLong(map, "goodsType") != null) {
criteria.andGoodsTypeIdEqualTo(MapUtils.getLong(map, "goodsType")); criteria.andGoodsTypeIdEqualTo(MapUtils.getLong(map, "goodsType"));
} }
@ -160,6 +166,13 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
return bsOrderGoodsMapper.selectByExample(example); return bsOrderGoodsMapper.selectByExample(example);
} }
@Override
public List<BsOrderGoods> getList() {
BsOrderGoodsExample example = new BsOrderGoodsExample();
return bsOrderGoodsMapper.selectByExample(example);
}
@Override @Override
public GoodsLogistics findGoodsLogistics(Long orderGoodsId) { public GoodsLogistics findGoodsLogistics(Long orderGoodsId) {
GoodsLogisticsExample example = new GoodsLogisticsExample(); GoodsLogisticsExample example = new GoodsLogisticsExample();
@ -270,9 +283,11 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态,不支持确认收货!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态,不支持确认收货!");
} }
orderGoods.setStatus(9);
// 子订单完成 // 子订单完成
orderService.childOrderComplete(orderGoods.getChildOrderNo()); orderService.childOrderComplete(orderGoods.getChildOrderNo());
orderGoods.setStatus(OrderChildStatusEnum.status3.getCode());
orderGoods.setUpdateTime(new Date());
update(orderGoods); update(orderGoods);
// 删除缓存 // 删除缓存
orderService.cacheDelete(orderGoods.getOrderNo()); orderService.cacheDelete(orderGoods.getOrderNo());

@ -239,7 +239,7 @@ public class OrderCreateService {
orderGoods.setGoodsSpecsName(goodsSpecs.getName()); orderGoods.setGoodsSpecsName(goodsSpecs.getName());
orderGoods.setGoodsSpecsOriginalPrice(goodsSpecs.getOriginalPrice()); orderGoods.setGoodsSpecsOriginalPrice(goodsSpecs.getOriginalPrice());
orderGoods.setGoodsCount(orderChild.getProductCount()); orderGoods.setGoodsCount(orderChild.getProductCount());
orderGoods.setStatus(OrderGoodsStatusEnum.status8.getCode()); orderGoods.setStatus(orderChild.getStatus());
orderGoods.setDeliveryAddress(address.getAddress()); orderGoods.setDeliveryAddress(address.getAddress());
orderGoods.setDeliveryAddressId(address.getId()); orderGoods.setDeliveryAddressId(address.getId());
orderGoods.setCreateTime(new Date()); orderGoods.setCreateTime(new Date());

@ -224,14 +224,16 @@ public class OrderPaySuccessService {
goodsOrder.setPaySerialNo(order.getPaySerialNo()); goodsOrder.setPaySerialNo(order.getPaySerialNo());
goodsOrder.setPayTime(order.getPayTime()); goodsOrder.setPayTime(order.getPayTime());
goodsOrder.setUpdateTime(new Date()); goodsOrder.setUpdateTime(new Date());
goodsOrder.setStatus(1); goodsOrder.setStatus(childOrder.getStatus());
bsOrderGoodsService.update(goodsOrder);
} catch (Exception e) { } catch (Exception e) {
goodsOrder.setExceptionStatus(true); if (goodsOrder == null) {
goodsOrder = new BsOrderGoods();
}
goodsOrder.setExceptionMsg(e.getMessage()); goodsOrder.setExceptionMsg(e.getMessage());
bsOrderGoodsService.update(goodsOrder);
} }
bsOrderGoodsService.update(goodsOrder);
} }
public void cinema(OrderModel order,BsOrderChild childOrder) { public void cinema(OrderModel order,BsOrderChild childOrder) {

@ -12,8 +12,10 @@ import com.hfkj.service.BsProductConfigService;
import com.hfkj.service.goods.*; import com.hfkj.service.goods.*;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl; import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.order.BsOrderChildService; import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; import com.hfkj.sysenum.order.OrderChildProductTypeEnum;
import com.hfkj.sysenum.order.OrderChildStatusEnum; import com.hfkj.sysenum.order.OrderChildStatusEnum;
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -48,6 +50,9 @@ public class BsOrderChildServiceImpl implements BsOrderChildService {
@Resource @Resource
private BsProductConfigService bsProductConfigService; private BsProductConfigService bsProductConfigService;
@Resource
private BsOrderService orderService;
@Override @Override
public void editData(BsOrderChild data) { public void editData(BsOrderChild data) {
data.setUpdateTime(new Date()); data.setUpdateTime(new Date());
@ -113,6 +118,16 @@ public class BsOrderChildServiceImpl implements BsOrderChildService {
object.put("orderGoodsId", orderGoods.getId()); object.put("orderGoodsId", orderGoods.getId());
childModel.setBusiness(object); childModel.setBusiness(object);
if (orderGoods.getLogisticsStatus() != null && orderGoods.getLogisticsStatus().equals(OrderLogisticsStatusEnum.statusSIGN.getCode())) {
// 子订单完成
orderService.childOrderComplete(orderGoods.getChildOrderNo());
orderGoods.setStatus(OrderChildStatusEnum.status3.getCode());
orderGoods.setUpdateTime(new Date());
orderGoodsService.update(orderGoods);
// 删除缓存
orderService.cacheDelete(orderGoods.getOrderNo());
}
} }
} else if (childModel.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { } else if (childModel.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {
childModel.setBusiness(goodsVpdService.queryDetailBySpecsId(childModel.getProductSpecId())); childModel.setBusiness(goodsVpdService.queryDetailBySpecsId(childModel.getProductSpecId()));

@ -0,0 +1,32 @@
package com.hfkj.sysenum.order;
import lombok.Getter;
@Getter
public enum OrderLogisticsStatusEnum {
statusDELIVERING("派件中" , "DELIVERING"),
statusTRANSPORT("运输中", "TRANSPORT"),
statusAGENT_SIGN("已代签收", "AGENT_SIGN"),
statusSIGN("已签收", "SIGN"),
statusACCEPT("已揽收", "ACCEPT"),
statusFAILED("包裹异常", "FAILED"),
statusWAIT_ACCEPT("待揽收", "WAIT_ACCEPT"),
;
private final String code;
private final String name;
OrderLogisticsStatusEnum(String name, String code) {
this.code = code;
this.name = name;
}
}
Loading…
Cancel
Save