master
袁野 6 months ago
parent 05ec670446
commit d7f036faa2
  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
private UserCenter userCenter;
@Resource
private GoodsUserAddressService deliveryAddressService;
@RequestMapping(value="/editGoodsMsg",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑商品信息")
@ -277,7 +280,7 @@ public class GoodsController {
map.put("goodsBrand", goodsBrand);
if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
map.put("merId", userModel.getAccount().getId());
map.put("merId", userModel.getAccount().getObjectId());
}
map.put("type", type);
@ -399,11 +402,6 @@ public class GoodsController {
SessionObject sessionObject = userCenter.getSessionObject(request);
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);
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<>();
if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
map.put("merId", userModel.getAccount().getId());
map.put("merId", userModel.getAccount().getObjectId());
}
map.put("logisticsNo", logisticsNo);

@ -60,7 +60,7 @@ public class OrderPaySuccessService {
for (BsOrderChild childOrder : order.getOrderChildList()) {
try {
if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
goods(order);
goods(order, childOrder);
} else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {
product(order, childOrder);
}
@ -184,7 +184,7 @@ public class OrderPaySuccessService {
* 实物产品
* @param order
*/
public void goods(OrderModel order) throws Exception {
public void goods(OrderModel order, BsOrderChild childOrder) throws Exception {
BsOrderGoods goodsOrder = bsOrderGoodsService.findGoodsOrder(order.getOrderNo());
if (goodsOrder == null) {
@ -193,7 +193,15 @@ public class OrderPaySuccessService {
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.setStatus(1);
bsOrderGoodsService.update(goodsOrder);

Loading…
Cancel
Save