| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.panzhihua.applets.config.MinioUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @RestController |
| | | @RequestMapping("/common/") |
| | | @Api(tags = {"公共接口"}) |
| | | public class CommonApi { |
| | | public class CommonApi extends BaseController { |
| | | /** |
| | | * 允许的图片文件后缀 |
| | | */ |
| | |
| | | @PostMapping(value = "uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) throws IOException { |
| | | // 微信图片内容校验 |
| | | WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService().getSecCheckService(); |
| | | WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService(this.getAppId()).getSecCheckService(); |
| | | String property = System.getProperty("user.dir"); |
| | | |
| | | String fileExtension = ".jpg"; |
| | |
| | | @ApiOperation(value = "根据距离搜索社区", response = CommunitySwitchAllAppletsVO.class) |
| | | @PostMapping("/distance/noToken") |
| | | public R searchDistance(@RequestBody SearchCommunityDTO communityDTO) { |
| | | communityDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.communitySwitchSearchDistanceList(communityDTO); |
| | | } |
| | | |
| | |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | addIdentityAuthDTO.setSubmitUserId(loginUserInfo.getUserId()); |
| | | addIdentityAuthDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | addIdentityAuthDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.addIdentityAuth(addIdentityAuthDTO); |
| | | } |
| | | |
| | |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | WxMaService maService = wxMaConfiguration.getMaService(); |
| | | WxMaService maService = wxMaConfiguration.getMaService(loginRequest.getAppid()); |
| | | WxMaJscode2SessionResult sessionInfo = null; |
| | | try { |
| | | sessionInfo = maService.getUserService().getSessionInfo(code); |
| | |
| | | if (empty || empty1) { |
| | | return R.fail("微信用户参数不全"); |
| | | } |
| | | WxMaService maService = wxMaConfiguration.getMaService(); |
| | | WxMaService maService = wxMaConfiguration.getMaService(this.getAppId()); |
| | | Long userId = this.getUserId(); |
| | | R<LoginUserInfoVO> r = userService.getUserInfoByUserId(userId + ""); |
| | | LoginUserInfoVO loginUserInfoVO = r.getData(); |
| | |
| | | return R.fail("缺少登录参数"); |
| | | } |
| | | log.info(code); |
| | | WxMaService maService = wxMaConfiguration.getMaService(); |
| | | WxMaService maService = wxMaConfiguration.getMaService(this.getAppId()); |
| | | WxMaJscode2SessionResult sessionInfo = null; |
| | | try { |
| | | sessionInfo = maService.getUserService().getSessionInfo(code); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.user.SysAppConfigVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | |
| | | @Resource |
| | | private WxMaRHProperties wxMaRHProperties; |
| | | |
| | | public WxMaService getMaService() { |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | public WxMaService getMaService(String appid) { |
| | | WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); |
| | | config.setAppid(properties.getAppid()); |
| | | config.setSecret(properties.getSecret()); |
| | | config.setMsgDataFormat(properties.getMsgDataFormat()); |
| | | if(StringUtils.isNotEmpty(appid)){ |
| | | R<SysAppConfigVO> r=userService.selectByAppid(appid); |
| | | if(R.isOk(r)){ |
| | | SysAppConfigVO sysAppConfigVO= r.getData(); |
| | | config.setAppid(sysAppConfigVO.getAppId()); |
| | | config.setSecret(sysAppConfigVO.getSecret()); |
| | | config.setMsgDataFormat(properties.getMsgDataFormat()); |
| | | } |
| | | } |
| | | else{ |
| | | config.setAppid(properties.getAppid()); |
| | | config.setSecret(properties.getSecret()); |
| | | config.setMsgDataFormat(properties.getMsgDataFormat()); |
| | | } |
| | | WxMaService wxMaService = new WxMaServiceImpl(); |
| | | wxMaService.setWxMaConfig(config); |
| | | return wxMaService; |
| | |
| | | @ApiModelProperty(name = "userInfo", value = "用户基本信息") |
| | | WxMaUserInfo userInfo; |
| | | |
| | | @ApiModelProperty("appid") |
| | | String appid; |
| | | } |
| | |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | |
| | | public boolean checkMessage(String msg) { |
| | | WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService().getSecCheckService(); |
| | | WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService("").getSecCheckService(); |
| | | try { |
| | | boolean b = wxMaSecCheckService.checkMessage(msg); |
| | | return b; |
| | |
| | | @GetMapping("listrolebackstage") |
| | | public R listRoleBackstage(@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize) { |
| | | Long communityId = 0L; |
| | | return userService.listRoleBackstage(communityId,pageNum,pageSize); |
| | | return userService.listRoleBackstage(communityId,pageNum,pageSize,this.getAreaCode()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询后台用户", response = AdministratorsUserVO.class) |
| | |
| | | /** |
| | | * 获取登录对象所在区域编码 |
| | | * |
| | | * @return 小区id |
| | | * @return |
| | | */ |
| | | public String getAreaCode() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComActVO comActVO = loginUserInfo.getComActVO(); |
| | | if (comActVO==null) { |
| | | return "510423"; |
| | | String appid = this.getRequest().getHeader("appid"); |
| | | if(StringUtils.isNotEmpty(appid)){ |
| | | if(appid.equals("wx08932ba29546ff82")){ |
| | | return "510411"; |
| | | } |
| | | else if(appid.equals("wx50d8c395af50481b")){ |
| | | return "510402"; |
| | | } |
| | | else { |
| | | return "510423"; |
| | | } |
| | | } |
| | | else { |
| | | return comActVO.getAreaCode(); |
| | | LoginUserInfoVO loginUserInfoVO=this.getLoginUserInfo(); |
| | | ComActVO comActVO=loginUserInfoVO.getComActVO(); |
| | | if(comActVO!=null){ |
| | | return comActVO.getAreaCode(); |
| | | } |
| | | return "510423"; |
| | | } |
| | | } |
| | | |
| | |
| | | return header; |
| | | } |
| | | |
| | | public String getAppId(){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | return loginUserInfo.getAppId(); |
| | | } |
| | | |
| | | public String getAppSecret(){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | return loginUserInfo.getAppSecret(); |
| | | } |
| | | /** |
| | | * 获取登录对象所有信息 |
| | | * |
| | |
| | | |
| | | @ApiModelProperty("认证期数") |
| | | private String authPeriod; |
| | | |
| | | private String areaCode; |
| | | } |
| | |
| | | @ApiModelProperty(value = "用户ID", hidden = true, example = "") |
| | | private Long userId; |
| | | |
| | | private String areaCode; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "操作人", hidden = true) |
| | | private Long userId; |
| | | |
| | | private String areaCode; |
| | | } |
| | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 预约状态(1.同意 2.拒绝) |
| | | */ |
| | |
| | | |
| | | @ApiModelProperty("是否物业工作人员 1.是 2.否") |
| | | private Integer isPropertyWorker; |
| | | |
| | | @ApiModelProperty("appid") |
| | | private String appId; |
| | | @ApiModelProperty("appSecret") |
| | | private String appSecret; |
| | | @ApiModelProperty("areaCode") |
| | | private String areaCode; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | private Long communityId; |
| | | |
| | | private String areaCode; |
| | | } |
| | |
| | | private List<String> nextIds; |
| | | |
| | | private Long communityId; |
| | | |
| | | private String areaCode; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * (SysAppConfig)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 10:10:15 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class SysAppConfigVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -90981038076389842L; |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * appid |
| | | */ |
| | | @ApiModelProperty(value = "appid") |
| | | private String appId; |
| | | |
| | | /** |
| | | * secret |
| | | */ |
| | | @ApiModelProperty(value = "secret") |
| | | private String secret; |
| | | |
| | | /** |
| | | * 小程序名字 |
| | | */ |
| | | @ApiModelProperty(value = "小程序名字") |
| | | private String name; |
| | | |
| | | private String areaCode; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:29:55 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class SysTemplateConfigVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -29178409799302189L; |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 模板id |
| | | */ |
| | | @ApiModelProperty(value = "模板id") |
| | | private String templateId; |
| | | |
| | | /** |
| | | * 模板类型 1活动变更 2留言回复 3活动取消 4审核状态 5认证审核 6调研问卷 7奖励发放 8报名成功 9活动即将开始 10预约提醒 |
| | | */ |
| | | @ApiModelProperty(value = "模板类型 1活动变更 2留言回复 3活动取消 4审核状态 5认证审核 6调研问卷 7奖励发放 8报名成功 9活动即将开始 10预约提醒 ") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | } |
| | |
| | | * @return 角色集合 |
| | | */ |
| | | @PostMapping("/role/listrolebackstage") |
| | | R listRoleBackstage(@RequestParam("communityId") Long communityId,@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize); |
| | | R listRoleBackstage(@RequestParam("communityId") Long communityId,@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize,@RequestParam("areaCode")String areaCode); |
| | | |
| | | /** |
| | | * 分页查询后台用户 |
| | |
| | | */ |
| | | @GetMapping("/getByUnionId") |
| | | R getUserInfoByUnionId(@RequestParam("unionId") String unionId); |
| | | |
| | | /** |
| | | * 小程序id获取相关信息 |
| | | * @param appId |
| | | * @return |
| | | */ |
| | | @GetMapping("/sysAppConfig/selectByAppid") |
| | | R<SysAppConfigVO> selectByAppid(@RequestParam("appId")String appId); |
| | | |
| | | /** |
| | | * 通过区域编码 类型获取动态模板id |
| | | * @param areaCode |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @GetMapping("/sysTemplateConfig/selectTemplate") |
| | | R<SysTemplateConfigVO> selectTemplate(@RequestParam("areaCode")String areaCode,@RequestParam("type")Integer type); |
| | | } |
| | |
| | | * 备注说明 |
| | | */ |
| | | public static void sendSubscribeJLDZ(String openId, String accessToken, String name, BigDecimal amount, |
| | | String remark) { |
| | | String remark,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.JLFF_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing1", name));// 活动名称 |
| | | paras.add(new TemplateParam("amount3", amount.toString()));// 奖励金额 |
| | |
| | | * 审核结果 |
| | | */ |
| | | public static void sendSubscribeRZSH(String openId, String accessToken, String name, String applyTime, |
| | | String result) { |
| | | String result,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.EZSH_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing2", name));// 认证内容 |
| | | paras.add(new TemplateParam("phrase1", result));// 审核结果 |
| | |
| | | * 审核时间 |
| | | */ |
| | | public static void sendSubscribeSHZT(String openId, String accessToken, String name, String applyTime, |
| | | String result) { |
| | | String result,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.SHZT_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing1", name));// 审核项目 |
| | | paras.add(new TemplateParam("phrase2", result));// 审核状态 |
| | |
| | | * @param time |
| | | * 活动时间 |
| | | */ |
| | | public static void sendSubscribeHDQX(String openId, String accessToken, String name, String time) { |
| | | public static void sendSubscribeHDQX(String openId, String accessToken, String name, String time,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.HDQX_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing1", name));// 活动标题 |
| | | paras.add(new TemplateParam("date2", time));// 活动时间 |
| | |
| | | * @param content |
| | | * 回复内容 |
| | | */ |
| | | public static void sendSubscribeLYHF(String openId, String accessToken, String name, String time, String content) { |
| | | public static void sendSubscribeLYHF(String openId, String accessToken, String name, String time, String content,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.LYHF_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing3", content));// 回复内容 |
| | | paras.add(new TemplateParam("name1", name));// 回复者 |
| | |
| | | * 活动地点 |
| | | */ |
| | | public static void sendSubscribeHDBG(String openId, String accessToken, String name, String changeTime, |
| | | String changeAddress, String time, String address) { |
| | | String changeAddress, String time, String address,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.HDBG_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing1", name));// 活动名称 |
| | | paras.add(new TemplateParam("time2", changeTime));// 活动时间变更 |
| | |
| | | * 活动参加人数 |
| | | */ |
| | | public static void sendSubscribeHDJJKS(String openId, String accessToken, String name, String time, String address, |
| | | String num) { |
| | | String num,String templateId) { |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.HDJJKS_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras = new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("thing1", name));// 活动名称 |
| | | paras.add(new TemplateParam("date2", time));// 活动时间 |
| | |
| | | * @param name 预约人 |
| | | * @param time 预约时间 |
| | | */ |
| | | public static void sendSubscribeYYTX(String openId, String accessToken, String result, String title, String name,String time){ |
| | | public static void sendSubscribeYYTX(String openId, String accessToken, String result, String title, String name,String time,String templateId){ |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(WxSubscribeConstants.YYTX_ID); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | List<TemplateParam> paras=new ArrayList<TemplateParam>(); |
| | | paras.add(new TemplateParam("phrase8",result));//预约结果 |
| | | paras.add(new TemplateParam("thing23",title));//预约主题 |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import org.apache.commons.fileupload.FileItem; |
| | | import org.apache.commons.fileupload.FileItemFactory; |
| | | import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
| | |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class WxXCXTempSend { |
| | | public class WxXCXTempSend extends BaseController { |
| | | |
| | | public static final String APP_ID = "wx0cef797390444b75"; |
| | | private static final String APP_SECRET = "c7ea9aaa7e391a487e8a5b9ba61045d1"; |
| | |
| | | try { |
| | | // 此处APP_ID APP_SECRET 在微信小程序后端可见 |
| | | // String accessTokenUrl = String.format(TEMP_URL, APP_ID, APP_SECRET); |
| | | String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=" + APP_ID + "&secret=" + APP_SECRET; |
| | | String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=" + getAppId() + "&secret=" + getAppSecret(); |
| | | String result = HttpClientUtil.httpGet(accessTokenUrl, null, null); |
| | | Map<String, Object> resultMap = JSON.parseObject(result, Map.class); |
| | | if (resultMap.containsKey("access_token")) { |
| | |
| | | return R.fail("请先登录"); |
| | | } |
| | | makeHandleDTO.setUserId(loginUserInfo.getUserId()); |
| | | makeHandleDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.makeHandleAdmin(makeHandleDTO); |
| | | } |
| | | |
| | |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | if (R.isOk(r2)) { |
| | | log.info("新增取消社区活动通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | |
| | | R<SysTemplateConfigVO> r4=userService.selectTemplate(this.getAreaCode(),3); |
| | | // 取消社区活动推送订阅消息给用户 |
| | | WxUtil.sendSubscribeHDQX(activitySignVO1.getOpenid(), accessToken, |
| | | comActActivityVO.getActivityName(), |
| | | DateUtils.format(comActActivityVO.getBeginAt(), DateUtils.ymdhms_format)); |
| | | DateUtils.format(comActActivityVO.getBeginAt(), DateUtils.ymdhms_format),r4.getData().getTemplateId()); |
| | | }); |
| | | } catch (Exception e) { |
| | | log.error("新增取消社区活动通知失败,错误原因:" + e.getMessage()); |
| | |
| | | result = result.substring(0, 4); |
| | | result += "…"; |
| | | } |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),4); |
| | | WxUtil.sendSubscribeSHZT(openid, util.getAppAccessToken(), "微心愿", |
| | | DateUtils.format(comActMicroWishVO1.getExamineAt(), DateUtils.ymdhms_format), |
| | | result); |
| | | result,sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | if (R.isOk(userResult)) { |
| | | String openid = userResult.getData().toString(); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),4); |
| | | try { |
| | | WxUtil.sendSubscribeSHZT(openid, util.getAppAccessToken(), "微心愿", |
| | | DateUtils.format(comActMicroWishVO1.getExamineAt(), DateUtils.ymdhms_format), |
| | | "审核通过"); |
| | | "审核通过",sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | if(comActEasyPhotoVO.getHandlerId() == null){ |
| | | comActEasyPhotoVO.setHandlerId(userId); |
| | | } |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),4); |
| | | R r = communityService.putEasypHotoStatus(comActEasyPhotoVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = communityService.detailEasyPhoto(id, userId); |
| | |
| | | result += "…"; |
| | | } |
| | | WxUtil.sendSubscribeSHZT(openid, util.getAppAccessToken(), "随手拍", |
| | | DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), result); |
| | | DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), result,sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeSHZT(openid, util.getAppAccessToken(), "随手拍", |
| | | DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), "审核通过"); |
| | | DateUtils.format(comActEasyPhotoVO1.getExamineAt(), DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | @PostMapping("grantReward") |
| | | public R grantReward(@Valid @RequestBody GrantRewardDTO grantRewardDTO) { |
| | | grantRewardDTO.setUserId(this.getUserId()); |
| | | grantRewardDTO.setAreaCode(this.getAreaCode()); |
| | | if (grantRewardDTO.getAmount() == null || grantRewardDTO.getAmount().compareTo(BigDecimal.ZERO) < -1) { |
| | | return R.fail("您输入的发放金额有误"); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | if (R.isOk(userResult)) { |
| | | String openid = userResult.getData().toString(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),5); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeRZSH(openid, util.getAppAccessToken(), "志愿者认证", |
| | | DateUtils.format(comMngVolunteerMngVO1.getCreateAt(), DateUtils.ymdhms_format), "审核通过"); |
| | | DateUtils.format(comMngVolunteerMngVO1.getCreateAt(), DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | |
| | | if (R.isOk(userResult)) { |
| | | String openid = userResult.getData().toString(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),5); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeRZSH(openid, util.getAppAccessToken(), "志愿者认证", |
| | | DateUtils.format(comMngVolunteerMngVO1.getCreateAt(), DateUtils.ymdhms_format), |
| | | "审核驳回,驳回原因:" + comMngVolunteerMngVO1.getRejectReson()); |
| | | "审核驳回,驳回原因:" + comMngVolunteerMngVO1.getRejectReson(),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.community_backstage.config.MinioUtil; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | R r1 = userService.getUserOpenId(userId); |
| | | if (R.isOk(r1)) { |
| | | String openid = r1.getData().toString(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),5); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeRZSH(openid, util.getAppAccessToken(), "党员认证", |
| | | DateUtils.format(vo1.getCreateAt(), DateUtils.ymdhms_format), "审核通过"); |
| | | DateUtils.format(vo1.getCreateAt(), DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | R r2 = userService.getUserOpenId(userId); |
| | | if (R.isOk(r2)) { |
| | | String openid = r2.getData().toString(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),5); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeRZSH(openid, util.getAppAccessToken(), "党员认证", |
| | | DateUtils.format(vo1.getCreateAt(), DateUtils.ymdhms_format), |
| | | "审核驳回,驳回原因:" + partyBuildingMemberVO.getRefuseReason()); |
| | | "审核驳回,驳回原因:" + partyBuildingMemberVO.getRefuseReason(),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | R addFeedback(@Validated @RequestBody EldersAuthFeedbackAddDTO eldersAuthFeedbackAddDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(eldersAuthFeedbackAddDTO); |
| | | eldersAuthFeedbackAddDTO.setUserId(getUserId()); |
| | | eldersAuthFeedbackAddDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.addFeedback(eldersAuthFeedbackAddDTO); |
| | | } |
| | | |
| | |
| | | @PostMapping("/authRecords/examine") |
| | | public R examineElderAuthRecords(@RequestBody ComElderAuthRecordVO comElderAuthRecordVO) { |
| | | comElderAuthRecordVO.setApproverId(this.getUserId()); |
| | | comElderAuthRecordVO.setAreaCode(this.getAreaCode()); |
| | | return communityService.examineElderAuthRecords(comElderAuthRecordVO); |
| | | } |
| | | |
| | |
| | | @PostMapping("/pensionAuthRecords/examine") |
| | | public R examinePensionAuthRecords(@RequestBody ComPensionAuthRecordVO comPensionAuthRecordVO) { |
| | | comPensionAuthRecordVO.setApproverId(this.getUserId()); |
| | | comPensionAuthRecordVO.setAreaCode(this.getAreaCode()); |
| | | return communityService.examinePensionAuthRecords(comPensionAuthRecordVO); |
| | | } |
| | | |
| | |
| | | R addPensionAuthRecordVO(@RequestBody ComElderAuthRecordVO comElderAuthRecordVO){ |
| | | comElderAuthRecordVO.setSubmitUserId(this.getUserId()); |
| | | comElderAuthRecordVO.setCommunityId(this.getCommunityId()); |
| | | comElderAuthRecordVO.setAreaCode(this.getAreaCode()); |
| | | return communityService.addPensionAuthRecordVO(comElderAuthRecordVO); |
| | | } |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | return R.fail("房屋租售id主键不能为空"); |
| | | } |
| | | R r = communityService.putOpsHouse(comOpsHouseVO); |
| | | |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(this.getAreaCode(),4); |
| | | Date nowDate = new Date(); |
| | | //查询用户openid |
| | | R userResult = null; |
| | |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeSHZT(openid, util.getAppAccessToken(), "房屋租售", |
| | | DateUtils.format(nowDate, DateUtils.ymdhms_format), "审核通过"); |
| | | DateUtils.format(nowDate, DateUtils.ymdhms_format), "审核通过",sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | result += "…"; |
| | | } |
| | | WxUtil.sendSubscribeSHZT(openid, util.getAppAccessToken(), "房屋租售", |
| | | DateUtils.format(nowDate, DateUtils.ymdhms_format), result); |
| | | DateUtils.format(nowDate, DateUtils.ymdhms_format), result,sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | @GetMapping("listrolebackstage") |
| | | public R listRoleBackstage(@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize) { |
| | | Long communityId = this.getCommunityId(); |
| | | return userService.listRoleBackstage(communityId,pageNum,pageSize); |
| | | return userService.listRoleBackstage(communityId,pageNum,pageSize,""); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询后台用户", response = AdministratorsUserVO.class) |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | |
| | | String openid = map.get("openid"); |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(eldersAuthFeedbackAddDTO.getAreaCode(),5); |
| | | String accessToken = util.getAppAccessToken(); |
| | | WxUtil.sendSubscribeRZSH(openid, accessToken, "高龄认证", |
| | | DateUtils.format(eldersAuthDO.getCreateAt(), DateUtils.ymdhms_format), |
| | | eldersAuthFeedbackAddDTO.getFeedBack()); |
| | | eldersAuthFeedbackAddDTO.getFeedBack(),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("推送审核状态订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.SysTemplateConfig; |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:46:03 |
| | | */ |
| | | @Mapper |
| | | public interface SysTemplateConfigDao extends BaseMapper<SysTemplateConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:46:03 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class SysTemplateConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 159008627741278306L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 模板id |
| | | */ |
| | | @ApiModelProperty(value = "模板id") |
| | | private String templateId; |
| | | |
| | | /** |
| | | * 模板类型 1活动变更 2留言回复 3活动取消 4审核状态 5认证审核 6调研问卷 7奖励发放 8报名成功 9活动即将开始 10预约提醒 |
| | | */ |
| | | @ApiModelProperty(value = "模板类型 1活动变更 2留言回复 3活动取消 4审核状态 5认证审核 6调研问卷 7奖励发放 8报名成功 9活动即将开始 10预约提醒 ") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActPictureDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityCodeDao; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.dao.ComBpActivityDAO; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.service.ComActActivityCodeService; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | | import com.panzhihua.service_community.service.ComActIntegralUserTradeService; |
| | |
| | | private ComActIntegralUserTradeService comActIntegralUserTradeService; |
| | | @Resource |
| | | private ComActActivityCodeService comActActivityCodeService; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | |
| | | ComActDO comActDO=comActDAO.selectById(comActActivityDO.getCommunityId()); |
| | | R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),1); |
| | | activitySignVOS.forEach(activitySignVO1 -> { |
| | | // 变更社区活动推送订阅消息给用户 |
| | | WxUtil.sendSubscribeHDBG(activitySignVO1.getOpenid(), accessToken, |
| | |
| | | comActActivityDO.getActivityAddr(), |
| | | com.panzhihua.common.utlis.DateUtils.format(comActActivityVO.getBeginAt(), |
| | | com.panzhihua.common.utlis.DateUtils.ymdhms_format), |
| | | comActActivityVO.getActivityAddr()); |
| | | comActActivityVO.getActivityAddr(),r.getData().getTemplateId()); |
| | | }); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | |
| | | try { |
| | | String accessToken = util.getAppAccessToken(); |
| | | actActivityList.forEach(actActivity -> { |
| | | ComActDO comActDO=comActDAO.selectById(actActivity.getCommunityId()); |
| | | R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),9); |
| | | // 查询报名活动人员列表 |
| | | List<ComActActSignDO> actSignList = comActActSignDAO.selectList(new QueryWrapper<ComActActSignDO>() |
| | | .lambda().eq(ComActActSignDO::getActivityId, actActivity.getId())); |
| | |
| | | // 查询用户openId |
| | | Map<String, String> map = comActActSignDAO.getUserOpenId(actSign.getUserId()); |
| | | if (map != null) { |
| | | |
| | | String openid = map.get("openid"); |
| | | // 推送消息 |
| | | WxUtil.sendSubscribeHDJJKS(openid, accessToken, actActivity.getActivityName(), |
| | | com.panzhihua.common.utlis.DateUtils.format(actActivity.getBeginAt(), |
| | | com.panzhihua.common.utlis.DateUtils.ymdhms_format), |
| | | actActivity.getActivityAddr(), actSignList.size() + ""); |
| | | actActivity.getActivityAddr(), actSignList.size() + "",r.getData().getTemplateId()); |
| | | } |
| | | |
| | | }); |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO; |
| | | import com.panzhihua.service_community.entity.SysTemplateConfig; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | private ComActReserveMapper comActReserveMapper; |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | |
| | | @Resource |
| | | private SysTemplateConfigDao sysTemplateConfigDao; |
| | | /** |
| | | * 分页查询随手拍 |
| | | * |
| | |
| | | Map<String, String> map = comActActSignDAO.getUserOpenId(easyPhotoDO.getSponsorId()); |
| | | if (map != null) { |
| | | String openid = map.get("openid"); |
| | | SysTemplateConfig sysTemplateConfig=sysTemplateConfigDao.selectOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode, grantRewardDTO.getAreaCode()).eq(SysTemplateConfig::getType,7)); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeJLDZ(openid, util.getAppAccessToken(), "随手拍有奖活动", |
| | | grantRewardDTO.getAmount(), activityType); |
| | | grantRewardDTO.getAmount(), activityType,sysTemplateConfig.getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | private ComActMessageBackDAO comActMessageBackDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public R addMessage(ComActMessageVO comActMessageVO) { |
| | |
| | | if (map != null) { |
| | | String openid = map.get("openid"); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | ComActDO comActDO=comActDAO.selectById(comActMessageBackVO.getCommunityId()); |
| | | R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),2); |
| | | try { |
| | | WxUtil.sendSubscribeLYHF(openid, util.getAppAccessToken(), comActMessageBackVO.getUserName(), |
| | | DateUtils.format(new Date(), DateUtils.ymdhms_format), comActMessageBackVO.getMsgContent()); |
| | | DateUtils.format(new Date(), DateUtils.ymdhms_format), comActMessageBackVO.getMsgContent(),r.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.reserve.*; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | |
| | | private ComActReserveOperationRecordService comActReserveOperationRecordService; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | private final static String CANCEL="用户取消"; |
| | | @Override |
| | |
| | | ComActReserveDO reserveDO = comActReserveMapper.selectById(reserveRecordDO.getReserveId()); |
| | | // 预约以后给用户推送消息 |
| | | Map<String, String> map = comActActSignDAO.getUserOpenId(reserveRecordDO.getUserId()); |
| | | |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(makeHandleDTO.getAreaCode(),10); |
| | | //判断处理是否通过 |
| | | if(makeHandleDTO.getIsOk().equals(MakeHandleAdminDTO.isOk.yes)){ |
| | | reserveRecordDO.setStatus(ComActReserveRecordDO.status.cg); |
| | |
| | | String openid = map.get("openid"); |
| | | try { |
| | | WxUtil.sendSubscribeYYTX(openid, util.getAppAccessToken(), "预约成功", |
| | | reserveDO.getTitle(), reserveRecordDO.getName(), makeHandleDTO.getMakeTime()); |
| | | reserveDO.getTitle(), reserveRecordDO.getName(), makeHandleDTO.getMakeTime(),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | String openid = map.get("openid"); |
| | | try { |
| | | WxUtil.sendSubscribeYYTX(openid, util.getAppAccessToken(), "预约失败", |
| | | reserveDO.getTitle(), reserveRecordDO.getName(), DateUtils.format(reserveRecordDO.getReserveTime(),DateUtils.ymdhms_format)); |
| | | reserveDO.getTitle(), reserveRecordDO.getName(), DateUtils.format(reserveRecordDO.getReserveTime(),DateUtils.ymdhms_format),sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_community.entity.SysTemplateConfig; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private ComActEasyPhotoRewardMapper comActEasyPhotoRewardMapper; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private SysTemplateConfigDao sysTemplateConfigDao; |
| | | |
| | | /** |
| | | * 查询用户钱包信息 |
| | |
| | | Map<String, String> map = comActActSignDAO.getUserOpenId(easyPhotoDO.getSponsorId()); |
| | | if (map != null) { |
| | | String openid = map.get("openid"); |
| | | ComActDO comActDO=comActDAO.selectById(easyPhotoDO.getCommunityId()); |
| | | SysTemplateConfig sysTemplateConfig=sysTemplateConfigDao.selectOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode, comActDO.getAreaCode()).eq(SysTemplateConfig::getType,7)); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeJLDZ(openid, util.getAppAccessToken(), "随手拍有奖活动", |
| | | amount.setScale(2, RoundingMode.HALF_UP), activityTypeName); |
| | | amount.setScale(2, RoundingMode.HALF_UP), activityTypeName,sysTemplateConfig.getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComElderAuthElderliesService; |
| | |
| | | private ComPensionAuthPensionerDAO comPensionAuthPensionerDAO; |
| | | @Resource |
| | | private ComElderAuthElderliesService comElderAuthElderliesService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public R pageElderAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | |
| | | comElderAuthRecordsDO.setApprovalDate(nowDate); |
| | | if (comElderAuthRecordVO.getApprovalStatus().equals(ComElderAuthRecordsDO.approvalStatus.tg)) { |
| | | comElderAuthRecordsDO.setAuthStatus(ComElderAuthRecordsDO.authStatus.yrz); |
| | | sendAuthSubscribe(comElderAuthRecordsDO.getSubmitUserId(), "高龄认证", "认证成功!"); |
| | | sendAuthSubscribe(comElderAuthRecordsDO.getSubmitUserId(), "高龄认证", "认证成功!",comElderAuthRecordVO.getAreaCode()); |
| | | |
| | | authElderliesDO.setAddress(comElderAuthRecordVO.getAddress()); |
| | | comElderAuthElderliesDAO.updateById(authElderliesDO); |
| | | } else { |
| | | sendAuthSubscribe(comElderAuthRecordsDO.getSubmitUserId(), "高龄认证", comElderAuthRecordVO.getRejectReason()); |
| | | sendAuthSubscribe(comElderAuthRecordsDO.getSubmitUserId(), "高龄认证", comElderAuthRecordVO.getRejectReason(),comElderAuthRecordVO.getAreaCode()); |
| | | } |
| | | // comElderAuthRecordsDO.setApprovalDate(new Date()); |
| | | int nub = comElderAuthRecordsDAO.updateById(comElderAuthRecordsDO); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private void sendAuthSubscribe(Long userId, String name, String result) { |
| | | private void sendAuthSubscribe(Long userId, String name, String result,String areaCode) { |
| | | //发送订阅通知 |
| | | Map<String, String> map = comActActSignDAO.getUserOpenId(userId); |
| | | if (map != null) { |
| | |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(areaCode,5); |
| | | WxUtil.sendSubscribeRZSH(openid, accessToken, name, |
| | | DateUtils.format(new Date(), DateUtils.ymdhms_format), |
| | | result); |
| | | result,sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("推送审核状态订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | return R.fail("认证失败,请重新尝试"); |
| | | } |
| | | if (addIdentityAuthDTO.getAuthMethod().intValue() == FACE_AUTH.getMethod()) { |
| | | sendAuthSubscribe(addIdentityAuthDTO.getSubmitUserId(), "高龄认证", "认证成功!"); |
| | | sendAuthSubscribe(addIdentityAuthDTO.getSubmitUserId(), "高龄认证", "认证成功!",addIdentityAuthDTO.getAreaCode()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComPensionAuthPensionerService; |
| | |
| | | private ComPensionAuthPensionerService comPensionAuthPensionerService; |
| | | @Resource |
| | | private ComElderAuthElderliesDAO comElderAuthElderliesDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public R pagePensionAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { |
| | |
| | | BeanUtils.copyProperties(comPensionAuthRecordVO, comPensionAuthRecordDO); |
| | | if (comPensionAuthRecordVO.getApprovalStatus().equals(PASS_THROUGH.getStatus())) { |
| | | comPensionAuthRecordDO.setAuthStatus(CERTIFIED.getStatus()); |
| | | sendAuthSubscribe(comPensionAuthRecordDO.getSubmitUserId(), "养老认证", "认证成功!"); |
| | | sendAuthSubscribe(comPensionAuthRecordDO.getSubmitUserId(), "养老认证", "认证成功!", comPensionAuthRecordVO.getAreaCode()); |
| | | |
| | | authPensionerDO.setAddress(comPensionAuthRecordVO.getAddress()); |
| | | comPensionAuthPensionerDAO.updateById(authPensionerDO); |
| | | } else { |
| | | sendAuthSubscribe(comPensionAuthRecordDO.getSubmitUserId(), "养老认证", comPensionAuthRecordVO.getRejectReason()); |
| | | sendAuthSubscribe(comPensionAuthRecordDO.getSubmitUserId(), "养老认证", comPensionAuthRecordVO.getRejectReason(),comPensionAuthRecordVO.getAreaCode()); |
| | | } |
| | | comPensionAuthRecordDO.setApprovalDate(new Date()); |
| | | int nub = comPensionAuthRecordDAO.updateById(comPensionAuthRecordDO); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private void sendAuthSubscribe(Long userId, String name, String result) { |
| | | private void sendAuthSubscribe(Long userId, String name, String result,String areaCode) { |
| | | //发送订阅通知 |
| | | Map<String, String> map = comActActSignDAO.getUserOpenId(userId); |
| | | if (map != null) { |
| | |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | R<SysTemplateConfigVO> sysTemplateConfigVO=userService.selectTemplate(areaCode,5); |
| | | WxUtil.sendSubscribeRZSH(openid, accessToken, name, |
| | | DateUtils.format(new Date(), DateUtils.ymdhms_format), |
| | | result); |
| | | result,sysTemplateConfigVO.getData().getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("推送审核状态订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | return R.fail("认证失败,请重新尝试"); |
| | | } |
| | | if (addIdentityAuthDTO.getAuthMethod().intValue() == FACE_AUTH.getMethod()) { |
| | | sendAuthSubscribe(comPensionAuthRecordDO.getSubmitUserId(), "养老认证", "认证成功!"); |
| | | sendAuthSubscribe(comPensionAuthRecordDO.getSubmitUserId(), "养老认证", "认证成功!", addIdentityAuthDTO.getAreaCode()); |
| | | } |
| | | return R.ok(); |
| | | } |
New file |
| | |
| | | <?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.SysTemplateConfigDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.SysTemplateConfig" id="SysTemplateConfigBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="templateId" column="template_id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="areaCode" column="area_code"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | * @return 角色集合 |
| | | */ |
| | | @PostMapping("listrolebackstage") |
| | | public R listRoleBackstage(@RequestParam("communityId") Long communityId,@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize) { |
| | | return roleService.listRoleBackstage(communityId,pageNum,pageSize); |
| | | public R listRoleBackstage(@RequestParam("communityId") Long communityId,@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize,@RequestParam("areaCode")String areaCode) { |
| | | return roleService.listRoleBackstage(communityId,pageNum,pageSize,areaCode); |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.panzhihua.service_user.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.user.SysAppConfigVO; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | import com.panzhihua.service_user.service.SysAppConfigService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (SysAppConfig)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 10:10:19 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("sysAppConfig") |
| | | public class SysAppConfigApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private SysAppConfigService sysAppConfigService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.sysAppConfigService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return R.ok(this.sysAppConfigService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param sysAppConfig 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody SysAppConfig sysAppConfig) { |
| | | return R.ok(this.sysAppConfigService.save(sysAppConfig)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param sysAppConfig 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody SysAppConfig sysAppConfig) { |
| | | return R.ok(this.sysAppConfigService.updateById(sysAppConfig)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.sysAppConfigService.removeById(id)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/selectByAppid") |
| | | public R<SysAppConfigVO> selectByAppid(@RequestParam("appId")String appId){ |
| | | SysAppConfig sysAppConfig=this.sysAppConfigService.getOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAppId,appId)); |
| | | if(sysAppConfig!=null){ |
| | | SysAppConfigVO sysAppConfigVO=new SysAppConfigVO(); |
| | | BeanUtils.copyProperties(sysAppConfig,sysAppConfigVO); |
| | | return R.ok(sysAppConfigVO); |
| | | } |
| | | |
| | | return R.fail(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | | import com.panzhihua.service_user.service.SysTemplateConfigService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:29:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("sysTemplateConfig") |
| | | public class SysTemplateConfigApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private SysTemplateConfigService sysTemplateConfigService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.sysTemplateConfigService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Serializable id) { |
| | | return R.ok(this.sysTemplateConfigService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param sysTemplateConfig 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody SysTemplateConfig sysTemplateConfig) { |
| | | return R.ok(this.sysTemplateConfigService.save(sysTemplateConfig)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param sysTemplateConfig 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody SysTemplateConfig sysTemplateConfig) { |
| | | return R.ok(this.sysTemplateConfigService.updateById(sysTemplateConfig)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.sysTemplateConfigService.removeById(id)); |
| | | } |
| | | |
| | | @GetMapping("/selectTemplate") |
| | | public R<SysTemplateConfigVO> selectTemplate(@RequestParam("areaCode")String areaCode,@RequestParam("type")Integer type){ |
| | | SysTemplateConfig sysTemplateConfig=this.sysTemplateConfigService.getOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode,areaCode).eq(SysTemplateConfig::getType,type)); |
| | | if(sysTemplateConfig!=null){ |
| | | SysTemplateConfigVO sysTemplateConfigVO=new SysTemplateConfigVO(); |
| | | BeanUtils.copyProperties(sysTemplateConfig,sysTemplateConfigVO); |
| | | return R.ok(sysTemplateConfigVO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | |
| | | /** |
| | | * (SysAppConfig)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 10:10:18 |
| | | */ |
| | | @Mapper |
| | | public interface SysAppConfigDao extends BaseMapper<SysAppConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:29:55 |
| | | */ |
| | | @Mapper |
| | | public interface SysTemplateConfigDao extends BaseMapper<SysTemplateConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (SysAppConfig)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 10:10:15 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class SysAppConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -90981038076389842L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * appid |
| | | */ |
| | | @ApiModelProperty(value = "appid") |
| | | private String appId; |
| | | |
| | | /** |
| | | * secret |
| | | */ |
| | | @ApiModelProperty(value = "secret") |
| | | private String secret; |
| | | |
| | | /** |
| | | * 小程序名字 |
| | | */ |
| | | @ApiModelProperty(value = "小程序名字") |
| | | private String name; |
| | | |
| | | private String areaCode; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:29:55 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("") |
| | | public class SysTemplateConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -29178409799302189L; |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 模板id |
| | | */ |
| | | @ApiModelProperty(value = "模板id") |
| | | private String templateId; |
| | | |
| | | /** |
| | | * 模板类型 1活动变更 2留言回复 3活动取消 4审核状态 5认证审核 6调研问卷 7奖励发放 8报名成功 9活动即将开始 10预约提醒 |
| | | */ |
| | | @ApiModelProperty(value = "模板类型 1活动变更 2留言回复 3活动取消 4审核状态 5认证审核 6调研问卷 7奖励发放 8报名成功 9活动即将开始 10预约提醒 ") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | } |
| | |
| | | */ |
| | | private Long communityId; |
| | | |
| | | private String areaCode; |
| | | |
| | | } |
| | |
| | | * 对应社区 0 表示运营后台 |
| | | * @return 角色集合 |
| | | */ |
| | | R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize); |
| | | R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize,String areaCode); |
| | | |
| | | /** |
| | | * 新增角色 |
New file |
| | |
| | | package com.panzhihua.service_user.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | |
| | | /** |
| | | * (SysAppConfig)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 10:10:18 |
| | | */ |
| | | public interface SysAppConfigService extends IService<SysAppConfig> { |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | R pageList(CommonPage commonPage); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:29:56 |
| | | */ |
| | | public interface SysTemplateConfigService extends IService<SysTemplateConfig> { |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param commonPage |
| | | * @return |
| | | */ |
| | | R pageList(CommonPage commonPage); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | * @return 角色集合 |
| | | */ |
| | | @Override |
| | | public R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize) { |
| | | IPage<SysRoleDO> sysRoleDOIPage=this.roleDAO.selectPage(new Page<>(pageNum,pageSize),new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getCommunityId, communityId).orderByDesc(SysRoleDO::getCreateAt)); |
| | | public R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize,String areaCode) { |
| | | LambdaQueryWrapper<SysRoleDO> queryWrapper=new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getCommunityId, communityId); |
| | | if(com.panzhihua.common.utlis.StringUtils.isNotEmpty(areaCode)){ |
| | | queryWrapper.eq(SysRoleDO::getAreaCode,areaCode); |
| | | } |
| | | queryWrapper.orderByDesc(SysRoleDO::getCreateAt); |
| | | IPage<SysRoleDO> sysRoleDOIPage=this.roleDAO.selectPage(new Page<>(pageNum,pageSize),queryWrapper); |
| | | if (ObjectUtils.isEmpty(sysRoleDOIPage.getRecords())) { |
| | | return R.fail("角色列表为空"); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | import com.panzhihua.service_user.dao.SysAppConfigDao; |
| | | import com.panzhihua.service_user.service.SysAppConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (SysAppConfig)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 10:10:18 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SysAppConfigServiceImpl extends ServiceImpl<SysAppConfigDao, SysAppConfig> implements SysAppConfigService { |
| | | |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | | import com.panzhihua.service_user.dao.SysTemplateConfigDao; |
| | | import com.panzhihua.service_user.service.SysTemplateConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (SysTemplateConfig)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-01-13 14:29:56 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SysTemplateConfigServiceImpl extends ServiceImpl<SysTemplateConfigDao, SysTemplateConfig> implements SysTemplateConfigService { |
| | | |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_user.dao.*; |
| | | import com.panzhihua.service_user.entity.SysAppConfig; |
| | | import com.panzhihua.service_user.entity.SysTemplateConfig; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_user.dao.ComActFourMemberDao; |
| | | import com.panzhihua.service_user.dao.ComMngFamilyInfoDAO; |
| | | import com.panzhihua.service_user.dao.ComMngUserTagDAO; |
| | | import com.panzhihua.service_user.dao.EventGridMemberBuildingRelationMapper; |
| | | import com.panzhihua.service_user.dao.LcCompareMemberCodeMapper; |
| | | import com.panzhihua.service_user.dao.RoleDAO; |
| | | import com.panzhihua.service_user.dao.SysMenuDAO; |
| | | import com.panzhihua.service_user.dao.SysOperLogDAO; |
| | | import com.panzhihua.service_user.dao.SysRoleMenuDAO; |
| | | import com.panzhihua.service_user.dao.SysUserAgreementDAO; |
| | | import com.panzhihua.service_user.dao.SysUserFeedbackDAO; |
| | | import com.panzhihua.service_user.dao.SysUserInputDAO; |
| | | import com.panzhihua.service_user.dao.SysUserNoticeDAO; |
| | | import com.panzhihua.service_user.dao.SysUserRoleDAO; |
| | | import com.panzhihua.service_user.dao.UserDao; |
| | | import com.panzhihua.service_user.model.dos.ComActFourMember; |
| | | import com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO; |
| | | import com.panzhihua.service_user.model.dos.ComMngUserTagDO; |
| | |
| | | private LcCompareMemberCodeMapper lcCompareMemberCodeMapper; |
| | | @Resource |
| | | private ComActFourMemberDao comActFourMemberDao; |
| | | @Resource |
| | | private SysAppConfigDao sysAppConfigDao; |
| | | @Resource |
| | | private SysTemplateConfigDao sysTemplateConfigDao; |
| | | // @Resource |
| | | // private GridService gridService; |
| | | |
| | |
| | | loginUserInfoVO.setCommunityId(sysUserDO.getCommunityId()); |
| | | if(comActVO!=null){ |
| | | loginUserInfoVO.setComActVO(comActVO); |
| | | SysAppConfig sysAppConfig=sysAppConfigDao.selectOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAreaCode,comActVO.getAreaCode())); |
| | | if(sysAppConfig!=null){ |
| | | loginUserInfoVO.setAppId(sysAppConfig.getAppId()); |
| | | loginUserInfoVO.setAppSecret(sysAppConfig.getSecret()); |
| | | } |
| | | } |
| | | } |
| | | List<SysRoleDO> roleDOList = roleDAO.selectByUserId(sysUserDO.getUserId()); |
| | |
| | | if (comActVO != null) { |
| | | loginUserInfoVO.setCommunityName(comActVO.getName()); |
| | | loginUserInfoVO.setComActVO(comActVO); |
| | | SysAppConfig sysAppConfig=sysAppConfigDao.selectOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAreaCode,comActVO.getAreaCode())); |
| | | if(sysAppConfig!=null){ |
| | | loginUserInfoVO.setAppId(sysAppConfig.getAppId()); |
| | | loginUserInfoVO.setAppSecret(sysAppConfig.getSecret()); |
| | | } |
| | | } |
| | | } |
| | | if (!ObjectUtils.isEmpty(phone)) { |
| | |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAppAccessToken(); |
| | | SysTemplateConfig sysTemplateConfig=sysTemplateConfigDao.selectOne(new QueryWrapper<SysTemplateConfig>().lambda().eq(SysTemplateConfig::getAreaCode, loginUserInfoVO.getComActVO()).eq(SysTemplateConfig::getType,5)); |
| | | // 用户实名认证推送消息 |
| | | WxUtil.sendSubscribeRZSH(user.getOpenid(), accessToken, "实名认证", |
| | | com.panzhihua.common.utlis.DateUtils.getCurrentDateStr(), "认证成功"); |
| | | com.panzhihua.common.utlis.DateUtils.getCurrentDateStr(), "认证成功",sysTemplateConfig.getTemplateId()); |
| | | } catch (Exception e) { |
| | | log.error("推送用户订阅消息失败,失败原因:" + e.getMessage()); |
| | | } |
New file |
| | |
| | | <?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_user.dao.SysAppConfigDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_user.entity.SysAppConfig" id="SysAppConfigBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="appId" column="app_id"/> |
| | | <result property="secret" column="secret"/> |
| | | <result property="name" column="name"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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_user.dao.SysTemplateConfigDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_user.entity.SysTemplateConfig" id="SysTemplateConfigBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="templateId" column="template_id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="areaCode" column="area_code"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.panzhihua.common.model.vos.user.SysAppConfigVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |