Browse Source

app活动报名

lizeyu 5 months ago
parent
commit
358dda6561
24 changed files with 791 additions and 40 deletions
  1. 31 0
      parth5/parth5/src/app/api/partylife/practicalActivity/index.ts
  2. 12 0
      parth5/parth5/src/app/routes/practicalActivity.ts
  3. 3 4
      parth5/parth5/src/app/service/user.service.ts
  4. 49 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/detail/detail.component.html
  5. 38 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/detail/detail.component.scss
  6. 104 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/detail/detail.component.ts
  7. 65 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/edit/edit.component.html
  8. 30 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/edit/edit.component.scss
  9. 83 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/edit/edit.component.ts
  10. 70 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/list.component.html
  11. 33 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/list.component.scss
  12. 90 0
      parth5/parth5/src/app/views/pages/partylife/practicalActivity/list.component.ts
  13. 7 1
      parth5/parth5/src/app/views/tapp/tab-main/tab-main.page.html
  14. 3 1
      parth5/parth5/src/app/views/tapp/tab-main/tab-main.route.ts
  15. 7 5
      parth5/parth5/src/app/views/tapp/tabs/tabs.module.ts
  16. 57 0
      src/main/java/com/ghsc/partybuild/controller/app/AppPracticalActivityController.java
  17. 6 3
      src/main/java/com/ghsc/partybuild/controller/partyLife/PfPracticalActivityController.java
  18. 5 0
      src/main/java/com/ghsc/partybuild/mapper/PfPracticalActivityCQuery.java
  19. 4 2
      src/main/java/com/ghsc/partybuild/service/PfPracticalActivityService.java
  20. 29 10
      src/main/java/com/ghsc/partybuild/service/impl/partyLife/PfPracticalActivityServiceImpl.java
  21. 2 0
      src/main/java/com/ghsc/partybuild/vo/partyLife/PfPracticalActivityVo.java
  22. 49 7
      src/main/resources/mapping/PfPracticalActivityCQuery.xml
  23. 10 6
      src/main/resources/static/app/main/partylife/practicalActivity/list.html
  24. 4 1
      src/main/resources/static/app/main/partylife/practicalActivity/userList.js

+ 31 - 0
parth5/parth5/src/app/api/partylife/practicalActivity/index.ts

@@ -0,0 +1,31 @@
+import {ConfigService, RequsetData} from "../../../service/config.service";
+import {Injectable} from "@angular/core";
+import {Observable} from "rxjs";
+import {UserService} from "../../../service/user.service";
+
+export interface reqParams {
+  pageindex: number,
+  pagesize: number
+  userNo: string,
+  type: string
+}
+
+@Injectable({providedIn: 'root'})
+export class PracticalActivityApi {
+  constructor(private configService: ConfigService, private userService: UserService) {
+  }
+
+  getList(params: reqParams): Observable<RequsetData> {
+    return this.configService.HttpGetRomote('/appApi/practicalactivity/getList', params);
+  }
+
+  get(id: string, userNo: string) {
+    return this.configService.HttpGetRomote('/appApi/practicalactivity/get', {id: id, userNo: userNo});
+  }
+
+  save(data: any): Observable<RequsetData> {
+    return this.configService.HttpPostRomote('/appApi/practicalactivity/save', data);
+  }
+
+}
+

+ 12 - 0
parth5/parth5/src/app/routes/practicalActivity.ts

@@ -0,0 +1,12 @@
+import {Routes} from "@angular/router";
+import {PracticalActivityComponent} from "../views/pages/partylife/practicalActivity/list.component";
+import {PracticalActivityEditComponent} from "../views/pages/partylife/practicalActivity/edit/edit.component";
+import {PracticalActivityDetailComponent} from "../views/pages/partylife/practicalActivity/detail/detail.component";
+
+const routes: Routes = [
+  {path: 'practicalActivity', component: PracticalActivityComponent},
+  {path: 'practicalActivity/edit', component: PracticalActivityEditComponent},
+  {path: 'practicalActivity/detail', component: PracticalActivityDetailComponent},
+];
+
+export default routes;

+ 3 - 4
parth5/parth5/src/app/service/user.service.ts

@@ -1,8 +1,6 @@
-import {Injectable, Inject} from '@angular/core';
+import {Inject, Injectable} from '@angular/core';
 import {DOCUMENT} from '@angular/common';
-import {ConfigService, RequsetData} from "./config.service";
-import {from, Observable} from "rxjs";
-import * as moment from "./work.service";
+import {ConfigService} from "./config.service";
 import {Router} from "@angular/router";
 import {AlertController} from "@ionic/angular";
 
