| @@ -401,5 +401,38 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("购物车订单详情接口") | |||||
| @GetMapping("goodsDetail") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||||
| }) | |||||
| public ResultData goodsDetail(String mainOrderId) { | |||||
| if (StringUtils.isBlank(mainOrderId) || mainOrderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| // c端用户应该只能看到自己的订单细节 | |||||
| WxOrder wxOrder = new WxOrder(); | |||||
| Long composeOrderId = 0L; | |||||
| try { | |||||
| composeOrderId = Long.valueOf(mainOrderId); | |||||
| } catch (NumberFormatException e) { | |||||
| logger.error("parse composeOrderId failed"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+mainOrderId); | |||||
| } | |||||
| wxOrder.setComposeOrderId(composeOrderId); | |||||
| Long memberId; | |||||
| try { | |||||
| memberId = getMemberId(); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| wxOrder.setCUserId(memberId); | |||||
| List<WxOrderCouponVo> wxOrders = wxOrderService.goodsDetailCUserVo(wxOrder); | |||||
| if (wxOrders == null) | |||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| return new ResultData(wxOrders); | |||||
| } | |||||
| } | } | ||||
| @@ -65,12 +65,12 @@ public class BaseTenantEntity extends BaseEntity { | |||||
| } | } | ||||
| } | } | ||||
| public TenantEntity getTenantInfo() { | |||||
| TenantEntity tenantEntity = new TenantEntity(); | |||||
| tenantEntity.setTenantId(tenantId); | |||||
| tenantEntity.setParentTenantId(parentTenantId); | |||||
| return tenantEntity; | |||||
| } | |||||
| // public TenantEntity getTenantInfo() { | |||||
| // TenantEntity tenantEntity = new TenantEntity(); | |||||
| // tenantEntity.setTenantId(tenantId); | |||||
| // tenantEntity.setParentTenantId(parentTenantId); | |||||
| // return tenantEntity; | |||||
| // } | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -154,6 +154,7 @@ public interface WxOrderService { | |||||
| WxOrderCouponVo detailCUserVo(WxOrder record); | WxOrderCouponVo detailCUserVo(WxOrder record); | ||||
| List<WxOrderCouponVo> goodsDetailCUserVo(WxOrder wxOrder); | |||||
| void stockBack(WxOrder updateOrder); | void stockBack(WxOrder updateOrder); | ||||
| @@ -242,4 +243,5 @@ public interface WxOrderService { | |||||
| //ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | //ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | ||||
| ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | ||||
| } | } | ||||
| @@ -46,16 +46,16 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| public WxFloatingLayer getFloatingLayer(String openId, String appId) { | public WxFloatingLayer getFloatingLayer(String openId, String appId) { | ||||
| WxAppinfo appinfo = appinfoMapper.findByAppId(appId); | WxAppinfo appinfo = appinfoMapper.findByAppId(appId); | ||||
| if (StringUtils.isBlank(openId)) { | if (StringUtils.isBlank(openId)) { | ||||
| return getWxFloatingLayer(appinfo.getTenantInfo()); | |||||
| return getWxFloatingLayer(appinfo.getTenantId()); | |||||
| } | } | ||||
| //1 查看是否存在用户,用户不存在 直接返回浮层信息 | //1 查看是否存在用户,用户不存在 直接返回浮层信息 | ||||
| WxCUser user = new WxCUser(); | WxCUser user = new WxCUser(); | ||||
| user.setOpenId(openId); | user.setOpenId(openId); | ||||
| user.setAppId(appId); | user.setAppId(appId); | ||||
| user.updateTenantInfo(appinfo); | |||||
| user.setTenantId(appinfo.getTenantId()); | |||||
| WxCUser byOpenId = wxCUserMapper.findByOpenId(user); | WxCUser byOpenId = wxCUserMapper.findByOpenId(user); | ||||
| if (byOpenId == null) { | if (byOpenId == null) { | ||||
| return getWxFloatingLayer(appinfo.getTenantInfo()); | |||||
| return getWxFloatingLayer(appinfo.getTenantId()); | |||||
| } | } | ||||
| //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | ||||
| WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | ||||
| @@ -68,7 +68,7 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| logger.error("用户 {} 已弹过浮层",byOpenId.getId()); | logger.error("用户 {} 已弹过浮层",byOpenId.getId()); | ||||
| return null; | return null; | ||||
| } | } | ||||
| return getWxFloatingLayer(byOpenId); | |||||
| return getWxFloatingLayer(byOpenId.getTenantId()); | |||||
| //merge from develop: 分支逻辑 | //merge from develop: 分支逻辑 | ||||
| // WxFloatingLayer wxFloatingLayer = getWxFloatingLayer(byOpenId); | // WxFloatingLayer wxFloatingLayer = getWxFloatingLayer(byOpenId); | ||||
| // if (wxFloatingLayer != null) { | // if (wxFloatingLayer != null) { | ||||
| @@ -84,15 +84,15 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| wxCuserFloatingLayer = new WxCuserFloatingLayer(); | wxCuserFloatingLayer = new WxCuserFloatingLayer(); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| wxCuserFloatingLayer.setId(idWorker.nextId()); | wxCuserFloatingLayer.setId(idWorker.nextId()); | ||||
| wxCuserFloatingLayer.setTenantId(wxCUser.getTenantId()); | |||||
| wxCuserFloatingLayer.setUserId(wxCUser.getId()); | wxCuserFloatingLayer.setUserId(wxCUser.getId()); | ||||
| wxCuserFloatingLayer.updateTenantInfo(wxCUser); | |||||
| wxCuserFloatingLayer.setCreateTime(new Date()); | wxCuserFloatingLayer.setCreateTime(new Date()); | ||||
| wxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | wxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | ||||
| } | } | ||||
| public WxFloatingLayer getWxFloatingLayer(TenantEntity tenantEntity) { | |||||
| public WxFloatingLayer getWxFloatingLayer(String tenantId) { | |||||
| WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | ||||
| wxFloatingLayer.updateTenantInfo(tenantEntity); | |||||
| wxFloatingLayer.setTenantId(tenantId); | |||||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | ||||
| return wxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); | return wxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); | ||||
| } | } | ||||
| @@ -1742,6 +1742,11 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public List<WxOrderCouponVo> goodsDetailCUserVo(WxOrder record) { | |||||
| return wxOrderMapper.selectDetailOfCUser(record); | |||||
| } | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void shareForMicroPay(TenantEntity tenantEntity, Long orderId, Long payOrderId,EnumPayWay payWay) { | public void shareForMicroPay(TenantEntity tenantEntity, Long orderId, Long payOrderId,EnumPayWay payWay) { | ||||
| @@ -47,10 +47,10 @@ public class SendWeappUniformMsgServiceImpl implements MsgSendService { | |||||
| public void send(BaseMsg baseMsg) throws Exception{ | public void send(BaseMsg baseMsg) throws Exception{ | ||||
| AppUniformMsg appUniformMsg = (AppUniformMsg)baseMsg; | AppUniformMsg appUniformMsg = (AppUniformMsg)baseMsg; | ||||
| TenantEntity tenantEntity = appUniformMsg.getTenantInfo(); | |||||
| if (StringUtils.isBlank(tenantEntity.getTenantId())) { | |||||
| String tenantId = appUniformMsg.getTenantId(); | |||||
| if (StringUtils.isBlank(tenantId)) { | |||||
| WxAppinfo appinfo = appinfoMapper.findByAppId(appUniformMsg.getAppId()); | WxAppinfo appinfo = appinfoMapper.findByAppId(appUniformMsg.getAppId()); | ||||
| tenantEntity = appinfo.getTenantInfo(); | |||||
| tenantId = appinfo.getTenantId(); | |||||
| } | } | ||||
| WxTemplateMsg msg = null; | WxTemplateMsg msg = null; | ||||
| @@ -58,7 +58,7 @@ public class SendWeappUniformMsgServiceImpl implements MsgSendService { | |||||
| // 查询信息模板 | // 查询信息模板 | ||||
| WxTemplateMsg msgQ = new WxTemplateMsg(); | WxTemplateMsg msgQ = new WxTemplateMsg(); | ||||
| msgQ.updateTenantInfo(tenantEntity); | |||||
| msgQ.setTenantId(tenantId); | |||||
| msgQ.setType(appUniformMsg.getTemplateType()); | msgQ.setType(appUniformMsg.getTemplateType()); | ||||
| try { | try { | ||||
| msg = wxTemplateMsgMapper.selectOne(new QueryWrapper(msgQ)); | msg = wxTemplateMsgMapper.selectOne(new QueryWrapper(msgQ)); | ||||
| @@ -381,6 +381,9 @@ | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and o.`parent_tenant_id` = #{parentTenantId} | and o.`parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != composeOrderId "> | |||||
| and o.`compose_order_id` = #{composeOrderId} | |||||
| </if> | |||||
| <if test="orderStatus != null"> | <if test="orderStatus != null"> | ||||
| AND o.order_status = #{orderStatus} | AND o.order_status = #{orderStatus} | ||||
| </if> | </if> | ||||
| @@ -403,6 +406,10 @@ | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and o.`parent_tenant_id` = #{parentTenantId} | and o.`parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != composeOrderId "> | |||||
| and o.`compose_order_id` = #{composeOrderId} | |||||
| </if> | |||||
| <if test="id != null"> | <if test="id != null"> | ||||
| and o.id = #{id} | and o.id = #{id} | ||||
| </if> | </if> | ||||
| @@ -128,7 +128,7 @@ public class TtUserGrantController extends BaseController { | |||||
| String ipaddress = IPUtil.getIpAddr(request); | String ipaddress = IPUtil.getIpAddr(request); | ||||
| TtCUser newUser = new TtCUser(); | TtCUser newUser = new TtCUser(); | ||||
| newUser.updateTenantInfo(wxAppinfo.getTenantInfo()); | |||||
| newUser.setTenantId(wxAppinfo.getTenantId()); | |||||
| newUser.setAppId(appId); | newUser.setAppId(appId); | ||||
| newUser.setOpenId(openId); | newUser.setOpenId(openId); | ||||