| @@ -4,10 +4,13 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.vo.WxCouponOrderCVo; | import com.iformall.domain.vo.WxCouponOrderCVo; | ||||
| import com.iformall.enums.EnumCreditLockedStatus; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCouponOrderService; | import com.iformall.service.WxCouponOrderService; | ||||
| import com.iformall.service.WxMerchantBUserService; | import com.iformall.service.WxMerchantBUserService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -35,6 +38,10 @@ public class WxCouponOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantBUserService wxMerchantBUserService; | private WxMerchantBUserService wxMerchantBUserService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -126,6 +133,10 @@ public class WxCouponOrderController extends BaseController { | |||||
| if (wxCouponOrderCVo == null) | if (wxCouponOrderCVo == null) | ||||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(wxCouponOrderCVo.getcUserId()); | |||||
| if (wxCUserBasicInfo != null && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||||
| } | |||||
| if (wxCouponOrderCVo.getValidStartDate() != null && wxCouponOrderCVo.getValidEndDate() != null ) { | if (wxCouponOrderCVo.getValidStartDate() != null && wxCouponOrderCVo.getValidEndDate() != null ) { | ||||
| Date now = new Date(); | Date now = new Date(); | ||||
| @@ -4,13 +4,12 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxAppinfo; | |||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.po.WxPayOrder; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.EnumCreditLockedStatus; | |||||
| import com.iformall.enums.EnumPayStatus; | import com.iformall.enums.EnumPayStatus; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import com.iformall.service.WxPayOrderService; | import com.iformall.service.WxPayOrderService; | ||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| @@ -39,6 +38,9 @@ public class WxPayOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxOrderService wxOrderService; | private WxOrderService wxOrderService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation(value = "发起微信小程序支付订单", notes = "{\"orderId\":\"string\"}") | @ApiOperation(value = "发起微信小程序支付订单", notes = "{\"orderId\":\"string\"}") | ||||
| @RequestMapping(value = "/create", method = RequestMethod.POST) | @RequestMapping(value = "/create", method = RequestMethod.POST) | ||||
| public ResultData _create(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws Exception { | public ResultData _create(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws Exception { | ||||
| @@ -50,6 +52,10 @@ public class WxPayOrderController extends BaseController { | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||||
| } | |||||
| WxAppinfo appInfo = getAppInfo(user.getAppId()); | WxAppinfo appInfo = getAppInfo(user.getAppId()); | ||||
| if(appInfo == null) { | if(appInfo == null) { | ||||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | ||||
| @@ -149,7 +155,9 @@ public class WxPayOrderController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute WxPayOrder wxPayOrder, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxPayOrder wxPayOrder, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxPayOrder) wxPayOrder = new WxPayOrder(); | |||||
| if (null == wxPayOrder) { | |||||
| wxPayOrder = new WxPayOrder(); | |||||
| } | |||||
| final PageInfo<WxPayOrder> page = wxPayOrderService.listAsPage(wxPayOrder, pageNum, pageSize); | final PageInfo<WxPayOrder> page = wxPayOrderService.listAsPage(wxPayOrder, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -86,7 +86,7 @@ public enum ErrorCode{ | |||||
| KAPCHA_NOT_EQUAL(2007, "验证码不正确"), | KAPCHA_NOT_EQUAL(2007, "验证码不正确"), | ||||
| USER_NAME_IS_FOUND(2008,"用户名已存在"), | USER_NAME_IS_FOUND(2008,"用户名已存在"), | ||||
| USER_PHONE_IS_FOUND(2009,"手机号已存在"), | USER_PHONE_IS_FOUND(2009,"手机号已存在"), | ||||
| MEMBER_IS_LOCKED(2010, "当前会员已被锁定"), | |||||
| /** | /** | ||||
| * 商场/商户 | * 商场/商户 | ||||
| @@ -211,6 +211,10 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||||
| //验证此用户是否存在 | //验证此用户是否存在 | ||||
| throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); | throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); | ||||
| } | } | ||||
| if (wxCUserBasicInfo != null && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | |||||
| logger.info(ErrorCode.MEMBER_IS_LOCKED.getMessage()); | |||||
| return record; | |||||
| } | |||||
| if (StringUtils.isNotEmpty(record.getSpendStr())) { | if (StringUtils.isNotEmpty(record.getSpendStr())) { | ||||
| record.setSpend(new BigDecimal(record.getSpendStr()).multiply(new BigDecimal(100)).intValue()); | record.setSpend(new BigDecimal(record.getSpendStr()).multiply(new BigDecimal(100)).intValue()); | ||||
| } | } | ||||
| @@ -34,7 +34,6 @@ public class WxScoreHistoryServiceImpl implements WxScoreHistoryService { | |||||
| @Override | @Override | ||||
| public void saveOrUpdate(WxScoreHistory record) { | public void saveOrUpdate(WxScoreHistory record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreateDate(new Date()); | record.setCreateDate(new Date()); | ||||
| @@ -21,12 +21,14 @@ | |||||
| <result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/> | <result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/> | ||||
| <result column="act_record" jdbcType="INTEGER" property="actRecord"/> | <result column="act_record" jdbcType="INTEGER" property="actRecord"/> | ||||
| <result column="score_date" jdbcType="TIMESTAMP" property="scoreDate"/> | <result column="score_date" jdbcType="TIMESTAMP" property="scoreDate"/> | ||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, | `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, | ||||
| `create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` | `create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` | ||||
| ,(select level from wx_level_config where poins >= points and tenant_id=#{tenantId} order by points desc limit 1 ) level | |||||
| ,(select level from wx_level_config where poins >= points and tenant_id=#{tenantId} order by points desc limit 1 ) level,status | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -87,13 +89,18 @@ | |||||
| <if test=" null != actRecord "> | <if test=" null != actRecord "> | ||||
| and `act_record` = #{actRecord} | and `act_record` = #{actRecord} | ||||
| </if> | </if> | ||||
| <if test=" null != name "> | <if test=" null != name "> | ||||
| and `name` like concat('%', #{name},'%') | and `name` like concat('%', #{name},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != startTime and null!=endTime"> | <if test=" null != startTime and null!=endTime"> | ||||
| and `create_date` between #{startTime} and #{endTime} | and `create_date` between #{startTime} and #{endTime} | ||||
| </if> | </if> | ||||
| <if test=" null != status "> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -158,7 +158,7 @@ public class DataInitController extends BaseController { | |||||
| creditHistory.setSpend(co.getCouponPrice()); | creditHistory.setSpend(co.getCouponPrice()); | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(buUser.getMerchantId()); | creditHistory.setMerchantId(buUser.getMerchantId()); | ||||
| creditHistory = creditHistoryService.saveOrUpdate(creditHistory); | |||||
| creditHistoryService.saveOrUpdate(creditHistory); | |||||
| }); | }); | ||||
| } | } | ||||