springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityVO.java
@@ -158,6 +158,9 @@ @ApiModelProperty(value = "社区id", hidden = true) private Long communityId; @ApiModelProperty(value = "社区id集合", hidden = true) private List<Long> communityIds; @ApiModelProperty(value = "社区名称") private String communityName; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java
@@ -1,6 +1,7 @@ package com.panzhihua.common.model.vos.partybuilding; import java.util.Date; import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; @@ -70,6 +71,9 @@ @ApiModelProperty("社区id") private Long communityId; @ApiModelProperty("社区id集合") private List<Long> communityIds; @ApiModelProperty("动态内容富文本--纯文本") private String contentText; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/west/PartyBuildingComPbDynVO.java
@@ -8,6 +8,7 @@ import lombok.Data; import java.util.Date; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -70,6 +71,11 @@ @JsonSerialize(using = ToStringSerializer.class) private Long communityId; @ApiModelProperty("社区id集合") @JsonSerialize(using = ToStringSerializer.class) private List<Long> communityIds; @ApiModelProperty("动态内容富文本--纯文本") private String contentText; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxXCXTempSend.java
@@ -155,6 +155,35 @@ } return accessToken; } /** * 发布消息时重新设置access_token 防止过期 * @param appId * @param appSecret * @throws Exception */ public void setAppAccessTokenToCache(String appId,String appSecret) throws Exception{ String accessToken = "0"; try { log.info("获取微信token参数:appid=" + appId + ",appSecret=" + appSecret); String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=" + appId + "&secret=" + appSecret; String result = HttpClientUtil.httpGet(accessTokenUrl, null, null); Map<String, Object> resultMap = JSON.parseObject(result, Map.class); if (resultMap.containsKey("access_token")) { accessToken = resultMap.get("access_token").toString(); wxXCXTempSend.stringRedisTemplate.opsForValue().set("access_token:access_token:" + appId, accessToken, EXPIRE_TIME,TimeUnit.HOURS); } } catch (IOException ioe) { log.error("小程序http请求异常"); ioe.printStackTrace(); } } public String getAccessTokenNoValid(String appId) throws Exception { String accessToken = ""; accessToken=wxXCXTempSend.stringRedisTemplate.boundValueOps("access_token:access_token:"+appId).get(); return accessToken; } public String getWsAccessToken() throws Exception { String accessToken = "0"; try { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComEventTransferRecordMapper.java
@@ -41,5 +41,5 @@ List<ComEventTransferRecord> listByComEventTransferRecord(@Param("comEventTransferRecord") ComEventTransferRecord comEventTransferRecord); int insertSelective(ComEventTransferRecord comEventTransferRecord); int insertSelective(@Param("comEventTransferRecord") ComEventTransferRecord comEventTransferRecord); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/message/AcidMessage.java
@@ -114,14 +114,22 @@ } @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"),"疫情快讯",comActDynVO.getTitle().length()>10?comActDynVO.getTitle().substring(0,10)+"..":comActDynVO.getTitle(),"/pages/community_child/community/detail?id="+comActDynVO.getId()+"&title=疫情快讯详情"); } catch (Exception e) { e.printStackTrace(); try{ List<String> openIds=sysUserDao.selectOpenId(); String appId = "wx118de8a734d269f0"; String appSecret = "0264342daefde5cd70a6adada09ee5b1"; WxXCXTempSend wxXCXTempSend=new WxXCXTempSend(); wxXCXTempSend.setAppAccessTokenToCache(appId,appSecret); for(String openId:openIds){ try { WxUtil.sendLongTimeTemplate(openId,wxXCXTempSend.getAccessTokenNoValid(appId),"疫情快讯",comActDynVO.getTitle().length()>10?comActDynVO.getTitle().substring(0,10)+"..":comActDynVO.getTitle(),"/pages/community_child/community/detail?id="+comActDynVO.getId()+"&title=疫情快讯详情"); } catch (Exception e) { e.printStackTrace(); } } }catch (Exception e){ e.printStackTrace(); } } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -19,6 +19,7 @@ import javax.annotation.Resource; import cn.hutool.core.collection.CollUtil; import com.panzhihua.common.constants.HttpStatus; import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; @@ -882,6 +883,15 @@ } page.setSize(pageSize); page.setCurrent(pageNum); Long communityId = comActActivityVO.getCommunityId(); if (null != communityId){ List<Long> communityIds = comActDAO.selectIds(communityId); if (CollUtil.isEmpty(communityIds)) { communityIds = new ArrayList<>(); communityIds.add(communityId); } comActActivityVO.setCommunityIds(communityIds); } IPage<ComActActivityVO> iPage = comActActivityDAO.pageActivityCommunityBack(page, comActActivityVO); iPage.getRecords().forEach(vo ->{ List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateDAO springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComBatteryCommodityOrderBargainServiceImpl.java
@@ -58,16 +58,14 @@ private ComBatteryCommodityOrderBargainRecordMapper orderBargainRecordMapper; @Value("${min.app.isTest}") private Boolean isTest; @Value("${min.app.isRefundTest}") private Boolean isRefundTest; @Value("${min.app.appid}") private String appid; @Value("${min.app.payKey}") private String payKey; @Value("${min.app.mchId}") private String mchId; @Value("${min.app.currencyNotifyUrl}") private String currencyNotifyUrl; // @Value("${min.app.currencyNotifyUrl}") // private String currencyNotifyUrl; /** * description queryByPage 分页查询 @@ -311,8 +309,8 @@ money = BigDecimal.valueOf(0.01); } // 调用wx支付 result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_ACTIVITY_PAY_NOTIFY_URL , remark, openId, orderNo, money,type); // result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_ACTIVITY_PAY_NOTIFY_URL // , remark, openId, orderNo, money,type); log.info("用户购买商品微信支付返回参数:" + result); return result; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComBatteryCommodityOrderCollageTeamServiceImpl.java
@@ -55,16 +55,14 @@ private ComBatteryTradeOrderService tradeOrderService; @Value("${min.app.isTest}") private Boolean isTest; @Value("${min.app.isRefundTest}") private Boolean isRefundTest; @Value("${min.app.appid}") private String appid; @Value("${min.app.payKey}") private String payKey; @Value("${min.app.mchId}") private String mchId; @Value("${min.app.currencyNotifyUrl}") private String currencyNotifyUrl; // @Value("${min.app.currencyNotifyUrl}") // private String currencyNotifyUrl; @Resource private ComBatteryCommodityMapper commodityMapper; @Resource @@ -326,8 +324,8 @@ money = BigDecimal.valueOf(0.01); } // 调用wx支付 result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_ACTIVITY_PAY_NOTIFY_URL , remark, openId, orderNo, money,type); // result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_ACTIVITY_PAY_NOTIFY_URL // , remark, openId, orderNo, money,type); log.info("用户购买商品微信支付返回参数:" + result); return result; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComBatteryCommodityOrderServiceImpl.java
@@ -58,16 +58,14 @@ private ComBatteryTradeOrderService tradeOrderService; @Value("${min.app.isTest}") private Boolean isTest; @Value("${min.app.isRefundTest}") private Boolean isRefundTest; @Value("${min.app.appid}") private String appid; @Value("${min.app.payKey}") private String payKey; @Value("${min.app.mchId}") private String mchId; @Value("${min.app.currencyNotifyUrl}") private String currencyNotifyUrl; // @Value("${min.app.currencyNotifyUrl}") // private String currencyNotifyUrl; @Resource private ComBatteryCommodityOrderCollageTeamMapper orderCollageTeamMapper; @Resource @@ -368,8 +366,8 @@ money = BigDecimal.valueOf(0.01); } // 调用wx支付 result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_PAY_NOTIFY_URL , remark, openId, orderNo, money,null); // result = WxPayUtils.getUnifiedorder(appid, mchId, payKey, currencyNotifyUrl + PayCpmstant.BATTERY_STORE_PAY_NOTIFY_URL // , remark, openId, orderNo, money,null); log.info("用户购买商品微信支付返回参数:" + result); return result; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -653,7 +653,6 @@ return R.ok(ReturnMsgConstants.SAVE_SUCCESS); } public void sendMessage(Long expertId,ComEvent comEvent){ //获取专家的openId ComSanshuoExpert expert = comSanShuoExpertService.getById(expertId); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
@@ -88,7 +88,13 @@ <if test='comActActivityVO.type != null and comActActivityVO.type == 4'> left join (select count(t.id) as socialCount,activity_id from com_act_act_regist t LEFT JOIN sys_user t1 on t.user_id = t1.user_id LEFT JOIN com_act_social_worker t2 on t1.phone = t2.telephone where t2.id is not null GROUP BY t.activity_id) so on a.id = so.activity_id </if> WHERE a.community_id=#{comActActivityVO.communityId} WHERE 1=1 <if test="comActActivityVO.communityIds != null and comActActivityVO.communityIds.size() != 0"> and a.community_id in <foreach collection="comActActivityVO.communityIds" item="item" open="(" separator="," close=")"> #{item} </foreach> </if> <if test='comActActivityVO.type != null'> AND a.type = #{comActActivityVO.type} </if> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventTransferRecordMapper.xml
@@ -46,157 +46,157 @@ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.panzhihua.service_community.entity.ComEventTransferRecord"> insert into com_sanshuo_event_transfer_record <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> <if test="comEventTransferRecord.id != null"> id, </if> <if test="eventId != null"> <if test="comEventTransferRecord.eventId != null"> event_id, </if> <if test="parentsTransferEventId != null"> <if test="comEventTransferRecord.parentsTransferEventId != null"> parents_transfer_event_id, </if> <if test="fromType != null"> <if test="comEventTransferRecord.fromType != null"> from_type, </if> <if test="fromId != null"> <if test="comEventTransferRecord.fromId != null"> from_id, </if> <if test="fromName != null"> <if test="comEventTransferRecord.fromName != null"> from_name, </if> <if test="fromUserId != null"> <if test="comEventTransferRecord.fromUserId != null"> from_user_id, </if> <if test="toType != null"> <if test="comEventTransferRecord.toType != null"> to_type, </if> <if test="toId != null"> <if test="comEventTransferRecord.toId != null"> to_id, </if> <if test="toName != null"> <if test="comEventTransferRecord.toName != null"> to_name, </if> <if test="toUserId != null"> <if test="comEventTransferRecord.toUserId != null"> to_user_id, </if> <if test="save != null"> <if test="comEventTransferRecord.save != null"> `save`, </if> <if test="processResult != null"> <if test="comEventTransferRecord.processResult != null"> process_result, </if> <if test="processResultData != null"> <if test="comEventTransferRecord.processResultData != null"> process_result_data, </if> <if test="processDate != null"> <if test="comEventTransferRecord.processDate != null"> process_date, </if> <if test="processBy != null"> <if test="comEventTransferRecord.processBy != null"> process_by, </if> <if test="processByName != null"> <if test="comEventTransferRecord.processByName != null"> process_by_name, </if> <if test="processType != null"> <if test="comEventTransferRecord.processType != null"> process_type, </if> <if test="createAt != null"> <if test="comEventTransferRecord.createAt != null"> create_at, </if> <if test="specialistId != null"> <if test="comEventTransferRecord.specialistId != null"> specialist_id, </if> <if test="specialistOrg != null"> <if test="comEventTransferRecord.specialistOrg != null"> specialist_org, </if> <if test="specialistLevel != null"> <if test="comEventTransferRecord.specialistLevel != null"> specialist_level, </if> <if test="specialistName != null"> <if test="comEventTransferRecord.specialistName != null"> specialist_name, </if> <if test="eventResult != null"> <if test="comEventTransferRecord.eventResult != null"> event_result, </if> <if test="eventStatus != null"> <if test="comEventTransferRecord.eventStatus != null"> event_status, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=BIGINT}, <if test="comEventTransferRecord.id != null"> #{comEventTransferRecord.id,jdbcType=BIGINT}, </if> <if test="eventId != null"> #{eventId,jdbcType=BIGINT}, <if test="comEventTransferRecord.eventId != null"> #{comEventTransferRecord.eventId,jdbcType=BIGINT}, </if> <if test="parentsTransferEventId != null"> #{parentsTransferEventId,jdbcType=BIGINT}, <if test="comEventTransferRecord.parentsTransferEventId != null"> #{comEventTransferRecord.parentsTransferEventId,jdbcType=BIGINT}, </if> <if test="fromType != null"> #{fromType,jdbcType=TINYINT}, <if test="comEventTransferRecord.fromType != null"> #{comEventTransferRecord.fromType,jdbcType=TINYINT}, </if> <if test="fromId != null"> #{fromId,jdbcType=BIGINT}, <if test="comEventTransferRecord.fromId != null"> #{comEventTransferRecord.fromId,jdbcType=BIGINT}, </if> <if test="fromName != null"> #{fromName,jdbcType=VARCHAR}, <if test="comEventTransferRecord.fromName != null"> #{comEventTransferRecord.fromName,jdbcType=VARCHAR}, </if> <if test="fromUserId != null"> #{fromUserId,jdbcType=BIGINT}, <if test="comEventTransferRecord.fromUserId != null"> #{comEventTransferRecord.fromUserId,jdbcType=BIGINT}, </if> <if test="toType != null"> #{toType,jdbcType=TINYINT}, <if test="comEventTransferRecord.toType != null"> #{comEventTransferRecord.toType,jdbcType=TINYINT}, </if> <if test="toId != null"> #{toId,jdbcType=BIGINT}, <if test="comEventTransferRecord.toId != null"> #{comEventTransferRecord.toId,jdbcType=BIGINT}, </if> <if test="toName != null"> #{toName,jdbcType=VARCHAR}, <if test="comEventTransferRecord.toName != null"> #{comEventTransferRecord.toName,jdbcType=VARCHAR}, </if> <if test="toUserId != null"> #{toUserId,jdbcType=BIGINT}, <if test="comEventTransferRecord.toUserId != null"> #{comEventTransferRecord.toUserId,jdbcType=BIGINT}, </if> <if test="save != null"> #{save,jdbcType=BIT}, <if test="comEventTransferRecord.save != null"> #{comEventTransferRecord.save,jdbcType=BIT}, </if> <if test="processResult != null"> #{processResult,jdbcType=VARCHAR}, <if test="comEventTransferRecord.processResult != null"> #{comEventTransferRecord.processResult,jdbcType=VARCHAR}, </if> <if test="processResultData != null"> #{processResultData,jdbcType=VARCHAR}, <if test="comEventTransferRecord.processResultData != null"> #{comEventTransferRecord.processResultData,jdbcType=VARCHAR}, </if> <if test="processDate != null"> #{processDate,jdbcType=TIMESTAMP}, <if test="comEventTransferRecord.processDate != null"> #{comEventTransferRecord.processDate,jdbcType=TIMESTAMP}, </if> <if test="processBy != null"> #{processBy,jdbcType=BIGINT}, <if test="comEventTransferRecord.processBy != null"> #{comEventTransferRecord.processBy,jdbcType=BIGINT}, </if> <if test="processByName != null"> #{processByName,jdbcType=VARCHAR}, <if test="comEventTransferRecord.processByName != null"> #{comEventTransferRecord.processByName,jdbcType=VARCHAR}, </if> <if test="processType != null"> #{processType,jdbcType=INTEGER}, <if test="comEventTransferRecord.processType != null"> #{comEventTransferRecord.processType,jdbcType=INTEGER}, </if> <if test="createAt != null"> #{createAt,jdbcType=TIMESTAMP}, <if test="comEventTransferRecord.createAt != null"> #{comEventTransferRecord.createAt,jdbcType=TIMESTAMP}, </if> <if test="specialistId != null"> #{specialistId,jdbcType=BIGINT}, <if test="comEventTransferRecord.specialistId != null"> #{comEventTransferRecord.specialistId,jdbcType=BIGINT}, </if> <if test="specialistOrg != null"> #{specialistOrg,jdbcType=VARCHAR}, <if test="comEventTransferRecord.specialistOrg != null"> #{comEventTransferRecord.specialistOrg,jdbcType=VARCHAR}, </if> <if test="specialistLevel != null"> #{specialistLevel,jdbcType=VARCHAR}, <if test="comEventTransferRecord.specialistLevel != null"> #{comEventTransferRecord.specialistLevel,jdbcType=VARCHAR}, </if> <if test="specialistName != null"> #{specialistName,jdbcType=VARCHAR}, <if test="comEventTransferRecord.specialistName != null"> #{comEventTransferRecord.specialistName,jdbcType=VARCHAR}, </if> <if test="eventResult != null"> #{eventResult,jdbcType=TINYINT}, <if test="comEventTransferRecord.eventResult != null"> #{comEventTransferRecord.eventResult,jdbcType=TINYINT}, </if> <if test="eventStatus != null"> #{eventStatus,jdbcType=TINYINT}, <if test="comEventTransferRecord.eventStatus != null"> #{comEventTransferRecord.eventStatus,jdbcType=TINYINT}, </if> </trim> </insert> springcloud_k8s_panzhihuazhihuishequ/service_community/src/test/java/com/panzhihua/service_community/service/impl/ComEventServiceImplTest.java
@@ -46,8 +46,8 @@ ComEvent comEvent=new ComEvent(); // comEvent.setCreateBy(1l); comEvent.setKeyword("17345059081"); R data = comEventService.pageByComEvent(comEvent, pagination); log.info(JSONObject.toJSONString(data)); // R data = comEventService.pageByComEvent(comEvent, pagination); // log.info(JSONObject.toJSONString(data)); } @Test @@ -96,8 +96,8 @@ @Test void calculate() { R data = comEventService.calculate(); log.info(JSONObject.toJSONString(data)); // R data = comEventService.calculate(); // log.info(JSONObject.toJSONString(data)); } @Test springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java
@@ -34,8 +34,9 @@ + "d.publish_at,\n" + "d.content,\n" + "d.cover,\n" + "d.cover_mode,\n" + "d.dyn_type,\n" + "d.create_at,t.name as communityName,d.policy_type \n" + "FROM\n" + "com_pb_dyn d\n" + "LEFT JOIN com_pb_dyn_user u ON d.id = u.dyn_id left join com_act t on d.community_id = t.community_id\n" + "where d.type=#{partyBuildingComPbDynVO.type} \n" + "<if test='partyBuildingComPbDynVO.communityId != null and partyBuildingComPbDynVO.communityId != 0'>" + "and d.community_id = ${partyBuildingComPbDynVO.communityId} \n" + " </if> " + "<if test='partyBuildingComPbDynVO.communityIds != null and partyBuildingComPbDynVO.communityIds > 0 '>" + " and a.community_id in " + "<foreach item=\"item\" collection=\"partyBuildingComPbDynVO.communityIds\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" + "#{item}\n" + "</foreach>\n" + " </if> " + "<if test='partyBuildingComPbDynVO.dynType != null and partyBuildingComPbDynVO.dynType != 0'>" + "and d.dyn_type = #{partyBuildingComPbDynVO.dynType} \n" + " </if> " + "<if test='partyBuildingComPbDynVO.policyType != null and partyBuildingComPbDynVO.policyType != 0'>" springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberWestServiceImpl.java
@@ -9,6 +9,7 @@ import javax.annotation.Resource; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdcardUtil; import com.google.common.collect.Lists; import com.panzhihua.common.enums.ComPbMemberRoleTypeEnum; @@ -72,6 +73,8 @@ private CommunityWestService communityWestService; @Resource private UserService userService; @Resource private ComPbMemberDAO comPbMemberDAO; /** * 新增党员 @@ -554,6 +557,15 @@ } page.setSize(pageSize); page.setCurrent(pageNum); Long communityId = partyBuildingComPbDynVO.getCommunityId(); if (null != communityId){ List<Long> communityIds = comPbMemberDAO.selectIds(communityId); if (CollUtil.isEmpty(communityIds)) { communityIds = new ArrayList<>(); communityIds.add(communityId); } partyBuildingComPbDynVO.setCommunityIds(communityIds); } IPage<PartyBuildingComPbDynVO> iPage = comPbDynDAO.pageYnamic(page, partyBuildingComPbDynVO); List<PartyBuildingComPbDynVO> records = iPage.getRecords(); if (!(ObjectUtils.isEmpty(records))) {