- 添加后去收件人信息

pull/1/head
sin 2019-04-05 15:16:23 +08:00
parent fb60682c44
commit 21bb6fd1c4
6 changed files with 52 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.order.api.OrderService; import cn.iocoder.mall.order.api.OrderService;
import cn.iocoder.mall.order.api.bo.OrderItemBO; import cn.iocoder.mall.order.api.bo.OrderItemBO;
import cn.iocoder.mall.order.api.bo.OrderPageBO; import cn.iocoder.mall.order.api.bo.OrderPageBO;
import cn.iocoder.mall.order.api.bo.OrderRecipientBO;
import cn.iocoder.mall.order.api.dto.*; import cn.iocoder.mall.order.api.dto.*;
import cn.iocoder.mall.order.application.convert.OrderConvertAPP; import cn.iocoder.mall.order.application.convert.OrderConvertAPP;
import cn.iocoder.mall.order.application.vo.OrderItemUpdateVO; import cn.iocoder.mall.order.application.vo.OrderItemUpdateVO;
@ -45,6 +46,12 @@ public class AdminsOrderController {
return orderService.getOrderItems(orderId); return orderService.getOrderItems(orderId);
} }
@GetMapping("order_recipient_info")
@ApiOperation("订单收件人信息")
public CommonResult<OrderRecipientBO> getOrderRecipientBO(@RequestParam("orderId") Integer orderId) {
return orderService.getOrderRecipientBO(orderId);
}
@PutMapping("update_remark") @PutMapping("update_remark")
@ApiOperation("更新-更新订单备注") @ApiOperation("更新-更新订单备注")
public CommonResult updateRemark(@RequestParam("orderId") Integer orderId, public CommonResult updateRemark(@RequestParam("orderId") Integer orderId,

View File

@ -4,6 +4,7 @@ import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.order.api.bo.OrderCreateBO; import cn.iocoder.mall.order.api.bo.OrderCreateBO;
import cn.iocoder.mall.order.api.bo.OrderItemBO; import cn.iocoder.mall.order.api.bo.OrderItemBO;
import cn.iocoder.mall.order.api.bo.OrderPageBO; import cn.iocoder.mall.order.api.bo.OrderPageBO;
import cn.iocoder.mall.order.api.bo.OrderRecipientBO;
import cn.iocoder.mall.order.api.dto.*; import cn.iocoder.mall.order.api.dto.*;
import java.util.List; import java.util.List;
@ -32,6 +33,14 @@ public interface OrderService {
*/ */
CommonResult<List<OrderItemBO>> getOrderItems(Integer orderId); CommonResult<List<OrderItemBO>> getOrderItems(Integer orderId);
/**
*
*
* @param orderId
* @return
*/
CommonResult<OrderRecipientBO> getOrderRecipientBO(Integer orderId);
/** /**
* - * -
* *

View File

@ -23,6 +23,9 @@ public interface OrderRecipientConvert {
@Mappings({}) @Mappings({})
OrderRecipientDO convert(OrderCreateDTO orderCreateDTO); OrderRecipientDO convert(OrderCreateDTO orderCreateDTO);
@Mappings({})
OrderRecipientBO convert(OrderRecipientDO orderRecipientDO);
@Mappings({}) @Mappings({})
List<OrderRecipientBO> convert(List<OrderRecipientDO> orderRecipientDOList); List<OrderRecipientBO> convert(List<OrderRecipientDO> orderRecipientDOList);
} }

View File

@ -24,6 +24,16 @@ public interface OrderRecipientMapper {
*/ */
int insert(OrderRecipientDO orderRecipient); int insert(OrderRecipientDO orderRecipient);
/**
* - orderId
*
* @param orderId
* @return
*/
OrderRecipientDO selectByOrderId(
@Param("orderId") Integer orderId
);
/** /**
* - orderIds * - orderIds
* *
@ -33,4 +43,5 @@ public interface OrderRecipientMapper {
List<OrderRecipientDO> selectByOrderIds( List<OrderRecipientDO> selectByOrderIds(
@Param("orderIds")Collection<Integer> orderIds @Param("orderIds")Collection<Integer> orderIds
); );
} }

View File

@ -118,6 +118,17 @@ public class OrderServiceImpl implements OrderService {
return CommonResult.success(orderItemBOList); return CommonResult.success(orderItemBOList);
} }
@Override
public CommonResult<OrderRecipientBO> getOrderRecipientBO(Integer orderId) {
if (orderMapper.selectById(orderId) == null) {
return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode());
}
OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderId);
OrderRecipientBO orderRecipientBO = OrderRecipientConvert.INSTANCE.convert(orderRecipientDO);
return CommonResult.success(orderRecipientBO);
}
@Override @Override
@Transactional @Transactional
public CommonResult<OrderCreateBO> createOrder(Integer userId, OrderCreateDTO orderCreateDTO) { public CommonResult<OrderCreateBO> createOrder(Integer userId, OrderCreateDTO orderCreateDTO) {

View File

@ -20,6 +20,16 @@
) )
</insert> </insert>
<!--
查询 - 根据 orderId
-->
<select id="selectByOrderId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO">
SELECT
<include refid="FIELDS" />
FROM `order_recipient`
WHERE order_id = #{orderId}
</select>
<!-- <!--
查询 - 根据 orderIds 查询 - 根据 orderIds
--> -->
@ -32,4 +42,5 @@
#{orderId} #{orderId}
</foreach> </foreach>
</select> </select>
</mapper> </mapper>