| @@ -0,0 +1,74 @@ | |||
| package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.AliBusinessCircleOrder; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.service.AliBusinessCircleOrderService; | |||
| import com.iformall.utils.Constant; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| @RestController | |||
| @RequestMapping("aliCircle") | |||
| @Api(description = "订单相关接口") | |||
| public class AliBusinessCircleOrderController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private AliBusinessCircleOrderService aliBusinessCircleOrderService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "-列表") | |||
| public ResultData list(@ModelAttribute AliBusinessCircleOrder circleOrder, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::list"); | |||
| if (null == circleOrder) { | |||
| circleOrder = new AliBusinessCircleOrder(); | |||
| } | |||
| circleOrder.updateTenantInfo(getTenantInfo()); | |||
| circleOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<AliBusinessCircleOrder> page = aliBusinessCircleOrderService.listAsPage(circleOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public ResultData detail(String orderId) { | |||
| if (StringUtils.isBlank(orderId) || orderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long id; | |||
| try { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "orderId: " + orderId + ", e: " + e.getMessage()); | |||
| } | |||
| AliBusinessCircleOrder order = aliBusinessCircleOrderService.detail(id,getTenantInfo()); | |||
| return new ResultData(order); | |||
| } | |||
| } | |||
| @@ -2,22 +2,26 @@ package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.tt.TtOrder; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("businessCircle") | |||
| @RequestMapping("wxCircle") | |||
| @Api(description = "订单相关接口") | |||
| public class WxBusinessCircleOrderController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @@ -43,5 +47,26 @@ public class WxBusinessCircleOrderController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public ResultData detail(String orderId) { | |||
| if (StringUtils.isBlank(orderId) || orderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long id; | |||
| try { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "orderId: " + orderId + ", e: " + e.getMessage()); | |||
| } | |||
| WxBusinessCircleOrder order = wxBusinessCircleOrderService.detail(id,getTenantInfo()); | |||
| return new ResultData(order); | |||
| } | |||
| } | |||
| @@ -0,0 +1,74 @@ | |||
| package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxThirdPartyOrders; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.service.WxThirdPartyOrdersService; | |||
| import com.iformall.utils.Constant; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| @RestController | |||
| @RequestMapping("thirdCircle") | |||
| @Api(description = "订单相关接口") | |||
| public class WxThirdPartyOrdersController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxThirdPartyOrdersService wxThirdPartyOrdersOrderService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "-列表") | |||
| public ResultData list(@ModelAttribute WxThirdPartyOrders circleOrder, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::list"); | |||
| if (null == circleOrder) { | |||
| circleOrder = new WxThirdPartyOrders(); | |||
| } | |||
| circleOrder.updateTenantInfo(getTenantInfo()); | |||
| circleOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxThirdPartyOrders> page = wxThirdPartyOrdersOrderService.listAsPage(circleOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public ResultData detail(String orderId) { | |||
| if (StringUtils.isBlank(orderId) || orderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long id; | |||
| try { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "orderId: " + orderId + ", e: " + e.getMessage()); | |||
| } | |||
| WxThirdPartyOrders order = wxThirdPartyOrdersOrderService.detail(id,getTenantInfo()); | |||
| return new ResultData(order); | |||
| } | |||
| } | |||
| @@ -66,11 +66,15 @@ public class BusinessCircleBase extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="门店Id,与第三方对齐",name="merchantId") | |||
| private Long merchantId; | |||
| private String merchantName; | |||
| @TableField(exist = false) | |||
| private WxMerchant merchant; | |||
| @io.swagger.annotations.ApiModelProperty(value="c端会员id,与第三方对齐",name="cUserId") | |||
| private Long cUserId; | |||
| private String cUserNickName; | |||
| private String cUserPhone; | |||
| @TableField(exist = false) | |||
| private WxCUserBasicInfo basicInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否获得积分(1:是,0:否)",name="earnPoints") | |||
| private Integer earnPoints; | |||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.AliBusinessCircleOrder; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import java.util.List; | |||
| @@ -25,6 +26,7 @@ public interface AliBusinessCircleOrderService { | |||
| * @return | |||
| */ | |||
| AliBusinessCircleOrder getById(Long id, String tenantId); | |||
| AliBusinessCircleOrder detail(Long id, TenantEntity tenantInfo); | |||
| /** | |||
| * transactionId+tenantId | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import java.util.List; | |||
| @@ -24,6 +25,7 @@ public interface WxBusinessCircleOrderService { | |||
| * @return | |||
| */ | |||
| WxBusinessCircleOrder getById(Long id, String tenantId); | |||
| WxBusinessCircleOrder detail(Long id, TenantEntity tenantInfo); | |||
| /** | |||
| * transactionId+tenantId | |||
| @@ -49,5 +51,4 @@ public interface WxBusinessCircleOrderService { | |||
| */ | |||
| void updateIsPointsNotify(WxBusinessCircleOrder record); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxThirdPartyOrders; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumThirdOrderType; | |||
| import java.util.List; | |||
| @@ -25,6 +26,7 @@ public interface WxThirdPartyOrdersService { | |||
| * @return | |||
| */ | |||
| WxThirdPartyOrders getById(Long id, String tenantId); | |||
| WxThirdPartyOrders detail(Long id, TenantEntity tenantInfo); | |||
| /** | |||
| * transactionId+tenantId | |||
| @@ -51,4 +53,5 @@ public interface WxThirdPartyOrdersService { | |||
| * @param record | |||
| */ | |||
| void pointDeduction(WxThirdPartyOrders record); | |||
| } | |||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.AliBusinessCircleOrderMapper; | |||
| import com.iformall.service.*; | |||
| @@ -16,7 +17,6 @@ import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @@ -59,6 +59,21 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||
| return aliBusinessCircleOrderMapper.getById(recordQ); | |||
| } | |||
| @Override | |||
| public AliBusinessCircleOrder detail(Long id, TenantEntity tenantInfo) { | |||
| AliBusinessCircleOrder order = this.getById(id, tenantInfo.getTenantId()); | |||
| if(order.getMerchantId() != null){ | |||
| order.setMerchant(wxMerchantService.selectById(order.getMerchantId())); | |||
| } | |||
| if(order.getCUserId() != null){ | |||
| order.setBasicInfo(wxCUserBasicInfoService.getById(id,tenantInfo.getFinalTenantId())); | |||
| } | |||
| // if(order.getIsRefund() != null && order.getIsRefund().equals(EnumYesOrNo.YES.getCode())){ | |||
| // | |||
| // } | |||
| return order; | |||
| } | |||
| @Override | |||
| public AliBusinessCircleOrder getOrderByTransactionId(String transactionId, String tenantId) { | |||
| AliBusinessCircleOrder recordQ = new AliBusinessCircleOrder(); | |||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.WxBusinessCircleOrderMapper; | |||
| import com.iformall.service.*; | |||
| @@ -39,6 +40,9 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| @Autowired | |||
| WxCUserService wxCUserService; | |||
| @Autowired | |||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @Autowired | |||
| WxCreditHistoryService creditHistoryService; | |||
| @@ -59,6 +63,21 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| return wxBusinessCircleOrderMapper.getById(recordQ); | |||
| } | |||
| @Override | |||
| public WxBusinessCircleOrder detail(Long id, TenantEntity tenantInfo) { | |||
| WxBusinessCircleOrder order = this.getById(id, tenantInfo.getTenantId()); | |||
| if(order.getMerchantId() != null){ | |||
| order.setMerchant(wxMerchantService.selectById(order.getMerchantId())); | |||
| } | |||
| if(order.getCUserId() != null){ | |||
| order.setBasicInfo(wxCUserBasicInfoService.getById(id,tenantInfo.getFinalTenantId())); | |||
| } | |||
| // if(order.getIsRefund() != null && order.getIsRefund().equals(EnumYesOrNo.YES.getCode())){ | |||
| // | |||
| // } | |||
| return order; | |||
| } | |||
| @Override | |||
| public WxBusinessCircleOrder getOrderByTransactionId(String transactionId, String tenantId) { | |||
| WxBusinessCircleOrder recordQ = new WxBusinessCircleOrder(); | |||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxThirdPartyOrdersMapper; | |||
| @@ -64,6 +65,21 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||
| return wxThirdPartyOrdersMapper.getById(recordQ); | |||
| } | |||
| @Override | |||
| public WxThirdPartyOrders detail(Long id, TenantEntity tenantInfo) { | |||
| WxThirdPartyOrders order = this.getById(id, tenantInfo.getTenantId()); | |||
| if(order.getMerchantId() != null){ | |||
| order.setMerchant(wxMerchantService.selectById(order.getMerchantId())); | |||
| } | |||
| if(order.getCUserId() != null){ | |||
| order.setBasicInfo(wxCUserBasicInfoService.getById(id,tenantInfo.getFinalTenantId())); | |||
| } | |||
| // if(order.getIsRefund() != null && order.getIsRefund().equals(EnumYesOrNo.YES.getCode())){ | |||
| // | |||
| // } | |||
| return order; | |||
| } | |||
| @Override | |||
| public WxThirdPartyOrders getOrderByTransactionId(EnumThirdOrderType orderType, String transactionId, String tenantId) { | |||
| WxThirdPartyOrders recordQ = new WxThirdPartyOrders(); | |||