| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ActivitySignUpDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO; |
| | |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "分页党建动态/政策文件",response =PartyCommitteeVO.class ) |
| | | @ApiOperation(value = "分页党建动态/政策文件",response =PartyBuildingComPbDynVO.class ) |
| | | @PostMapping("pagedynamic") |
| | | public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO){ |
| | | Long communityId = this.getCommunityId(); |
| | |
| | | comPbDynUserVO.setCreateAt(new Date()); |
| | | comPbDynUserVO.setDynId(id); |
| | | comPbDynUserVO.setUserId(userId); |
| | | partyBuildingService.addDynUser(comPbDynUserVO); |
| | | R r1 = partyBuildingService.addDynUser(comPbDynUserVO); |
| | | PartyBuildingComPbDynVO partyBuildingComPbDynVO=JSONObject.parseObject(JSONObject.toJSONString(r.getData()),PartyBuildingComPbDynVO.class); |
| | | if (R.isOk(r1)) { |
| | | partyBuildingComPbDynVO.setIsAdd(1); |
| | | }else{ |
| | | partyBuildingComPbDynVO.setIsAdd(0); |
| | | } |
| | | return R.ok(partyBuildingComPbDynVO); |
| | | } |
| | | return r; |
| | | } |
| | |
| | | sysUserNoticeVO.setTitle("报名成功"); |
| | | sysUserNoticeVO.setBusinessType(2); |
| | | sysUserNoticeVO.setBusinessTitle(partyBuildingActivityVO.getName()); |
| | | sysUserNoticeVO.setBusinessContent(String.format("活动将于%s开始,请按时参加",partyBuildingActivityVO.getActivityTimeBegin())); |
| | | Date activityTimeBegin = partyBuildingActivityVO.getActivityTimeBegin(); |
| | | sysUserNoticeVO.setBusinessContent(String.format("活动将于 %tF %tT 开始,请按时参加", activityTimeBegin,activityTimeBegin)); |
| | | sysUserNoticeVO.setBusinessId(id); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | |
| | | @ApiOperation(value = "创建党员活动") |
| | | @PostMapping("activityinfo") |
| | | public R addActivityinfo(@RequestBody @Validated(AddGroup.class) ComPbActivityDTO comPbActivityDTO) { |
| | | // 微信内容审核 |
| | | String msg = comPbActivityDTO.getRichText(); |
| | | if (!checkService.checkMessage(msg)) { |
| | | return R.fail("内容违规"); |
| | | } |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | |
| | | return partyBuildingService.pageServiceTeam(pageComPbServiceTeamDTO); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = new Date(); |
| | | String dateFormat = String.format("%tF %tT ", date, date); |
| | | System.out.println(dateFormat); |
| | | } |
| | | } |