|
|
|
@@ -12,6 +12,7 @@ import com.iformall.domain.dto.WxMerchantDto; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.po.base.BaseEntity; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.tt.TtCoupon; |
|
|
|
import com.iformall.domain.po.tt.TtUserFollow; |
|
|
|
import com.iformall.domain.vo.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
@@ -105,6 +106,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
@Autowired |
|
|
|
WxMallService wxMallService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
TtCouponMapper ttCouponMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
TtUserFollowMapper ttUserFollowMapper; |
|
|
|
|
|
|
|
@@ -1088,4 +1092,52 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
public ResultData ttdisable(Long id) { |
|
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectById(id); |
|
|
|
if (wxMerchant == null || wxMerchant.getStatus().equals(EnumYesOrNo.NO.getCode())) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"作者信息未找到或者已停用"); |
|
|
|
} |
|
|
|
//停用作者 |
|
|
|
WxMerchant disableMerchant = new WxMerchant(); |
|
|
|
disableMerchant.setId(id); |
|
|
|
disableMerchant.setStatus(EnumYesOrNo.NO.getCode()); |
|
|
|
disableMerchant.setMark(EnumYesOrNo.NO.getCode()); |
|
|
|
disableMerchant.setUpdateDate(new Date()); |
|
|
|
wxMerchantMapper.updateById(disableMerchant); |
|
|
|
//下架作者所有作品 |
|
|
|
TtCoupon couponq = new TtCoupon(); |
|
|
|
couponq.setMerchantId(id); |
|
|
|
couponq.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_SHELFING.getCode()); |
|
|
|
TtCoupon coupon = new TtCoupon(); |
|
|
|
coupon.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_AFTER_SHELF.getCode()); |
|
|
|
coupon.setMark(EnumYesOrNo.NO.getCode()); |
|
|
|
coupon.setUpdateDate(new Date()); |
|
|
|
ttCouponMapper.update(coupon,new QueryWrapper<>(couponq)); |
|
|
|
//驳回作者下所有审核中的作品 |
|
|
|
couponq.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_EXAMINE.getCode()); |
|
|
|
coupon.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_REJECT.getCode()); |
|
|
|
coupon.setRemark("作者停用"); |
|
|
|
ttCouponMapper.update(coupon,new QueryWrapper<>(couponq)); |
|
|
|
//关闭所有待支付订单(暂未处理) |
|
|
|
|
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData ttstartusing(Long id) { |
|
|
|
WxMerchant wxMerchant = wxMerchantMapper.selectById(id); |
|
|
|
if (wxMerchant == null || wxMerchant.getStatus().equals(EnumYesOrNo.NO.getCode())) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"作者信息未找到或者已启用"); |
|
|
|
} |
|
|
|
WxMerchant disableMerchant = new WxMerchant(); |
|
|
|
disableMerchant.setId(id); |
|
|
|
disableMerchant.setStatus(EnumYesOrNo.YES.getCode()); |
|
|
|
disableMerchant.setUpdateDate(new Date()); |
|
|
|
wxMerchantMapper.updateById(disableMerchant); |
|
|
|
|
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
} |