Browse Source

App党组织风采

lizeyu 7 months ago
parent
commit
9464fe099d
22 changed files with 917 additions and 18 deletions
  1. 3 2
      parth5/parth5/src/app/api/file/index.ts
  2. 36 0
      parth5/parth5/src/app/api/propagandawork/dzzfc/index.ts
  3. 4 2
      parth5/parth5/src/app/comm/modal/bimage/bimage.component.ts
  4. 1 1
      parth5/parth5/src/app/comm/modal/imglist/imglist.component.ts
  5. 18 0
      parth5/parth5/src/app/routes/propagandawork/dzzfc.ts
  6. 49 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/detail/detail.component.html
  7. 38 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/detail/detail.component.scss
  8. 107 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/detail/detail.component.ts
  9. 71 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/edit/edit.component.html
  10. 31 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/edit/edit.component.scss
  11. 138 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/edit/edit.component.ts
  12. 53 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/list.component.html
  13. 42 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/list.component.scss
  14. 147 0
      parth5/parth5/src/app/views/pages/propagandawork/dzzfc/list.component.ts
  15. 2 0
      parth5/parth5/src/app/views/tapp/tab-main/tab-main.route.ts
  16. 6 2
      parth5/parth5/src/app/views/tapp/tabs/tabs.module.ts
  17. 103 0
      src/main/java/com/ghsc/partybuild/controller/app/AppDzzfcController.java
  18. 2 2
      src/main/java/com/ghsc/partybuild/controller/app/AppFileController.java
  19. 0 2
      src/main/java/com/ghsc/partybuild/mapper/PartyCQuery.java
  20. 17 2
      src/main/java/com/ghsc/partybuild/service/FileService.java
  21. 48 4
      src/main/java/com/ghsc/partybuild/service/impl/FileServiceImpl.java
  22. 1 1
      src/main/resources/mapping/PartyCQuery.xml

+ 3 - 2
parth5/parth5/src/app/api/file/index.ts

@@ -36,9 +36,10 @@ export class FileApi {
     });
   }
 
-  getImageBase64(fileId: string) {
+  getImageBase64(id: string, type: string) {
     return this.configService.HttpGetRomote('/appApi/file/getImageBase64', {
-      fileId: fileId
+      id: id,
+      type : type
     });
   }
 

+ 36 - 0
parth5/parth5/src/app/api/propagandawork/dzzfc/index.ts

@@ -0,0 +1,36 @@
+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,
+  dzzdm: string,
+  ztmc: string,
+  fcType: number
+}
+
+@Injectable({providedIn: 'root'})
+export class DzzfcApi {
+  constructor(private configService: ConfigService, private userService: UserService) {
+  }
+
+  getList(params: reqParams): Observable<RequsetData> {
+    return this.configService.HttpGetRomote('/appApi/publicity/dzzfc/getList', params);
+  }
+
+  delete(id: string): Observable<RequsetData> {
+    return this.configService.HttpGetRomote('/appApi/publicity/dzzfc/delete', {id: id });
+  }
+
+  getData(id: string) {
+    return this.configService.HttpGetRomote('/appApi/publicity/dzzfc/get', {id: id});
+  }
+
+  save(data: any): Observable<RequsetData> {
+    return this.configService.HttpPostRomote('/appApi/publicity/dzzfc/save', data);
+  }
+
+}
+

+ 4 - 2
parth5/parth5/src/app/comm/modal/bimage/bimage.component.ts

