Browse Source

[会员锁定][修改][购买、核销、积分]

release_toaliyun_real
gongbiao 6 years ago
parent
commit
da5a050d71
7 changed files with 39 additions and 10 deletions
  1. +11
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  2. +13
    -5
      mallinkCApi/src/main/java/com/iformall/controller/WxPayOrderController.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  4. +4
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java
  5. +0
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxScoreHistoryServiceImpl.java
  6. +9
    -2
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  7. +1
    -1
      mallinkSysAdmin/src/main/java/com/iformall/controller/sys/DataInitController.java

+ 11
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java View File

@@ -4,10 +4,13 @@ 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.WxCouponOrder;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.vo.WxCouponOrderCVo;
import com.iformall.enums.EnumCreditLockedStatus;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCouponOrderService;
import com.iformall.service.WxMerchantBUserService;
import io.swagger.annotations.Api;
@@ -35,6 +38,10 @@ public class WxCouponOrderController extends BaseController {
@Autowired
private WxMerchantBUserService wxMerchantBUserService;

@Autowired
private WxCUserBasicInfoService wxCUserBasicInfoService;


@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@@ -126,6 +133,10 @@ public class WxCouponOrderController extends BaseController {
if (wxCouponOrderCVo == 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 ) {
Date now = new Date();


+ 13
- 5
mallinkCApi/src/main/java/com/iformall/controller/WxPayOrderController.java View File

@@ -4,13 +4,12 @@ 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.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.EnumPayWay;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxOrderService;
import com.iformall.service.WxPayOrderService;
import com.iformall.utils.IPUtil;
@@ -39,6 +38,9 @@ public class WxPayOrderController extends BaseController {
@Autowired
private WxOrderService wxOrderService;

@Autowired
private WxCUserBasicInfoService wxCUserBasicInfoService;

@ApiOperation(value = "发起微信小程序支付订单", notes = "{\"orderId\":\"string\"}")
@RequestMapping(value = "/create", method = RequestMethod.POST)
public ResultData _create(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws Exception {
@@ -50,6 +52,10 @@ public class WxPayOrderController extends BaseController {
}

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());
if(appInfo == null) {
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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
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);
return new ResultData(page);
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/common/ErrorCode.java View File

@@ -86,7 +86,7 @@ public enum ErrorCode{
KAPCHA_NOT_EQUAL(2007, "验证码不正确"),
USER_NAME_IS_FOUND(2008,"用户名已存在"),
USER_PHONE_IS_FOUND(2009,"手机号已存在"),
MEMBER_IS_LOCKED(2010, "当前会员已被锁定"),

/**
* 商场/商户


+ 4
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java View File

@@ -211,6 +211,10 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
//验证此用户是否存在
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())) {
record.setSpend(new BigDecimal(record.getSpendStr()).multiply(new BigDecimal(100)).intValue());
}


+ 0
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxScoreHistoryServiceImpl.java View File

@@ -34,7 +34,6 @@ public class WxScoreHistoryServiceImpl implements WxScoreHistoryService {
@Override
public void saveOrUpdate(WxScoreHistory record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setCreateDate(new Date());


+ 9
- 2
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml View File

@@ -21,12 +21,14 @@
<result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/>
<result column="act_record" jdbcType="INTEGER" property="actRecord"/>
<result column="score_date" jdbcType="TIMESTAMP" property="scoreDate"/>
<result column="status" jdbcType="INTEGER" property="status"/>

</resultMap>

<sql id="allColumns">
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,
`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 id="dynamicWhereConditions">
@@ -87,13 +89,18 @@
<if test=" null != actRecord ">
and `act_record` = #{actRecord}
</if>
<if test=" null != name ">
and `name` like concat('%', #{name},'%')
</if>
<if test=" null != startTime and null!=endTime">
and `create_date` between #{startTime} and #{endTime}
</if>
<if test=" null != status ">
and `status` = #{status}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


+ 1
- 1
mallinkSysAdmin/src/main/java/com/iformall/controller/sys/DataInitController.java View File

@@ -158,7 +158,7 @@ public class DataInitController extends BaseController {
creditHistory.setSpend(co.getCouponPrice());
//如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户
creditHistory.setMerchantId(buUser.getMerchantId());
creditHistory = creditHistoryService.saveOrUpdate(creditHistory);
creditHistoryService.saveOrUpdate(creditHistory);
});
}



Loading…
Cancel
Save