| @@ -8,7 +8,8 @@ public enum EnumEnableType { | |||||
| // 0:启用 1:停用 | // 0:启用 1:停用 | ||||
| Enable(0, "启用"), | Enable(0, "启用"), | ||||
| Disable(1, "停用") | |||||
| Disable(1, "停用"), | |||||
| Auditing(2, "审核"), | |||||
| ; | ; | ||||
| public static EnumEnableType getEnum(Integer code) { | public static EnumEnableType getEnum(Integer code) { | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.douyin.miniapp.api.TtMaService; | import com.iformall.douyin.miniapp.api.TtMaService; | ||||
| import com.iformall.enums.EnumEnableType; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.CUserTokenService; | import com.iformall.service.CUserTokenService; | ||||
| import com.iformall.service.WxAppinfoService; | import com.iformall.service.WxAppinfoService; | ||||
| @@ -88,6 +89,14 @@ public class BaseController { | |||||
| return tenantEntity; | return tenantEntity; | ||||
| } | } | ||||
| public Integer getAppEnable(){ | |||||
| String key = "webapp:enable:"+this.getTenantInfo().getTenantId(); | |||||
| if(objectCommonRedisTemplate.hasKey(key)){ | |||||
| return EnumEnableType.Auditing.getCode(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| /** | /** | ||||
| * 用于查询内容(集团) | * 用于查询内容(集团) | ||||
| * @return | * @return | ||||
| @@ -53,8 +53,12 @@ public class TtCouponController extends BaseController { | |||||
| public ResultData list(@ModelAttribute TtCoupon record, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute TtCoupon record, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] TtCouponController::list"); | logger.debug("[" + getIpAddr() + "] TtCouponController::list"); | ||||
| if (record == null) record = new TtCoupon(); | if (record == null) record = new TtCoupon(); | ||||
| if(getAppEnable() != null){ | |||||
| record.setIsPayment(EnumYesOrNo.NO.getCode()); | |||||
| } | |||||
| record.updateTenantInfo(getParentTenantInfo()); | record.updateTenantInfo(getParentTenantInfo()); | ||||
| record.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_SHELFING.getCode()); | record.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_SHELFING.getCode()); | ||||
| if(StringUtils.isNotBlank(record.getSortColumn())){ | if(StringUtils.isNotBlank(record.getSortColumn())){ | ||||
| String coryColumn = "c."+record.getSortColumns(); | String coryColumn = "c."+record.getSortColumns(); | ||||
| record.setSortColumns(coryColumn); | record.setSortColumns(coryColumn); | ||||
| @@ -19,6 +19,7 @@ import com.iformall.enums.*; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| import com.iformall.utils.RedisCacheUtils; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| @@ -82,9 +83,18 @@ public class TtUserGrantController extends BaseController { | |||||
| if(wxAppinfo == null){ | if(wxAppinfo == null){ | ||||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | ||||
| } | } | ||||
| if(!wxAppinfo.getEnable().equals(EnumEnableType.Enable.getCode())){ | |||||
| if(wxAppinfo.getEnable().equals(EnumEnableType.Disable.getCode())){ | |||||
| return new ResultData(ErrorCode.APP_ID_NOT_ENABLE); | return new ResultData(ErrorCode.APP_ID_NOT_ENABLE); | ||||
| } | } | ||||
| String key = "webapp:enable:"+wxAppinfo.getTenantId(); | |||||
| if(wxAppinfo.getEnable().equals(EnumEnableType.Auditing.getCode())){ | |||||
| resultMap.put("enable",wxAppinfo.getEnable()); | |||||
| if(!objectCommonRedisTemplate.hasKey(key)){ | |||||
| RedisCacheUtils.cache(objectCommonRedisTemplate, key, wxAppinfo.getEnable(), 0); | |||||
| } | |||||
| }else{ | |||||
| RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); | |||||
| } | |||||
| TtMaService ttMaService = getWeappServiceByAppInfo(wxAppinfo); | TtMaService ttMaService = getWeappServiceByAppInfo(wxAppinfo); | ||||