@@ -15,9 +15,11 @@ export class BimageComponent implements OnInit {
   photoSwipe: PhotoSwipeComponent;
 
   @Input() fileid: string = '';
+  @Input() type: string = '';
 
   imgModel: any = {
-    fileid: ''
+    fileid: '',
+    type: '1',
   };
 
   constructor(private fileApi: FileApi, private sanitizer: DomSanitizer, private alertModal: AlertModal) {
@@ -28,7 +30,7 @@ export class BimageComponent implements OnInit {
   }
 
   getImgBase64() {
-    this.fileApi.getImageBase64(this.fileid).subscribe((data: RequsetData) => {
+    this.fileApi.getImageBase64(this.fileid, this.type).subscribe((data: RequsetData) => {
       if (data.success && data.item != null) {
         this.imgModel.base64 = "data:image/png;base64," + data.item.base64;
         this.imgModel.height = data.item.height;

+ 1 - 1
parth5/parth5/src/app/comm/modal/imglist/imglist.component.ts

@@ -61,7 +61,7 @@ export class ImglistComponent implements OnInit {
 
   getImgBase64() {
     this.imgList.filter(e => !e.base64).forEach(img => {
-      this.fileApi.getImageBase64(img.fileid).subscribe((data: RequsetData) => {
+      this.fileApi.getImageBase64(img.fileid, "1").subscribe((data: RequsetData) => {
         if (data.success && data.item != null) {
           img.base64 = "data:image/png;base64," + data.item.base64;
           img.height = data.item.height;

+ 18 - 0
parth5/parth5/src/app/routes/propagandawork/dzzfc.ts

@@ -0,0 +1,18 @@
+import {Routes} from "@angular/router";
+import {
+  DzzfcListComponent
+} from "../../views/pages/propagandawork/dzzfc/list.component";
+import {
+  DzzfcEditComponent
+} from "../../views/pages/propagandawork/dzzfc/edit/edit.component";
+import {
+  DzzfcDetailComponent
+} from "../../views/pages/propagandawork/dzzfc/detail/detail.component";
+
+const routes: Routes = [
+  {path: 'propagandawork/dzzfc', component: DzzfcListComponent},
+  {path: 'propagandawork/dzzfc/edit', component: DzzfcEditComponent},
+  {path: 'propagandawork/dzzfc/detail', component: DzzfcDetailComponent},
+];
+
+export default routes;

+ 49 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/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/propagandawork/dzzfc/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;
+}

+ 107 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/detail/detail.component.ts

@@ -0,0 +1,107 @@
+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 {PositionApi} from "../../../../../api/propagandawork/position";
+import {AlertModal} from "../../../../../comm/modal/alert";
+import {PanelApi} from "../../../../../api/propagandawork/position/panel";
+import {DzzfcApi} from "../../../../../api/propagandawork/dzzfc";
+import {DictionaryApi} from "../../../../../api/system/dictionary";
+import * as moment from "moment";
+
+@Component({
+  selector: 'app-detail',
+  templateUrl: './detail.component.html',
+  styleUrls: ['./detail.component.scss'],
+})
+export class DzzfcDetailComponent 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;
+    }
+  }
+
+}

+ 71 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/edit/edit.component.html

@@ -0,0 +1,71 @@
+<ion-header class="header-theme2">
+  <ion-toolbar>
+    <ion-label class="title-center">{{title}}党组织生活</ion-label>
+    <ion-buttons slot="start">
+      <ion-back-button icon="ios-back2" defaultHref="/tapp/tabs/tabMain/propagandawork/dzzfc" text="" mode="md"></ion-back-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+<ion-content>
+  <form #dataForm="ngForm" class="form-table">
+    <ion-item detail mode="md">
+      <ion-label>所属党组织<span class="danger">*</span></ion-label>
+      <app-partyselect [(dzzdm)]="dataModel.dzzdm" [(dzzmc)]="dataModel.dzzmc"></app-partyselect>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>主题名称<span class="danger">*</span></ion-label>
+      <ion-input #ztmc="ngModel" name="ztmc" id="ztmc" [(ngModel)]="dataModel.ztmc"
+                 placeholder="请输入主题名称" required></ion-input>
+    </ion-item>
+    <ion-item detail mode="md">
+      <ion-label>类别<span class="danger">*</span></ion-label>
+      <ion-select #fcType="ngModel" name="fcType"
+                  id="fcType"
+                  [(ngModel)]="dataModel.fcType" okText="确定" cancelText="取消" placeholder="请选择"
+                  interface="action-sheet" required>
+        <ion-select-option *ngFor="let item of fcTypeList"
+                           [value]="item.dickey">{{item.dicvalue}}</ion-select-option>
+      </ion-select>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>时间<span class="danger">*</span></ion-label>
+      <ion-datetime #sj="ngModel" displayFormat="YYYY-MM-DD" pickerFormat="YYYY MM DD"
+                    name="sj" id="sj"
+                    cancelText="取消" doneText="选择" placeholder="请选择时间"
+                    [(ngModel)]="dataModel.sj"
+                    required></ion-datetime>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>链接</ion-label>
+      <ion-input #lj="ngModel" name="lj" id="lj" [(ngModel)]="dataModel.lj"
+                 placeholder="请输链接"></ion-input>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>简介</ion-label>
+      <ion-textarea readonly="false" placeholder="请填写简介" name="jj"
+                    [(ngModel)]="dataModel.jj"></ion-textarea>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>内容</ion-label>
+      <ion-textarea readonly="false" placeholder="请填写内容" name="nr"
+                    [(ngModel)]="dataModel.nr"></ion-textarea>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>备注</ion-label>
+      <ion-textarea readonly="false" placeholder="请填写备注" name="remark"
+                    [(ngModel)]="dataModel.remark"></ion-textarea>
+    </ion-item>
+    <ion-item mode="md">
+      <ion-label>上传图片</ion-label>
+    </ion-item>
+    <app-imglist [(imgOption)]="imgOption" [(imgList)]="imgList"></app-imglist>
+    <div class="footer-btn">
+      <ion-button slot="end" color="danger" mode="ios"
+                  (click)="save()" [disabled]="!dataForm.form.valid">
+        提交
+      </ion-button>
+    </div>
+  </form>
+</ion-content>
+<app-photo-swipe></app-photo-swipe>
+

+ 31 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/edit/edit.component.scss

@@ -0,0 +1,31 @@
+ion-content{
+  z-index: 11;
+}
+
+ion-select::part(icon) {
+  display: none;
+}
+
+app-partyselect{
+  width: 75%;
+}
+
+.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;
+}
+
+.item-img{
+  width: 80px;
+  height: 50px;
+  padding-right: 10px;
+}
+
+.item-detail{
+  margin: 0px !important;
+}

+ 138 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/edit/edit.component.ts

@@ -0,0 +1,138 @@
+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 * as moment from 'moment';
+import {PhotoSwipeComponent} from "../../../../../comm/modal/photo-swipe/photo-swipe.component";
+import {DzzfcApi} from "../../../../../api/propagandawork/dzzfc";
+import {AlertModal} from "../../../../../comm/modal/alert";
+import {DictionaryApi} from "../../../../../api/system/dictionary";
+
+@Component({
+  selector: 'app-edit',
+  templateUrl: './edit.component.html',
+  styleUrls: ['./edit.component.scss'],
+})
+export class DzzfcEditComponent implements OnInit {
+
+  @ViewChild(PhotoSwipeComponent)
+  photoSwipe: PhotoSwipeComponent;
+
+  op: number = 0;
+  title: string = "新增";
+  dataModel: any = {};
+  fcTypeList: any = [];
+  detailOpen: boolean = false;
+  webServerHost: string = '';
+  imgOption: any = {
+    fileRefid: '',
+    fileName: '',
+    fileType: 4,
+    isMulti: true,
+    readonly: false
+  };
+  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.op = parseInt(params['op']);
+      this.title = this.op == 0 ? "新增" : "编辑";
+      this.getDictionList();
+      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;
+      }
+    });
+  }
+
+  getDictionList() {
+    this.dictionaryApi.getDictionaryList('fcType').subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.fcTypeList = data.item;
+      }
+    });
+  }
+
+  save() {
+    this.alertModal.loading("提交中...").then((loading) => {
+      this.dataModel.sj = moment(this.dataModel.sj).format("YYYY-MM-DD");
+      this.dzzfcApi.save(this.dataModel).subscribe((data: RequsetData) => {
+        loading.dismiss();
+        if (data.success) {
+          this.back();
+        }
+        this.alertModal.alert(data.msg);
+      }, () => {
+        loading.dismiss();
+      });
+    });
+  }
+
+  back() {
+    this.router.navigate(['../../dzzfc'], {relativeTo: this.routeInfo, queryParams: {random: Math.random()}});
+  }
+
+  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;
+    }
+  }
+
+}

+ 53 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/list.component.html

@@ -0,0 +1,53 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-label>党组织风采</ion-label>
+    <ion-buttons slot="start">
+<!--      <ion-back-button icon="ios-back" mode="md"></ion-back-button>-->
+      <ion-back-button icon="ios-back2" defaultHref="/tapp/tabs/tabMain" text="" mode="md"></ion-back-button>
+    </ion-buttons>
+    <ion-searchbar slot="end" mode="ios" enterkeyhint="search" placeholder="搜索主题名称" showCancelButton="never"
+                   (ionChange)="searchChange($event)"></ion-searchbar>
+  </ion-toolbar>
+  <app-partysearch [(dzzdm)]="searchParams.dzzdm" (dzzdmChange)="reload()"></app-partysearch>
+  <ion-item class="item-filter">
+    <div slot="end" (click)="search()">
+      <span>条件筛选</span>
+      <ion-icon name="dj-search"></ion-icon>
+    </div>
+  </ion-item>
+</ion-header>
+<ion-content>
+  <ion-list>
+    <ion-item-sliding *ngFor="let item of dataList">
+      <ion-item detail  [routerLink]="['./edit']" [queryParams]="{id: item.id,op:1}">
+        <div class="item-img">
+          <app-bimage [(fileid)]="item.id"></app-bimage>
+        </div>
+        <ion-label>
+          <h2>{{item.ztmc}}<span class="dues-month">{{item.sj}}</span></h2>
+          <p>{{item.dzzmc}}</p>
+        </ion-label>
+      </ion-item>
+
+      <ion-item-options side="end">
+        <ion-item-option (click)="delete(item.id)">删除</ion-item-option>
+      </ion-item-options>
+    </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-fab vertical="bottom" horizontal="center" slot="fixed" class="fab-add">
+    <ion-fab-button>
+      <ion-text class="btn-add" (click)="add()">
+        <img src="../../../../../assets/icon/btnadd.png" style="width: 30px;height:30px;">
+        <span class="btn-add-text">新增</span>
+      </ion-text>
+    </ion-fab-button>
+  </ion-fab>
+</ion-content>
+
+

+ 42 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/list.component.scss

@@ -0,0 +1,42 @@
+ion-label {
+  margin: 3px !important;
+  padding: 0px;
+  white-space: normal !important;
+}
+.dues-month{
+  color: #998989;
+  font-size: 12px;
+  border-radius: 4px;
+  background-color: #F3F3F3;
+  padding: 0px 4px;
+  margin-left: 20px;
+}
+
+.dues-money{
+  color: #DE4F3F;
+}
+
+ion-select {
+  color: #5E4545;
+
+  --placeholder-color: #5E4545;
+
+  --placeholder-opacity: 1;
+}
+ion-select::part(icon) {
+  color: #5E4545;
+  opacity: 1;
+}
+ion-header {
+  ion-item {
+    --inner-border-width:  0px;
+    --border-width:0px;
+  }
+}
+
+.item-img{
+  width: 80px;
+  height: 50px;
+  padding-right: 10px;
+}
+

+ 147 - 0
parth5/parth5/src/app/views/pages/propagandawork/dzzfc/list.component.ts

@@ -0,0 +1,147 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {AlertController, IonInfiniteScroll, LoadingController, 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 {SearchComponent} from "../../../../comm/modal/search/search.component";
+import {DzzfcApi, reqParams} from "../../../../api/propagandawork/dzzfc";
+import {AlertModal} from "../../../../comm/modal/alert";
+
+@Component({
+  selector: 'app-dzzfc-list',
+  templateUrl: './list.component.html',
+  styleUrls: ['./list.component.scss'],
+})
+export class DzzfcListComponent implements OnInit {
+
+  @ViewChild(IonInfiniteScroll, {static: true}) infiniteScroll: IonInfiniteScroll;
+
+  webServerHost: string = '';
+  userInfo: any = {};
+  dataList: any[] = [];
+  searchParams: reqParams = {
+    pageindex: 1,
+    pagesize: 15,
+    dzzdm: '',
+    ztmc: '',
+    fcType: null
+  };
+  total: number = 15;
+  fieldList: any[] = [{label: '主题名称', name: 'ztmc', type: 'text', value: '', placeholder: '输入主题名称'},
+    {
+      label: '类别',
+      name: 'fcType',
+      type: 'select',
+      value: '',
+      dicParams: {
+        getUrl: 'getDictionaryList',
+        dicTypeKey: 'fcType',
+        textField: 'dicvalue',
+        valueField: 'dickey',
+        ismulti: false
+      }
+    }
+  ];
+
+  constructor(private router: Router, private routeInfo: ActivatedRoute, private configService: ConfigService, private userService: UserService, public modalController: ModalController, private navCtrl: NavController
+    , private dzzfcApi: DzzfcApi, private alertModal: AlertModal) {
+  }
+
+  ngOnInit() {
+    this.userInfo = this.userService.GetUser();
+    this.routeInfo.queryParams.subscribe(params => {
+      debugger;
+      this.searchParams.dzzdm = this.searchParams.dzzdm || this.userService.GetUser().dataDzzdm;
+      this.reload();
+    });
+    this.configService.GetConfig().subscribe((config) => {
+      this.webServerHost = config.webServerHost;
+    });
+  }
+
+  getList() {
+    this.dzzfcApi.getList(this.searchParams).subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.dataList = this.dataList.concat(data.item.list);
+        this.total = data.item.total;
+      }
+    });
+  }
+
+  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);
+  }
+
+  yearChange(e) {
+    this.reload();
+  }
+
+  searchChange(event) {
+    this.fieldList[0].value = event.detail.value;
+    this.searchParams.ztmc = event.detail.value;
+    this.reload();
+  }
+
+  async search() {
+    const modal = await this.modalController.create({
+      component: SearchComponent,
+      componentProps: {
+        'fieldList': this.fieldList
+      },
+      cssClass: 'search-modal'
+    });
+
+    await modal.present();
+
+    const {data} = await modal.onWillDismiss();
+    if (data && data.success) {
+      this.searchParams.ztmc = data.params.ztmc;
+      this.searchParams.fcType = data.params.fcType;
+      this.reload();
+    }
+  }
+
+  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}
+    });
+  }
+
+  delete(id) {
+    this.alertModal.confirm("确认删除?", () => {
+      this.alertModal.loading("正在删除").then((loading) => {
+        this.dzzfcApi.delete(id).subscribe((fdata: RequsetData) => {
+          loading.dismiss();
+          if (fdata.success) {
+            this.reload();
+          }
+          this.alertModal.alert(fdata.msg);
+        }, () => {
+          loading.dismiss();
+        });
+      });
+    });
+  }
+
+}

