| @@ -35,7 +35,13 @@ public class WxActivityController extends BaseController { | |||
| @GetMapping("/queryStatus") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData queryStatus(Long id) { | |||
| return new ResultData(wxActivityService.queryStatus(id, getMemberId())); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return new ResultData(wxActivityService.queryStatus(id, memberId)); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @@ -43,7 +49,13 @@ public class WxActivityController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(Long id) { | |||
| WxActivity wxActivity = wxActivityService.getById(id); | |||
| Integer status = wxActivityService.queryStatus(id, getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| Integer status = wxActivityService.queryStatus(id, memberId); | |||
| Map<String, Object> data = new HashMap<>(); | |||
| data.put("activity", wxActivity); | |||
| data.put("status", status); | |||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| @@ -45,8 +46,14 @@ public class WxActivityJoinController extends BaseController { | |||
| if (null == wxActivityJoin) { | |||
| wxActivityJoin = new WxActivityJoin(); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxActivityJoin.updateTenantInfo(getTenantInfo()); | |||
| wxActivityJoin.setUserId(getMemberId()); | |||
| wxActivityJoin.setUserId(memberId); | |||
| wxActivityJoin.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| final PageInfo<WxActivity> page = wxActivityJoinService.clistAsPage(wxActivityJoin, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -58,7 +65,13 @@ public class WxActivityJoinController extends BaseController { | |||
| if (wxActivityJoin.getActivityId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | |||
| } | |||
| WxCUserBasicInfo member = getMember(); | |||
| WxCUserBasicInfo member; | |||
| try { | |||
| member = getMember(); | |||
| } catch (Exception e1) { | |||
| return new ResultData(Result.ERROR,e1.getMessage()); | |||
| } | |||
| wxActivityJoin.updateTenantInfo(getTenantInfo()); | |||
| wxActivityJoin.setUserId(member.getId()); | |||
| wxActivityJoin.setNickName(member.getNickName()); | |||
| @@ -81,8 +94,14 @@ public class WxActivityJoinController extends BaseController { | |||
| if (wxActivityJoin.getActivityId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxActivityJoin.updateTenantInfo(getTenantInfo()); | |||
| wxActivityJoin.setUserId(getMemberId()); | |||
| wxActivityJoin.setUserId(memberId); | |||
| return wxActivityJoinService.sign(wxActivityJoin); | |||
| } | |||
| @@ -108,8 +108,14 @@ public class WxCarController extends BaseController { | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(getTenantInfo()); | |||
| // 2. get vendor params | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | |||
| return etcpHelper.initForEtcp(paramMap, getMemberId(), park); | |||
| return etcpHelper.initForEtcp(paramMap, memberId, park); | |||
| }else { | |||
| try { | |||
| String vendorPersonId = parkFactory.getParkService(park.getVendorType()).initLogin(paramMap, park, getMember()); | |||
| @@ -138,7 +144,12 @@ public class WxCarController extends BaseController { | |||
| @ApiOperation(value = "绑车牌", notes = "ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\"}, TJD:={\"carNumber\":\"string\"}") | |||
| @PostMapping("/bindCar") | |||
| public ResultData bindCar(@RequestBody Map<String, String> paramMap) { | |||
| WxCUserBasicInfo member = getMember(); | |||
| WxCUserBasicInfo member; | |||
| try { | |||
| member = getMember(); | |||
| } catch (Exception e1) { | |||
| return new ResultData(Result.ERROR,e1.getMessage()); | |||
| } | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(getTenantInfo()); | |||
| // 2. get vendor params | |||
| @@ -178,8 +189,14 @@ public class WxCarController extends BaseController { | |||
| public ResultData unbindCar(@RequestBody Map<String, String> paramMap) { | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(getTenantInfo()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | |||
| return etcpHelper.etcpUnbindCar(paramMap, park, getMemberId()); | |||
| return etcpHelper.etcpUnbindCar(paramMap, park, memberId); | |||
| } else { | |||
| try { | |||
| parkFactory.getParkService(park.getVendorType()).unbindCar(paramMap, park, getMember()); | |||
| @@ -279,10 +296,17 @@ public class WxCarController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId转化失败"); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| WxCouponOrderCarCVo userCar = null; | |||
| WxCouponOrder userCarQ = new WxCouponOrder(); | |||
| userCarQ.updateTenantInfo(park); | |||
| userCarQ.setCUserId(getMemberId()); | |||
| userCarQ.setCUserId(memberId); | |||
| userCarQ.setId(couponOrderId); | |||
| userCarQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); | |||
| List<WxCouponOrderCarCVo> list = wxCouponOrderService.carListCUserVo(userCarQ); | |||
| @@ -322,9 +346,16 @@ public class WxCarController extends BaseController { | |||
| if (pageNum == null || pageSize == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCarCVo(); | |||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| wxCouponOrder.setCUserId(getMemberId()); | |||
| wxCouponOrder.setCUserId(memberId); | |||
| if (wxCouponOrder.getCouponOrderStatus() == null) | |||
| wxCouponOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | |||
| @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| @@ -80,7 +81,13 @@ public class WxCardPayController extends BaseController { | |||
| String cardIdStr = paramMap.get("cardId"); | |||
| String merchantStr = paramMap.get("merchantId"); | |||
| String totalFeeStr = paramMap.get("totalFee"); | |||
| return saveCardPayOrder(getMemberId(),cardIdStr,merchantStr,totalFeeStr,EnumPayWay.PAY_WAY_WECHAT); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return saveCardPayOrder(memberId,cardIdStr,merchantStr,totalFeeStr,EnumPayWay.PAY_WAY_WECHAT); | |||
| } | |||
| private ResultData saveCardPayOrder(Long cUserId,String cardIdStr,String merchantStr,String totalFeeStr,EnumPayWay payWay) { | |||
| @@ -194,7 +201,13 @@ public class WxCardPayController extends BaseController { | |||
| public ResultData cardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend, Integer pageNum, Integer pageSize) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("list: " + ipStr + " :" + wxCardSpend.toString()); | |||
| return cardSpendList(wxCardSpend,getMemberId(), pageNum, pageSize); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return cardSpendList(wxCardSpend,memberId, pageNum, pageSize); | |||
| } | |||
| private ResultData cardSpendList(WxCardSpendVo wxCardSpend,Long cUserId,Integer pageNum, Integer pageSize) { | |||
| @@ -210,7 +223,13 @@ public class WxCardPayController extends BaseController { | |||
| public ResultData sumCardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend) { | |||
| String ipStr = getIpAddr(); | |||
| logger.info("sumCardSpendList: " + ipStr + " :" + wxCardSpend.toString()); | |||
| return sumCardSpendList(wxCardSpend, getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return sumCardSpendList(wxCardSpend,memberId); | |||
| } | |||
| private ResultData sumCardSpendList(WxCardSpendVo wxCardSpend,Long cUserId) { | |||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| @@ -69,8 +70,14 @@ public class WxCouponOrderController extends BaseController { | |||
| if (pageNum == null || pageSize == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCVo(); | |||
| wxCouponOrder.setCUserId(getMemberId()); | |||
| wxCouponOrder.setCUserId(memberId); | |||
| if (wxCouponOrder.getCouponOrderStatus() == null) | |||
| wxCouponOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC, BaseEntity.SortField.Id_DESC); | |||
| else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | |||
| @@ -112,7 +119,13 @@ public class WxCouponOrderController extends BaseController { | |||
| if (wxCouponOrderCVo == null) { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| if (!wxCouponOrderCVo.getCUserId().equals(getMemberId())) { | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (!wxCouponOrderCVo.getCUserId().equals(memberId)) { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| WxCouponCVo wxCouponCVo = null; | |||
| @@ -245,7 +258,13 @@ public class WxCouponOrderController extends BaseController { | |||
| cardCVo = new WxCardCVo(); | |||
| } | |||
| cardCVo.updateTenantInfo(getTenantInfo()); | |||
| cardCVo.setOwnerId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| cardCVo.setOwnerId(memberId); | |||
| if(StringUtils.isNotBlank(cardCVo.getStatusStr())) { | |||
| String [] statusAttr = cardCVo.getStatusStr().split(","); | |||
| List<Integer> tmpList = new ArrayList<Integer>(); | |||
| @@ -275,8 +294,13 @@ public class WxCouponOrderController extends BaseController { | |||
| if (couponOrderId == null || couponOrderId.equalsIgnoreCase(Constant.UNDEFINED) ) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| return wxCouponOrderService.cardDetailCUserVo(getMemberId(), couponOrderId); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxCouponOrderService.cardDetailCUserVo(memberId, couponOrderId); | |||
| } | |||
| @ApiOperation(value = "卡转赠领取") | |||
| @@ -297,7 +321,13 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cUserId不能为空"); | |||
| } | |||
| //当前领取人 | |||
| wxCouponOrder.setOwnerId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxCouponOrder.setOwnerId(memberId); | |||
| //转赠者与当前领取人是否为同一个 | |||
| if (cUserId.equals(wxCouponOrder.getOwnerId())) { | |||
| logger.info("转赠人与卡所有者相同"); | |||
| @@ -330,7 +360,13 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "updateDate不能为空"); | |||
| } | |||
| //当前领取人 | |||
| wxCouponOrder.setOwnerId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxCouponOrder.setOwnerId(memberId); | |||
| return wxCouponOrderService.queryCardStatus(wxCouponOrder); | |||
| } | |||
| @@ -338,7 +374,12 @@ public class WxCouponOrderController extends BaseController { | |||
| @GetMapping("checkH5CouponOrder") | |||
| public ResultData checkH5CouponOrder() { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| WxCUserBasicInfo member = getMember(); | |||
| WxCUserBasicInfo member; | |||
| try { | |||
| member = getMember(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| memCouponFromDspService.couponOrderFromDsp(tenantEntity, member.getPhone()); | |||
| return new ResultData(); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.*; | |||
| @@ -42,7 +43,13 @@ public class WxCouponPasswordController extends BaseController { | |||
| logger.info("getCouponOrderByPassword: " + getIpAddr() + params.toString()); | |||
| String password = params.get("password"); | |||
| String formId = params.get("formId"); | |||
| return getCouponOrderByPassword(password, formId, getMemberId(),EnumPayWay.PAY_WAY_NOT_UNPAY_PASSWD); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return getCouponOrderByPassword(password, formId, memberId,EnumPayWay.PAY_WAY_NOT_UNPAY_PASSWD); | |||
| } | |||
| private ResultData getCouponOrderByPassword(String password,String formId,Long memberId,EnumPayWay payWay) { | |||
| @@ -2,6 +2,7 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| @@ -39,7 +40,13 @@ public class WxCreditHistoryController extends BaseController{ | |||
| if (null == wxCreditHistory){ | |||
| wxCreditHistory = new WxCreditHistory(); | |||
| } | |||
| wxCreditHistory.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxCreditHistory.setCUserId(memberId); | |||
| wxCreditHistory.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxCreditHistory> page = wxCreditHistoryService.listAsPage(wxCreditHistory, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -65,7 +65,13 @@ public class WxOrderController extends BaseController { | |||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||
| @PostMapping("save") | |||
| public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | |||
| return saveOrder(orderSaveDto,getMemberId(),EnumPayWay.PAY_WAY_WECHAT); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return saveOrder(orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT); | |||
| } | |||
| private ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay) { | |||
| @@ -289,7 +295,13 @@ public class WxOrderController extends BaseController { | |||
| if (wxOrder == null){ | |||
| wxOrder = new WxOrder(); | |||
| } | |||
| wxOrder.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| wxOrder.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<WxOrderCouponVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize); | |||
| @@ -329,7 +341,13 @@ public class WxOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | |||
| } | |||
| wxOrder.setId(id); | |||
| wxOrder.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| WxOrderCouponVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | |||
| if (wxOrderCVo == null) | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| @@ -434,7 +452,13 @@ public class WxOrderController extends BaseController { | |||
| public ResultData pressOrderList(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||
| // c端用户应该只能看到自己的订单 | |||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||
| wxOrder.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| wxOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| final PageInfo<WxOrderCouponPressVo> page = wxOrderService.listPressVoAsPage(wxOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -2,6 +2,7 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxOrder; | |||
| @@ -50,7 +51,13 @@ public class WxOrderGroupController extends BaseController { | |||
| wxOrderGroup.setRemainPeople(1); | |||
| wxOrderGroup.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()); | |||
| wxOrderGroup.updateTenantInfo(getTenantInfo()); | |||
| return wxOrderGroupService.queryRemainOne(wxOrderGroup, getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return wxOrderGroupService.queryRemainOne(wxOrderGroup, memberId); | |||
| } | |||
| @@ -62,7 +69,13 @@ public class WxOrderGroupController extends BaseController { | |||
| }) | |||
| public ResultData queryOrderGroup(Integer pageNum, Integer pageSize) { | |||
| WxOrder wxOrder = new WxOrder(); | |||
| wxOrder.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| wxOrder.updateTenantInfo(getTenantInfo()); | |||
| final PageInfo<Map<String, Object>> page = wxOrderGroupService.queryOrderGroup(wxOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -119,7 +132,13 @@ public class WxOrderGroupController extends BaseController { | |||
| if (wxOrderGroup.getId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | |||
| } | |||
| wxOrderGroup.setUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrderGroup.setUserId(memberId); | |||
| wxOrderGroup.updateTenantInfo(getTenantInfo()); | |||
| return wxOrderGroupService.queryAttendStatus(wxOrderGroup); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxOrder; | |||
| @@ -154,8 +155,14 @@ public class WxPressOrderController extends BaseController { | |||
| logger.error("此砍价订单被锁定, orderId: " + orderIdStr); | |||
| return new ResultData(ErrorCode.TOO_MANY_REQUEST); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| // 检查此人是否已参与砍价 | |||
| boolean hadJoin = wxOrderPressService.checkCUserHasJoin(order, getMemberId()); | |||
| boolean hadJoin = wxOrderPressService.checkCUserHasJoin(order, memberId); | |||
| if (hadJoin) { | |||
| redisLock.unlock(orderIdStr, timeStr); | |||
| logger.error("用户已参与砍价"); | |||
| @@ -163,7 +170,7 @@ public class WxPressOrderController extends BaseController { | |||
| } | |||
| try { | |||
| WxOrderPress orderPress = wxOrderPressService.pressCouponJoin(order, wxCouponCVo, getMemberId()); | |||
| WxOrderPress orderPress = wxOrderPressService.pressCouponJoin(order, wxCouponCVo, memberId); | |||
| if (orderPress != null) { | |||
| // 更新砍价信息 | |||
| Integer index = order.getPressCurrentNum() + 1; | |||
| @@ -241,11 +248,17 @@ public class WxPressOrderController extends BaseController { | |||
| logger.error("订单不存在:" + orderId); | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| if(order.getCUserId().equals(getMemberId())) { | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if(order.getCUserId().equals(memberId)) { | |||
| ret.put("status", EnumOrderPressStatus.FIRST.getCode()); | |||
| return new ResultData(ret); | |||
| } | |||
| int status = wxOrderPressService.pressCouponStatus(order, getMemberId()); | |||
| int status = wxOrderPressService.pressCouponStatus(order, memberId); | |||
| ret.put("status", status); | |||
| return new ResultData(ret); | |||
| } | |||
| @@ -51,6 +51,12 @@ public class WxQuestionController extends BaseController { | |||
| }catch (Exception e) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxQuestionConfig.setCouponTypeList(ct.toString()); | |||
| List<WxQuestionConfig> listConfig = wxQuestionService.findConfigList(wxQuestionConfig); | |||
| if (listConfig.size() > 0) { | |||
| @@ -68,7 +74,7 @@ public class WxQuestionController extends BaseController { | |||
| while(q.hasNext()){ | |||
| WxQuestion x = q.next(); | |||
| wxQuestionLog.setQuestionId(x.getId()); | |||
| wxQuestionLog.setUserId(getMemberId()); | |||
| wxQuestionLog.setUserId(memberId); | |||
| wxQuestionLog.updateTenantInfo(wxQuestionConfig); | |||
| if(wxQuestionService.findLogList(wxQuestionLog).size()>0){ | |||
| @@ -95,6 +101,12 @@ public class WxQuestionController extends BaseController { | |||
| if (wxQuestionLog.getAnswer() == null) | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (wxQuestionLog.getAnswer().isEmpty()) { | |||
| wxQuestionLog.setAnswer(null); | |||
| } else { | |||
| @@ -105,10 +117,10 @@ public class WxQuestionController extends BaseController { | |||
| } | |||
| wxQuestionLog.setAnswer(JSONObject.toJSONString(as)); | |||
| wxCUserTagsService.assignTags(as, wxCUserBasicInfoService.getById(getMemberId())); | |||
| wxCUserTagsService.assignTags(as, wxCUserBasicInfoService.getById(memberId)); | |||
| } | |||
| wxQuestionLog.setUserId(getMemberId()); | |||
| wxQuestionLog.setUserId(memberId); | |||
| wxQuestionService.saveOrUpdateLog(wxQuestionLog); | |||
| return new ResultData(); | |||
| @@ -2,6 +2,7 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| @@ -31,7 +32,13 @@ public class WxScoreHistoryController extends BaseController { | |||
| public ResultData list(Integer pageNum, Integer pageSize) { | |||
| WxScoreHistory wxScoreHistory = new WxScoreHistory(); | |||
| // wxScoreHistory.updateTenantInfo(getTenantInfo()); | |||
| wxScoreHistory.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxScoreHistory.setCUserId(memberId); | |||
| wxScoreHistory.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| final PageInfo<WxScoreHistory> page = wxScoreHistoryService.listAsPage(wxScoreHistory, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -784,6 +784,7 @@ public class WxUserGrantController extends BaseController { | |||
| @GetMapping("/userinfo") | |||
| public ResultData getUserInfo() { | |||
| WxCUser user = getWxCUser(); | |||
| WxCUserVo userVo = new WxCUserVo(); | |||
| org.springframework.beans.BeanUtils.copyProperties(user, userVo); | |||
| userVo.setScore(0); | |||
| @@ -837,7 +838,12 @@ public class WxUserGrantController extends BaseController { | |||
| @ApiOperation("当前用户名下是否有车") | |||
| @GetMapping("/carCount") | |||
| public ResultData carCount() { | |||
| WxCUserBasicInfo member = getMember(); | |||
| WxCUserBasicInfo member; | |||
| try { | |||
| member = getMember(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| WxCUserCar userCar = new WxCUserCar(); | |||
| userCar.setCUserId(member.getId()); | |||
| Integer count = wxCUserCarService.countUserCar(userCar); | |||
| @@ -858,7 +864,14 @@ public class WxUserGrantController extends BaseController { | |||
| @GetMapping("/carList") | |||
| public ResultData getCarList() { | |||
| WxCUserCar userCar = new WxCUserCar(); | |||
| userCar.setCUserId(getMemberId()); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| userCar.setCUserId(memberId); | |||
| List<WxCUserCar> list = wxCUserCarService.getList(userCar); | |||
| return new ResultData(Result.SUCCESS, "获取查询成功", list); | |||
| } | |||
| @@ -914,13 +927,19 @@ public class WxUserGrantController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (wxCUserBasicInfo.getName() != null || | |||
| wxCUserBasicInfo.getBirthdate() != null || | |||
| wxCUserBasicInfo.getSex() != null || | |||
| wxCUserBasicInfo.getAddress() != null) { | |||
| WxCUserBasicInfo record = new WxCUserBasicInfo(); | |||
| record.setId(getMemberId()); | |||
| record.setId(memberId); | |||
| record.setName(wxCUserBasicInfo.getName()); | |||
| record.setAvatarUrl(wxCUserBasicInfo.getAvatarUrl()); | |||
| record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||
| @@ -936,7 +955,7 @@ public class WxUserGrantController extends BaseController { | |||
| wxCreditHistory.setCreateDate(new Date()); | |||
| wxCreditHistory.setCreditType(EnumScoreType.COMPLETE_INFO.getCode()); | |||
| wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); | |||
| wxCreditHistory.setOperatorId(getMemberId()); | |||
| wxCreditHistory.setOperatorId(memberId); | |||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | |||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record); | |||
| } | |||
| @@ -951,7 +970,12 @@ public class WxUserGrantController extends BaseController { | |||
| @RequestMapping("/getDiscountInfo") | |||
| @ApiOperation(value = "获取用户折扣率", notes = "") | |||
| public ResultData getDiscountInfo() { | |||
| WxCUserBasicInfo member = getMember(); | |||
| WxCUserBasicInfo member; | |||
| try { | |||
| member = getMember(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(getTenantInfo()); | |||
| String level = WxLevelConfigService.DEFAULT_LEVEL; | |||