@@ -52,6 +50,7 @@ export class UserService {
     let prm = new Promise((resolve, reject) => {
       configService.HttpPostRomote(this.userDataScope, {roleId, userId: this.userInfo.userid}).subscribe(req => {
         let user = Object.assign(this.userInfo, req.item);
+        user.userInfo = req.item.
         this.SetUser(user);
         resolve(this.userInfo);
       });

+ 49 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/detail/detail.component.html

@@ -0,0 +1,49 @@
+<ion-header class="header-theme2">
+  <ion-toolbar>
+    <ion-label class="title-center">宣传阵地信息详情</ion-label>
+    <ion-buttons slot="start">
+      <ion-back-button icon="ios-back2" mode="md"></ion-back-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+<ion-content>
+  <form class="form-table">
+    <ion-item>
+      <ion-label>主题名称</ion-label>
+      <ion-text>{{dataModel.ztmc}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>所属党组织</ion-label>
+      <ion-text>{{dataModel.dzzmc}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>类别</ion-label>
+      <ion-text>{{dataModel.fctypename}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>时间</ion-label>
+      <ion-text>{{dataModel.sj}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>链接</ion-label>
+      <ion-text>{{dataModel.lj}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>简介</ion-label>
+      <ion-text>{{dataModel.jj}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>内容</ion-label>
+      <ion-text>{{dataModel.nr}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>宣传备注</ion-label>
+      <ion-text>{{dataModel.remark}}</ion-text>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>图片</ion-label>
+    </ion-item>
+    <app-imglist [(imgOption)]="imgOption" [(imgList)]="imgList"></app-imglist>
+  </form>
+</ion-content>
+<app-photo-swipe></app-photo-swipe>

+ 38 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/detail/detail.component.scss

@@ -0,0 +1,38 @@
+ion-content{
+  z-index: 11;
+}
+
+ion-item {
+  --inner-border-width: 0px 0px 1px 0px;
+  margin-right: 10px;
+}
+
+.detail-open::part(detail-icon){
+  transform: rotate(90deg);
+  transition: transform 0.2s ease-out;
+}
+
+.detail-close::part(detail-icon){
+  transform: rotate(0deg);
+  transition: transform 0.2s ease-out;
+}
+
+ion-item{
+  img{
+    margin-right: 10px;
+    border-radius: 8px;
+    width: 80px;
+    height: 50px;
+  }
+  .item-img{
+    object-fit: cover;
+  }
+}
+
+.item-detail{
+  margin: 0px !important;
+}
+
+.border-none{
+  --inner-border-width: 0px !important;
+}

+ 104 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/detail/detail.component.ts

@@ -0,0 +1,104 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {DatePipe} from "@angular/common";
+import {ActivatedRoute, Router} from "@angular/router";
+import {AlertController, LoadingController, ModalController} from "@ionic/angular";
+import {PhotoSwipeComponent} from "../../../../../comm/modal/photo-swipe/photo-swipe.component";
+import {ConfigService, RequsetData} from "../../../../../service/config.service";
+import {UserService} from "../../../../../service/user.service";
+import {AlertModal} from "../../../../../comm/modal/alert";
+import {DzzfcApi} from "../../../../../api/propagandawork/dzzfc";
+import {DictionaryApi} from "../../../../../api/system/dictionary";
+
+@Component({
+  selector: 'app-detail',
+  templateUrl: './detail.component.html',
+  styleUrls: ['./detail.component.scss'],
+})
+export class PracticalActivityDetailComponent implements OnInit {
+
+  @ViewChild(PhotoSwipeComponent)
+  photoSwipe: PhotoSwipeComponent;
+
+  dataModel: any = {};
+  detailOpen: boolean = false;
+  webServerHost: string = '';
+  imgOption: any = {
+    fileRefid: '',
+    fileName: '',
+    fileType: 4,
+    isMulti: true,
+    readonly: true
+  };
+  imgList = [];
+
+  constructor(private datePipe: DatePipe, private router: Router, private routeInfo: ActivatedRoute, private configService: ConfigService, private userService: UserService, public alertController: AlertController,
+              public modalController: ModalController, public loadingController: LoadingController
+    , private dzzfcApi: DzzfcApi, private alertModal: AlertModal, private dictionaryApi: DictionaryApi) {
+
+  }
+
+  ngOnInit() {
+    this.routeInfo.queryParams.subscribe(params => {
+      this.dataModel.id = params['id'];
+      this.imgOption.fileRefid = params['id'];
+      this.getData();
+    });
+
+    this.configService.GetConfig().subscribe((config) => {
+      this.webServerHost = config.webServerHost;
+    });
+  }
+
+  getData() {
+    this.dzzfcApi.getData(this.dataModel.id).subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.dataModel = data.item;
+        this.imgOption.fileRefid = this.dataModel.id;
+      }
+    });
+  }
+
+  showBigImage(id) {
+    try {
+      var items = [];
+      let url = this.webServerHost + "/appApi/home/showImg/" + id;
+      let img = this.getImageWidth(url) || {width: 500, height: 300};
+      items.push({
+        src: url,
+        w: img.width || 500,
+        h: img.height || 300
+      })
+
+      this.photoSwipe.open(items, {
+        index: 0,
+        tapToClose: true
+      }, "pswp" + (Math.random() * 100000).toFixed(0).toString());
+    } catch (e) {
+      this.alertModal.alert("图片查看异常:" + e);
+    }
+  }
+
+  getImageWidth(url) {
+    let obj = {width: 0, height: 0}
+    try {
+      var img = new Image();
+      img.src = url;
+      // 如果图片被缓存,则直接返回缓存数据
+      if (img.complete) {
+        obj.width = img.width;
+        obj.height = img.height;
+        return obj
+      } else {
+        img.onload = function () {
+          obj.width = img.width;
+          obj.height = img.height;
+          return obj
+        }
+      }
+    } catch (e) {
+      this.alertModal.alert("图片高宽获取异常:" + e);
+      return obj;
+    }
+  }
+
+}

+ 65 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/edit/edit.component.html

@@ -0,0 +1,65 @@
+
+<ion-header class="header-theme2">
+  <ion-toolbar>
+    <ion-label class="title-center">活动详情</ion-label>
+    <ion-buttons slot="start">
+      <ion-back-button icon="ios-back2" defaultHref="/tapp/tabs/tabMain/partylife/practicalActivity" text="" mode="md"></ion-back-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+<ion-content>
+  <div class="user-info">
+    <ion-item class="item-detail">
+      <div class="line-y"></div>
+      活动基本信息
+    </ion-item>
+    <ion-item>
+      <ion-label>活动主题:</ion-label>
+      <ion-text >{{dataModel.activityName}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>活动地点:</ion-label>
+      <ion-text >{{dataModel.address}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>活动举办时间:</ion-label>
+      <ion-text >{{dataModel.beginDate|date:'yyyy-MM-dd'}}~{{dataModel.endDate|date:'yyyy-MM-dd'}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>活动报名时间:</ion-label>
+      <ion-text >{{dataModel.beginTheRegistrationTime|date:'yyyy-MM-dd'}}~{{dataModel.endTheRegistrationTime|date:'yyyy-MM-dd'}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>活动备注:</ion-label>
+    </ion-item>
+    <ion-item>
+      <ion-text >{{dataModel.remark}}</ion-text>
+    </ion-item>
+    <ion-item class="item-detail">
+      <div class="line-y"></div>
+      活动其他信息
+    </ion-item>
+    <ion-item>
+      <ion-label>活动内容简介:</ion-label>
+    </ion-item>
+    <ion-item>
+      <ion-text >{{dataModel.content}}</ion-text>
+    </ion-item>
+    <ion-item>
+      <ion-label>活动其他说明:</ion-label>
+    </ion-item>
+    <ion-item>
+      <ion-text >{{dataModel.otherExplain}}</ion-text>
+    </ion-item>
+  </div>
+</ion-content>
+<ion-footer *ngIf="dataModel.activityState == 2">
+  <ion-toolbar class="toolbar-center">
+    <ion-button color="danger" mode="ios" size="large"
+                (click)="save()">
+      {{(this.dataModel.state==null || this.dataModel.state==1) ? "立即报名" : "取消报名"}}
+    </ion-button>
+  </ion-toolbar>
+</ion-footer>
+<app-photo-swipe></app-photo-swipe>
+

+ 30 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/edit/edit.component.scss

@@ -0,0 +1,30 @@
+ion-content{
+  z-index: 11;
+}
+
+.user-info {
+  border-radius: 8px;
+  background-color: white;
+  margin: 0px 10px 10px 10px;
+  padding: 10px 0px;
+
+  ion-label{
+    color: #998989;
+    white-space:normal;
+    margin-right: 2px;
+  }
+
+  ion-item{
+    --padding-start: 10px;
+    ion-text{
+      --margin-inner-start:15px;
+      //text-align: right;
+      margin-left: 5px;
+    }
+  }
+  .item-detail{
+    margin: 0px;
+    font-size: 15px;
+    font-weight: bold;
+  }
+}

+ 83 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/edit/edit.component.ts

@@ -0,0 +1,83 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {DatePipe} from "@angular/common";
+import {ActivatedRoute, Router} from "@angular/router";
+import {ConfigService, RequsetData} from "../../../../../service/config.service";
+import {UserService} from "../../../../../service/user.service";
+import {AlertController, LoadingController, ModalController} from "@ionic/angular";
+import {PhotoSwipeComponent} from "../../../../../comm/modal/photo-swipe/photo-swipe.component";
+import {PracticalActivityApi} from "../../../../../api/partylife/practicalActivity";
+import {AlertModal} from "../../../../../comm/modal/alert";
+import {DictionaryApi} from "../../../../../api/system/dictionary";
+import * as moment from "moment";
+
+@Component({
+  selector: 'app-edit',
+  templateUrl: './edit.component.html',
+  styleUrls: ['./edit.component.scss'],
+})
+export class PracticalActivityEditComponent implements OnInit {
+
+  @ViewChild(PhotoSwipeComponent)
+  photoSwipe: PhotoSwipeComponent;
+
+  loading: any = null;
+  dataModel: any = {id:''};
+  webServerHost: string = '';
+
+  constructor(private datePipe: DatePipe, private router: Router, private routeInfo: ActivatedRoute, private configService: ConfigService,
+              private userService: UserService, public alertController: AlertController,
+              public modalController: ModalController, public loadingController: LoadingController
+    , private practicalActivityApi: PracticalActivityApi, private alertModal: AlertModal, private dictionaryApi: DictionaryApi) {
+
+  }
+
+  ngOnInit() {
+    this.routeInfo.queryParams.subscribe(params => {
+      this.dataModel.id = params['id'];
+      this.getData();
+    });
+
+    this.configService.GetConfig().subscribe((config) => {
+      this.webServerHost = config.webServerHost;
+    });
+  }
+
+  getData() {
+    this.practicalActivityApi.get(this.dataModel.id, this.userService.GetUser().userid).subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.dataModel = data.item;
+      }
+    });
+  }
+
+  save() {
+    this.alertModal.loading("提交中...").then((loading) => {
+      let userInfo = this.userService.GetExt().userInfo;
+      let data = {
+        id: this.dataModel.practicalActivityUserId,
+        practicalActivityId: this.dataModel.id,
+        userNo: userInfo.rybm,
+        userName: userInfo.xm,
+        partyCode: userInfo.szdzbdm,
+        partyName: userInfo.dzzmc,
+        phone: userInfo.mobile,
+        state: (this.dataModel.state==null || this.dataModel.state==1) ? 2 : 1,
+        createTime: moment(new Date()).format("YYYY-MM-DD")
+      }
+      this.practicalActivityApi.save(data).subscribe((data: RequsetData) => {
+        loading.dismiss();
+        if (data.success) {
+          this.back();
+        }
+        this.alertModal.alert(data.msg);
+      }, () => {
+        loading.dismiss();
+      });
+    });
+  }
+
+  back() {
+    this.router.navigate(['../../practicalActivity'], {relativeTo: this.routeInfo, queryParams: {random: Math.random()}});
+  }
+
+}

+ 70 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/list.component.html

@@ -0,0 +1,70 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-label>活动报名</ion-label>
+    <ion-buttons slot="start">
+      <ion-back-button icon="ios-back2" defaultHref="/tapp/tabs/tabMain" text="" mode="md"></ion-back-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="practicalActivity">
+  <ion-list>
+    <ion-item style="--padding-start: 0px;">
+      <ion-tabs>
+        <ion-tab-bar class="choice" slot="top">
+          <ion-tab-button [ngClass]="searchParams.type==0?'selectTabButton':''" tabindex="0" (click)="clickTab('0')">
+            全部
+          </ion-tab-button>
+          <ion-tab-button [ngClass]="searchParams.type==1?'selectTabButton':''" tabindex="1" (click)="clickTab('1')">
+            可报名
+          </ion-tab-button>
+          <ion-tab-button [ngClass]="searchParams.type==2?'selectTabButton':''" tabindex="2" (click)="clickTab('2')">
+            已报名
+          </ion-tab-button>
+        </ion-tab-bar>
+      </ion-tabs>
+      <div class="tabs">
+      </div>
+    </ion-item>
+    <ion-item-sliding *ngFor="let item of dataList">
+      <ion-item style="--padding-start: 10px;" detail  [routerLink]="['./edit']" [queryParams]="{id: item.id}">
+        <ion-label text-wrap>
+          <ion-row>
+            <ion-col size="8">
+              <ion-label>
+              <h2 style="font-weight: 600">{{item.activityName}}</h2>
+              </ion-label>
+            </ion-col>
+            <ion-col size="4">
+              <div style="text-align: right">
+                <ion-button *ngIf="item.activityState==1" color="medium" fill="outline">未开始</ion-button>
+                <ion-button *ngIf="item.activityState==2 && item.state==null || item.state==1" color="primary" style="--ion-color-primary: #4c8dff;" fill="outline">立即报名</ion-button>
+                <ion-button *ngIf="item.activityState==2 && item.state==2" color="danger" fill="outline">取消报名</ion-button>
+                <ion-button *ngIf="item.activityState==3" color="medium" fill="outline">已结束</ion-button>
+              </div>
+            </ion-col>
+          </ion-row>
+          <ion-row class="item-subtitle">
+            <ion-label>
+              活动举办日期:<span class="dues-month">{{item.beginDate|date:'yyyy-MM-dd'}}~{{item.endDate|date:'yyyy-MM-dd'}}</span>
+            </ion-label>
+            <ion-label>
+              报名日期:<span class="dues-month">{{item.beginTheRegistrationTime|date:'yyyy-MM-dd'}}~{{item.endTheRegistrationTime|date:'yyyy-MM-dd'}}</span>
+            </ion-label>
+            <ion-label class="item-subtitle-type">
+              {{item.address}}
+            </ion-label>
+          </ion-row>
+        </ion-label>
+      </ion-item>
+    </ion-item-sliding>
+  </ion-list>
+  <ion-infinite-scroll threshold="100px" (ionInfinite)="scroll($event)">
+    <ion-infinite-scroll-content
+      loadingSpinner="bubbles"
+      loadingText="{{total>searchParams.pageindex*searchParams.pagesize?'正在加载...':'暂无更多'}}">
+    </ion-infinite-scroll-content>
+  </ion-infinite-scroll>
+</ion-content>
+
+

+ 33 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/list.component.scss

@@ -0,0 +1,33 @@
+.practicalActivity{
+  ion-label {
+    margin: 3px !important;
+    padding: 0px;
+    white-space: normal !important;
+  }
+  ion-list {
+    ion-item {
+      --inner-border-width:  0px;
+      --border-width:0px;
+    }
+
+    ion-tabs{
+      //--color-selected: red;
+
+      ion-tab-button {
+        font-size: 15px;
+        font-weight: 200;
+        color: #1e2023;
+      }
+
+      .selectTabButton{
+        font-weight: 530;
+        color: red;
+        font-size: inherit;
+        border-bottom-style: solid;
+      }
+    }
+  }
+
+
+
+}

+ 90 - 0
parth5/parth5/src/app/views/pages/partylife/practicalActivity/list.component.ts

@@ -0,0 +1,90 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {IonInfiniteScroll, ModalController, NavController} from "@ionic/angular";
+import {ActivatedRoute, Router} from "@angular/router";
+import {ConfigService, RequsetData} from "../../../../service/config.service";
+import {UserService} from "../../../../service/user.service";
+import {PracticalActivityApi, reqParams} from "../../../../api/partylife/practicalActivity";
+import {AlertModal} from "../../../../comm/modal/alert";
+
+@Component({
+  selector: 'app-practicalActivity-list',
+  templateUrl: './list.component.html',
+  styleUrls: ['./list.component.scss'],
+})
+export class PracticalActivityComponent implements OnInit {
+
+  @ViewChild(IonInfiniteScroll, {static: true}) infiniteScroll: IonInfiniteScroll;
+
+  webServerHost: string = '';
+  userInfo: any = {};
+  dataList: any[] = [];
+  searchParams: reqParams = {
+    pageindex: 1,
+    pagesize: 15,
+    userNo: '',
+    type: ''
+  };
+  total: number = 15;
+
+  constructor(private router: Router, private routeInfo: ActivatedRoute, private configService: ConfigService, private userService: UserService, public modalController: ModalController, private navCtrl: NavController
+    , private practicalActivityApi: PracticalActivityApi, private alertModal: AlertModal) {
+  }
+
+  ngOnInit() {
+    this.userInfo = this.userService.GetUser();
+    this.routeInfo.queryParams.subscribe(params => {
+      this.searchParams.userNo = this.userService.GetUser().userid;
+      this.reload();
+    });
+    this.configService.GetConfig().subscribe((config) => {
+      this.webServerHost = config.webServerHost;
+    });
+  }
+
+  getList() {
+    this.practicalActivityApi.getList(this.searchParams).subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.dataList = this.dataList.concat(data.item.list);
+        this.total = data.item.total;
+      }
+    });
+  }
+
+  clickTab(type) {
+    this.searchParams.type = type;
+    this.reload();
+  }
+
+  reload() {
+    this.dataList = [];
+    this.searchParams.pageindex = 1;
+    this.total = 15;
+    this.getList();
+  }
+
+  scroll(event) {
+    setTimeout(() => {
+      event.target.complete();
+      if (this.total > this.searchParams.pageindex * this.searchParams.pagesize) {
+        this.searchParams.pageindex += 1;
+        this.getList();
+      }
+    }, 500);
+  }
+
+  detail(item) {
+    this.router.navigate(['./detail'], {
+      relativeTo: this.routeInfo,
+      queryParams: {random: Math.random(),id: item.id}
+    });
+  }
+
+  add() {
+    this.router.navigate(['./edit'], {
+      relativeTo: this.routeInfo,
+      queryParams: {random: Math.random(), op: 0}
+    });
+  }
+
+
+}

+ 7 - 1
parth5/parth5/src/app/views/tapp/tab-main/tab-main.page.html

@@ -7,10 +7,16 @@
       </div>
       <div class="tool-title">{{item.MODULARNAME}}</div>
     </a>
-    <a class="tool-item"   routerLink="./exam/examtest">
+    <a class="tool-item"   routerLink="./practicalActivity">
       <div class="tool-img">
         <img src="assets/icon/tool_thought.svg" style="width: 32px;height: 32px">
       </div>
+      <div class="tool-title">活动报名</div>
+    </a>
+    <a class="tool-item"   routerLink="./exam/examtest">
+      <div class="tool-img">
+        <img src="assets/icon/tool_djcg.svg" style="width: 32px;height: 32px">
+      </div>
       <div class="tool-title">自测练习</div>
     </a>
     <a class="tool-item"   routerLink="./exam/examonline">

+ 3 - 1
parth5/parth5/src/app/views/tapp/tab-main/tab-main.route.ts

@@ -7,6 +7,7 @@ import partyDuesRoutes from "../../../routes/partyDues";
 import positionRoutes from "../../../routes/propagandawork/position";
 import dzzfcRoutes from "../../../routes/propagandawork/dzzfc";
 import examRoutes from "../../../routes/exam";
+import practicalActivityRoutes from "../../../routes/practicalActivity";
 
 export const routes: Routes = [
   {
@@ -19,5 +20,6 @@ export const routes: Routes = [
   ...partyDuesRoutes,
   ...positionRoutes,
   ...dzzfcRoutes,
-  ...examRoutes
+  ...examRoutes,
+  ...practicalActivityRoutes
 ];

+ 7 - 5
parth5/parth5/src/app/views/tapp/tabs/tabs.module.ts

@@ -54,14 +54,11 @@ import {MyfilterPipe} from "../../../comm/pipes/myfilter.pipe";
 import {SelectuserComponent} from "../../pages/partyuser/party-dues/selectuser/selectuser.component";
 import {BimageComponent} from "../../../comm/modal/bimage/bimage.component";
 import {UserselectPage} from "../../../comm/modal/userselect/userselect.page";
-import {routes as MainRoutes} from "../tab-main/tab-main.route";
-import {routes as StudyRoutes} from "../tab-study/tab-study.route";
-import {routes as UserRoutes} from "../tab-user/tab-user.route";
 import {CardComponent} from "../../pages/examtest/show/card/card.component";
 import {ResultComponent as ExamtestResultComponent} from "../../pages/examtest/show/result/result.component";
 import {ResultComponent as ExamonlineResultComponent} from "../../pages/examonline/showpaper/result/result.component";
 
-import { ExamtestComponent} from "../../pages/examtest/examtest.component";
+import {ExamtestComponent} from "../../pages/examtest/examtest.component";
 import {DzzfcListComponent} from "../../pages/propagandawork/dzzfc/list.component";
 import {DzzfcEditComponent} from "../../pages/propagandawork/dzzfc/edit/edit.component";
 import {DzzfcDetailComponent} from "../../pages/propagandawork/dzzfc/detail/detail.component";
@@ -69,6 +66,9 @@ import {ShowComponent as ExamtestShowComponent} from "../../pages/examtest/show/
 import {ExamonlineComponent} from "../../pages/examonline/examonline.component";
 import {ShowpaperComponent} from "../../pages/examonline/showpaper/showpaper.component";
 import {CardComponent as ShowpaperCardComponent} from "../../pages/examonline/showpaper/card/card.component";
+import {PracticalActivityComponent} from "../../pages/partylife/practicalActivity/list.component";
+import {PracticalActivityEditComponent} from "../../pages/partylife/practicalActivity/edit/edit.component";
+
 const pageComponents = [
   PositionComponent,
   PositionEditComponent,
@@ -105,7 +105,9 @@ const pageComponents = [
   ExamonlineResultComponent,
   DzzfcListComponent,
   DzzfcEditComponent,
-  DzzfcDetailComponent
+  DzzfcDetailComponent,
+  PracticalActivityComponent,
+  PracticalActivityEditComponent
 ];
 
 const pubComponents = [

+ 57 - 0
src/main/java/com/ghsc/partybuild/controller/app/AppPracticalActivityController.java

@@ -0,0 +1,57 @@
+package com.ghsc.partybuild.controller.app;
+
+import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
+import com.ghsc.partybuild.model.PfPracticalActivityUser;
+import com.ghsc.partybuild.service.PfPracticalActivityService;
+import com.ghsc.partybuild.service.UserService;
+import com.ghsc.partybuild.vo.partyLife.PfPracticalActivityVo;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@Slf4j
+@RestController
+@RequestMapping(value = "/appApi/practicalactivity")
+public class AppPracticalActivityController {
+    @Autowired
+    private PfPracticalActivityService pfPracticalActivityService;
+    @Autowired
+    private UserService userService;
+
+    @ResponseBody
+    @GetMapping("/getList")
+    public RequsetData<PageInfo<PfPracticalActivityVo>> getList(int pageindex, int pagesize, @RequestParam(required = false) String userNo, @RequestParam(required = false) Integer type) {
+        RequsetData<PageInfo<PfPracticalActivityVo>> result = new RequsetData<>();
+        result.setItem(pfPracticalActivityService.getAppList(pageindex, pagesize, null, userNo, type));
+        return result;
+    }
+
+    @ResponseBody
+    @GetMapping("/get")
+    public RequsetData<PfPracticalActivityVo> get(@RequestParam(required = false) String id, @RequestParam(required = false) String userNo) throws Exception {
+        RequsetData<PfPracticalActivityVo> res = new RequsetData<>();
+
+        res.setItem(pfPracticalActivityService.getUserById(id, userNo));
+        return res;
+    }
+
+    @ResponseBody
+    @PostMapping("/save")
+    public RequsetData<String> save(@RequestBody PfPracticalActivityUser data) {
+        RequsetData<String> result = new RequsetData<String>();
+        int count = 0;
+        String message = "";
+
+        try {
+            count = pfPracticalActivityService.saveUser(data, userService.getLoginUser().getUserid());
+        } catch (Exception e) {
+            e.printStackTrace();
+            message = e.toString();
+        }
+
+        result.setSuccess(count > 0);
+        result.setMsg(count > 0 ? "操作成功!" : "操作失败!" + message);
+        return result;
+    }
+}

+ 6 - 3
src/main/java/com/ghsc/partybuild/controller/partyLife/PfPracticalActivityController.java

@@ -156,20 +156,23 @@ public class PfPracticalActivityController {
 
     @ResponseBody
     @PostMapping("/addUsers")
-    public RequsetData<String> addUsers(@RequestBody List<PfPracticalActivityUser> data) {
+    public RequsetData<String> addUsers(@RequestBody Map<String, Object> reqMap) {
         RequsetData<String> result = new RequsetData<String>();
         int count = 0;
         String message = "";
 
         try {
-            count = pfPracticalActivityService.addUsers(data, userService.getLoginUser().getUserid());
+            List<PfPracticalActivityUser> data = JsonMapper.jsonToObject(reqMap.get("list").toString(), new TypeReference<List<PfPracticalActivityUser>>() {
+            });
+            String practicalActivityId = reqMap.get("practicalActivityId").toString();
+            count = pfPracticalActivityService.addUsers(data, practicalActivityId, userService.getLoginUser().getUserid());
         } catch (Exception e) {
             e.printStackTrace();
             message = e.toString();
         }
 
         result.setSuccess(count > 0);
-        result.setMsg(count > 0 ? "保存成功!" : "保存失败!" + message);
+        result.setMsg(count > 0 ? "录入成功!" : "录入失败!" + message);
         return result;
     }
 

+ 5 - 0
src/main/java/com/ghsc/partybuild/mapper/PfPracticalActivityCQuery.java

@@ -12,9 +12,14 @@ public interface PfPracticalActivityCQuery {
                                                               @Param("activityType") String activityType,
                                                               @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
+    List<PfPracticalActivityVo> selectAppPfPracticalActivityList(@Param("id") String id, @Param("userNo") String activityName,
+                                                                 @Param("type") Integer type);
+
     List<PfPracticalActivityUserVo> selectPfPracticalActivityUserList(@Param("id") String id, @Param("practicalActivityId") String practicalActivityId, @Param("partyCode") String partyCode,
                                                                       @Param("userName") String userName, @Param("phone") String phone);
 
     List<String> selectAddressList(@Param("userId") String userId);
 
+    String findPfPracticalActivityUser(@Param("practicalActivityId") String practicalActivityId, @Param("userNoList") List<String> userNoList);
+
 }

+ 4 - 2
src/main/java/com/ghsc/partybuild/service/PfPracticalActivityService.java

@@ -11,6 +11,8 @@ import java.util.List;
 public interface PfPracticalActivityService {
     PageInfo<PfPracticalActivityVo> getList(int pageIndex, int pageSize, String id, String activityName, String activityType, Date beginDate, Date endDate);
 
+    PageInfo<PfPracticalActivityVo> getAppList(int pageIndex, int pageSize, String id, String userNo, Integer type);
+
     PageInfo<PfPracticalActivityUserVo> getUserList(int pageIndex, int pageSize, String practicalActivityId, String partyCode, String userName, String phone);
 
     List<String> getUserAddressList(String userId);
@@ -21,11 +23,11 @@ public interface PfPracticalActivityService {
 
     int delete(List<String> idList);
 
-//    PfPracticalActivityUser getUserById(String id);
+    PfPracticalActivityVo getUserById(String practicalActivityId, String userNo);
 
     int saveUser(PfPracticalActivityUser data, String userId);
 
-    int addUsers(List<PfPracticalActivityUser> data, String userId);
+    int addUsers(List<PfPracticalActivityUser> data, String practicalActivityId, String userId) throws Exception;
 
     int deleteUser(List<String> idList);
 }

+ 29 - 10
src/main/java/com/ghsc/partybuild/service/impl/partyLife/PfPracticalActivityServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
+import java.util.stream.Collectors;
 
 @Service("PfPracticalActivityService")
 public class PfPracticalActivityServiceImpl implements PfPracticalActivityService {
@@ -48,6 +49,23 @@ public class PfPracticalActivityServiceImpl implements PfPracticalActivityServic
         return result;
     }
 
+    @Override
+    public PageInfo<PfPracticalActivityVo> getAppList(int pageIndex, int pageSize, String id, String userNo, Integer type) {
+        List<CfDictionary> activityTypeList = dictionaryService.getDictionaryListByDicTypeKey("activityType");
+        List<CfDictionary> activityStateList = dictionaryService.getDictionaryListByDicTypeKey("activityState");
+
+        PageHelper.startPage(pageIndex, pageSize);
+        List<PfPracticalActivityVo> list = pfPracticalActivityCQuery.selectAppPfPracticalActivityList(id, userNo, type);
+
+        list.forEach(item -> {
+            item.setActivityTypeName(dictionaryService.getDicByKey(item.getActivityType(), activityTypeList).getDicvalue());
+            item.setActivityStateName(dictionaryService.getDicByKey(item.getActivityState(), activityStateList).getDicvalue());
+        });
+
+        PageInfo<PfPracticalActivityVo> result = new PageInfo(list);
+        return result;
+    }
+
     @Override
     public PageInfo<PfPracticalActivityUserVo> getUserList(int pageIndex, int pageSize, String practicalActivityId, String parytCode, String userName, String phone) {
 
@@ -138,15 +156,10 @@ public class PfPracticalActivityServiceImpl implements PfPracticalActivityServic
         return pfPracticalActivityMapper.deleteByExample(exp);
     }
 
-
-//
-//    @Override
-//    public PfPracticalActivityUser getUserById(String practicalActivityId, String) {
-//        if (stringUtils.IsNullOrEmpty(id))
-//            return null;
-//
-//        return pfPracticalActivityCQuery.selectPfPracticalActivityUserList(id, null, null, null, null).stream().findFirst().orElse(null);
-//    }
+    @Override
+    public PfPracticalActivityVo getUserById(String practicalActivityId, String userNo) {
+        return pfPracticalActivityCQuery.selectAppPfPracticalActivityList(practicalActivityId, userNo, null).stream().findFirst().orElse(null);
+    }
 
     @Override
     public int saveUser(PfPracticalActivityUser data, String userId) {
@@ -185,7 +198,13 @@ public class PfPracticalActivityServiceImpl implements PfPracticalActivityServic
     }
 
     @Override
-    public int addUsers(List<PfPracticalActivityUser> data, String userId) {
+    public int addUsers(List<PfPracticalActivityUser> data, String practicalActivityId, String userId) throws Exception {
+
+        String userName = pfPracticalActivityCQuery.findPfPracticalActivityUser(practicalActivityId, data.stream().map(x -> x.getUserNo()).collect(Collectors.toList()));
+        if (!stringUtils.IsNullOrEmpty(userName)) {
+            throw new Exception(String.format("人员:%s已录入,请重新选择!", userName));
+        }
+
         data.forEach(item -> {
             PfPracticalActivityUser dbModel = new PfPracticalActivityUser();
             dbModel.setId(UUID.randomUUID().toString());

+ 2 - 0
src/main/java/com/ghsc/partybuild/vo/partyLife/PfPracticalActivityVo.java

@@ -14,5 +14,7 @@ public class PfPracticalActivityVo extends PfPracticalActivity {
     private String activityTypeName;
     private String createUserName;
     private Integer activityCount;
+    private String practicalActivityUserId;
+    private Integer state;
     private List<PfPracticalActivityUser> userList;
 }

+ 49 - 7
src/main/resources/mapping/PfPracticalActivityCQuery.xml

@@ -22,16 +22,21 @@
         <result column="update_userid" jdbcType="VARCHAR" property="updateUserid"/>
         <result column="update_userid" jdbcType="VARCHAR" property="updateUserid"/>
         <result column="activity_state" jdbcType="INTEGER" property="activityState"/>
-        <result column="activity_tate_name" jdbcType="VARCHAR" property="activityStateName"/>
+        <result column="activity_state_name" jdbcType="VARCHAR" property="activityStateName"/>
         <result column="activity_count" jdbcType="INTEGER" property="activityCount"/>
-        <result column="create_user_name" jdbcType="INTEGER" property="createUserName"/>
+        <result column="create_user_name" jdbcType="VARCHAR" property="createUserName"/>
+        <result column="practical_activity_user_id" jdbcType="VARCHAR" property="practicalActivityUserId"/>
+        <result column="state" jdbcType="INTEGER" property="state"/>
     </resultMap>
     <select id="selectPfPracticalActivityList" resultMap="BaseResultMap">
         select ppa.id, ppa.activity_name, ppa.activity_type, ppa.address, ppa.begin_date, ppa.end_date,
         ppa.begin_the_registration_time, ppa.end_the_registration_time, ppa.remark, ppa.content, ppa.other_explain,
         ppa.activity_record_id, ppa.activity_image_id, ppa.create_time, ppa.create_userid, ppa.update_time,
-        ppa.update_userid ,
-        ppau.activity_count, cu.username as create_user_name
+        ppa.update_userid ,ppau.activity_count, cu.username as create_user_name,
+        case when CURDATE() <![CDATA[<]]> ppa.begin_the_registration_time then 1
+        when ppa.begin_the_registration_time <![CDATA[<=]]> CURDATE() and CURDATE() <![CDATA[<=]]>
+        ppa.end_the_registration_time then 2
+        when CURDATE() <![CDATA[>]]> ppa.end_the_registration_time then 3 end as activity_state
         from pf_practical_activity ppa
         left join (select practical_activity_id, count(0) as activity_count
         from pf_practical_activity_user ppau
@@ -49,17 +54,46 @@
         </if>
         <choose>
             <when test="beginDate!=null and endDate!=null ">
-                and (ppa.begin_date <![CDATA[ <= ]]> #{endDate} and ppa.end_date <![CDATA[ >= ]]> #{beginDate})
+                and (ppa.begin_the_registration_time <![CDATA[ <= ]]> #{endDate} and ppa.end_the_registration_time
+                <![CDATA[ >= ]]> #{beginDate})
             </when>
             <when test="beginDate!=null">
-                and ppa.begin_date <![CDATA[ >= ]]> #{beginDate}
+                and ppa.begin_the_registration_time <![CDATA[ >= ]]> #{beginDate}
             </when>
             <when test="endDate!=null">
-                and ppa.end_date <![CDATA[ <= ]]> #{endDate}
+                and ppa.end_the_registration_time <![CDATA[ <= ]]> #{endDate}
             </when>
         </choose>
         order by ppa.create_time desc
     </select>
+    <select id="selectAppPfPracticalActivityList" resultMap="BaseResultMap">
+        select ppa.id, ppa.activity_name, ppa.activity_type, ppa.address, ppa.begin_date, ppa.end_date,
+        ppa.begin_the_registration_time, ppa.end_the_registration_time, ppa.remark, ppa.content, ppa.other_explain,
+        ppa.activity_record_id, ppa.activity_image_id, ppa.create_time, ppa.create_userid, ppa.update_time,
+        ppa.update_userid, ppau.practical_activity_user_id, ppau.state,
+        case when CURDATE() <![CDATA[<]]> ppa.begin_the_registration_time then 1
+        when ppa.begin_the_registration_time <![CDATA[<=]]> CURDATE() and CURDATE() <![CDATA[<=]]>
+        ppa.end_the_registration_time then 2
+        when CURDATE() <![CDATA[>]]> ppa.end_the_registration_time then 3 end as activity_state
+        from pf_practical_activity ppa
+        left join (select ppau.id as practical_activity_user_id, ppau.practical_activity_id, ppau.state
+        from pf_practical_activity_user ppau
+        where ppau.user_no = #{userNo}) ppau
+        on ppa.id = ppau.practical_activity_id
+        where 1=1
+        <if test="id != null and id != ''">
+            and ppa.id = #{id}
+        </if>
+        <if test="type!=null and type==1">
+            and ppa.begin_the_registration_time <![CDATA[<=]]> CURDATE() and CURDATE() <![CDATA[<=]]>
+            ppa.end_the_registration_time
+            and (ppau.state is null or ppau.state = 1)
+        </if>
+        <if test="type!=null and type==2">
+            and ppau.state = 2
+        </if>
+        order by ppa.create_time desc
+    </select>
     <select id="selectAddressList" resultType="java.lang.String">
         select c.address
         from pf_practical_activity c
@@ -108,4 +142,12 @@
         </if>
         order by ppau.create_time desc
     </select>
+    <select id="findPfPracticalActivityUser" resultType="java.lang.String">
+        select GROUP_CONCAT(user_name) from pf_practical_activity_user
+        where practical_activity_id = #{practicalActivityId}
+        and user_no in
+        <foreach collection="userNoList" item="item" index="index" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
 </mapper>

+ 10 - 6
src/main/resources/static/app/main/partylife/practicalActivity/list.html

@@ -39,22 +39,22 @@
                                         </div>
                                     </div>
                                     <div class="col-lg-1 col-md-1 dj-label">
-                                        <label>举办时间</label>
+                                        <label>举办日期</label>
                                     </div>
-                                    <div class="col-lg-2 col-md-2">
+                                    <div class="col-lg-3 col-md-3">
                                         <div class="form-group">
                                             <div class="form-line">
                                                 <input name="beginDate" class="form-control fm-ct-first"
                                                        autocomplete="off"
                                                        autoclose="true"
-                                                       data-date-format="yyyy-MM-dd" data-date-type="date"
+                                                       data-date-format="yyyy-MM-dd" data-date-type="string"
                                                        ng-model="selectparams.beginDate"
                                                        ng-change="search()"
                                                        placeholder="" bs-datepicker/>
                                                 <input name="endDate" class="form-control fm-ct-last"
                                                        autocomplete="off"
                                                        autoclose="true"
-                                                       data-date-format="yyyy-MM-dd" data-date-type="date"
+                                                       data-date-format="yyyy-MM-dd" data-date-type="string"
                                                        ng-model="selectparams.endDate"
                                                        ng-change="search()"
                                                        placeholder="" bs-datepicker/>
@@ -103,7 +103,8 @@
                                     <th>序号</th>
                                     <th>活动主题</th>
                                     <th>活动举办日期</th>
-                                    <th>报名时间</th>
+                                    <th>报名日期</th>
+                                    <th>报名状态</th>
                                     <th>已报名人数</th>
                                     <th>创建人</th>
                                     <th>创建时间</th>
@@ -123,7 +124,10 @@
                                     </td>
                                     <td>{{it.activityName}}</td>
                                     <td>{{it.beginDate | date:'yyyy-MM-dd'}}~{{it.endDate | date:'yyyy-MM-dd'}}</td>
-                                    <td>{{it.beginTheRegistrationTime | date:'yyyy-MM-dd'}}</td>
+                                    <td>
+                                        {{it.beginTheRegistrationTime | date:'yyyy-MM-dd'}}~{{it.endTheRegistrationTime | date:'yyyy-MM-dd'}}
+                                    </td>
+                                    <td>{{it.activityStateName}}</td>
                                     <td>{{it.activityCount}}</td>
                                     <td>{{it.createUserName}}</td>
                                     <td>{{it.createTime | date:'yyyy-MM-dd'}}</td>

+ 4 - 1
src/main/resources/static/app/main/partylife/practicalActivity/userList.js

@@ -93,7 +93,10 @@
                     $http({
                         method: "post",
                         url: "../../api/partylife/practicalactivity/addUsers",
-                        data: $scope.userList
+                        data: {
+                            list: JSON.stringify($scope.userList),
+                            practicalActivityId: $scope.dataModel.id,
+                        }
                     }).then(function (result) {
                         $loading.hide();
                         if (result.data.success) {