+ 2 - 0
parth5/parth5/src/app/views/tapp/tab-main/tab-main.route.ts

@@ -5,6 +5,7 @@ import partyUserRoutes from "../../../routes/partyUser";
 import shykRoutes from "../../../routes/shyk";
 import partyDuesRoutes from "../../../routes/partyDues";
 import positionRoutes from "../../../routes/propagandawork/position";
+import dzzfcRoutes from "../../../routes/propagandawork/dzzfc";
 import examRoutes from "../../../routes/exam";
 
 export const routes: Routes = [
@@ -17,5 +18,6 @@ export const routes: Routes = [
   ...shykRoutes,
   ...partyDuesRoutes,
   ...positionRoutes,
+  ...dzzfcRoutes,
   ...examRoutes
 ];

+ 6 - 2
parth5/parth5/src/app/views/tapp/tabs/tabs.module.ts

@@ -60,6 +60,9 @@ import {routes as UserRoutes} from "../tab-user/tab-user.route";
 import {CardComponent} from "../../pages/examtest/show/card/card.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";
 import {ShowComponent as ExamtestShowComponent} from "../../pages/examtest/show/show.component";
 
 const pageComponents = [
@@ -89,8 +92,9 @@ const pageComponents = [
   RecordComponent,
   PartyUserRewardComponent,
   ExamtestComponent,
-  ExamtestShowComponent,
-  CardComponent
+  DzzfcListComponent,
+  DzzfcEditComponent,
+  DzzfcDetailComponent
 ];
 
 const pubComponents = [

+ 103 - 0
src/main/java/com/ghsc/partybuild/controller/app/AppDzzfcController.java

@@ -0,0 +1,103 @@
+package com.ghsc.partybuild.controller.app;
+
+import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
+import com.ghsc.partybuild.service.UserService;
+import com.ghsc.partybuild.service.impl.PubDzzfcService;
+import com.ghsc.partybuild.util.DateUtils;
+import com.ghsc.partybuild.vo.publicity.PubDzzfcVo;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+@Slf4j
+@RestController
+@RequestMapping(value = "/appApi/publicity/dzzfc")
+public class AppDzzfcController {
+    @Autowired
+    private PubDzzfcService pubDzzfcService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private DateUtils dateUtils;
+
+    @ResponseBody
+    @GetMapping("/getList")
+    public RequsetData<PageInfo<PubDzzfcVo>> getList(int pageindex, int pagesize, @RequestParam(required = false) String dzzdm,
+                                                     @RequestParam(required = false) String ztmc, @RequestParam(required = false) String fcType) {
+
+        RequsetData<PageInfo<PubDzzfcVo>> result = new RequsetData<>();
+        result.setItem(pubDzzfcService.getList(pageindex, pagesize, null, dzzdm, ztmc, fcType));
+        return result;
+    }
+
+    @ResponseBody
+    @GetMapping("/get")
+    public RequsetData<PubDzzfcVo> get(@RequestParam(required = false) String id) {
+        RequsetData<PubDzzfcVo> res = new RequsetData<>();
+
+        PubDzzfcVo model = pubDzzfcService.getPubDzzfcById(id);
+        if (model == null) {
+            model = new PubDzzfcVo();
+            model.setId(UUID.randomUUID().toString());
+        }
+
+        res.setItem(model);
+        return res;
+    }
+
+    @ResponseBody
+    @PostMapping("/save")
+    public RequsetData<String> save(@RequestBody PubDzzfcVo data) {
+        RequsetData<String> result = new RequsetData<String>();
+        int count = 0;
+        String message = "";
+
+        try {
+            count = pubDzzfcService.save(data, userService.getLoginUser().getUserid());
+        } catch (Exception e) {
+            e.printStackTrace();
+            message = e.toString();
+        }
+
+        if (count > 0) {
+            result.setSuccess(true);
+            result.setMsg("保存成功!");
+        } else {
+            result.setSuccess(false);
+            result.setMsg("保存失败!" + message);
+        }
+        return result;
+    }
+
+    @ResponseBody
+    @GetMapping("/delete")
+    public RequsetData<Integer> delete(@RequestParam String id) {
+        RequsetData<Integer> result = new RequsetData<>();
+        int count = 0;
+        String message = "";
+
+        try {
+            List<String> idList = new ArrayList<>();
+            idList.add(id);
+            count = pubDzzfcService.delete(idList);
+        } catch (Exception e) {
+            e.printStackTrace();
+            message = e.toString();
+        }
+
+        if (count > 0) {
+            result.setItem(count);
+            result.setSuccess(true);
+            result.setMsg("删除成功!");
+        } else {
+            result.setSuccess(false);
+            result.setMsg("删除失败!" + message);
+        }
+        return result;
+    }
+}

+ 2 - 2
src/main/java/com/ghsc/partybuild/controller/app/AppFileController.java

@@ -119,8 +119,8 @@ public class AppFileController {
     }
 
     @GetMapping("getImageBase64")
-    public RequsetData<ImageBase64Vo> getImageBase64(@RequestParam("fileId") String fileId) throws IOException {
-        return RespGenerstor.success(fileService.getImageBase64(fileId));
+    public RequsetData<ImageBase64Vo> getImageBase64(@RequestParam("id") String id, @RequestParam("type") String type) throws IOException {
+        return RespGenerstor.success(fileService.getImageBase64(id, type));
     }
 
     @PostMapping("uploadBase64")

+ 0 - 2
src/main/java/com/ghsc/partybuild/mapper/PartyCQuery.java

@@ -93,10 +93,8 @@ public interface PartyCQuery {
     /**
      * 党组织树
      * @param parentCode
-     * @param isshowxz
      * @param dzzdm
      * @param onlyshow_dw
-     * @param zzfbType
      * @param showdxz
      * @return
      */

+ 17 - 2
src/main/java/com/ghsc/partybuild/service/FileService.java

@@ -13,6 +13,7 @@ import org.apache.commons.net.ftp.FTPClient;
 
 import com.github.pagehelper.PageInfo;
 import com.ghsc.partybuild.model.CfFile;
+import org.bouncycastle.jcajce.provider.drbg.DRBG;
 
 /**
  *
@@ -52,13 +53,21 @@ public interface FileService {
     String SaveFile(String file, String fileName, String fileRefID, String uid, Integer fileType);
 
     /**
-     * down
+     * down 根据fileId查询
      * @param fileId
      * @param os
      * @return
      */
     CfFile downFtpFile(String fileId, OutputStream os);
 
+    /**
+     * down 根据fileRefID查询 创建时间升序返回第一条数据
+     * @param fileRefID
+     * @param os
+     * @return
+     */
+    CfFile downFtpFile2(String fileRefID, OutputStream os);
+
     /**
      * 查询cf_file表附件
      * @param fileRefID
@@ -97,7 +106,13 @@ public interface FileService {
 
     String getFileBase64(String fileId) throws IOException;
 
-    ImageBase64Vo getImageBase64(String fileId) throws IOException;
+    /**
+     * 返回图片信息
+     * @param id
+     * @param type 1:fileId;2fileRefId
+     * @return
+     * */
+    ImageBase64Vo getImageBase64(String id, String type) throws IOException;
 
     Integer uploadBase64(List<UploadFileBase64Vo> fileList, String userId) throws IOException;
 

+ 48 - 4
src/main/java/com/ghsc/partybuild/service/impl/FileServiceImpl.java

@@ -259,8 +259,48 @@ public class FileServiceImpl implements FileService {
     }
 
     @Override
-    public CfFile downFtpFile(String fileId, OutputStream os) {
-        CfFile file = cfFileMapper.selectByPrimaryKey(fileId);
+    public CfFile downFtpFile(String id, OutputStream os) {
+        CfFile file = cfFileMapper.selectByPrimaryKey(id);
+
+        try {
+            FTPClient ftpClient = new FTPClient();
+            ftpHelper.connectToServer(ftpClient);
+            ftpClient.enterLocalPassiveMode();
+            ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+
+            ftpClient.retrieveFile(file.getFileurl(), os);
+            /*
+            FTPFile[] files = ftpClient.listFiles(file.getFileurl());
+
+            if(files.length>0){
+
+                String filePath=GetParentPath(file.getFileurl());
+
+                ftpClient.changeWorkingDirectory(filePath);
+
+
+            }*/
+
+            ftpHelper.closeConnect(ftpClient);
+
+        } catch (Exception ex) {
+            logger.error("downFtpFile,下载文件失败!", ex);
+            file = null;
+        }
+
+        return file;
+    }
+
+    @Override
+    public CfFile downFtpFile2(String id, OutputStream os) {
+        CfFileExample emp = new CfFileExample();
+        emp.or().andFilerefidEqualTo(id);
+        emp.setOrderByClause("createtime");
+        CfFile file = cfFileMapper.selectByExample(emp).stream().findFirst().orElse(null);
+
+        if(file == null){
+            return null;
+        }
 
         try {
             FTPClient ftpClient = new FTPClient();
@@ -451,13 +491,17 @@ public class FileServiceImpl implements FileService {
     }
 
     @Override
-    public ImageBase64Vo getImageBase64(String fileId) throws IOException {
+    public ImageBase64Vo getImageBase64(String id, String type) throws IOException {
         ImageBase64Vo result = new ImageBase64Vo();
 
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
 
         try {
-            this.downFtpFile(fileId, bos);
+            if("1".equals(type)){
+                this.downFtpFile(id, bos);
+            }else {
+                this.downFtpFile2(id, bos);
+            }
 
             byte[] bytes = bos.toByteArray();
 

+ 1 - 1
src/main/resources/mapping/PartyCQuery.xml

@@ -260,7 +260,7 @@
         ) c on p.dzzdm=SUBSTR(c.DZZDM,1,LENGTH(c.DZZDM)-3)
         left join ZZ_DZZFBQK fbType on p.DZZDM = fbType.DZZDM
         where 1=1
-        and p.DZZDM like ''||#{parentCode}||'%'
+        and p.DZZDM like concat('',#{parentCode},'%')
         and length(p.DZZDM)=(length(#{parentCode})+3)
         <if test="dzzdm != null and dzzdm != ''">
             and p.DZZDM = #{dzzdm}