| @@ -39,7 +39,7 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| void updateMsgCount(WxCUser user); | void updateMsgCount(WxCUser user); | ||||
| void updateMsgCountDown(@Param("tenantId")String tenantId, @Param("openId")String openId); | |||||
| // void updateMsgCountDown(@Param("tenantId")String tenantId, @Param("openId")String openId); | |||||
| List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId); | List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId); | ||||
| } | } | ||||
| @@ -323,9 +323,9 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||||
| if(openIds != null && openIds.size() > 0){ | if(openIds != null && openIds.size() > 0){ | ||||
| WxMsg msg = new WxMsg(); | WxMsg msg = new WxMsg(); | ||||
| msg.updateTenantInfo(record); | msg.updateTenantInfo(record); | ||||
| msg.setWay(EnumSendWay.APPINFOR.getCode()); | |||||
| msg.setIsright(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode()); | |||||
| msg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | |||||
| // msg.setWay(EnumSendWay.APPINFOR.getCode()); | |||||
| // msg.setIsright(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode()); | |||||
| // msg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | |||||
| msg.setPhones(String.join(",", openIds)); | msg.setPhones(String.join(",", openIds)); | ||||
| msg.setModelId(temp.getId()); | msg.setModelId(temp.getId()); | ||||
| Map<String,String> map = new HashMap<>(); | Map<String,String> map = new HashMap<>(); | ||||
| @@ -335,9 +335,10 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||||
| map.put("thing3",EnumScoreType.getEnum(record.getCreditType()).getMessage()); | map.put("thing3",EnumScoreType.getEnum(record.getCreditType()).getMessage()); | ||||
| map.put("goToPage","pages/index/index?type=jf"); | map.put("goToPage","pages/index/index?type=jf"); | ||||
| msg.setMsg(JSONObject.toJSONString(map)); | msg.setMsg(JSONObject.toJSONString(map)); | ||||
| msg.setName(EnumTemplateType.CREDIT_UPD_REMIND.name()); | |||||
| msg.setSignature(EnumTemplateType.CREDIT_UPD_REMIND.name()); | |||||
| wxMsgService.add(msg); | |||||
| // msg.setName(EnumTemplateType.CREDIT_UPD_REMIND.name()); | |||||
| // msg.setSignature(EnumTemplateType.CREDIT_UPD_REMIND.name()); | |||||
| // wxMsgService.add(msg); | |||||
| wxMsgService.batchSendAppinfo(msg); | |||||
| }else{ | }else{ | ||||
| logger.error("找不到微信用户"); | logger.error("找不到微信用户"); | ||||
| } | } | ||||
| @@ -133,7 +133,7 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService { | |||||
| .build(); | .build(); | ||||
| wxMaService.getMsgService().sendSubscribeMsg(subscribeMessage); | wxMaService.getMsgService().sendSubscribeMsg(subscribeMessage); | ||||
| wxCUserMapper.updateMsgCountDown(tenantEntity.getTenantId(),to); | |||||
| // wxCUserMapper.updateMsgCountDown(tenantEntity.getTenantId(),to); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("openId:"+to+"-----发送订阅消息失败"); | logger.error("openId:"+to+"-----发送订阅消息失败"); | ||||
| } | } | ||||
| @@ -232,7 +232,7 @@ | |||||
| <select id="listOpenId" parameterType="com.iformall.domain.po.WxCUser" resultType="String"> | <select id="listOpenId" parameterType="com.iformall.domain.po.WxCUser" resultType="String"> | ||||
| select open_id from wx_c_user where msg_count > 0 | |||||
| select open_id from wx_c_user where msg_count > 10 | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -243,7 +243,7 @@ | |||||
| <update id="updateMsgCount" parameterType="com.iformall.domain.po.WxCUser"> | <update id="updateMsgCount" parameterType="com.iformall.domain.po.WxCUser"> | ||||
| update wx_c_user set msg_count = msg_count+2 | update wx_c_user set msg_count = msg_count+2 | ||||
| where 1=1 | |||||
| where msg_count < 10 | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | </if> | ||||
| @@ -258,14 +258,14 @@ | |||||
| </if> | </if> | ||||
| </update> | </update> | ||||
| <update id="updateMsgCountDown"> | |||||
| update wx_c_user set msg_count = msg_count-1 | |||||
| where msg_count > 0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| and `open_id` = #{openId} | |||||
| </update> | |||||
| <!-- <update id="updateMsgCountDown">--> | |||||
| <!-- update wx_c_user set msg_count = msg_count-1--> | |||||
| <!-- where msg_count > 0--> | |||||
| <!-- <if test=" null != tenantId and '' != tenantId">--> | |||||
| <!-- and `tenant_id` = #{tenantId}--> | |||||
| <!-- </if>--> | |||||
| <!-- and `open_id` = #{openId}--> | |||||
| <!-- </update>--> | |||||
| <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_c_user | select <include refid="allColumns"/> from wx_c_user | ||||