| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.BaseEntity; | import com.iformall.domain.po.BaseEntity; | ||||
| import com.iformall.domain.po.WxFloatingLayer; | import com.iformall.domain.po.WxFloatingLayer; | ||||
| import com.iformall.domain.vo.WxFloatingLayerVO; | |||||
| import com.iformall.enums.EnumFloatingLayerStatus; | import com.iformall.enums.EnumFloatingLayerStatus; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxFloatingLayerService; | import com.iformall.service.WxFloatingLayerService; | ||||
| @@ -29,7 +30,7 @@ public class WxFloatingLayerController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| private WxFloatingLayerService wxFloatingLayerService; | |||||
| WxFloatingLayerService wxFloatingLayerService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| @@ -41,7 +42,7 @@ public class WxFloatingLayerController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::list"); | logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::list"); | ||||
| wxFloatingLayer.setTenantId(getTenantId()); | wxFloatingLayer.setTenantId(getTenantId()); | ||||
| wxFloatingLayer.setSortColumns(BaseEntity.SortField.CreateTime_DESC, BaseEntity.SortField.Id_DESC); | wxFloatingLayer.setSortColumns(BaseEntity.SortField.CreateTime_DESC, BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxFloatingLayer> page = wxFloatingLayerService.listAsPage(wxFloatingLayer, pageNum, pageSize); | |||||
| final PageInfo<WxFloatingLayerVO> page = wxFloatingLayerService.listAsPage(wxFloatingLayer, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -2,10 +2,14 @@ package com.iformall.controller.mem; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| 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.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxScoreHistory; | import com.iformall.domain.po.WxScoreHistory; | ||||
| import com.iformall.enums.EnumCUserBasicInfoStatus; | |||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxScoreHistoryService; | import com.iformall.service.WxScoreHistoryService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -23,6 +27,10 @@ public class WxScoreHistoryController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxScoreHistoryService wxScoreHistoryService; | private WxScoreHistoryService wxScoreHistoryService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -43,6 +51,9 @@ public class WxScoreHistoryController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxScoreHistoryController::add"); | logger.debug("[" + getIpAddr() + "] WxScoreHistoryController::add"); | ||||
| //Assert.notNull(wxScoreHistory.getName(), "角色名不能为空"); | //Assert.notNull(wxScoreHistory.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| if (checkMemberStatus(wxScoreHistory.getCUserId())) { | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||||
| } | |||||
| wxScoreHistoryService.saveOrUpdate(wxScoreHistory); | wxScoreHistoryService.saveOrUpdate(wxScoreHistory); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -52,10 +63,22 @@ public class WxScoreHistoryController extends BaseController { | |||||
| @SystemControllerLog(description = "成长值-更新") | @SystemControllerLog(description = "成长值-更新") | ||||
| public ResultData update(@RequestBody WxScoreHistory wxScoreHistory) { | public ResultData update(@RequestBody WxScoreHistory wxScoreHistory) { | ||||
| logger.debug("[" + getIpAddr() + "] WxScoreHistoryController::update"); | logger.debug("[" + getIpAddr() + "] WxScoreHistoryController::update"); | ||||
| if (checkMemberStatus(wxScoreHistory.getCUserId())) { | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||||
| } | |||||
| wxScoreHistoryService.saveOrUpdate(wxScoreHistory); | wxScoreHistoryService.saveOrUpdate(wxScoreHistory); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| public boolean checkMemberStatus(Long userId) { | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + userId); | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_mall | |||||
| change column `introduction` `introduction` varchar(1024) DEFAULT '' not null COMMENT '简介'; | |||||
| @@ -0,0 +1 @@ | |||||
| alter table wx_credit_history change column buserId buser_id bigint(20) default 0 not null comment 'B端微信用户ID'; | |||||
| @@ -28,8 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| @RestController | @RestController | ||||
| @@ -66,6 +64,12 @@ public class WxOrderController extends BaseController { | |||||
| if (resultData != null) return resultData; | if (resultData != null) return resultData; | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + user.getId()); | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||||
| } | |||||
| resultData = couponUserCheck(user, wxCouponChannelService.findDetailVo(orderSaveDto.getCouponChannelId())); | resultData = couponUserCheck(user, wxCouponChannelService.findDetailVo(orderSaveDto.getCouponChannelId())); | ||||
| if (resultData != null) return resultData; | if (resultData != null) return resultData; | ||||
| @@ -668,6 +668,7 @@ public class WxUserGrantController extends BaseController { | |||||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | ||||
| userVo.setSex(wxCUserBasicInfo.getSex()); | userVo.setSex(wxCUserBasicInfo.getSex()); | ||||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | userVo.setAddress(wxCUserBasicInfo.getAddress()); | ||||
| userVo.setStatus(wxCUserBasicInfo.getStatus()); | |||||
| } | } | ||||
| return new ResultData(userVo); | return new ResultData(userVo); | ||||
| @@ -1,6 +1,6 @@ | |||||
| package com.iformall.schedule; | package com.iformall.schedule; | ||||
| import com.iformall.mapper.WxFloatingLayerMapper; | |||||
| import com.iformall.mapper.WxCuserFloatingLayerMapper; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -16,7 +16,7 @@ public class FloatingLayerSchedule { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| private WxFloatingLayerMapper wxFloatingLayerMapper; | |||||
| private WxCuserFloatingLayerMapper wxCuserFloatingLayerMapper; | |||||
| /** | /** | ||||
| @@ -25,7 +25,7 @@ public class FloatingLayerSchedule { | |||||
| @Scheduled(cron = "0 48 10 * * ?") | @Scheduled(cron = "0 48 10 * * ?") | ||||
| public void sendMsg() { | public void sendMsg() { | ||||
| logger.info("删除前一天浮层用户数据开始"); | logger.info("删除前一天浮层用户数据开始"); | ||||
| wxFloatingLayerMapper.delete(null); | |||||
| wxCuserFloatingLayerMapper.delete(null); | |||||
| logger.info("删除前一天浮层用户数据结束"); | logger.info("删除前一天浮层用户数据结束"); | ||||
| } | } | ||||
| @@ -525,6 +525,11 @@ public enum ErrorCode{ | |||||
| // 招商管理 53000 begin | // 招商管理 53000 begin | ||||
| CUSTOMER_NOT_FOUND(53000, "客户信息不存在"), | CUSTOMER_NOT_FOUND(53000, "客户信息不存在"), | ||||
| // 招商管理 53999 end | // 招商管理 53999 end | ||||
| /** | |||||
| * 首页浮屠广告 | |||||
| */ | |||||
| FLOATING_LAYER_FOUND(60001, "首页广告已存在,请先下线再重新投放"), | |||||
| ; | ; | ||||
| @@ -126,10 +126,10 @@ public class WxMerchant extends BaseEntity { | |||||
| private String talkUserAux; | private String talkUserAux; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "startTime") | @io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "startTime") | ||||
| private transient Date starttime; | |||||
| private transient Date starttime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endTime") | @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endTime") | ||||
| private transient Date endtime; | |||||
| private transient Date endtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "昵称", name = "userName") | @io.swagger.annotations.ApiModelProperty(value = "昵称", name = "userName") | ||||
| private transient String userName; | private transient String userName; | ||||
| @@ -17,7 +17,7 @@ public class UserTradeRecordVo implements Serializable{ | |||||
| private String sale; | private String sale; | ||||
| @Excel(name="面额",width = 20,orderNum = "3") | @Excel(name="面额",width = 20,orderNum = "3") | ||||
| private String price; | private String price; | ||||
| @Excel(name="卷状态",width = 20,orderNum = "4") | |||||
| @Excel(name="券状态",width = 20,orderNum = "4") | |||||
| private String status; | private String status; | ||||
| @Excel(name="交易时间",width = 20,orderNum = "5") | @Excel(name="交易时间",width = 20,orderNum = "5") | ||||
| private String tradeTime; | private String tradeTime; | ||||
| @@ -36,4 +36,7 @@ public class WxCUserVo extends WxCUser { | |||||
| private Integer upgradePercent; | private Integer upgradePercent; | ||||
| @io.swagger.annotations.ApiModelProperty(value="升级分",name="upgradeScore") | @io.swagger.annotations.ApiModelProperty(value="升级分",name="upgradeScore") | ||||
| private Integer upgradeScore; | private Integer upgradeScore; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "0正常1锁定", name = "status") | |||||
| private Integer status; | |||||
| } | } | ||||
| @@ -0,0 +1,39 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import com.iformall.domain.po.BaseEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxFloatingLayerVO extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | |||||
| private String tenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "coverImg") | |||||
| private String coverImg; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "产品ID", name = "produceId") | |||||
| private Long produceId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "小程序跳转路径", name = "pagePath") | |||||
| private String pagePath; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "0上线 1下线", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") | |||||
| private Date createTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") | |||||
| private Date updateTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "名称", name = "title") | |||||
| private String title; | |||||
| } | |||||
| @@ -23,15 +23,12 @@ public class WxMerchantTradeDetailVo extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "券名称", name = "couponName") | @io.swagger.annotations.ApiModelProperty(value = "券名称", name = "couponName") | ||||
| private String couponName; | private String couponName; | ||||
| @Excel(name="券价格",width = 20,orderNum = "4") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "券价格", name = "couponSale") | @io.swagger.annotations.ApiModelProperty(value = "券价格", name = "couponSale") | ||||
| private Integer couponSale; | private Integer couponSale; | ||||
| @Excel(name="券面额",width = 20,orderNum = "5") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "核销券面额", name = "couponPrice") | @io.swagger.annotations.ApiModelProperty(value = "核销券面额", name = "couponPrice") | ||||
| private Integer couponPrice; | private Integer couponPrice; | ||||
| @Excel(name="消费金额",width = 20,orderNum = "6") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "消费金额", name = "tradeAmt") | @io.swagger.annotations.ApiModelProperty(value = "消费金额", name = "tradeAmt") | ||||
| private Integer tradeAmt; | private Integer tradeAmt; | ||||
| @@ -40,6 +37,18 @@ public class WxMerchantTradeDetailVo extends BaseEntity { | |||||
| @Excel(name="交易时间",width = 20,orderNum = "7") | @Excel(name="交易时间",width = 20,orderNum = "7") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "交易时间", name = "tradeDate") | @io.swagger.annotations.ApiModelProperty(value = "交易时间", name = "tradeDate") | ||||
| private Date tradeDateStr; | |||||
| private String tradeDateStr; | |||||
| @Excel(name="券价格",width = 20,orderNum = "4") | |||||
| private String couponSaleStr; | |||||
| @Excel(name="券面额",width = 20,orderNum = "5") | |||||
| private String couponPriceStr; | |||||
| @Excel(name="消费金额",width = 20,orderNum = "6") | |||||
| private String tradeAmtStr; | |||||
| } | } | ||||
| @@ -0,0 +1,35 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumCUserBasicInfoStatus { | |||||
| NORMAL(0, "正常"), | |||||
| LOCKED(1, "锁定"),; | |||||
| public static EnumCUserBasicInfoStatus getEnum(Integer code) { | |||||
| for (EnumCUserBasicInfoStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumCUserBasicInfoStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -8,7 +8,7 @@ public enum EnumCarSupport { | |||||
| // 0-不支持 1-ETCP | // 0-不支持 1-ETCP | ||||
| NOCAR(0, "暂未支持"), | NOCAR(0, "暂未支持"), | ||||
| ETCP(1, "ETCP"), | |||||
| CAR(1, "停车支持"), | |||||
| ; | ; | ||||
| public static EnumCarSupport getEnum(Integer code) { | public static EnumCarSupport getEnum(Integer code) { | ||||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxFloatingLayer; | import com.iformall.domain.po.WxFloatingLayer; | ||||
| import com.iformall.domain.vo.WxFloatingLayerVO; | |||||
| import java.util.List; | import java.util.List; | ||||
| @@ -12,4 +13,8 @@ public interface WxFloatingLayerMapper extends CommonMapper<WxFloatingLayer, Lon | |||||
| List<WxFloatingLayer> findList(WxFloatingLayer wxFloatingLayer); | List<WxFloatingLayer> findList(WxFloatingLayer wxFloatingLayer); | ||||
| List<WxFloatingLayerVO> findListVO(WxFloatingLayer wxFloatingLayer); | |||||
| void updateStatus(Long couponId); | |||||
| } | } | ||||
| @@ -209,18 +209,18 @@ public interface WxCouponService { | |||||
| * 库存减少 | * 库存减少 | ||||
| * | * | ||||
| * @param id 券ID | * @param id 券ID | ||||
| * @param remainInventory 当前库存 | |||||
| * @param number 减少数量 | * @param number 减少数量 | ||||
| * @param remainInventory 当前库存 | |||||
| */ | */ | ||||
| void reduceRemainInventory(Long id, Integer remainInventory, Integer number); | |||||
| void reduceRemainInventory(Long id, Integer number, Integer remainInventory); | |||||
| /** | /** | ||||
| * 库存退回 | * 库存退回 | ||||
| * | * | ||||
| * @param id 券ID | * @param id 券ID | ||||
| * @param remainInventory 当前库存 | |||||
| * @param number 回退数量 | * @param number 回退数量 | ||||
| * @param remainInventory 当前库存 | |||||
| */ | */ | ||||
| void backRemainInventory(Long id, Integer remainInventory, Integer number); | |||||
| void backRemainInventory(Long id, Integer number, Integer remainInventory); | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxFloatingLayer; | import com.iformall.domain.po.WxFloatingLayer; | ||||
| import com.iformall.domain.vo.WxFloatingLayerVO; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -17,7 +18,7 @@ public interface WxFloatingLayerService { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxFloatingLayer> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxFloatingLayerVO> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -849,13 +849,15 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| Date createDate = oldUserBase.getCreateDate() == null ? new Date() : oldUserBase.getCreateDate(); | Date createDate = oldUserBase.getCreateDate() == null ? new Date() : oldUserBase.getCreateDate(); | ||||
| oldUserBase.setUpdateDate(userBase.getUpdateDate() == null ? updateDate : userBase.getUpdateDate()); | oldUserBase.setUpdateDate(userBase.getUpdateDate() == null ? updateDate : userBase.getUpdateDate()); | ||||
| oldUserBase.setCreateDate(userBase.getCreateDate() == null ? createDate : userBase.getCreateDate()); | oldUserBase.setCreateDate(userBase.getCreateDate() == null ? createDate : userBase.getCreateDate()); | ||||
| // 成长值 | |||||
| if(points != null) { | |||||
| oldUserBase.setPoins(points); | |||||
| } | |||||
| // 覆盖原积分 | |||||
| if(credit != null) { | |||||
| oldUserBase.setCredit(credit); | |||||
| if (oldUserBase.getStatus().equals(EnumCUserBasicInfoStatus.NORMAL.getCode())) { | |||||
| // 成长值 | |||||
| if (points != null) { | |||||
| oldUserBase.setPoins(points); | |||||
| } | |||||
| // 覆盖原积分 | |||||
| if (credit != null) { | |||||
| oldUserBase.setCredit(credit); | |||||
| } | |||||
| } | } | ||||
| } else { | } else { | ||||
| userBase.setId(idWorker.nextId()); | userBase.setId(idWorker.nextId()); | ||||
| @@ -13,10 +13,7 @@ import com.iformall.domain.vo.WxCouponChannelAddVo; | |||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.WxCardInfoMapper; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | |||||
| import com.iformall.mapper.WxCouponMerchantMapper; | |||||
| import com.iformall.mapper.WxMerchantMapper; | |||||
| import com.iformall.mapper.*; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -46,6 +43,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| QrCodeService qrCodeService; | QrCodeService qrCodeService; | ||||
| @Autowired | @Autowired | ||||
| WxCardInfoMapper wxCardInfoMapper; | WxCardInfoMapper wxCardInfoMapper; | ||||
| @Autowired | |||||
| WxFloatingLayerMapper wxFloatingLayerMapper; | |||||
| /** | /** | ||||
| * B端业务端 | * B端业务端 | ||||
| @@ -105,7 +104,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| wxOrderService.updateOrderGroupStatusByCouponChannelId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | wxOrderService.updateOrderGroupStatusByCouponChannelId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | ||||
| //修改卡状态 | //修改卡状态 | ||||
| wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); | wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); | ||||
| //浮层下架 | |||||
| wxFloatingLayerMapper.updateStatus(orignal.getCouponId()); | |||||
| } | } | ||||
| } | } | ||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| @@ -179,7 +179,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| } | } | ||||
| //更新库存 | //更新库存 | ||||
| wxCouponService.reduceRemainInventory(wxCouponOfDb.getId(), wxCouponOfDb.getRemainInventory(), merchantLnventory); | |||||
| wxCouponService.reduceRemainInventory(wxCouponOfDb.getId(), merchantLnventory, wxCouponOfDb.getRemainInventory()); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -208,7 +208,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| } | } | ||||
| //退回coupon库存 | //退回coupon库存 | ||||
| if(merchantRemain!=0) { | if(merchantRemain!=0) { | ||||
| wxCouponService.backRemainInventory(queryById.getId(), wxCouponOfDb.getRemainInventory(), merchantRemain); | |||||
| wxCouponService.backRemainInventory(queryById.getId(), merchantRemain, wxCouponOfDb.getRemainInventory()); | |||||
| } | } | ||||
| } | } | ||||
| wxCouponSendMapper.updateById(record); | wxCouponSendMapper.updateById(record); | ||||
| @@ -310,6 +310,12 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| return false; | return false; | ||||
| } | } | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + cUserId); | |||||
| return false; | |||||
| } | |||||
| //查询开关是否打开 | //查询开关是否打开 | ||||
| WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(); | WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(); | ||||
| wxCouponSendConfig.setSendType(type.getCode()); | wxCouponSendConfig.setSendType(type.getCode()); | ||||
| @@ -668,7 +668,7 @@ import java.util.stream.Collectors; | |||||
| @Override | @Override | ||||
| @Transactional(isolation= Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | @Transactional(isolation= Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | ||||
| public void reduceRemainInventory(Long id, Integer remainInventory, Integer number) { | |||||
| public void reduceRemainInventory(Long id, Integer number, Integer remainInventory) { | |||||
| int num = wxCouponMapper.reduceInventory(id, number, remainInventory); | int num = wxCouponMapper.reduceInventory(id, number, remainInventory); | ||||
| if (num == 0) { | if (num == 0) { | ||||
| throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); | throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); | ||||
| @@ -677,7 +677,7 @@ import java.util.stream.Collectors; | |||||
| @Override | @Override | ||||
| @Transactional(isolation= Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | @Transactional(isolation= Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | ||||
| public void backRemainInventory(Long id, Integer remainInventory, Integer number) { | |||||
| public void backRemainInventory(Long id, Integer number, Integer remainInventory) { | |||||
| int num = wxCouponMapper.backInventory(id, number, remainInventory); | int num = wxCouponMapper.backInventory(id, number, remainInventory); | ||||
| if (num == 0) { | if (num == 0) { | ||||
| throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL); | throw new MallinkException(ErrorCode.REMAIN_BACK_FAIL); | ||||
| @@ -25,13 +25,13 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| WxCuserFloatingLayerMapper WxCuserFloatingLayerMapper; | |||||
| WxCuserFloatingLayerMapper wxCuserFloatingLayerMapper; | |||||
| @Autowired | @Autowired | ||||
| WxFloatingLayerMapper WxFloatingLayerMapper; | |||||
| WxFloatingLayerMapper wxFloatingLayerMapper; | |||||
| @Autowired | @Autowired | ||||
| WxCUserMapper WxCUserMapper; | |||||
| WxCUserMapper wxCUserMapper; | |||||
| @Override | @Override | ||||
| @@ -39,14 +39,14 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| //1 查看是否存在用户,用户不存在 直接返回浮层信息 | //1 查看是否存在用户,用户不存在 直接返回浮层信息 | ||||
| WxCUser user = new WxCUser(); | WxCUser user = new WxCUser(); | ||||
| user.setOpenId(openId); | user.setOpenId(openId); | ||||
| WxCUser byOpenId = WxCUserMapper.findByOpenId(user); | |||||
| WxCUser byOpenId = wxCUserMapper.findByOpenId(user); | |||||
| if (byOpenId == null) { | if (byOpenId == null) { | ||||
| return getWxFloatingLayer(); | return getWxFloatingLayer(); | ||||
| } | } | ||||
| //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | //2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 | ||||
| WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); | ||||
| wxCuserFloatingLayerQuery.setUserId(byOpenId.getId()); | wxCuserFloatingLayerQuery.setUserId(byOpenId.getId()); | ||||
| WxCuserFloatingLayer wxCuserFloatingLayer = WxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); | |||||
| WxCuserFloatingLayer wxCuserFloatingLayer = wxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); | |||||
| if (wxCuserFloatingLayer == null) { | if (wxCuserFloatingLayer == null) { | ||||
| saveCuserFloatingLayer(byOpenId); | saveCuserFloatingLayer(byOpenId); | ||||
| return getWxFloatingLayer(); | return getWxFloatingLayer(); | ||||
| @@ -62,12 +62,12 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ | |||||
| wxCuserFloatingLayer.setUserId(wxCUser.getId()); | wxCuserFloatingLayer.setUserId(wxCUser.getId()); | ||||
| wxCuserFloatingLayer.setTenantId(wxCUser.getTenantId()); | wxCuserFloatingLayer.setTenantId(wxCUser.getTenantId()); | ||||
| wxCuserFloatingLayer.setCreateTime(new Date()); | wxCuserFloatingLayer.setCreateTime(new Date()); | ||||
| WxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | |||||
| wxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); | |||||
| } | } | ||||
| public WxFloatingLayer getWxFloatingLayer() { | public WxFloatingLayer getWxFloatingLayer() { | ||||
| WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); | ||||
| 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)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| @@ -7,6 +8,7 @@ import com.iformall.common.IdWorker; | |||||
| 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.WxFloatingLayer; | import com.iformall.domain.po.WxFloatingLayer; | ||||
| import com.iformall.domain.vo.WxFloatingLayerVO; | |||||
| import com.iformall.mapper.WxFloatingLayerMapper; | import com.iformall.mapper.WxFloatingLayerMapper; | ||||
| import com.iformall.service.WxFloatingLayerService; | import com.iformall.service.WxFloatingLayerService; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -27,16 +29,16 @@ public class WxFloatingLayerServiceImpl implements WxFloatingLayerService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| WxFloatingLayerMapper WxFloatingLayerMapper; | |||||
| WxFloatingLayerMapper wxFloatingLayerMapper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxFloatingLayer> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> WxFloatingLayerMapper.findList(record)); | |||||
| public PageInfo<WxFloatingLayerVO> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFloatingLayerMapper.findListVO(record)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxFloatingLayer getById(Long id) { | public WxFloatingLayer getById(Long id) { | ||||
| return WxFloatingLayerMapper.selectById(id); | |||||
| return wxFloatingLayerMapper.selectById(id); | |||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | ||||
| @@ -48,16 +50,23 @@ public class WxFloatingLayerServiceImpl implements WxFloatingLayerService { | |||||
| if (StringUtils.isEmpty(wxFloatingLayer.getPagePath())) { | if (StringUtils.isEmpty(wxFloatingLayer.getPagePath())) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空"); | ||||
| } | } | ||||
| WxFloatingLayer wxFloatingLayerQuery = new WxFloatingLayer(); | |||||
| wxFloatingLayerQuery.setTenantId(wxFloatingLayer.getTenantId()); | |||||
| wxFloatingLayerQuery.setStatus(wxFloatingLayer.getStatus()); | |||||
| Integer integer = wxFloatingLayerMapper.selectCount(new QueryWrapper<>(wxFloatingLayerQuery)); | |||||
| if (integer > 0) { | |||||
| return new ResultData(ErrorCode.FLOATING_LAYER_FOUND); | |||||
| } | |||||
| Date date = new Date(); | Date date = new Date(); | ||||
| if (wxFloatingLayer.getId() == null) { | if (wxFloatingLayer.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| wxFloatingLayer.setId(idWorker.nextId()); | wxFloatingLayer.setId(idWorker.nextId()); | ||||
| wxFloatingLayer.setCreateTime(date); | wxFloatingLayer.setCreateTime(date); | ||||
| wxFloatingLayer.setUpdateTime(date); | wxFloatingLayer.setUpdateTime(date); | ||||
| WxFloatingLayerMapper.insert(wxFloatingLayer); | |||||
| wxFloatingLayerMapper.insert(wxFloatingLayer); | |||||
| } else { | } else { | ||||
| wxFloatingLayer.setUpdateTime(date); | wxFloatingLayer.setUpdateTime(date); | ||||
| WxFloatingLayerMapper.updateById(wxFloatingLayer); | |||||
| wxFloatingLayerMapper.updateById(wxFloatingLayer); | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||
| @@ -19,6 +19,9 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.BeanMapping; | import com.iformall.utils.BeanMapping; | ||||
| import com.iformall.utils.DataUtil; | |||||
| import com.iformall.utils.DateUtils; | |||||
| import me.chanjar.weixin.common.util.DataUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -30,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | |||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| @@ -749,6 +753,18 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public void exportUserTradeList(WxMerchant record,HttpServletRequest request, HttpServletResponse response) { | public void exportUserTradeList(WxMerchant record,HttpServletRequest request, HttpServletResponse response) { | ||||
| List<WxMerchantTradeDetailVo> datalist = wxMerchantMapper.userTradeDetailList(record); | List<WxMerchantTradeDetailVo> datalist = wxMerchantMapper.userTradeDetailList(record); | ||||
| datalist.stream().forEach(e->{ | |||||
| if(e.getTradeDate() != null) { | |||||
| e.setTradeDateStr(DateUtils.formatDateTime(e.getTradeDate())); | |||||
| } | |||||
| BigDecimal bigDecimal = new BigDecimal(e.getCouponPrice()); | |||||
| e.setCouponPriceStr(bigDecimal.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||||
| bigDecimal = new BigDecimal(e.getCouponSale()); | |||||
| e.setCouponSaleStr(bigDecimal.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||||
| bigDecimal = new BigDecimal(e.getTradeAmt()); | |||||
| e.setTradeAmtStr(bigDecimal.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||||
| }); | |||||
| excelService.exportExcel(datalist, null, "商户会员消费列表", WxMerchantTradeDetailVo.class, "商户会员消费列表.xlsx", response, false); | excelService.exportExcel(datalist, null, "商户会员消费列表", WxMerchantTradeDetailVo.class, "商户会员消费列表.xlsx", response, false); | ||||
| } | } | ||||
| @@ -513,7 +513,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| try { | try { | ||||
| wxCouponMapper.backInventory(coupon.getId(), coupon.getRemainInventory(), 1); | |||||
| wxCouponMapper.backInventory(coupon.getId(), 1, coupon.getRemainInventory()); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("数据库更新失败,库存+1失败, e:" + e.getMessage()); | logger.error("数据库更新失败,库存+1失败, e:" + e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "库存恢复失败"); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "库存恢复失败"); | ||||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumBusiness; | import com.iformall.enums.EnumBusiness; | ||||
| import com.iformall.enums.EnumCUserBasicInfoStatus; | |||||
| import com.iformall.enums.EnumScoreRules; | import com.iformall.enums.EnumScoreRules; | ||||
| import com.iformall.enums.EnumScoreType; | import com.iformall.enums.EnumScoreType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -555,27 +556,42 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| @Override | @Override | ||||
| public int addScore(EnumScoreType scoreType, Object param) { | public int addScore(EnumScoreType scoreType, Object param) { | ||||
| WxCUser wxCUser = null; | |||||
| WxCUserCar userCar = null; | |||||
| WxCUserBasicInfo userBasicInfo = null; | |||||
| Long userId = null; | |||||
| if (param instanceof WxCUser) { | |||||
| wxCUser = (WxCUser) param; | |||||
| userId = wxCUser.getId(); | |||||
| } | |||||
| if (param instanceof WxCUserCar) { | |||||
| userCar = (WxCUserCar) param; | |||||
| userId = userCar.getCUserId(); | |||||
| } | |||||
| if (param instanceof WxCUserBasicInfo) { | |||||
| userBasicInfo = (WxCUserBasicInfo) param; | |||||
| userId = userBasicInfo.getId(); | |||||
| } | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + userId); | |||||
| return 0; | |||||
| } | |||||
| switch (scoreType){ | switch (scoreType){ | ||||
| case LOGIN: { | case LOGIN: { | ||||
| WxCUser user = (WxCUser) param; | |||||
| return loginAddScore(user); | |||||
| return loginAddScore(wxCUser); | |||||
| } | } | ||||
| case BIND_CAR:{ | case BIND_CAR:{ | ||||
| WxCUserCar userCar = (WxCUserCar) param; | |||||
| return bindCarAddScore(userCar); | return bindCarAddScore(userCar); | ||||
| } | } | ||||
| case WECHAT_PERSION:{ | case WECHAT_PERSION:{ | ||||
| WxCUser user = (WxCUser) param; | |||||
| return personAddScore(user); | |||||
| return personAddScore(wxCUser); | |||||
| } | } | ||||
| case WECHAT_PHONE:{ | case WECHAT_PHONE:{ | ||||
| WxCUser user = (WxCUser) param; | |||||
| return phoneAddScore(user); | |||||
| return phoneAddScore(wxCUser); | |||||
| } | } | ||||
| case COMPLETE_INFO:{ | case COMPLETE_INFO:{ | ||||
| WxCUserBasicInfo user = (WxCUserBasicInfo) param; | |||||
| return infoAddScore(user); | |||||
| return infoAddScore(userBasicInfo); | |||||
| } | } | ||||
| default: { | default: { | ||||
| @@ -587,14 +603,30 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| @Override | @Override | ||||
| public int addScore2(EnumScoreType scoreType, Object param1, Object param2) { | public int addScore2(EnumScoreType scoreType, Object param1, Object param2) { | ||||
| WxOrder order = null; | |||||
| WxCUserBasicInfo user = null; | |||||
| Long userId = null; | |||||
| if (param1 instanceof WxOrder) { | |||||
| order = (WxOrder) param1; | |||||
| userId = order.getCUserId(); | |||||
| } | |||||
| if (param1 instanceof WxCUserBasicInfo) { | |||||
| user = (WxCUserBasicInfo) param1; | |||||
| userId = user.getId(); | |||||
| } | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + userId); | |||||
| return 0; | |||||
| } | |||||
| switch (scoreType){ | switch (scoreType){ | ||||
| case CONSUMPTION: { | case CONSUMPTION: { | ||||
| WxOrder order = (WxOrder) param1; | |||||
| Integer bussinessId = (Integer) param2; | Integer bussinessId = (Integer) param2; | ||||
| return payAddScore(order, bussinessId); | return payAddScore(order, bussinessId); | ||||
| } | } | ||||
| case MEM_IMPORT: { | case MEM_IMPORT: { | ||||
| WxCUserBasicInfo user = (WxCUserBasicInfo) param1; | |||||
| boolean bHaveCUser = (boolean)(param2); | boolean bHaveCUser = (boolean)(param2); | ||||
| return memResetScore(user, bHaveCUser); | return memResetScore(user, bHaveCUser); | ||||
| } | } | ||||
| @@ -606,9 +638,13 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| @Override | @Override | ||||
| public int reduceScore(EnumScoreType scoreType, Object param1, Object param2, Object param3) { | public int reduceScore(EnumScoreType scoreType, Object param1, Object param2, Object param3) { | ||||
| WxCUserBasicInfo user = (WxCUserBasicInfo) param1; | |||||
| if (user != null && user.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + user.getId()); | |||||
| return 0; | |||||
| } | |||||
| switch (scoreType){ | switch (scoreType){ | ||||
| case MEM_REDUCE: { | case MEM_REDUCE: { | ||||
| WxCUserBasicInfo user = (WxCUserBasicInfo)param1; | |||||
| String reason = (String)param2; | String reason = (String)param2; | ||||
| Integer scoreNum = (Integer)param3; | Integer scoreNum = (Integer)param3; | ||||
| return memReduceScore(user, reason, scoreNum); | return memReduceScore(user, reason, scoreNum); | ||||
| @@ -39,7 +39,7 @@ | |||||
| </sql> | </sql> | ||||
| <select id="findBySettleId" parameterType="com.iformall.domain.po.WxBillSettleBill" resultMap="BaseResultMap"> | <select id="findBySettleId" parameterType="com.iformall.domain.po.WxBillSettleBill" resultMap="BaseResultMap"> | ||||
| select bl.`type`,bill.starttime,bill.endtime,bl.bill_id,bl.bill_type,bill.bill_type billName,IFNULL(bill.owe,0) receivePay | |||||
| select bl.`type`,IFNULL(bill.starttime,NULL),IFNULL(bill.endtime,NULL),bl.bill_id,bl.bill_type,bill.bill_type billName,IFNULL(bill.owe,0) receivePay | |||||
| from wx_bill_settle_bill bl left join | from wx_bill_settle_bill bl left join | ||||
| (select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金-租金' | (select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金-租金' | ||||
| @@ -216,8 +216,8 @@ | |||||
| select <include refid="allColumnsOfScoreList"/> | select <include refid="allColumnsOfScoreList"/> | ||||
| from wx_c_user_basic_info cub | from wx_c_user_basic_info cub | ||||
| inner join wx_c_user cu on cu.id = cub.id | inner join wx_c_user cu on cu.id = cub.id | ||||
| where 1=1 | |||||
| where 1=1 and cub.status=0 | |||||
| <if test=" null != levelStartScore "> | <if test=" null != levelStartScore "> | ||||
| and cub.poins >= #{levelStartScore} | and cub.poins >= #{levelStartScore} | ||||
| @@ -241,7 +241,7 @@ | |||||
| select <include refid="allColumnsOfScoreList"/> | select <include refid="allColumnsOfScoreList"/> | ||||
| from wx_c_user_basic_info cub | from wx_c_user_basic_info cub | ||||
| inner join wx_c_user cu on cu.id = cub.id | inner join wx_c_user cu on cu.id = cub.id | ||||
| where cu.phone is not null | |||||
| where cub.status = 0 and cu.phone is not null | |||||
| AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} | AND DATE_FORMAT(cub.birthdate,'%m-%d') >= #{begin} | ||||
| AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} | AND DATE_FORMAT(cub.birthdate,'%m-%d') <= #{end} | ||||
| <if test="null != tenantId"> | <if test="null != tenantId"> | ||||
| @@ -1,51 +0,0 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.WxFloatingLayerMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFloatingLayer"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | |||||
| <result column="produce_id" jdbcType="VARCHAR" property="produceId"/> | |||||
| <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | |||||
| <result column="status" jdbcType="VARCHAR" property="status"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`, `tenant_id` , `cover_img` , `produce_id`, `page_path` , `status`, `create_time`, `update_time` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </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=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_floating_layer | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -0,0 +1,104 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.WxFloatingLayerMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFloatingLayer"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | |||||
| <result column="produce_id" jdbcType="VARCHAR" property="produceId"/> | |||||
| <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | |||||
| <result column="status" jdbcType="VARCHAR" property="status"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`, `tenant_id` , `cover_img` , `produce_id`, `page_path` , `status`, `create_time`, `update_time` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </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=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <sql id="allColumnsVO"> | |||||
| fl.`id` as id, fl.`tenant_id` , fl.`cover_img` , fl.`produce_id`, | |||||
| fl.`page_path` , fl.`status`, fl.`create_time` as create_time, fl.`update_time`, | |||||
| c.title | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_floating_layer | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <resultMap id="resultListVO" type="com.iformall.domain.vo.WxFloatingLayerVO"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | |||||
| <result column="produce_id" jdbcType="VARCHAR" property="produceId"/> | |||||
| <result column="page_path" jdbcType="VARCHAR" property="pagePath"/> | |||||
| <result column="status" jdbcType="VARCHAR" property="status"/> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||||
| <result column="title" jdbcType="VARCHAR" property="title"/> | |||||
| </resultMap> | |||||
| <sql id="dynamicWhereConditionsVO"> | |||||
| <if test=" null != id "> | |||||
| and fl.`id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and fl.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and fl.`status` = #{status} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and fl.id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findListVO" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="resultListVO"> | |||||
| select | |||||
| <include refid="allColumnsVO"/> | |||||
| from wx_floating_layer fl left join wx_coupon c on fl.produce_id=c.id | |||||
| where c.status = 0 | |||||
| <include refid="dynamicWhereConditionsVO"/> | |||||
| </select> | |||||
| <update id="updateStatus"> | |||||
| update wx_floating_layer set status=1 where produce_id=#{value} | |||||
| </update> | |||||
| </mapper> | |||||
| @@ -428,11 +428,13 @@ | |||||
| (select count(*) from wx_coupon_order o | (select count(*) from wx_coupon_order o | ||||
| left join wx_coupon co on(o.`coupon_id`=co.id) | left join wx_coupon co on(o.`coupon_id`=co.id) | ||||
| left join wx_coupon_merchant cm on(cm.product_id=co.id) | left join wx_coupon_merchant cm on(cm.product_id=co.id) | ||||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 | |||||
| <if test="starttime != null and starttime!=''"> | |||||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) | |||||
| inner join wx_merchant_b_user mb on(mb.id=c.id) | |||||
| where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id | |||||
| <if test="starttime != null"> | |||||
| and o.create_date >= #{starttime} | and o.create_date >= #{starttime} | ||||
| </if> | </if> | ||||
| <if test="endtime != null and endtime!=''"> | |||||
| <if test="endtime != null"> | |||||
| and o.create_date <= #{endtime} | and o.create_date <= #{endtime} | ||||
| </if> | </if> | ||||
| ) consumeCount, | ) consumeCount, | ||||
| @@ -440,11 +442,13 @@ | |||||
| (select count(distinct c.id) from wx_coupon_order o | (select count(distinct c.id) from wx_coupon_order o | ||||
| left join wx_coupon co on(o.`coupon_id`=co.id) | left join wx_coupon co on(o.`coupon_id`=co.id) | ||||
| left join wx_coupon_merchant cm on(cm.product_id=co.id) | left join wx_coupon_merchant cm on(cm.product_id=co.id) | ||||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 | |||||
| <if test="starttime != null and starttime!=''"> | |||||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) | |||||
| inner join wx_merchant_b_user mb on(mb.id=c.id) | |||||
| where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id | |||||
| <if test="starttime != null"> | |||||
| and o.create_date >= #{starttime} | and o.create_date >= #{starttime} | ||||
| </if> | </if> | ||||
| <if test="endtime != null and endtime!=''"> | |||||
| <if test="endtime != null"> | |||||
| and o.create_date <= #{endtime} | and o.create_date <= #{endtime} | ||||
| </if> | </if> | ||||
| ) consumeCountP, | ) consumeCountP, | ||||
| @@ -452,16 +456,19 @@ | |||||
| IFNULL((select sum(co.price) from wx_coupon_order o | IFNULL((select sum(co.price) from wx_coupon_order o | ||||
| left join wx_coupon co on(o.`coupon_id`=co.id) | left join wx_coupon co on(o.`coupon_id`=co.id) | ||||
| left join wx_coupon_merchant cm on(cm.product_id=co.id) | left join wx_coupon_merchant cm on(cm.product_id=co.id) | ||||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 | |||||
| <if test="starttime != null and starttime!=''"> | |||||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) | |||||
| inner join wx_merchant_b_user mb on(mb.id=c.id) | |||||
| where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id | |||||
| <if test="starttime != null"> | |||||
| and o.create_date >= #{starttime} | and o.create_date >= #{starttime} | ||||
| </if> | </if> | ||||
| <if test="endtime != null and endtime!=''"> | |||||
| <if test="endtime != null"> | |||||
| and o.create_date <= #{endtime} | and o.create_date <= #{endtime} | ||||
| </if> | </if> | ||||
| ),0) tradeAmt | ),0) tradeAmt | ||||
| from wx_merchant m where 1=1 | |||||
| from wx_merchant m where m.status=1 | |||||
| <if test=" null != name and ''!=name "> | <if test=" null != name and ''!=name "> | ||||
| and `name` like concat('%', #{name},'%') | and `name` like concat('%', #{name},'%') | ||||
| @@ -494,6 +501,12 @@ | |||||
| <if test=" null != couponName "> | <if test=" null != couponName "> | ||||
| and co.`title` like concat('%', #{couponName},'%') | and co.`title` like concat('%', #{couponName},'%') | ||||
| </if> | </if> | ||||
| <if test="starttime != null"> | |||||
| and o.create_date >= #{starttime} | |||||
| </if> | |||||
| <if test="endtime != null"> | |||||
| and o.create_date <= #{endtime} | |||||
| </if> | |||||
| order by o.create_date desc | order by o.create_date desc | ||||
| </select> | </select> | ||||