springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
@@ -92,6 +92,10 @@ userService.addOrUpdate(openid, sessionKey, unionid,this.getAppId()); return tokenService.loginApplets(openid,this.getAppId()); } @PostMapping("/loginTest") public R loginTest(@RequestBody LoginRequest loginRequest){ return tokenService.loginApplets(loginRequest.getCode(),this.getAppId()); } @ApiOperation(value = "H5登录", response = LoginReturnVO.class) @PostMapping("loginH5") @@ -330,4 +334,9 @@ R r=tokenService.tfLogin(uuLoginVO.getMobile(),"Huacheng@123","wx118de8a734d269f0"); return r; } @ApiOperation("用户授权") @GetMapping("/accept") public R accept(){ return userService.accept(this.getUserId()); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/acid/ComActAcidRecordDTO.java
@@ -65,4 +65,6 @@ @ApiModelProperty("登录的账号名") private String loginAccount; private Integer type; private String dangerArea; private String touristCity; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -1274,4 +1274,9 @@ @PostMapping("/tfLogin") R tfLogin(@RequestBody UuLoginVO uuLoginVO); @GetMapping("/accept") R accept(Long userId); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxXCXTempSend.java
@@ -98,6 +98,11 @@ accessToken=wxXCXTempSend.stringRedisTemplate.boundValueOps("access_token:access_token:"+this.getAppId()).get(); return accessToken; } public String getAccessToken(String appid) throws Exception { String accessToken = ""; accessToken=wxXCXTempSend.stringRedisTemplate.boundValueOps("access_token:access_token:"+appid).get(); return accessToken; } public String getAppAccessToken() throws Exception { String accessToken = "0"; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/config/RabbitmqConfig.java
@@ -41,6 +41,9 @@ public static final String ACID_DIRECT_ROUTING_KEY = "huacheng.acid.direct.key"; public static final String ACID_DIRECT_EXCHANGE = "huacheng.acid.direct.exchange"; public static final String ACID_MESSAGE_QUEUE="huacheng.acid.message.queue"; public static final String ACID_MESSAGE_ROUTING_KEY = "huacheng.acid.message.key"; public static final String ACID_MESSAGE_EXCHANGE = "huacheng.acid.message.exchange"; @Bean public Queue preOrderQueue(){ @@ -124,6 +127,20 @@ public Binding acidDirectBinding(){ return BindingBuilder.bind(acidDirectQueue()).to(acidDirectExchange()).with(ACID_DIRECT_ROUTING_KEY).noargs(); } @Bean public Queue acidMessageQueue(){ return new Queue(ACID_MESSAGE_QUEUE,true,false,false,null); } @Bean public Exchange acidMessageExchange(){ return new DirectExchange(ACID_MESSAGE_EXCHANGE,true,false); } @Bean public Binding acidMessageBinding(){ return BindingBuilder.bind(acidMessageQueue()).to(acidMessageExchange()).with(ACID_MESSAGE_ROUTING_KEY).noargs(); } @Bean public Queue mcsOrderQueue(){ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/SysUserDao.java
@@ -4,6 +4,8 @@ import org.apache.ibatis.annotations.Mapper; import com.panzhihua.service_community.entity.SysUser; import java.util.List; /** * 用户表 后台用户+小程序用户(SysUser)表数据库访问层 * projectName 成都呐喊信息技术有限公司-智慧社区项目 @@ -14,5 +16,5 @@ */ @Mapper public interface SysUserDao extends BaseMapper<SysUser> { List<String> selectOpenId(); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/SysUser.java
@@ -274,4 +274,5 @@ int YES = 1; int NO = 2; } private Integer isAccept; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/message/AcidMessage.java
@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.panzhihua.common.model.vos.community.ComActDynVO; import com.panzhihua.service_community.dao.ComActDAO; import com.panzhihua.service_community.dao.SysUserDao; import com.panzhihua.service_community.model.dos.ComActDO; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Component; @@ -33,12 +35,15 @@ public static final String DELAYED_QUEUE="huacheng.acid.queue"; public static final String ACID_DANGER_QUEUE = "huacheng.acid.danger.queue"; public static final String DIRECT_QUEUE="huacheng.acid.direct.queue"; public static final String ACID_MESSAGE_QUEUE="huacheng.acid.message.queue"; @Resource private UserService userService; @Resource private ComActAcidMemberService comActAcidMemberService; @Resource private ComActDAO comActDAO; @Resource private SysUserDao sysUserDao; @RabbitListener(queues=DELAYED_QUEUE) public void doTemplate(ComActAcidRecordVO comActAcidRecordVO) { @@ -107,4 +112,16 @@ } } } @RabbitListener(queues = ACID_MESSAGE_QUEUE) public void sendMessage(ComActDynVO comActDynVO){ List<String> openIds=sysUserDao.selectOpenId(); WxXCXTempSend wxXCXTempSend=new WxXCXTempSend(); for(String openId:openIds){ try { WxUtil.sendLongTimeTemplate(openId,wxXCXTempSend.getAccessToken("wx118de8a734d269f0"),"疫情快讯","您有新的疫情快讯待查看","/pages/community_child/community/detail?id="+comActDynVO.getId()+"&title=疫情快讯详情"); } catch (Exception e) { e.printStackTrace(); } } } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDynDO.java
@@ -93,4 +93,6 @@ * 类型(1.社区动态 2.党务公开 3.花城资讯) */ private Integer category; private Integer readNum; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -819,10 +819,8 @@ // 修改报名状态 变为报名中 // int num1 = comActActivityDAO.updateStatusToBeginSign(); // log.info("定时任务--修改社区活动报名状态活动数量【{}】", num1); int num3 = comActActivityDAO.updateStatusToBeginAfterSingEnd(); log.info("定时任务--报名结束修改社区活动进行状态活动数量【{}】", num3); // 查询已经结束的活动,需要计算积分 List<Long> activityEndIds = comActActivityDAO.getActivityEndIds(); List<Long> activityEndIds = comActActivityDAO.selectBeginIds(); if(!CollectionUtils.isEmpty(activityEndIds)){ activityEndIds.forEach(activityId->{ List<String> openIds=comActActivityDAO.selectOpenIdByActivityId(activityId); @@ -830,7 +828,7 @@ openIds.forEach(op->{ WxXCXTempSend wxXCXTempSend=new WxXCXTempSend(); try { WxUtil.sendLongTimeTemplate(op,wxXCXTempSend.getAccessToken(),"活动开始提醒","您参加的活动已开始","packageC/pages/activity/communityActivityDetails/communityActivityDetails?id="+activityId); WxUtil.sendLongTimeTemplate(op,wxXCXTempSend.getAccessToken("wx118de8a734d269f0"),"活动开始提醒","您参加的活动已开始","packageC/pages/activity/communityActivityDetails/communityActivityDetails?id="+activityId); } catch (Exception e) { e.printStackTrace(); } @@ -838,6 +836,8 @@ } }); } int num3 = comActActivityDAO.updateStatusToBeginAfterSingEnd(); log.info("定时任务--报名结束修改社区活动进行状态活动数量【{}】", num3); // 修改进行状态 变为进行中或者已结束 List<Long> ids = comActActivityDAO.getActivityEndIds(); if(!CollectionUtils.isEmpty(ids)){ @@ -849,7 +849,7 @@ openIds.forEach(op->{ WxXCXTempSend wxXCXTempSend=new WxXCXTempSend(); try { WxUtil.sendLongTimeTemplate(op,wxXCXTempSend.getAccessToken(),"活动结束提醒","您参加的活动已结束","packageC/pages/activity/communityActivityDetails/communityActivityDetails?id="+id); WxUtil.sendLongTimeTemplate(op,wxXCXTempSend.getAccessToken("wx118de8a734d269f0"),"活动结束提醒","您参加的活动已结束","packageC/pages/activity/communityActivityDetails/communityActivityDetails?id="+id); } catch (Exception e) { e.printStackTrace(); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java
@@ -103,6 +103,10 @@ comActDynVO.setCommunityName(comActDO.getName()); } } if(comActDynDO.getCategory()==4){ comActDynDO.setReadNum(comActDynDO.getReadNum()+1); comActDynDAO.updateById(comActDynDO); } return R.ok(comActDynVO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActAcidRecordMapper.xml
@@ -60,6 +60,12 @@ <if test="commonPage.departureCity !=null and commonPage.departureCity !=''"> and departure_city like concat('%',#{commonPage.departureCity},'%') </if> <if test="commonPage.touristCity !=null and commonPage.touristCity !=''"> and tourist_city like concat('%',#{commonPage.touristCity},'%') </if> <if test="commonPage.dangerArea !=null and commonPage.dangerArea !=''"> and danger_area = #{commonPage.dangerArea} </if> <if test="commonPage.localCity !=null and commonPage.localCity !='' and commonPage.localCity !='panzhihua'"> and local_city like concat('%',#{commonPage.localCity},'%') </if> @@ -107,6 +113,12 @@ <if test="commonPage.departureCity !=null and commonPage.departureCity !=''"> and departure_city like concat('%',#{commonPage.departureCity},'%') </if> <if test="commonPage.touristCity !=null and commonPage.touristCity !=''"> and tourist_city like concat('%',#{commonPage.touristCity},'%') </if> <if test="commonPage.dangerArea !=null and commonPage.dangerArea !=''"> and danger_area = #{commonPage.dangerArea} </if> <if test="commonPage.localCity !=null and commonPage.localCity !='' and commonPage.localCity !='panzhihua'"> and local_city like concat('%',#{commonPage.localCity},'%') </if> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/SysUserMapper.xml
@@ -1,45 +1,47 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_community.dao.SysUserMapper"> <mapper namespace="com.panzhihua.service_community.dao.SysUserDao"> <resultMap type="com.panzhihua.service_community.entity.SysUser" id="SysUserMap"> <result property="userId" column="user_id" jdbcType="INTEGER"/> <result property="account" column="account" jdbcType="VARCHAR"/> <result property="password" column="password" jdbcType="VARCHAR"/> <result property="openid" column="openid" jdbcType="VARCHAR"/> <result property="sessionKey" column="session_key" jdbcType="VARCHAR"/> <result property="unionid" column="unionid" jdbcType="VARCHAR"/> <result property="phone" column="phone" jdbcType="VARCHAR"/> <result property="nickName" column="nick_name" jdbcType="VARCHAR"/> <result property="name" column="name" jdbcType="VARCHAR"/> <result property="communityId" column="community_id" jdbcType="INTEGER"/> <result property="sex" column="sex" jdbcType="INTEGER"/> <result property="idCard" column="id_card" jdbcType="VARCHAR"/> <result property="birthday" column="birthday" jdbcType="TIMESTAMP"/> <result property="imageUrl" column="image_url" jdbcType="VARCHAR"/> <result property="type" column="type" jdbcType="INTEGER"/> <result property="job" column="job" jdbcType="VARCHAR"/> <result property="isVolunteer" column="is_volunteer" jdbcType="INTEGER"/> <result property="isPartymember" column="is_partymember" jdbcType="INTEGER"/> <result property="status" column="status" jdbcType="INTEGER"/> <result property="createAt" column="create_at" jdbcType="TIMESTAMP"/> <result property="lastLoginTime" column="last_login_time" jdbcType="TIMESTAMP"/> <result property="tags" column="tags" jdbcType="VARCHAR"/> <result property="familyId" column="family_id" jdbcType="INTEGER"/> <result property="faceUrl" column="face_url" jdbcType="VARCHAR"/> <result property="faceState" column="face_state" jdbcType="INTEGER"/> <result property="rejectReson" column="reject_reson" jdbcType="VARCHAR"/> <result property="areaId" column="area_id" jdbcType="INTEGER"/> <result property="cardPhotoFront" column="card_photo_front" jdbcType="VARCHAR"/> <result property="cardPhotoBack" column="card_photo_back" jdbcType="VARCHAR"/> <result property="familyBook" column="family_book" jdbcType="VARCHAR"/> <result property="continuousLandingDays" column="continuous_landing_days" jdbcType="INTEGER"/> <result property="isTips" column="is_tips" jdbcType="INTEGER"/> <result property="workStatus" column="work_status" jdbcType="INTEGER"/> <result property="workStartTime" column="work_start_time" jdbcType="INTEGER"/> <result property="workEndTime" column="work_end_time" jdbcType="INTEGER"/> <result property="bigAgeTips" column="big_age_tips" jdbcType="INTEGER"/> <result property="plaintextPassword" column="plaintext_password" jdbcType="VARCHAR"/> <resultMap type="com.panzhihua.service_community.entity.SysUser" id="SysUserBaseResultMap"> <result property="userId" column="user_id"/> <result property="account" column="account"/> <result property="password" column="password"/> <result property="openid" column="openid"/> <result property="sessionKey" column="session_key"/> <result property="unionid" column="unionid"/> <result property="phone" column="phone"/> <result property="nickName" column="nick_name"/> <result property="name" column="name"/> <result property="communityId" column="community_id"/> <result property="sex" column="sex"/> <result property="idCard" column="id_card"/> <result property="birthday" column="birthday"/> <result property="imageUrl" column="image_url"/> <result property="type" column="type"/> <result property="job" column="job"/> <result property="isVolunteer" column="is_volunteer"/> <result property="isPartymember" column="is_partymember"/> <result property="status" column="status"/> <result property="createAt" column="create_at"/> <result property="lastLoginTime" column="last_login_time"/> <result property="tags" column="tags"/> <result property="familyId" column="family_id"/> <result property="faceUrl" column="face_url"/> <result property="faceState" column="face_state"/> <result property="rejectReson" column="reject_reson"/> <result property="areaId" column="area_id"/> <result property="cardPhotoFront" column="card_photo_front"/> <result property="cardPhotoBack" column="card_photo_back"/> <result property="familyBook" column="family_book"/> <result property="continuousLandingDays" column="continuous_landing_days"/> <result property="isTips" column="is_tips"/> <result property="workStatus" column="work_status"/> <result property="workStartTime" column="work_start_time"/> <result property="workEndTime" column="work_end_time"/> <result property="bigAgeTips" column="big_age_tips"/> <result property="plaintextPassword" column="plaintext_password"/> <result property="streetId" column="street_id"/> <result property="relationName" column="relation_name"/> </resultMap> <!--查询单个--> @@ -301,4 +303,7 @@ <update id="updatePassWord"> update sys_user set plaintext_password = #{passWord},password = #{pwd} where community_id = #{storeId} and `type` = 20 </update> <select id="selectOpenId" resultType="String"> select openid from sys_user where type = 1 and app_id ='wx118de8a734d269f0' and is_accept = 1 </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml
@@ -705,7 +705,7 @@ m.employment_time, DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge from com_pb_member as m LEFT JOIN sys_user u ON m.id_card = u.id_card and u.type = 1 LEFT JOIN (select user_id,phone from sys_user where type = 1 and app_id = "wx118de8a734d269f0") u ON m.phone = u.phone LEFT JOIN com_pb_org as cpo on cpo.id = m.org_id LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id LEFT JOIN (select t1.user_id,sum(t.duration) as partyTime,sum(t1.award) as partyInterval from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id where t1.sign_identity = 2 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -1450,4 +1450,9 @@ public R tfLogin(@RequestBody UuLoginVO uuLoginVO){ return userService.tfLogin(uuLoginVO); } @GetMapping("/accept") public R accept(Long userId){ return userService.accept(userId); } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/model/dos/SysUserDO.java
@@ -208,4 +208,6 @@ private String relationName; private String appId; private Integer isAccept; } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -920,4 +920,11 @@ * @return */ R tfLogin(UuLoginVO uuLoginVO); /** * 用户授权 * @param userId * @return */ R accept(Long userId); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -3668,6 +3668,15 @@ return R.ok(); } @Override public R accept(Long userId) { SysUserDO sysUserDO=new SysUserDO(); sysUserDO.setUserId(userId); sysUserDO.setIsAccept(1); userDao.updateById(sysUserDO); return R.ok(); } @Override public R getAreaAndStreet() {