| @@ -103,13 +103,7 @@ public class WxCashOutController extends BaseController { | |||||
| WxMerchant merchant = wxMerchantService.getById(buser.getMerchantId()); | WxMerchant merchant = wxMerchantService.getById(buser.getMerchantId()); | ||||
| WxMall mall = wxMallService.getByTenantId(buser.getTenantId()); | WxMall mall = wxMallService.getByTenantId(buser.getTenantId()); | ||||
| Map<String,Object> resultMap = new HashMap<String,Object>(); | Map<String,Object> resultMap = new HashMap<String,Object>(); | ||||
| //当日提现次数 | |||||
| Date currDateBegin = DateUtils.stringToDate(DateUtils.format(new Date())+" 00:00:00", DateUtils.DATE_TIME_PATTERN); | |||||
| if (null == merchant.getCashOutLastTime() || merchant.getCashOutLastTime().before(currDateBegin)) { | |||||
| resultMap.put("cashOutCount", 0); | |||||
| }else { | |||||
| resultMap.put("cashOutCount", merchant.getCashOutCount()); | |||||
| } | |||||
| resultMap.put("cashOutCount", merchant.getCashOutCount()); | |||||
| resultMap.put("cashOutNumber", merchant.getCashOutNumber()); | resultMap.put("cashOutNumber", merchant.getCashOutNumber()); | ||||
| resultMap.put("cashOutSupport", mall.getCashOutSupport()); | resultMap.put("cashOutSupport", mall.getCashOutSupport()); | ||||
| resultMap.put("cashOutLimit", mall.getCashOutLimit()); | resultMap.put("cashOutLimit", mall.getCashOutLimit()); | ||||
| @@ -56,6 +56,25 @@ public class CashOutSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Scheduled(cron = "* 5 * * * ?") // 执行一次 | |||||
| public void merchantCountSchedule() { | |||||
| List<WxMall> malls = getMalls(); | |||||
| for (WxMall mall : malls) { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.updateTenantInfo(mall); | |||||
| List<WxMerchant> merchantList = wxMerchantMapper.findList(wxMerchant); | |||||
| for (WxMerchant merchant : merchantList) { | |||||
| try { | |||||
| wxMerchantMapper.reSetCashCount(merchant); | |||||
| }catch(Exception e) { | |||||
| logger.error("merchantCountSchedule error.merchant:"+merchant.getId(),e); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @Scheduled(cron = "0/5 * * * * ?") // 执行一次 | @Scheduled(cron = "0/5 * * * * ?") // 执行一次 | ||||
| public void cashOutFailSchedule() { | public void cashOutFailSchedule() { | ||||
| List<WxMall> malls = getMalls(); | List<WxMall> malls = getMalls(); | ||||
| @@ -47,4 +47,6 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| void reduceCash(WxMerchant record); | void reduceCash(WxMerchant record); | ||||
| void increaseCashCount(WxMerchant record); | void increaseCashCount(WxMerchant record); | ||||
| void reSetCashCount(WxMerchant record); | |||||
| } | } | ||||
| @@ -623,5 +623,9 @@ | |||||
| <update id="increaseCashCount" parameterType="com.iformall.domain.po.WxMerchant"> | <update id="increaseCashCount" parameterType="com.iformall.domain.po.WxMerchant"> | ||||
| update wx_merchant set cash_out_count = cash_out_count+1 where id = #{id} | update wx_merchant set cash_out_count = cash_out_count+1 where id = #{id} | ||||
| </update> | </update> | ||||
| <update id="reSetCashCount" parameterType="com.iformall.domain.po.WxMerchant"> | |||||
| update wx_merchant set cash_out_count = 0 where id = #{id} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||