master
袁野 6 months ago
parent b3d720bf76
commit 82446abe63
  1. 32
      bweb/src/main/java/com/bweb/controller/goods/GoodsController.java
  2. 2
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  3. 14
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java

@ -57,6 +57,9 @@ public class GoodsController {
@Resource @Resource
private UserCenter userCenter; private UserCenter userCenter;
@Resource
private GoodsUserAddressService deliveryAddressService;
@RequestMapping(value="/editGoodsMsg",method = RequestMethod.POST) @RequestMapping(value="/editGoodsMsg",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "编辑商品信息") @ApiOperation(value = "编辑商品信息")
@ -277,7 +280,7 @@ public class GoodsController {
map.put("goodsBrand", goodsBrand); map.put("goodsBrand", goodsBrand);
if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
map.put("merId", userModel.getAccount().getId()); map.put("merId", userModel.getAccount().getObjectId());
} }
map.put("type", type); map.put("type", type);
@ -399,11 +402,6 @@ public class GoodsController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject();
if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
GoodsMsg goodsMsg = goodsMsgService.queryDetail(id); GoodsMsg goodsMsg = goodsMsgService.queryDetail(id);
if (goodsMsg.getStatus() == 1) { if (goodsMsg.getStatus() == 1) {
@ -441,6 +439,28 @@ public class GoodsController {
} }
@RequestMapping(value = "/findDeliveryAddressById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询收货地址详情")
public ResponseData findDeliveryAddressById(
@RequestParam(value = "id", required = true) Long id
) {
try {
GoodsUserAddress deliveryAddress = deliveryAddressService.queryDetail(id);
if (deliveryAddress == null) {
log.error("GoodsDetailController -> findGoodsDetailById() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相信息");
}
return ResponseMsgUtil.success(deliveryAddress);
} catch (Exception e) {
log.error("GoodsDetailController --> findGoodsDetailById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -76,7 +76,7 @@ public class BsOrderGoodsController {
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
map.put("merId", userModel.getAccount().getId()); map.put("merId", userModel.getAccount().getObjectId());
} }
map.put("logisticsNo", logisticsNo); map.put("logisticsNo", logisticsNo);

@ -60,7 +60,7 @@ public class OrderPaySuccessService {
for (BsOrderChild childOrder : order.getOrderChildList()) { for (BsOrderChild childOrder : order.getOrderChildList()) {
try { try {
if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
goods(order); goods(order, childOrder);
} else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { } else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {
product(order, childOrder); product(order, childOrder);
} }
@ -184,7 +184,7 @@ public class OrderPaySuccessService {
* 实物产品 * 实物产品
* @param order * @param order
*/ */
public void goods(OrderModel order) throws Exception { public void goods(OrderModel order, BsOrderChild childOrder) throws Exception {
BsOrderGoods goodsOrder = bsOrderGoodsService.findGoodsOrder(order.getOrderNo()); BsOrderGoods goodsOrder = bsOrderGoodsService.findGoodsOrder(order.getOrderNo());
if (goodsOrder == null) { if (goodsOrder == null) {
@ -193,7 +193,15 @@ public class OrderPaySuccessService {
goodsMsgService.editSaleNum(goodsOrder.getGoodsId() , goodsOrder.getGoodsCount() , 1); goodsMsgService.editSaleNum(goodsOrder.getGoodsId() , goodsOrder.getGoodsCount() , 1);
goodsOrder.setTotalPrice(childOrder.getProductTotalPrice());
goodsOrder.setTotalDeductionPrice(childOrder.getTotalDeductionPrice());
goodsOrder.setCouponDiscountPrice(childOrder.getCouponDiscountPrice());
goodsOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice());
goodsOrder.setPayRealPrice(childOrder.getSurplusRefundPrice());
goodsOrder.setPayChannel(order.getPayChannel());
goodsOrder.setPayType(order.getPayType());
goodsOrder.setPaySerialNo(order.getPaySerialNo());
goodsOrder.setPayTime(order.getPayTime());
goodsOrder.setUpdateTime(new Date()); goodsOrder.setUpdateTime(new Date());
goodsOrder.setStatus(1); goodsOrder.setStatus(1);
bsOrderGoodsService.update(goodsOrder); bsOrderGoodsService.update(goodsOrder);

Loading…
Cancel
Save