| @@ -41,7 +41,7 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| cal.add(Calendar.DAY_OF_YEAR, -1); | cal.add(Calendar.DAY_OF_YEAR, -1); | ||||
| SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd"); | ||||
| wxMerchantTradeDaily.setReportDate(fmt.format(cal.getTime())); | wxMerchantTradeDaily.setReportDate(fmt.format(cal.getTime())); | ||||
| wxMerchantTradeDaily.setSortColumns(WxMerchantTradeDailyVo.Field.CreateDate_DESC); | |||||
| wxMerchantTradeDaily.setSortColumns(WxMerchantTradeDailyVo.Field.MerchantId_DESC); | |||||
| final PageInfo<WxMerchantTradeDailyVo> page = wxMerchantTradeDailyService.listAsPageVo(wxMerchantTradeDaily, pageNum, pageSize); | final PageInfo<WxMerchantTradeDailyVo> page = wxMerchantTradeDailyService.listAsPageVo(wxMerchantTradeDaily, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -25,13 +25,17 @@ public class WiwideTokenSchedule { | |||||
| @Autowired | @Autowired | ||||
| private WxWiwideInfoMapper wxWiwideInfoMapper; | private WxWiwideInfoMapper wxWiwideInfoMapper; | ||||
| @Scheduled(cron = "0 0/45 * * * ?") | |||||
| @Scheduled(cron = "0 0/30 * * * ?") | |||||
| public void requestToken() { | public void requestToken() { | ||||
| List<WxWiWideInfo> list = wxWiwideInfoMapper.findList(null); | List<WxWiWideInfo> list = wxWiwideInfoMapper.findList(null); | ||||
| for (int i = 0, size = list.size(); i < size; i++) { | for (int i = 0, size = list.size(); i < size; i++) { | ||||
| WxWiWideInfo wxWiWideInfo = list.get(i); | WxWiWideInfo wxWiWideInfo = list.get(i); | ||||
| String data = WiwideUtil.queryToken(wxWiWideInfo); | String data = WiwideUtil.queryToken(wxWiWideInfo); | ||||
| String token = (String) JSONObject.parseObject(data).get("data"); | String token = (String) JSONObject.parseObject(data).get("data"); | ||||
| if(token==null){ | |||||
| logger.error("商场:"+wxWiWideInfo.getTenantId()+",token为空"); | |||||
| continue; | |||||
| } | |||||
| updateToken(wxWiWideInfo, token); | updateToken(wxWiWideInfo, token); | ||||
| } | } | ||||
| @@ -47,7 +51,7 @@ public class WiwideTokenSchedule { | |||||
| try { | try { | ||||
| wxWiwideInfoMapper.updateToken(record); | wxWiwideInfoMapper.updateToken(record); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.info("更新TOKEN失败:商场" + wxWiWideInfo.getTenantId()); | |||||
| logger.error("更新TOKEN失败:商场" + wxWiWideInfo.getTenantId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -153,7 +153,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| return; | return; | ||||
| } | } | ||||
| if(!wxMerchant.getCarVendorType().equals(EnumMerchantStatus.NOT_VALID)){ | |||||
| if(!wxMerchant.getCarVendorType().equals(EnumMerchantStatus.NOT_VALID.getCode())){ | |||||
| logger.info("不能停用停车商户"); | logger.info("不能停用停车商户"); | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -2,9 +2,9 @@ package com.iformall.utils; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.domain.po.WxMall; | |||||
| import com.iformall.domain.po.WxWiWideInfo; | import com.iformall.domain.po.WxWiWideInfo; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.shiro.codec.Base64; | import org.apache.shiro.codec.Base64; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -135,7 +135,17 @@ public class WiwideUtil { | |||||
| logger.info("获取TOKEN"); | logger.info("获取TOKEN"); | ||||
| String username = wiWideInfo.getWiwideId(); | String username = wiWideInfo.getWiwideId(); | ||||
| String authVal = WiwideUtil.encrypt(wiWideInfo.getWiwideKey()); | String authVal = WiwideUtil.encrypt(wiWideInfo.getWiwideKey()); | ||||
| Map<String, String> params = new HashMap<>(); | |||||
| if(StringUtils.isEmpty(username)){ | |||||
| logger.error("商场:" + wiWideInfo.getTenantId() + ",wiwideId为空" ); | |||||
| return null; | |||||
| } | |||||
| if(StringUtils.isEmpty(authVal)){ | |||||
| logger.error("商场:" + wiWideInfo.getTenantId() + ",wiwideKey为空" ); | |||||
| return null; | |||||
| } | |||||
| Map<String, String> params = new HashMap<>(2); | |||||
| params.put("username", username); | params.put("username", username); | ||||
| params.put("authVal", authVal); | params.put("authVal", authVal); | ||||
| String wiwideUrl = wiWideInfo.getWiwideUrl(); | String wiwideUrl = wiWideInfo.getWiwideUrl(); | ||||
| @@ -134,8 +134,8 @@ | |||||
| <update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where shop_id in ( | update wx_rent_contract set status=#{status} where shop_id in ( | ||||
| select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and merchant_id is not null and status!=6 | |||||
| )s) and merchant_id is null and tenant_id=#{tenantId} | |||||
| select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status in(2,3,4) | |||||
| )s) and status=1 and status!=7 and tenant_id=#{tenantId} | |||||
| </update> | </update> | ||||
| <select id="getRentContractList" parameterType="String" resultType="com.iformall.domain.po.WxRentContract"> | <select id="getRentContractList" parameterType="String" resultType="com.iformall.domain.po.WxRentContract"> | ||||