瀏覽代碼

病例第一套增加问卷

liangpeile 1 年之前
父節點
當前提交
6d9a933018
共有 21 個文件被更改,包括 1958 次插入875 次删除
  1. 34 1
      medical_history-vue/src/views/admin/AdminDoctorUserList.vue
  2. 7 2
      medical_history-vue/src/views/admin/AdminMedicalHistoryList.vue
  3. 7 2
      medical_history-vue/src/views/admin/AdminMedicalHistoryList2.vue
  4. 7 2
      medical_history-vue/src/views/admin/AdminMedicalHistoryList3.vue
  5. 7 2
      medical_history-vue/src/views/admin/AdminMedicalHistoryList4.vue
  6. 103 4
      medical_history-vue/src/views/admin/AdminTopicList.vue
  7. 6 1
      medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm.vue
  8. 5 0
      medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm2.vue
  9. 5 0
      medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm3.vue
  10. 5 0
      medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm4.vue
  11. 228 23
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admincasehistory/controller/AdminMedicalHistoryController.java
  12. 15 10
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admincasehistory/entity/AdminMedicalHistory.java
  13. 2 0
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/entity/AdminUser.java
  14. 591 4
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc/controller/AdminTopicController.java
  15. 10 0
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc/entity/AdminTopic.java
  16. 276 667
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/controller/AdminTopicController2.java
  17. 1 0
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/entity/AdminTopicTwo.java
  18. 58 144
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/entity/AdminTopicTwo4.java
  19. 3 0
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/service/IAdminTopicaTwoService.java
  20. 457 1
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/service/impl/AdminTopicServiceTwoImplTopic.java
  21. 131 12
      medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/APIController.java

+ 34 - 1
medical_history-vue/src/views/admin/AdminDoctorUserList.vue

@@ -116,7 +116,9 @@
               <a @click="blsc(record.id,record.wisMhu)">病历上传({{record.wisMhu}})</a>
 
           <a-divider type="vertical" />
-              <a @click="wjdc(record.id,record.wisWjdc)">问卷调查({{record.wisWjdc}})</a>
+              <a @click="wjdc(record.id,record.wisWjdc)">问卷调查1({{record.wisWjdc}})</a>
+          <a-divider type="vertical" />
+              <a @click="wjdc2(record.id,record.wisWjdc2)">问卷调查2({{record.wisWjdc2}})</a>
 
           <a-divider type="vertical" />
           <a-dropdown>
@@ -271,6 +273,11 @@ export default {
           dataIndex: 'wisWjdc'
         },
         {
+          title: '是否允许问卷二调查',
+          align: 'center',
+          dataIndex: 'wisWjdc2'
+        },
+        {
           title: '操作',
           dataIndex: 'action',
           align: 'center',
@@ -282,6 +289,7 @@ export default {
       url: {
         list: '/adminDoctorUser/adminUser/list',
         edit: '/adminDoctorUser/adminUser/edit',
+        edit2: '/adminDoctorUser/adminUser/edit2',
         delete: '/adminDoctorUser/adminUser/delete',
         deleteBatch: '/adminDoctorUser/adminUser/deleteBatch',
         exportXlsUrl: '/adminDoctorUser/adminUser/exportXls',
@@ -352,6 +360,31 @@ export default {
         }
       })
     },
+    wjdc2(id,str){
+      var that = this
+      let str2
+      if (str =="允许"){
+        str2 = "不允许"
+      }
+      if (str =="不允许"){
+        str2 = "允许"
+      }
+      if (str ==null){
+        str2 = "允许"
+      }
+      httpAction(that.url.edit2, {
+        id: id,
+        wisWjdc2: str2
+      }, 'post').then((res) => {
+        if (res.success) {
+          that.$message.success(res.message)
+          that.$emit('ok')
+          that.loadData()
+        } else {
+          that.$message.warning(res.message)
+        }
+      })
+    },
     //=============修改密码
     handleCancelzz() {
       this.closezz()

+ 7 - 2
medical_history-vue/src/views/admin/AdminMedicalHistoryList.vue

@@ -10,8 +10,8 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="姓名">
-              <a-input placeholder="请输入姓名" v-model="queryParam.ssname"></a-input>
+            <a-form-item label="医生姓名">
+              <a-input placeholder="请输入医生姓名" v-model="queryParam.ssname"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -239,6 +239,11 @@ export default {
           dataIndex: 'phone'
         },
         {
+          title: '医生姓名',
+          align: 'center',
+          dataIndex: 'submitterName'
+        },
+        {
           title: '分类名称',
           align: 'center',
           dataIndex: 'uploadingName'

+ 7 - 2
medical_history-vue/src/views/admin/AdminMedicalHistoryList2.vue

@@ -10,8 +10,8 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="姓名">
-              <a-input placeholder="请输入姓名" v-model="queryParam.ssname"></a-input>
+            <a-form-item label="医生姓名">
+              <a-input placeholder="请输入医生姓名" v-model="queryParam.ssname"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -157,6 +157,11 @@ export default {
           dataIndex: 'phone'
         },
         {
+          title: '医生姓名',
+          align: 'center',
+          dataIndex: 'submitterName'
+        },
+        {
           title: '分类名称',
           align: 'center',
           dataIndex: 'uploadingName'

+ 7 - 2
medical_history-vue/src/views/admin/AdminMedicalHistoryList3.vue

@@ -10,8 +10,8 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="姓名">
-              <a-input placeholder="请输入姓名" v-model="queryParam.ssname"></a-input>
+            <a-form-item label="医生姓名">
+              <a-input placeholder="请输入医生姓名" v-model="queryParam.ssname"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -150,6 +150,11 @@ export default {
           dataIndex: 'phone'
         },
         {
+          title: '医生姓名',
+          align: 'center',
+          dataIndex: 'submitterName'
+        },
+        {
           title: '分类名称',
           align: 'center',
           dataIndex: 'uploadingName'

+ 7 - 2
medical_history-vue/src/views/admin/AdminMedicalHistoryList4.vue

@@ -10,8 +10,8 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="姓名">
-              <a-input placeholder="请输入姓名" v-model="queryParam.ssname"></a-input>
+            <a-form-item label="医生姓名">
+              <a-input placeholder="请输入医生姓名" v-model="queryParam.ssname"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -150,6 +150,11 @@ export default {
           dataIndex: 'phone'
         },
         {
+          title: '医生姓名',
+          align: 'center',
+          dataIndex: 'submitterName'
+        },
+        {
           title: '分类名称',
           align: 'center',
           dataIndex: 'uploadingName'

+ 103 - 4
medical_history-vue/src/views/admin/AdminTopicList.vue

@@ -1,4 +1,5 @@
 <template>
+  <a-spin :spinning="loading2">
   <a-card :bordered="false">
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
@@ -9,9 +10,21 @@
               <a-input placeholder="请输入提交用户" v-model="queryParam.ssusername"></a-input>
             </a-form-item>
           </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="提交数据">
-              <a-input placeholder="请输入提交数据" v-model="queryParam.sstopic"></a-input>
+<!--          <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
+<!--            <a-form-item label="提交数据">-->
+<!--              <a-input placeholder="请输入提交数据" v-model="queryParam.sstopic"></a-input>-->
+<!--            </a-form-item>-->
+<!--          </a-col>-->
+          <a-col :md="6" :sm="10">
+            <a-form-item label="提交时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-range-picker
+                style="width: 210px"
+                v-model="queryParam.createTimeRange"
+                format="YYYY-MM-DD"
+                :placeholder="['开始时间', '结束时间']"
+                @change="onDateChange"
+                @ok="onDateOk"
+              />
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -28,7 +41,7 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <!--      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
-      <!--      <a-button type="primary" icon="download" @click="handleExportXls('问卷调查')">导出</a-button>-->
+            <a-button type="primary" icon="download" @click="handleExportXls('问卷调查')">导出</a-button>
       <!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
       <!--        <a-button type="primary" icon="import">导入</a-button>-->
       <!--      </a-upload>-->
@@ -112,6 +125,7 @@
 
     <admin-topic-modal ref="modalForm" @ok="modalFormOk"></admin-topic-modal>
   </a-card>
+  </a-spin>
 </template>
 
 <script>
@@ -122,6 +136,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import AdminTopicModal from './modules/AdminTopicModal'
 import { httpAction } from '@api/manage'
 import { downFile } from '../../api/manage'
+import { filterObj } from '@/utils/util'
 
 export default {
   name: 'AdminTopicList',
@@ -132,6 +147,10 @@ export default {
   data() {
     return {
       description: '问卷调查管理页面',
+      queryParam: {
+        createTimeRange:[],
+      },
+      loading2: false,
       // 表头
       columns: [
         {
@@ -155,6 +174,21 @@ export default {
           dataIndex: 'username'
         },
         {
+          title: '手机号',
+          align: 'center',
+          dataIndex: 'phone'
+        },
+        {
+          title: '医院',
+          align: 'center',
+          dataIndex: 'hospital'
+        },
+        {
+          title: '门诊日期',
+          align: 'center',
+          dataIndex: 'outpatientServiceTime'
+        },
+        {
           title: '提交时间',
           align: 'center',
           dataIndex: 'createTime'
@@ -190,6 +224,43 @@ export default {
     }
   },
   methods: {
+    handleExportXls(fileName){
+      if(!fileName || typeof fileName != "string"){
+        fileName = "导出文件"
+      }
+      let param = this.getQueryParams();
+      if(this.selectedRowKeys && this.selectedRowKeys.length>0){
+        param['selections'] = this.selectedRowKeys.join(",")
+      }
+      // if(this.selectedRowKeys.length>20){
+      //   this.$message.warning("导出不要超过20")
+      //   return
+      // }
+      console.log("导出参数",param)
+      this.loading2 = !this.loading2
+      downFile(this.url.exportXlsUrl,param).then((data)=>{
+        if (!data) {
+          this.$message.warning("文件下载失败")
+          this.spinning = !this.spinning
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
+          this.loading2 = !this.loading2
+        }else{
+          let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName+'.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link); //下载完成移除元素
+          window.URL.revokeObjectURL(url); //释放掉blob对象
+          this.loading2 = !this.loading2
+        }
+      })
+    },
     dc2(record){
       let fileName = record.username+"问卷调查"
 
@@ -261,6 +332,27 @@ export default {
     },
     initDictConfig() {
     },
+    getQueryParams(){
+      var param = Object.assign({}, this.queryParam,this.isorter);
+      param.field = this.getQueryField();
+      param.pageNo = this.ipagination.current;
+      param.pageSize = this.ipagination.pageSize;
+      delete param.createTimeRange; // 时间参数不传递后台
+      if (this.superQueryParams) {
+        param['superQueryParams'] = encodeURI(this.superQueryParams)
+        param['superQueryMatchType'] = this.superQueryMatchType
+      }
+
+      return filterObj(param);
+    },
+    onDateChange: function (value, dateString) {
+      console.log(dateString[0],dateString[1]);
+      this.queryParam.createTime_begin=dateString[0];
+      this.queryParam.createTime_end=dateString[1];
+    },
+    onDateOk(value) {
+      console.log(value);
+    },
     getSuperFieldList() {
       let fieldList = []
       fieldList.push({ type: 'Text', value: 'topic', text: '题和答案', dictCode: '' })
@@ -272,5 +364,12 @@ export default {
 }
 </script>
 <style scoped>
+.spin-content{
+  border: 1px solid #91d5ff;
+  background-color: #e6f7ff;
+  padding: 30px;
+}
+</style>
+<style scoped>
 @import '~@assets/less/common.less';
 </style>

+ 6 - 1
medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm.vue

@@ -5,7 +5,12 @@
         <a-row>
           <a-col :span="24">
             <a-form-model-item label="提交人账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
-              <a-input v-model="model.phone" placeholder="请输入提交人账号"  ></a-input>
+              <a-input v-model="model.phone"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="提交人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitterName">
+              <a-input v-model="model.submitterName"></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">

+ 5 - 0
medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm2.vue

@@ -9,6 +9,11 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
+            <a-form-model-item label="提交人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitterName">
+              <a-input v-model="model.submitterName"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
             <a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="uploadingName">
               <a-input v-model="model.uploadingName" placeholder="请输入分类名称"  ></a-input>
             </a-form-model-item>

+ 5 - 0
medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm3.vue

@@ -9,6 +9,11 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
+            <a-form-model-item label="提交人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitterName">
+              <a-input v-model="model.submitterName"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
             <a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="uploadingName">
               <a-input v-model="model.uploadingName" placeholder="请输入分类名称"  ></a-input>
             </a-form-model-item>

+ 5 - 0
medical_history-vue/src/views/admin/modules/AdminMedicalHistoryForm4.vue

@@ -9,6 +9,11 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
+            <a-form-model-item label="提交人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitterName">
+              <a-input v-model="model.submitterName"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
             <a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="uploadingName">
               <a-input v-model="model.uploadingName" placeholder="请输入分类名称"  ></a-input>
             </a-form-model-item>

+ 228 - 23
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admincasehistory/controller/AdminMedicalHistoryController.java

@@ -14,8 +14,11 @@ import javax.servlet.http.HttpServletResponse;
 import com.aliyun.ocr_api20210707.models.RecognizeAdvancedResponse;
 import com.aliyun.tea.TeaException;
 import net.sf.json.JSONObject;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.admincasehistory.entity.AdminMedicalHistory;
 import org.jeecg.modules.admincasehistory.service.IAdminMedicalHistoryService;
@@ -35,6 +38,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -59,6 +63,9 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
     private IAdminMedicalHistoryService adminMedicalHistoryService;
     @Autowired
     private IAdminUserService adminUserService;
+    @Value("${jeecg.path.upload}")
+    private String upLoadPath;
+
     /**
      * 分页列表查询
      *
@@ -77,12 +84,13 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
                                                             HttpServletRequest req,String sstitle,String ssname) {
         QueryWrapper<AdminMedicalHistory> queryWrapper = QueryGenerator.initQueryWrapper(adminMedicalHistory, req.getParameterMap());
         //未初审的
-        queryWrapper.eq("first_trial","0").or().eq( "first_trial","1" );
+//        queryWrapper.eq("first_trial","0").or().eq( "first_trial","1" );
+        queryWrapper.in( "first_trial","0","1" );
         if (sstitle != null){
             queryWrapper.like("title",sstitle);
         }
         if (ssname != null){
-            queryWrapper.like("name",ssname);
+            queryWrapper.like("submitter_name",ssname);
         }
         Page<AdminMedicalHistory> page = new Page<AdminMedicalHistory>(pageNo, pageSize);
         IPage<AdminMedicalHistory> pageList = adminMedicalHistoryService.page(page, queryWrapper);
@@ -103,7 +111,7 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
             queryWrapper.like("title",sstitle);
         }
         if (ssname != null){
-            queryWrapper.like("name",ssname);
+            queryWrapper.like("submitter_name",ssname);
         }
         queryWrapper.orderByDesc( "auditor_time" );
         Page<AdminMedicalHistory> page = new Page<AdminMedicalHistory>(pageNo, pageSize);
@@ -124,7 +132,7 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
             queryWrapper.like("title",sstitle);
         }
         if (ssname != null){
-            queryWrapper.like("name",ssname);
+            queryWrapper.like("submitter_name",ssname);
         }
         queryWrapper.orderByDesc( "zjsp_time    " );
         Page<AdminMedicalHistory> page = new Page<AdminMedicalHistory>(pageNo, pageSize);
@@ -144,7 +152,7 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
             queryWrapper.like("title",sstitle);
         }
         if (ssname != null){
-            queryWrapper.like("name",ssname);
+            queryWrapper.like("submitter_name",ssname);
         }
         Page<AdminMedicalHistory> page = new Page<AdminMedicalHistory>(pageNo, pageSize);
         IPage<AdminMedicalHistory> pageList = adminMedicalHistoryService.page(page, queryWrapper);
@@ -283,7 +291,10 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
     @ApiOperation(value = "病历管理-编辑", notes = "病历管理-编辑")
     @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody AdminMedicalHistory adminMedicalHistory) {
-        if (adminMedicalHistory.getType()!=null){
+//        if (adminMedicalHistory.getType()!=null){
+//            adminMedicalHistory.setZjspTime( new Date(  ) );
+//        }
+        if (adminMedicalHistory.getFirstTrial()!=null){
             adminMedicalHistory.setAuditorTime( new Date(  ) );
         }
         adminMedicalHistoryService.updateById(adminMedicalHistory);
@@ -341,34 +352,228 @@ public class AdminMedicalHistoryController extends JeecgController<AdminMedicalH
      * @param request
      * @param adminMedicalHistory
      */
+//    @RequestMapping(value = "/exportXls")
+//    public ModelAndView exportXls(HttpServletRequest request, AdminMedicalHistory adminMedicalHistory,String sstitle,String ssname) {
+//        adminMedicalHistory.setTitle( sstitle );
+//        adminMedicalHistory.setName( ssname );
+//        adminMedicalHistory.setFirstTrial( "0" );
+//        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "待审核病历列表");
+//    }
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, AdminMedicalHistory adminMedicalHistory,String sstitle,String ssname) {
-        adminMedicalHistory.setTitle( sstitle );
-        adminMedicalHistory.setName( ssname );
-        adminMedicalHistory.setFirstTrial( "0" );
-        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "待审核病历列表");
+        String title = "待审核病历列表";
+        // Step.1 组装查询条件
+        QueryWrapper<AdminMedicalHistory> queryWrapper = QueryGenerator.initQueryWrapper(adminMedicalHistory, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (sstitle != null){
+            queryWrapper.like( "title",sstitle );
+        }
+        if (ssname != null){
+            queryWrapper.like( "submitter_name",ssname );
+        }
+        queryWrapper.in("first_trial","0","1");
+        // Step.2 获取导出数据
+        List<AdminMedicalHistory> pageList = service.list(queryWrapper);
+
+
+        List<AdminMedicalHistory> exportList = null;
+
+        // 过滤选中数据
+        String selections = request.getParameter("selections");
+        if (oConvertUtils.isNotEmpty(selections)) {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+            exportList = pageList.stream().filter(item -> selectionList.contains(getId(item))).collect(Collectors.toList());
+        } else {
+            exportList = pageList;
+        }
+        //导出不太可能 一是慢这个没啥问题 二是只能通过
+        int a = exportList.size();
+        for (int i = 0; i<a;i++){
+            if (exportList.get( i ).getSubmitterName()==null){
+                QueryWrapper<AdminUser> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq( "phone", exportList.get( i ).getPhone() );
+                AdminUser storeMember1 = adminUserService.getOne( queryWrapper2 );
+                exportList.get( i ).setSubmitterName( storeMember1.getName() );
+            }
+        }
+
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.CLASS, AdminMedicalHistory.class);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams  exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
+        exportParams.setImageBasePath(upLoadPath);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS,exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
+        return mv;
+    }
+    private String getId(AdminMedicalHistory item) {
+        try {
+            return PropertyUtils.getProperty(item, "id").toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
     }
     @RequestMapping(value = "/exportXls2")
     public ModelAndView exportXls2(HttpServletRequest request, AdminMedicalHistory adminMedicalHistory,String sstitle,String ssname) {
-        adminMedicalHistory.setTitle( sstitle );
-        adminMedicalHistory.setName( ssname );
-        adminMedicalHistory.setFirstTrial( "2" );
-        adminMedicalHistory.setAllocation( "1" );
-        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "初审通过病例列表");
+//        adminMedicalHistory.setTitle( sstitle );
+//        adminMedicalHistory.setName( ssname );
+//        adminMedicalHistory.setFirstTrial( "2" );
+//        adminMedicalHistory.setAllocation( "1" );
+//        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "初审通过病例列表");
+        String title = "初审通过病例列表";
+        // Step.1 组装查询条件
+        QueryWrapper<AdminMedicalHistory> queryWrapper = QueryGenerator.initQueryWrapper(adminMedicalHistory, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (sstitle != null){
+            queryWrapper.like( "title",sstitle );
+        }
+        if (ssname != null){
+            queryWrapper.like( "submitter_name",ssname );
+        }
+        queryWrapper.eq( "allocation","1" );
+        queryWrapper.eq( "first_trial","2" );
+        // Step.2 获取导出数据
+        List<AdminMedicalHistory> pageList = service.list(queryWrapper);
+
+
+        List<AdminMedicalHistory> exportList = null;
+
+        // 过滤选中数据
+        String selections = request.getParameter("selections");
+        if (oConvertUtils.isNotEmpty(selections)) {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+            exportList = pageList.stream().filter(item -> selectionList.contains(getId(item))).collect(Collectors.toList());
+        } else {
+            exportList = pageList;
+        }
+        int a = exportList.size();
+        for (int i = 0; i<a;i++){
+            if (exportList.get( i ).getSubmitterName()==null){
+                QueryWrapper<AdminUser> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq( "phone", exportList.get( i ).getPhone() );
+                AdminUser storeMember1 = adminUserService.getOne( queryWrapper2 );
+                exportList.get( i ).setSubmitterName( storeMember1.getName() );
+            }
+        }
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.CLASS, AdminMedicalHistory.class);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams  exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
+        exportParams.setImageBasePath(upLoadPath);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS,exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
+        return mv;
     }
     @RequestMapping(value = "/exportXls3")
     public ModelAndView exportXls3(HttpServletRequest request, AdminMedicalHistory adminMedicalHistory,String sstitle,String ssname) {
-        adminMedicalHistory.setTitle( sstitle );
-        adminMedicalHistory.setName( ssname );
-        adminMedicalHistory.setAllocation( "2" );
-        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "专家审核病例列表");
+//        adminMedicalHistory.setTitle( sstitle );
+////        adminMedicalHistory.setName( ssname );
+////        adminMedicalHistory.setAllocation( "2" );
+////        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "专家审核病例列表");
+        String title = "专家审核病例列表";
+        // Step.1 组装查询条件
+        QueryWrapper<AdminMedicalHistory> queryWrapper = QueryGenerator.initQueryWrapper(adminMedicalHistory, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (sstitle != null){
+            queryWrapper.like( "title",sstitle );
+        }
+        if (ssname != null){
+            queryWrapper.like( "submitter_name",ssname );
+        }
+        queryWrapper.eq( "allocation","2" );
+        // Step.2 获取导出数据
+        List<AdminMedicalHistory> pageList = service.list(queryWrapper);
+
+
+        List<AdminMedicalHistory> exportList = null;
+
+        // 过滤选中数据
+        String selections = request.getParameter("selections");
+        if (oConvertUtils.isNotEmpty(selections)) {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+            exportList = pageList.stream().filter(item -> selectionList.contains(getId(item))).collect(Collectors.toList());
+        } else {
+            exportList = pageList;
+        }
+        int a = exportList.size();
+        for (int i = 0; i<a;i++){
+            if (exportList.get( i ).getSubmitterName()==null){
+                QueryWrapper<AdminUser> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq( "phone", exportList.get( i ).getPhone() );
+                AdminUser storeMember1 = adminUserService.getOne( queryWrapper2 );
+                exportList.get( i ).setSubmitterName( storeMember1.getName() );
+            }
+        }
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.CLASS, AdminMedicalHistory.class);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams  exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
+        exportParams.setImageBasePath(upLoadPath);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS,exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
+        return mv;
     }
     @RequestMapping(value = "/exportXls4")
     public ModelAndView exportXls4(HttpServletRequest request, AdminMedicalHistory adminMedicalHistory,String sstitle,String ssname) {
-        adminMedicalHistory.setTitle( sstitle );
-        adminMedicalHistory.setName( ssname );
-        adminMedicalHistory.setType( "2" );
-        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "优秀病例列表");
+//        adminMedicalHistory.setTitle( sstitle );
+//        adminMedicalHistory.setName( ssname );
+//        adminMedicalHistory.setType( "2" );
+//        return super.exportXls(request, adminMedicalHistory, AdminMedicalHistory.class, "优秀病例列表");
+        String title = "优秀病例列表";
+        // Step.1 组装查询条件
+        QueryWrapper<AdminMedicalHistory> queryWrapper = QueryGenerator.initQueryWrapper(adminMedicalHistory, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (sstitle != null){
+            queryWrapper.like( "title",sstitle );
+        }
+        if (ssname != null){
+            queryWrapper.like( "submitter_name",ssname );
+        }
+        queryWrapper.eq( "type","2" );
+        // Step.2 获取导出数据
+        List<AdminMedicalHistory> pageList = service.list(queryWrapper);
+
+
+        List<AdminMedicalHistory> exportList = null;
+
+        // 过滤选中数据
+        String selections = request.getParameter("selections");
+        if (oConvertUtils.isNotEmpty(selections)) {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+            exportList = pageList.stream().filter(item -> selectionList.contains(getId(item))).collect(Collectors.toList());
+        } else {
+            exportList = pageList;
+        }
+        int a = exportList.size();
+        for (int i = 0; i<a;i++){
+            if (exportList.get( i ).getSubmitterName()==null){
+                QueryWrapper<AdminUser> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq( "phone", exportList.get( i ).getPhone() );
+                AdminUser storeMember1 = adminUserService.getOne( queryWrapper2 );
+                exportList.get( i ).setSubmitterName( storeMember1.getName() );
+            }
+        }
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.CLASS, AdminMedicalHistory.class);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams  exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
+        exportParams.setImageBasePath(upLoadPath);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS,exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
+        return mv;
     }
     /**
      * 通过excel导入数据

+ 15 - 10
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/admincasehistory/entity/AdminMedicalHistory.java

@@ -36,28 +36,32 @@ public class AdminMedicalHistory implements Serializable {
     @ApiModelProperty(value = "id")
     private String id;
 	/**提交人账号*/
-//	@Excel(name = "提交人账号", width = 15)
-    @ApiModelProperty(value = "提交人账号")
+	@Excel(name = "医生账号(手机号)", width = 15)
+    @ApiModelProperty(value = "医生账号(手机号)")
     private String phone;
+
+    @Excel(name = "医生姓名", width = 15)
+    @ApiModelProperty(value = "医生姓名")
+    private String submitterName;
 	/**分类名称*/
 	@Excel(name = "分类名称", width = 15)
     @ApiModelProperty(value = "分类名称")
     private String uploadingName;
 	/**审核人账号*/
-//	@Excel(name = "审核人账号", width = 15)
-    @ApiModelProperty(value = "审核人账号")
+	@Excel(name = "初审审核人账号", width = 15)
+    @ApiModelProperty(value = "初审审核人账号")
     private String auditor;
 	/**审核时间*/
-//	@Excel(name = "审核时间", width = 15)
-    @ApiModelProperty(value = "审核时间")
+    @Excel(name = "初审审核时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "初审审核时间")
     private Date auditorTime;
 	/**标题*/
 	@Excel(name = "标题", width = 15)
     @ApiModelProperty(value = "标题")
     private String title;
 	/**姓名*/
-	@Excel(name = "姓名", width = 15)
-    @ApiModelProperty(value = "姓名")
+	@Excel(name = "患者姓名", width = 15)
+    @ApiModelProperty(value = "患者姓名")
     private String name;
 	/**省份*/
 	@Excel(name = "省份", width = 15)
@@ -76,10 +80,10 @@ public class AdminMedicalHistory implements Serializable {
     @ApiModelProperty(value = "病历类型")
     private String caseName;
 	/**拍照图片*/
-	@Excel(name = "拍照图片(修改或者不修改看到的图片)", width = 15)
+	@Excel(name = "修改后的图片地址", width = 15)
     @ApiModelProperty(value = "拍照图片(修改或者不修改看到的图片)")
     private String pic;
-//	@Excel(name = "不变的图片(上传的图片)", width = 15)
+	@Excel(name = "修改前的图片地址", width = 15)
     @ApiModelProperty(value = "不变的图片(上传的图片)")
     private String picTwo;
 	/**图片识别文字*/
@@ -115,6 +119,7 @@ public class AdminMedicalHistory implements Serializable {
     @ApiModelProperty(value = "创建人")
     private String createBy;
 	/**创建时间*/
+    @Excel(name = "医生病例创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 	/**更新人*/

+ 2 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/entity/AdminUser.java

@@ -114,4 +114,6 @@ public class AdminUser implements Serializable {
     private String wisMhu;
     @ApiModelProperty(value = "是否允许问卷调查1允许 2不允许")
     private String wisWjdc;
+    @ApiModelProperty(value = "是否允许问卷2调查1允许 2不允许")
+    private String wisWjdc2;
 }

+ 591 - 4
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc/controller/AdminTopicController.java

@@ -15,13 +15,12 @@ import net.sf.json.JSONArray;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.shiro.SecurityUtils;
+import org.checkerframework.checker.units.qual.A;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.adminwjdc.entity.AdminTopic;
-import org.jeecg.modules.adminwjdc.entity.AdminTopic2;
-import org.jeecg.modules.adminwjdc.entity.AdminTopic3;
+import org.jeecg.modules.adminwjdc.entity.*;
 import org.jeecg.modules.adminwjdc.service.IAdminTopicService;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -35,6 +34,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -117,7 +117,7 @@ public class AdminTopicController extends JeecgController<AdminTopic, IAdminTopi
 		adminTopicService.updateById(adminTopic);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -344,6 +344,593 @@ public class AdminTopicController extends JeecgController<AdminTopic, IAdminTopi
 		 return mv;
 	 }
 
+	 @RequestMapping(value = "/exportXls")
+	 public ModelAndView exportXls1(HttpServletRequest request, AdminTopic adminTopic,String ssusername,String sstopic) {
+		 // Step.1 组装查询条件查询数据
+//		 QueryWrapper<AdminTopic> queryWrapper = QueryGenerator.initQueryWrapper( adminTopic, request.getParameterMap() );
+		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//		 if (ssusername != null){
+//			 queryWrapper.like("username",ssusername);
+//		 }
+//		 if (sstopic != null){
+//			 queryWrapper.like("topic",sstopic);
+//		 }
+		 //Step.2 获取导出数据
+//		 List<AdminTopic> queryList = adminTopicService.list( queryWrapper );
+		 // 过滤选中数据
+		 String selections = request.getParameter( "selections" );
+		 List<AdminTopic> adminTopics = new ArrayList<AdminTopic>();
+		 List<AdminTopic4> adminTopics4 = new ArrayList<AdminTopic4>();
+		 if (oConvertUtils.isEmpty( selections )) {
+//			 adminTopics = queryList;
+		 } else {
+			 List<String> selectionList = Arrays.asList( selections.split( "," ) );
+//			 adminTopics = queryList.stream().filter( item -> selectionList.contains( item.getId() ) ).collect( Collectors.toList() );
+
+			 QueryWrapper<AdminTopic> queryWrapper = new QueryWrapper<>(  );
+			 queryWrapper.in( "id", selectionList);
+			 List<AdminTopic> queryList = adminTopicService.list( queryWrapper );
+			 adminTopics = queryList;
+		 }
+		 //下面对数据做处理
+//		 转成AdminTopic4对象的类型
+		 int a = adminTopics.size();
+		 for (int i=0;i<a;i++){
+			 AdminTopic4 adminTopic4 = new AdminTopic4();
+			 adminTopic4.setXuhao( i+1 );
+			 adminTopic4.setName( adminTopics.get( i ).getUsername() );
+			 adminTopic4.setPhone( adminTopics.get( i ).getPhone() );
+			 adminTopic4.setHospital( adminTopics.get( i ).getHospital() );
+			 adminTopic4.setOutpatientServiceTime( adminTopics.get( i ).getOutpatientServiceTime() );
+			 adminTopic4.setCreateTime( adminTopics.get( i ).getCreateTime() );
+			 String s = adminTopics.get( i ).getTopicTop();
+			 String numStr = s.substring(s.indexOf("人数") + 3, s.indexOf("(人)"));
+			 adminTopic4.setDiaoyan( numStr );
+
+			 String topic = adminTopics.get( i ).getTopicTwo();
+			 String res = StringEscapeUtils.unescapeJava(topic);
+			 List<AdminTopic2> exportList = null;
+			 JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
+			 exportList = JSONArray.toList(jsonArray,AdminTopic2.class);
+			 //1、
+			 AdminTopic2 adminTopic1 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "1、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic1 != null) {
+				 String[] split = adminTopic1.getTopicD().split( "," );
+				 adminTopic4.setA1( split[0] );
+				 adminTopic4.setA2( split[1] );
+			 } else {
+				 adminTopic4.setA1( "" );
+				 adminTopic4.setA2( "" );
+			 }
+			 //2、
+			 AdminTopic2 adminTopic2 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "2、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic2 != null) {
+				 String[] split = adminTopic2.getTopicD().split( "," );
+				 adminTopic4.setB1( split[0] );
+				 adminTopic4.setB2( split[1] );
+				 adminTopic4.setB3( split[2] );
+				 adminTopic4.setB4( split[3] );
+			 } else {
+				 adminTopic4.setB1( "" );
+				 adminTopic4.setB2( "" );
+				 adminTopic4.setB3( "" );
+				 adminTopic4.setB4( "" );
+			 }
+			 //3、
+			 AdminTopic2 adminTopic3 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "3、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic3 != null) {
+				 String[] split = adminTopic3.getTopicD().split( "," );
+				 adminTopic4.setC1( split[0] );
+				 adminTopic4.setC2( split[1] );
+				 adminTopic4.setC3( split[2] );
+				 adminTopic4.setC4( split[3] );
+			 } else {
+				 adminTopic4.setC1( "" );
+				 adminTopic4.setC2( "" );
+				 adminTopic4.setC3( "" );
+				 adminTopic4.setC4( "" );
+			 }
+			 //4、
+			 AdminTopic2 adminTopic44 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "4、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic44 != null) {
+				 String[] split = adminTopic44.getTopicD().split( "," );
+				 adminTopic4.setD1( split[0] );
+				 adminTopic4.setD2( split[1] );
+				 adminTopic4.setD3( split[2] );
+				 adminTopic4.setD4( split[3] );
+				 adminTopic4.setD5( split[4] );
+				 adminTopic4.setD6( split[5] );
+				 adminTopic4.setD7( split[6] );
+				 adminTopic4.setD8( split[7] );
+			 } else {
+				 adminTopic4.setD1( "" );
+				 adminTopic4.setD2( "" );
+				 adminTopic4.setD3( "" );
+				 adminTopic4.setD4( "" );
+				 adminTopic4.setD5( "" );
+				 adminTopic4.setD6( "" );
+				 adminTopic4.setD7( "" );
+				 adminTopic4.setD8( "" );
+			 }
+			 //5、
+			 AdminTopic2 adminTopic5 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "5、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic5 != null) {
+				 String[] split = adminTopic5.getTopicD().split( "," );
+				 adminTopic4.setE1( split[0] );
+			 } else {
+				 adminTopic4.setE1( "" );
+			 }
+			 //6、
+			 AdminTopic2 adminTopic6 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "6、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic6 != null) {
+				 String[] split = adminTopic6.getTopicD().split( "," );
+				 adminTopic4.setF1( split[0] );
+				 adminTopic4.setF2( split[1] );
+			 } else {
+				 adminTopic4.setF1( "" );
+				 adminTopic4.setF2( "" );
+			 }
+			 //7、
+			 AdminTopic2 adminTopic7 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "7、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic7 != null) {
+				 String[] split = adminTopic7.getTopicD().split( "," );
+				 adminTopic4.setG1( split[0] );
+				 adminTopic4.setG2( split[1] );
+				 adminTopic4.setG3( split[2] );
+				 adminTopic4.setG4( split[3] );
+				 adminTopic4.setG5( split[4] );
+				 adminTopic4.setG6( split[5] );
+				 adminTopic4.setG7( split[6] );
+				 adminTopic4.setG8( split[7] );
+				 adminTopic4.setG9( split[8] );
+				 adminTopic4.setG10( split[9] );
+				 adminTopic4.setG11( split[10] );
+				 adminTopic4.setG12( split[11] );
+			 } else {
+				 adminTopic4.setG1( "" );
+				 adminTopic4.setG2( "" );
+				 adminTopic4.setG3( "" );
+				 adminTopic4.setG4( "" );
+				 adminTopic4.setG5( "" );
+				 adminTopic4.setG6( "" );
+				 adminTopic4.setG7( "" );
+				 adminTopic4.setG8( "" );
+				 adminTopic4.setG9( "" );
+				 adminTopic4.setG10( "" );
+				 adminTopic4.setG11( "" );
+				 adminTopic4.setG12( "" );
+			 }
+			 //8、
+			 AdminTopic2 adminTopic8 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "8、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic8 != null) {
+				 String[] split = adminTopic8.getTopicD().split( "," );
+				 adminTopic4.setH1( split[0] );
+				 adminTopic4.setH2( split[1] );
+				 adminTopic4.setH3( split[2] );
+				 adminTopic4.setH4( split[3] );
+				 adminTopic4.setH5( split[4] );
+				 adminTopic4.setH6( split[5] );
+				 adminTopic4.setH7( split[6] );
+				 adminTopic4.setH8( split[7] );
+			 } else {
+				 adminTopic4.setH1( "" );
+				 adminTopic4.setH2( "" );
+				 adminTopic4.setH3( "" );
+				 adminTopic4.setH4( "" );
+				 adminTopic4.setH5( "" );
+				 adminTopic4.setH6( "" );
+				 adminTopic4.setH7( "" );
+				 adminTopic4.setH8( "" );
+			 }
+			 //9、
+			 AdminTopic2 adminTopic9 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "9、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic9 != null) {
+				 String[] split = adminTopic9.getTopicD().split( "," );
+				 adminTopic4.setI1( split[0] );
+			 } else {
+				 adminTopic4.setI1( "" );
+			 }
+			 //10、
+			 AdminTopic2 adminTopic10 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "10、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic10 != null) {
+				 String[] split = adminTopic10.getTopicD().split( "," );
+				 adminTopic4.setJ1( split[0] );
+			 } else {
+				 adminTopic4.setJ1( "" );
+			 }
+			 //11、
+			 AdminTopic2 adminTopic11 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "11、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic11 != null) {
+				 String[] split = adminTopic11.getTopicD().split( "," );
+				 adminTopic4.setK1( split[0] );
+				 adminTopic4.setK2( split[1] );
+				 adminTopic4.setK3( split[2] );
+				 adminTopic4.setK4( split[3] );
+				 adminTopic4.setK5( split[4] );
+				 adminTopic4.setK6( split[5] );
+				 adminTopic4.setK7( split[6] );
+				 adminTopic4.setK8( split[7] );
+				 adminTopic4.setK9( split[8] );
+				 adminTopic4.setK10( split[9] );
+			 } else {
+				 adminTopic4.setK1( "" );
+				 adminTopic4.setK2( "" );
+				 adminTopic4.setK3( "" );
+				 adminTopic4.setK4( "" );
+				 adminTopic4.setK5( "" );
+				 adminTopic4.setK6( "" );
+				 adminTopic4.setK7( "" );
+				 adminTopic4.setK8( "" );
+				 adminTopic4.setK9( "" );
+				 adminTopic4.setK10( "" );
+			 }
+			 //12、
+			 AdminTopic2 adminTopic12 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "12、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic12 != null) {
+				 String[] split = adminTopic12.getTopicD().split( "," );
+				 if (split[0].equals( "是" )){
+					 adminTopic4.setL1( split[0] );
+					 adminTopic4.setL2( "" );
+					 adminTopic4.setL3( "" );
+					 adminTopic4.setL4( "" );
+					 adminTopic4.setL5( "" );
+				 }else {
+					 adminTopic4.setL1( split[0] );
+					 adminTopic4.setL2( split[1] );
+					 adminTopic4.setL3( split[2] );
+					 adminTopic4.setL4( split[3] );
+					 adminTopic4.setL5( split[4] );
+				 }
+			 } else {
+				 adminTopic4.setL1( "" );
+				 adminTopic4.setL2( "" );
+				 adminTopic4.setL3( "" );
+				 adminTopic4.setL4( "" );
+				 adminTopic4.setL5( "" );
+			 }
+			 //13、
+			 AdminTopic2 adminTopic13 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "13、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic13 != null) {
+				 String[] split = adminTopic13.getTopicD().split( "," );
+				 adminTopic4.setM1( split[0] );
+				 adminTopic4.setM2( split[1] );
+				 adminTopic4.setM3( split[2] );
+				 adminTopic4.setM4( split[3] );
+				 adminTopic4.setM5( split[4] );
+				 adminTopic4.setM6( split[5] );
+
+			 } else {
+				 adminTopic4.setM1( "" );
+				 adminTopic4.setM2( "" );
+				 adminTopic4.setM3( "" );
+				 adminTopic4.setM4( "" );
+				 adminTopic4.setM5( "" );
+				 adminTopic4.setM6( "" );
+			 }
+			 //14、
+			 AdminTopic2 adminTopic14 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "14、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic14 != null) {
+				 String[] split = adminTopic14.getTopicD().split( "," );
+				 adminTopic4.setN1( split[0] );
+			 } else {
+				 adminTopic4.setN1( "" );
+			 }
+			 //15、
+			 AdminTopic2 adminTopic15 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "15、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic15 != null) {
+				 String[] split = adminTopic15.getTopicD().split( "," );
+				 adminTopic4.setO1( split[0] );
+				 adminTopic4.setO2( split[1] );
+				 adminTopic4.setO3( split[2] );
+			 } else {
+				 adminTopic4.setO1( "" );
+				 adminTopic4.setO2( "" );
+				 adminTopic4.setO3( "" );
+			 }
+			 //16、
+			 AdminTopic2 adminTopic16 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "16、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic16 != null) {
+				 String[] split = adminTopic16.getTopicD().split( "," );
+				 adminTopic4.setP1( split[0] );
+				 adminTopic4.setP2( split[1] );
+				 adminTopic4.setP3( split[2] );
+				 adminTopic4.setP4( split[3] );
+				 adminTopic4.setP5( split[4] );
+
+			 } else {
+				 adminTopic4.setP1( "" );
+				 adminTopic4.setP2( "" );
+				 adminTopic4.setP3( "" );
+				 adminTopic4.setP4( "" );
+				 adminTopic4.setP5( "" );
+			 }
+			 //17、
+			 AdminTopic2 adminTopic17 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "17、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic17 != null) {
+				 String[] split = adminTopic17.getTopicD().split( "," );
+				 adminTopic4.setQ1( split[0] );
+				 adminTopic4.setQ2( split[1] );
+				 adminTopic4.setQ3( split[2] );
+				 adminTopic4.setQ4( split[3] );
+				 adminTopic4.setQ5( split[4] );
+				 adminTopic4.setQ6( split[5] );
+
+			 } else {
+				 adminTopic4.setQ1( "" );
+				 adminTopic4.setQ2( "" );
+				 adminTopic4.setQ3( "" );
+				 adminTopic4.setQ4( "" );
+				 adminTopic4.setQ5( "" );
+				 adminTopic4.setQ6( "" );
+			 }
+			 //18、
+			 AdminTopic2 adminTopic18 = exportList.stream()
+					 .filter( p -> p.getTopicT().matches( "18、" + ".*" ) )
+					 .findFirst()
+					 .orElse( null );
+
+			 if (adminTopic18 != null) {
+				 String[] split = adminTopic18.getTopicD().split( "," );
+				 adminTopic4.setX1( split[0] );
+			 } else {
+				 adminTopic4.setX1( "" );
+			 }
+			 adminTopics4.add( adminTopic4 );
+		 }
+
+		 // Step.4 AutoPoi 导出Excel
+		 ModelAndView mv = new ModelAndView( new JeecgEntityExcelView() );
+		 mv.addObject( NormalExcelConstants.FILE_NAME, "问卷调查列表" );
+		 mv.addObject( NormalExcelConstants.CLASS, AdminTopic4.class );
+		 mv.addObject( NormalExcelConstants.PARAMS, new ExportParams( "问卷调查数据", "导出人:" + sysUser.getRealname(), "问卷调查" ) );
+		 mv.addObject( NormalExcelConstants.DATA_LIST, adminTopics4 );
+		 return mv;
+	 }
+
+
+//	 @RequestMapping(value = "/exportXls")
+//	 public ModelAndView exportXls1(HttpServletRequest request, AdminTopic adminTopic,String ssusername,String sstopic) {
+//		 // Step.1 组装查询条件查询数据
+//		 QueryWrapper<AdminTopic> queryWrapper = QueryGenerator.initQueryWrapper( adminTopic, request.getParameterMap() );
+//		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//		 if (ssusername != null){
+//			 queryWrapper.like("username",ssusername);
+//		 }
+//		 if (sstopic != null){
+//			 queryWrapper.like("topic",sstopic);
+//		 }
+//		 //Step.2 获取导出数据
+//		 List<AdminTopic> queryList = adminTopicService.list( queryWrapper );
+//		 // 过滤选中数据
+//		 String selections = request.getParameter( "selections" );
+//		 List<AdminTopic> adminTopics = new ArrayList<AdminTopic>();
+//		 List<AdminTopic4> adminTopics4 = new ArrayList<AdminTopic4>();
+//		 if (oConvertUtils.isEmpty( selections )) {
+//			 adminTopics = queryList;
+//		 } else {
+//			 List<String> selectionList = Arrays.asList( selections.split( "," ) );
+//			 adminTopics = queryList.stream().filter( item -> selectionList.contains( item.getId() ) ).collect( Collectors.toList() );
+//		 }
+//		 //下面对数据做处理
+////		 转成AdminTopic4对象的类型
+//		 int a = adminTopics.size();
+//		 for (int i=0;i<a;i++){
+//			 AdminTopic4 adminTopic4 = new AdminTopic4();
+//			 adminTopic4.setXuhao( i+1 );
+//			 adminTopic4.setName( adminTopics.get( i ).getUsername() );
+//			 adminTopic4.setPhone( adminTopics.get( i ).getPhone() );
+//			 adminTopic4.setHospital( adminTopics.get( i ).getHospital() );
+//			 adminTopic4.setOutpatientServiceTime( adminTopics.get( i ).getOutpatientServiceTime() );
+//			 adminTopic4.setCreateTime( adminTopics.get( i ).getCreateTime() );
+//
+//			 String topic = adminTopics.get( i ).getTopicTwo();
+//			 String res = StringEscapeUtils.unescapeJava(topic);
+//			 List<AdminTopic2> exportList = null;
+//			 JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
+//			 exportList = JSONArray.toList(jsonArray,AdminTopic2.class);
+//			 for (int j = 0; j <exportList.size() ; j++) {
+//				 String str1 = exportList.get( j ).getTopicT();
+//				 if(str1.contains("1、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setA1( split[0] );
+//					 adminTopic4.setA2( split[1] );
+//				 }else{
+//					 adminTopic4.setA1( "" );
+//					 adminTopic4.setA2( "" );
+//				 }
+//				 if(str1.contains("2、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setB1( split[0] );
+//					 adminTopic4.setB2( split[1] );
+//					 adminTopic4.setB3( split[2] );
+//					 adminTopic4.setB4( split[3] );
+//				 }else{
+//					 adminTopic4.setB1( "" );
+//					 adminTopic4.setB2( "" );
+//					 adminTopic4.setB3( "" );
+//					 adminTopic4.setB4( "" );
+//				 }
+//				 if(str1.contains("3、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setC1( split[0] );
+//					 adminTopic4.setC2( split[1] );
+//					 adminTopic4.setC3( split[2] );
+//					 adminTopic4.setC4( split[3] );
+//				 }else{
+//					 adminTopic4.setC1( "" );
+//					 adminTopic4.setC2( "" );
+//					 adminTopic4.setC3( "" );
+//					 adminTopic4.setC4( "" );
+//				 }
+//				 if(str1.contains("4、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setD1( split[0] );
+//					 adminTopic4.setD2( split[1] );
+//					 adminTopic4.setD3( split[2] );
+//					 adminTopic4.setD4( split[3] );
+//					 adminTopic4.setD5( split[4] );
+//					 adminTopic4.setD6( split[5] );
+//					 adminTopic4.setD7( split[6] );
+//					 adminTopic4.setD8( split[7] );
+//				 }else{
+//					 adminTopic4.setD1( "" );
+//					 adminTopic4.setD2( "" );
+//					 adminTopic4.setD3( "" );
+//					 adminTopic4.setD4( "" );
+//					 adminTopic4.setD5( "" );
+//					 adminTopic4.setD6( "" );
+//					 adminTopic4.setD7( "" );
+//					 adminTopic4.setD8( "" );
+//				 }
+//				 if(str1.contains("5、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setE1( split[0] );
+//				 }else{
+//					 adminTopic4.setE1( "" );
+//				 }
+//				 if(str1.contains("6、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setF1( split[0] );
+//					 adminTopic4.setF2( split[1] );
+//				 }else{
+//					 adminTopic4.setF1( "" );
+//					 adminTopic4.setF2( "" );
+//				 }
+//				 if(str1.contains("7、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setG1( split[0] );
+//					 adminTopic4.setG2( split[1] );
+//					 adminTopic4.setG3( split[2] );
+//					 adminTopic4.setG4( split[3] );
+//					 adminTopic4.setG5( split[4] );
+//					 adminTopic4.setG6( split[5] );
+//					 adminTopic4.setG7( split[6] );
+//					 adminTopic4.setG8( split[7] );
+//					 adminTopic4.setG9( split[8] );
+//					 adminTopic4.setG10( split[9] );
+//					 adminTopic4.setG11( split[10] );
+//					 adminTopic4.setG12( split[11] );
+//				 }else{
+//					 adminTopic4.setG1( "" );
+//					 adminTopic4.setG2( "" );
+//					 adminTopic4.setG3( "" );
+//					 adminTopic4.setG4( "" );
+//					 adminTopic4.setG5( "" );
+//					 adminTopic4.setG6( "" );
+//					 adminTopic4.setG7( "" );
+//					 adminTopic4.setG8( "" );
+//					 adminTopic4.setG9( "" );
+//					 adminTopic4.setG10( "" );
+//					 adminTopic4.setG11( "" );
+//					 adminTopic4.setG12( "" );
+//				 }
+//				 if(str1.contains("8、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setH1( split[0] );
+//					 adminTopic4.setH2( split[1] );
+//					 adminTopic4.setH3( split[2] );
+//					 adminTopic4.setH4( split[3] );
+//					 adminTopic4.setH5( split[4] );
+//					 adminTopic4.setH6( split[5] );
+//					 adminTopic4.setH7( split[6] );
+//					 adminTopic4.setH8( split[7] );
+//				 }else{
+//					 adminTopic4.setH1( "" );
+//					 adminTopic4.setH2( "" );
+//					 adminTopic4.setH3( "" );
+//					 adminTopic4.setH4( "" );
+//					 adminTopic4.setH5( "" );
+//					 adminTopic4.setH6( "" );
+//					 adminTopic4.setH7( "" );
+//					 adminTopic4.setH8( "" );
+//				 }
+//				 if(str1.contains("9、")){
+//					 String[] split = exportList.get( j ).getTopicD().split( "," );
+//					 adminTopic4.setI1( split[0] );
+//				 }else{
+//					 adminTopic4.setI1( "" );
+//				 }
+//			 }
+//			 adminTopics4.add( adminTopic4 );
+//		 }
+//
+//		 // Step.4 AutoPoi 导出Excel
+//		 ModelAndView mv = new ModelAndView( new JeecgEntityExcelView() );
+//		 mv.addObject( NormalExcelConstants.FILE_NAME, "问卷调查列表" );
+//		 mv.addObject( NormalExcelConstants.CLASS, AdminTopic4.class );
+//		 mv.addObject( NormalExcelConstants.PARAMS, new ExportParams( "问卷调查数据", "导出人:" + sysUser.getRealname(), "问卷调查" ) );
+//		 mv.addObject( NormalExcelConstants.DATA_LIST, adminTopics4 );
+//		 return mv;
+//	 }
+
 	 private String getId(AdminTopic2 item) {
 		 try {
 			 return PropertyUtils.getProperty(item, "id").toString();

+ 10 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc/entity/AdminTopic.java

@@ -49,7 +49,17 @@ public class AdminTopic implements Serializable {
 	@Excel(name = "提交人", width = 15)
     @ApiModelProperty(value = "提交人")
     private String username;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "医院")
+    private String hospital;
+
+    @ApiModelProperty(value = "门诊日期")
+    private String outpatientServiceTime;
 	/**提交时间*/
     @ApiModelProperty(value = "提交时间")
     private Date createTime;
+
 }

+ 276 - 667
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/controller/AdminTopicController2.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.adminwjdc2.controller;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -27,203 +28,204 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.security.oauth2.resource.IssuerUriCondition;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.jeecg.common.aspect.annotation.AutoLog;
 
- /**
+/**
  * @Description: 问卷调查
  * @Author: jeecg-boot
- * @Date:   2023-02-25
+ * @Date: 2023-02-25
  * @Version: V1.0
  */
-@Api(tags="问卷调查二")
+@Api(tags = "问卷调查二")
 @RestController
 @RequestMapping("/adminwjdc2/adminTopic2")
 @Slf4j
 public class AdminTopicController2 extends JeecgController<AdminTopicTwo, IAdminTopicaTwoService> {
-	@Autowired
-	private IAdminTopicaTwoService adminTopicService;
-
-	/**
-	 * 分页列表查询
-	 *
-	 * @param adminTopic
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "问卷调查-分页列表查询")
-	@ApiOperation(value="问卷调查二-分页列表查询", notes="问卷调查二-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<AdminTopicTwo>> queryPageList(AdminTopicTwo adminTopic,
-													  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-													  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-													  HttpServletRequest req, String ssusername, String sstopic) {
-		QueryWrapper<AdminTopicTwo> queryWrapper = QueryGenerator.initQueryWrapper(adminTopic, req.getParameterMap());
-		if (ssusername != null){
-			queryWrapper.like("username",ssusername);
-		}
-		if (sstopic != null){
-			queryWrapper.like("topic",sstopic);
-		}
-		Page<AdminTopicTwo> page = new Page<AdminTopicTwo>(pageNo, pageSize);
-		IPage<AdminTopicTwo> pageList = adminTopicService.page(page, queryWrapper);
+    @Autowired
+    private IAdminTopicaTwoService adminTopicService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param adminTopic
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "问卷调查-分页列表查询")
+    @ApiOperation(value = "问卷调查二-分页列表查询", notes = "问卷调查二-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<AdminTopicTwo>> queryPageList(AdminTopicTwo adminTopic,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req, String ssusername, String sstopic, Date createTime[]) {
+        QueryWrapper<AdminTopicTwo> queryWrapper = QueryGenerator.initQueryWrapper(adminTopic, req.getParameterMap());
+        if (ssusername != null) {
+            queryWrapper.like("username", ssusername);
+        }
+        if (sstopic != null) {
+            queryWrapper.like("topic", sstopic);
+        }
+        Page<AdminTopicTwo> page = new Page<AdminTopicTwo>(pageNo, pageSize);
+        IPage<AdminTopicTwo> pageList = adminTopicService.page(page, queryWrapper);
 //		for (int i = 0;i<pageList.getRecords().size();i++){
 //
 //		}
-		return Result.OK(pageList);
-
-	}
-
-	/**
-	 *   添加
-	 *
-	 * @param adminTopic
-	 * @return
-	 */
-	@AutoLog(value = "问卷调查二-添加")
-	@ApiOperation(value="问卷调查二-添加", notes="问卷调查二-添加")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody AdminTopicTwo adminTopic) {
-		adminTopicService.save(adminTopic);
-		return Result.OK("添加成功!");
-	}
-
-	/**
-	 *  编辑
-	 *
-	 * @param adminTopic
-	 * @return
-	 */
-	@AutoLog(value = "问卷调查二-编辑")
-	@ApiOperation(value="问卷调查二-编辑", notes="问卷调查二-编辑")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody AdminTopicTwo adminTopic) {
-		adminTopicService.updateById(adminTopic);
-		return Result.OK("编辑成功!");
-	}
-
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "问卷调查二-通过id删除")
-	@ApiOperation(value="问卷调查二-通过id删除", notes="问卷调查二-通过id删除")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		adminTopicService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "问卷调查二-批量删除")
-	@ApiOperation(value="问卷调查二-批量删除", notes="问卷调查二-批量删除")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.adminTopicService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "问卷调查-通过id查询")
-	@ApiOperation(value="问卷调查二-通过id查询", notes="问卷调查二-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<AdminTopicTwo> queryById(@RequestParam(name="id",required=true) String id) {
-		AdminTopicTwo adminTopic = adminTopicService.getById(id);
-		if(adminTopic==null) {
-			return Result.error("未找到对应数据",null);
-		}
-		return Result.OK(adminTopic);
-	}
+        return Result.OK(pageList);
+
+    }
+
+    /**
+     * 添加
+     *
+     * @param adminTopic
+     * @return
+     */
+    @AutoLog(value = "问卷调查二-添加")
+    @ApiOperation(value = "问卷调查二-添加", notes = "问卷调查二-添加")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody AdminTopicTwo adminTopic) {
+        adminTopicService.save(adminTopic);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param adminTopic
+     * @return
+     */
+    @AutoLog(value = "问卷调查二-编辑")
+    @ApiOperation(value = "问卷调查二-编辑", notes = "问卷调查二-编辑")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody AdminTopicTwo adminTopic) {
+        adminTopicService.updateById(adminTopic);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "问卷调查二-通过id删除")
+    @ApiOperation(value = "问卷调查二-通过id删除", notes = "问卷调查二-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        adminTopicService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "问卷调查二-批量删除")
+    @ApiOperation(value = "问卷调查二-批量删除", notes = "问卷调查二-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.adminTopicService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "问卷调查-通过id查询")
+    @ApiOperation(value = "问卷调查二-通过id查询", notes = "问卷调查二-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<AdminTopicTwo> queryById(@RequestParam(name = "id", required = true) String id) {
+        AdminTopicTwo adminTopic = adminTopicService.getById(id);
+        if (adminTopic == null) {
+            return Result.error("未找到对应数据", null);
+        }
+        return Result.OK(adminTopic);
+    }
 
     /**
-    * 导出excel
-    */
+     * 导出excel
+     */
     @RequestMapping(value = "/exportXls/{id}")
     public ModelAndView exportXls(@PathVariable String id) {
 //        return super.exportXls(request, adminTopic, AdminTopic.class, "问卷调查");
 //		QueryWrapper<AdminTopic2> queryWrapper = new QueryWrapper<>(  );
-		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		AdminTopicTwo adminTopic = adminTopicService.getById(id);
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        AdminTopicTwo adminTopic = adminTopicService.getById(id);
 //		String title = adminTopic.getTopicTop();
-		String title = adminTopic.getTopicTop();
-		String topic = adminTopic.getTopicTwo();
-		String res = StringEscapeUtils.unescapeJava(topic);
+        String title = adminTopic.getTopicTop();
+        String topic = adminTopic.getTopicTwo();
+        String res = StringEscapeUtils.unescapeJava(topic);
 //		String topic = "[{\"topicT\":\"题目1\",\"topicD\":\"答案\"}]";
-		// Step.2 获取导出数据
-		List<AdminTopicTwo2> exportList = null;
-		List<AdminTopicTwo3> exportList3 = new ArrayList<>(  );
-		JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
-		exportList = JSONArray.toList(jsonArray, AdminTopicTwo2.class);
-
-		for (int i = 0;i<exportList.size();i++){
-			AdminTopicTwo3 adminTopic3 = new AdminTopicTwo3();
-			adminTopic3.setTopicT( exportList.get( i ).getTopicT() );
-			List<String> result = Arrays.asList(exportList.get( i ).getTopicD().split(","));
-			adminTopic3.setA( "" );
-			adminTopic3.setB( "" );
-			adminTopic3.setC( "" );
-			adminTopic3.setD( "" );
-			adminTopic3.setE( "" );
-			adminTopic3.setF( "" );
-			adminTopic3.setG( "" );
-			adminTopic3.setH( "" );
-			adminTopic3.setI( "" );
-			adminTopic3.setJ( "" );
-			adminTopic3.setK( "" );
-			adminTopic3.setL( "" );
+        // Step.2 获取导出数据
+        List<AdminTopicTwo2> exportList = null;
+        List<AdminTopicTwo3> exportList3 = new ArrayList<>();
+        JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
+        exportList = JSONArray.toList(jsonArray, AdminTopicTwo2.class);
+
+        for (int i = 0; i < exportList.size(); i++) {
+            AdminTopicTwo3 adminTopic3 = new AdminTopicTwo3();
+            adminTopic3.setTopicT(exportList.get(i).getTopicT());
+            List<String> result = Arrays.asList(exportList.get(i).getTopicD().split(","));
+            adminTopic3.setA("");
+            adminTopic3.setB("");
+            adminTopic3.setC("");
+            adminTopic3.setD("");
+            adminTopic3.setE("");
+            adminTopic3.setF("");
+            adminTopic3.setG("");
+            adminTopic3.setH("");
+            adminTopic3.setI("");
+            adminTopic3.setJ("");
+            adminTopic3.setK("");
+            adminTopic3.setL("");
 //			exportList3.add( adminTopic3 );
 
-			for (int j = 0;j<result.size();j++){
-				if (j == 0){
-					adminTopic3.setA( result.get( 0 ) );
-				}else if (j == 1){
-					adminTopic3.setB( result.get( 1 ) );
-				}else if (j == 2){
-					adminTopic3.setC( result.get( 2 ) );
-				}else if (j == 3){
-					adminTopic3.setD( result.get( 3 ) );
-				}else if (j == 4){
-					adminTopic3.setE( result.get( 4 ) );
-				}else if (j == 5){
-					adminTopic3.setF( result.get( 5 ) );
-				}else if (j == 6){
-					adminTopic3.setG( result.get( 6 ) );
-				}else if (j == 7){
-					adminTopic3.setH( result.get( 7 ) );
-				}else if (j == 8){
-					adminTopic3.setI( result.get( 8 ) );
-				}else if (j == 9){
-					adminTopic3.setJ( result.get( 9 ) );
-				}else if (j == 10){
-					adminTopic3.setK( result.get( 10 ) );
-				}else if (j == 11){
-					adminTopic3.setL( result.get( 11 ) );
-				}
-			}
-			exportList3.add( adminTopic3 );
-		}
+            for (int j = 0; j < result.size(); j++) {
+                if (j == 0) {
+                    adminTopic3.setA(result.get(0));
+                } else if (j == 1) {
+                    adminTopic3.setB(result.get(1));
+                } else if (j == 2) {
+                    adminTopic3.setC(result.get(2));
+                } else if (j == 3) {
+                    adminTopic3.setD(result.get(3));
+                } else if (j == 4) {
+                    adminTopic3.setE(result.get(4));
+                } else if (j == 5) {
+                    adminTopic3.setF(result.get(5));
+                } else if (j == 6) {
+                    adminTopic3.setG(result.get(6));
+                } else if (j == 7) {
+                    adminTopic3.setH(result.get(7));
+                } else if (j == 8) {
+                    adminTopic3.setI(result.get(8));
+                } else if (j == 9) {
+                    adminTopic3.setJ(result.get(9));
+                } else if (j == 10) {
+                    adminTopic3.setK(result.get(10));
+                } else if (j == 11) {
+                    adminTopic3.setL(result.get(11));
+                }
+            }
+            exportList3.add(adminTopic3);
+        }
 
 //		List<AdminTopic2> exportList = null;
 
 
-		// 过滤选中数据
+        // 过滤选中数据
 //		String selections = request.getParameter("selections");
 //		if (oConvertUtils.isNotEmpty(selections)) {
 //			List<String> selectionList = Arrays.asList(selections.split(","));
@@ -232,87 +234,87 @@ public class AdminTopicController2 extends JeecgController<AdminTopicTwo, IAdmin
 //			exportList = pageList;
 //		}
 
-		// Step.3 AutoPoi 导出Excel
-		ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-		mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
-		mv.addObject(NormalExcelConstants.CLASS, AdminTopicTwo3.class);
-		//update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
-		ExportParams  exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
-		//update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
-		mv.addObject(NormalExcelConstants.PARAMS,exportParams);
-		mv.addObject(NormalExcelConstants.DATA_LIST, exportList3);
-		return mv;
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.CLASS, AdminTopicTwo3.class);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS, exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList3);
+        return mv;
     }
 
-	 @RequestMapping(value = "/exportXls2/{id}")
-	 public ModelAndView exportXls2(@PathVariable String id) {
+    @RequestMapping(value = "/exportXls2/{id}")
+    public ModelAndView exportXls2(@PathVariable String id) {
 //        return super.exportXls(request, adminTopic, AdminTopic.class, "问卷调查");
 //		QueryWrapper<AdminTopic2> queryWrapper = new QueryWrapper<>(  );
-		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		 AdminTopicTwo adminTopic = adminTopicService.getById(id);
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        AdminTopicTwo adminTopic = adminTopicService.getById(id);
 //		String title = adminTopic.getTopicTop();
-		 String title = adminTopic.getTopicTop();
-		 String topic = adminTopic.getTopic();
-		 String res = StringEscapeUtils.unescapeJava(topic);
+        String title = adminTopic.getTopicTop();
+        String topic = adminTopic.getTopic();
+        String res = StringEscapeUtils.unescapeJava(topic);
 //		String topic = "[{\"topicT\":\"题目1\",\"topicD\":\"答案\"}]";
-		 // Step.2 获取导出数据
-		 List<AdminTopicTwo2> exportList = null;
-		 List<AdminTopicTwo3> exportList3 = new ArrayList<>(  );
-		 JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
-		 exportList = JSONArray.toList(jsonArray, AdminTopicTwo2.class);
-
-		 for (int i = 0;i<exportList.size();i++){
-			 AdminTopicTwo3 adminTopic3 = new AdminTopicTwo3();
-			 adminTopic3.setTopicT( exportList.get( i ).getTopicT() );
-			 List<String> result = Arrays.asList(exportList.get( i ).getTopicD().split(","));
-			 adminTopic3.setA( "" );
-			 adminTopic3.setB( "" );
-			 adminTopic3.setC( "" );
-			 adminTopic3.setD( "" );
-			 adminTopic3.setE( "" );
-			 adminTopic3.setF( "" );
-			 adminTopic3.setG( "" );
-			 adminTopic3.setH( "" );
-			 adminTopic3.setI( "" );
-			 adminTopic3.setJ( "" );
-			 adminTopic3.setK( "" );
-			 adminTopic3.setL( "" );
+        // Step.2 获取导出数据
+        List<AdminTopicTwo2> exportList = null;
+        List<AdminTopicTwo3> exportList3 = new ArrayList<>();
+        JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
+        exportList = JSONArray.toList(jsonArray, AdminTopicTwo2.class);
+
+        for (int i = 0; i < exportList.size(); i++) {
+            AdminTopicTwo3 adminTopic3 = new AdminTopicTwo3();
+            adminTopic3.setTopicT(exportList.get(i).getTopicT());
+            List<String> result = Arrays.asList(exportList.get(i).getTopicD().split(","));
+            adminTopic3.setA("");
+            adminTopic3.setB("");
+            adminTopic3.setC("");
+            adminTopic3.setD("");
+            adminTopic3.setE("");
+            adminTopic3.setF("");
+            adminTopic3.setG("");
+            adminTopic3.setH("");
+            adminTopic3.setI("");
+            adminTopic3.setJ("");
+            adminTopic3.setK("");
+            adminTopic3.setL("");
 //			exportList3.add( adminTopic3 );
 
-			 for (int j = 0;j<result.size();j++){
-				 if (j == 0){
-					 adminTopic3.setA( result.get( 0 ) );
-				 }else if (j == 1){
-					 adminTopic3.setB( result.get( 1 ) );
-				 }else if (j == 2){
-					 adminTopic3.setC( result.get( 2 ) );
-				 }else if (j == 3){
-					 adminTopic3.setD( result.get( 3 ) );
-				 }else if (j == 4){
-					 adminTopic3.setE( result.get( 4 ) );
-				 }else if (j == 5){
-					 adminTopic3.setF( result.get( 5 ) );
-				 }else if (j == 6){
-					 adminTopic3.setG( result.get( 6 ) );
-				 }else if (j == 7){
-					 adminTopic3.setH( result.get( 7 ) );
-				 }else if (j == 8){
-					 adminTopic3.setI( result.get( 8 ) );
-				 }else if (j == 9){
-					 adminTopic3.setJ( result.get( 9 ) );
-				 }else if (j == 10){
-					 adminTopic3.setK( result.get( 10 ) );
-				 }else if (j == 11){
-					 adminTopic3.setL( result.get( 11 ) );
-				 }
-			 }
-			 exportList3.add( adminTopic3 );
-		 }
+            for (int j = 0; j < result.size(); j++) {
+                if (j == 0) {
+                    adminTopic3.setA(result.get(0));
+                } else if (j == 1) {
+                    adminTopic3.setB(result.get(1));
+                } else if (j == 2) {
+                    adminTopic3.setC(result.get(2));
+                } else if (j == 3) {
+                    adminTopic3.setD(result.get(3));
+                } else if (j == 4) {
+                    adminTopic3.setE(result.get(4));
+                } else if (j == 5) {
+                    adminTopic3.setF(result.get(5));
+                } else if (j == 6) {
+                    adminTopic3.setG(result.get(6));
+                } else if (j == 7) {
+                    adminTopic3.setH(result.get(7));
+                } else if (j == 8) {
+                    adminTopic3.setI(result.get(8));
+                } else if (j == 9) {
+                    adminTopic3.setJ(result.get(9));
+                } else if (j == 10) {
+                    adminTopic3.setK(result.get(10));
+                } else if (j == 11) {
+                    adminTopic3.setL(result.get(11));
+                }
+            }
+            exportList3.add(adminTopic3);
+        }
 
 //		List<AdminTopic2> exportList = null;
 
 
-		 // 过滤选中数据
+        // 过滤选中数据
 //		String selections = request.getParameter("selections");
 //		if (oConvertUtils.isNotEmpty(selections)) {
 //			List<String> selectionList = Arrays.asList(selections.split(","));
@@ -321,426 +323,32 @@ public class AdminTopicController2 extends JeecgController<AdminTopicTwo, IAdmin
 //			exportList = pageList;
 //		}
 
-		 // Step.3 AutoPoi 导出Excel
-		 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-		 mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
-		 mv.addObject(NormalExcelConstants.CLASS, AdminTopicTwo3.class);
-		 //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
-		 ExportParams  exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
-		 //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
-		 mv.addObject(NormalExcelConstants.PARAMS,exportParams);
-		 mv.addObject(NormalExcelConstants.DATA_LIST, exportList3);
-		 return mv;
-	 }
-
-	 @RequestMapping(value = "/exportXls")
-	 public ModelAndView exportXls1(HttpServletRequest request, AdminTopicTwo adminTopic, String ssusername, String sstopic) {
-		 // Step.1 组装查询条件查询数据
-//		 QueryWrapper<AdminTopic> queryWrapper = QueryGenerator.initQueryWrapper( adminTopic, request.getParameterMap() );
-		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//		 if (ssusername != null){
-//			 queryWrapper.like("username",ssusername);
-//		 }
-//		 if (sstopic != null){
-//			 queryWrapper.like("topic",sstopic);
-//		 }
-		 //Step.2 获取导出数据
-//		 List<AdminTopic> queryList = adminTopicService.list( queryWrapper );
-		 // 过滤选中数据
-		 String selections = request.getParameter( "selections" );
-		 List<AdminTopicTwo> adminTopics = new ArrayList<AdminTopicTwo>();
-		 List<AdminTopicTwo4> adminTopics4 = new ArrayList<AdminTopicTwo4>();
-		 if (oConvertUtils.isEmpty( selections )) {
-//			 adminTopics = queryList;
-		 } else {
-			 List<String> selectionList = Arrays.asList( selections.split( "," ) );
-//			 adminTopics = queryList.stream().filter( item -> selectionList.contains( item.getId() ) ).collect( Collectors.toList() );
+        // Step.3 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
+        mv.addObject(NormalExcelConstants.CLASS, AdminTopicTwo3.class);
+        //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
+        ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
+        //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
+        mv.addObject(NormalExcelConstants.PARAMS, exportParams);
+        mv.addObject(NormalExcelConstants.DATA_LIST, exportList3);
+        return mv;
+    }
 
-			 QueryWrapper<AdminTopicTwo> queryWrapper = new QueryWrapper<>(  );
-			 queryWrapper.in( "id", selectionList);
-			 List<AdminTopicTwo> queryList = adminTopicService.list( queryWrapper );
-			 adminTopics = queryList;
-		 }
-		 //下面对数据做处理
-//		 转成AdminTopic4对象的类型
-		 int a = adminTopics.size();
-		 for (int i=0;i<a;i++){
-			 AdminTopicTwo4 adminTopic4 = new AdminTopicTwo4();
-			 adminTopic4.setXuhao( i+1 );
-			 adminTopic4.setName( adminTopics.get( i ).getUsername() );
-			 adminTopic4.setPhone( adminTopics.get( i ).getPhone() );
-			 adminTopic4.setHospital( adminTopics.get( i ).getHospital() );
-			 adminTopic4.setOutpatientServiceTime( adminTopics.get( i ).getOutpatientServiceTime() );
-			 adminTopic4.setCreateTime( adminTopics.get( i ).getCreateTime() );
-			 String s = adminTopics.get( i ).getTopicTop();
-			 String numStr = s.substring(s.indexOf("人数") + 3, s.indexOf("(人)"));
-			 adminTopic4.setDiaoyan( numStr );
-
-			 String topic = adminTopics.get( i ).getTopicTwo();
-			 String res = StringEscapeUtils.unescapeJava(topic);
-			 List<AdminTopicTwo2> exportList = null;
-			 JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
-			 exportList = JSONArray.toList(jsonArray, AdminTopicTwo2.class);
-			 //1、
-			 AdminTopicTwo2 adminTopic1 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "1、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			/* if (adminTopic1 != null) {
-				 String[] split = adminTopic1.getTopicD().split( "," );
-				 adminTopic4.setA1( split[0] );
-			 } else {
-				 adminTopic4.setA1( "" );
-			 }*/
-			 //2、
-			 AdminTopicTwo2 adminTopic2 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "2、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic2 != null) {
-				 String[] split = adminTopic2.getTopicD().split( "," );
-				 adminTopic4.setB1( split[0] );
-//				 adminTopic4.setB2( split[1] );
-//				 adminTopic4.setB3( split[2] );
-//				 adminTopic4.setB4( split[3] );
-			 } else {
-				 adminTopic4.setB1( "" );
-//				 adminTopic4.setB2( "" );
-//				 adminTopic4.setB3( "" );
-//				 adminTopic4.setB4( "" );
-			 }
-			 //3、
-			 AdminTopicTwo2 adminTopic3 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "3、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic3 != null) {
-				 String[] split = adminTopic3.getTopicD().split( "," );
-				 adminTopic4.setC1( split[0] );
-//				 adminTopic4.setC2( split[1] );
-//				 adminTopic4.setC3( split[2] );
-//				 adminTopic4.setC4( split[3] );
-			 } else {
-				 adminTopic4.setC1( "" );
-//				 adminTopic4.setC2( "" );
-//				 adminTopic4.setC3( "" );
-//				 adminTopic4.setC4( "" );
-			 }
-			 //4、
-			 AdminTopicTwo2 adminTopic44 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "4、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic44 != null) {
-				 String[] split = adminTopic44.getTopicD().split( "," );
-				 adminTopic4.setD1( split[0] );
-				 adminTopic4.setD2( split[1] );
-				 adminTopic4.setD3( split[2] );
-				 adminTopic4.setD4( split[3] );
-				 adminTopic4.setD5( split[4] );
-				 adminTopic4.setD6( split[5] );
-//				 adminTopic4.setD7( split[6] );
-//				 adminTopic4.setD8( split[7] );
-			 } else {
-				 adminTopic4.setD1( "" );
-				 adminTopic4.setD2( "" );
-				 adminTopic4.setD3( "" );
-				 adminTopic4.setD4( "" );
-				 adminTopic4.setD5( "" );
-				 adminTopic4.setD6( "" );
-//				 adminTopic4.setD7( "" );
-//				 adminTopic4.setD8( "" );
-			 }
-			 //5、
-			 AdminTopicTwo2 adminTopic5 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "5、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic5 != null) {
-				 String[] split = adminTopic5.getTopicD().split( "," );
-				 adminTopic4.setE1( split[0] );
-			 } else {
-				 adminTopic4.setE1( "" );
-			 }
-			 //6、
-			 AdminTopicTwo2 adminTopic6 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "6、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic6 != null) {
-				 String[] split = adminTopic6.getTopicD().split( "," );
-				 adminTopic4.setF1( split[0] );
-				 adminTopic4.setF2( split[1] );
-			 } else {
-				 adminTopic4.setF1( "" );
-				 adminTopic4.setF2( "" );
-			 }
-			 //7、
-			 AdminTopicTwo2 adminTopic7 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "7、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic7 != null) {
-				 String[] split = adminTopic7.getTopicD().split( "," );
-				 adminTopic4.setG1( split[0] );
-//				 adminTopic4.setG2( split[1] );
-//				 adminTopic4.setG3( split[2] );
-//				 adminTopic4.setG4( split[3] );
-//				 adminTopic4.setG5( split[4] );
-//				 adminTopic4.setG6( split[5] );
-//				 adminTopic4.setG7( split[6] );
-//				 adminTopic4.setG8( split[7] );
-//				 adminTopic4.setG9( split[8] );
-//				 adminTopic4.setG10( split[9] );
-//				 adminTopic4.setG11( split[10] );
-//				 adminTopic4.setG12( split[11] );
-			 } else {
-				 adminTopic4.setG1( "" );
-//				 adminTopic4.setG2( "" );
-//				 adminTopic4.setG3( "" );
-//				 adminTopic4.setG4( "" );
-//				 adminTopic4.setG5( "" );
-//				 adminTopic4.setG6( "" );
-//				 adminTopic4.setG7( "" );
-//				 adminTopic4.setG8( "" );
-//				 adminTopic4.setG9( "" );
-//				 adminTopic4.setG10( "" );
-//				 adminTopic4.setG11( "" );
-//				 adminTopic4.setG12( "" );
-			 }
-			 //8、
-			 AdminTopicTwo2 adminTopic8 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "8、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic8 != null) {
-				 String[] split = adminTopic8.getTopicD().split( "," );
-				 adminTopic4.setH1( split[0] );
-				 adminTopic4.setH2( split[1] );
-//				 adminTopic4.setH3( split[2] );
-//				 adminTopic4.setH4( split[3] );
-//				 adminTopic4.setH5( split[4] );
-//				 adminTopic4.setH6( split[5] );
-//				 adminTopic4.setH7( split[6] );
-//				 adminTopic4.setH8( split[7] );
-			 } else {
-				 adminTopic4.setH1( "" );
-				 adminTopic4.setH2( "" );
-//				 adminTopic4.setH3( "" );
-//				 adminTopic4.setH4( "" );
-//				 adminTopic4.setH5( "" );
-//				 adminTopic4.setH6( "" );
-//				 adminTopic4.setH7( "" );
-//				 adminTopic4.setH8( "" );
-			 }
-			 //9、
-			 AdminTopicTwo2 adminTopic9 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "9、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic9 != null) {
-				 String[] split = adminTopic9.getTopicD().split( "," );
-				 adminTopic4.setI1( split[0] );
-			 } else {
-				 adminTopic4.setI1( "" );
-			 }
-			 //10、
-			 AdminTopicTwo2 adminTopic10 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "10、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic10 != null) {
-				 String[] split = adminTopic10.getTopicD().split( "," );
-				 adminTopic4.setJ1( split[0] );
-			 } else {
-				 adminTopic4.setJ1( "" );
-			 }
-			 //11、
-			 AdminTopicTwo2 adminTopic11 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "11、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic11 != null) {
-				 String[] split = adminTopic11.getTopicD().split( "," );
-				 adminTopic4.setK1( split[0] );
-				 adminTopic4.setK2( split[1] );
-				 adminTopic4.setK3( split[2] );
-				 adminTopic4.setK4( split[3] );
-//				 adminTopic4.setK5( split[4] );
-//				 adminTopic4.setK6( split[5] );
-//				 adminTopic4.setK7( split[6] );
-//				 adminTopic4.setK8( split[7] );
-//				 adminTopic4.setK9( split[8] );
-//				 adminTopic4.setK10( split[9] );
-			 } else {
-				 adminTopic4.setK1( "" );
-				 adminTopic4.setK2( "" );
-				 adminTopic4.setK3( "" );
-				 adminTopic4.setK4( "" );
-//				 adminTopic4.setK5( "" );
-//				 adminTopic4.setK6( "" );
-//				 adminTopic4.setK7( "" );
-//				 adminTopic4.setK8( "" );
-//				 adminTopic4.setK9( "" );
-//				 adminTopic4.setK10( "" );
-			 }
-			 //12、
-			 AdminTopicTwo2 adminTopic12 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "12、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic12 != null) {
-				 String[] split = adminTopic12.getTopicD().split( "," );
-				 if (split[0].equals( "是" )){
-					 adminTopic4.setL1( split[0] );
-					 adminTopic4.setL2( "" );
-					 adminTopic4.setL3( "" );
-					 adminTopic4.setL4( "" );
-					 adminTopic4.setL5( "" );
-				 }else {
-					 adminTopic4.setL1( split[0] );
-					 adminTopic4.setL2( split[1] );
-					 adminTopic4.setL3( split[2] );
-					 adminTopic4.setL4( split[3] );
-					 adminTopic4.setL5( split[4] );
-				 }
-			 } else {
-				 adminTopic4.setL1( "" );
-				 adminTopic4.setL2( "" );
-				 adminTopic4.setL3( "" );
-				 adminTopic4.setL4( "" );
-				 adminTopic4.setL5( "" );
-			 }
-			 //13、
-			 AdminTopicTwo2 adminTopic13 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "13、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic13 != null) {
-				 String[] split = adminTopic13.getTopicD().split( "," );
-				 adminTopic4.setM1( split[0] );
-				 adminTopic4.setM2( split[1] );
-//				 adminTopic4.setM3( split[2] );
-//				 adminTopic4.setM4( split[3] );
-//				 adminTopic4.setM5( split[4] );
-//				 adminTopic4.setM6( split[5] );
-
-			 } else {
-				 adminTopic4.setM1( "" );
-				 adminTopic4.setM2( "" );
-//				 adminTopic4.setM3( "" );
-//				 adminTopic4.setM4( "" );
-//				 adminTopic4.setM5( "" );
-//				 adminTopic4.setM6( "" );
-			 }
-			 //14、
-			 AdminTopicTwo2 adminTopic14 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "14、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic14 != null) {
-				 String[] split = adminTopic14.getTopicD().split( "," );
-				 adminTopic4.setN1( split[0] );
-			 } else {
-				 adminTopic4.setN1( "" );
-			 }
-			 //15、
-			 AdminTopicTwo2 adminTopic15 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "15、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic15 != null) {
-				 String[] split = adminTopic15.getTopicD().split( "," );
-//				 adminTopic4.setO1( split[0] );
-//				 adminTopic4.setO2( split[1] );
-//				 adminTopic4.setO3( split[2] );
-			 } else {
-//				 adminTopic4.setO1( "" );
-//				 adminTopic4.setO2( "" );
-//				 adminTopic4.setO3( "" );
-			 }
-			 //16、
-			 AdminTopicTwo2 adminTopic16 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "16、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic16 != null) {
-				 String[] split = adminTopic16.getTopicD().split( "," );
-				 adminTopic4.setP1( split[0] );
-				 adminTopic4.setP2( split[1] );
-				 adminTopic4.setP3( split[2] );
-				 adminTopic4.setP4( split[3] );
-				 adminTopic4.setP5( split[4] );
-
-			 } else {
-				 adminTopic4.setP1( "" );
-				 adminTopic4.setP2( "" );
-				 adminTopic4.setP3( "" );
-				 adminTopic4.setP4( "" );
-				 adminTopic4.setP5( "" );
-			 }
-			 //17、
-			 AdminTopicTwo2 adminTopic17 = exportList.stream()
-					 .filter( p -> p.getTopicT().matches( "17、" + ".*" ) )
-					 .findFirst()
-					 .orElse( null );
-
-			 if (adminTopic17 != null) {
-				 String[] split = adminTopic17.getTopicD().split( "," );
-//				 adminTopic4.setQ1( split[0] );
-//				 adminTopic4.setQ2( split[1] );
-//				 adminTopic4.setQ3( split[2] );
-//				 adminTopic4.setQ4( split[3] );
-//				 adminTopic4.setQ5( split[4] );
-//				 adminTopic4.setQ6( split[5] );
-
-			 } else {
-//				 adminTopic4.setQ1( "" );
-//				 adminTopic4.setQ2( "" );
-//				 adminTopic4.setQ3( "" );
-//				 adminTopic4.setQ4( "" );
-//				 adminTopic4.setQ5( "" );
-//				 adminTopic4.setQ6( "" );
-			 }
-//			 //18、
-//			 AdminTopicTwo2 adminTopic18 = exportList.stream()
-//					 .filter( p -> p.getTopicT().matches( "18、" + ".*" ) )
-//					 .findFirst()
-//					 .orElse( null );
-//
-//			 if (adminTopic18 != null) {
-//				 String[] split = adminTopic18.getTopicD().split( "," );
-//				 adminTopic4.setX1( split[0] );
-//			 } else {
-//				 adminTopic4.setX1( "" );
-//			 }
-			 adminTopics4.add( adminTopic4 );
-		 }
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls1(HttpServletRequest request, AdminTopicTwo adminTopic, String ssusername, String sstopic) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
-		 // Step.4 AutoPoi 导出Excel
-		 ModelAndView mv = new ModelAndView( new JeecgEntityExcelView() );
-		 mv.addObject( NormalExcelConstants.FILE_NAME, "问卷调查列表" );
-		 mv.addObject( NormalExcelConstants.CLASS, AdminTopicTwo4.class );
-		 mv.addObject( NormalExcelConstants.PARAMS, new ExportParams( "问卷调查数据", "导出人:" + sysUser.getRealname(), "问卷调查" ) );
-		 mv.addObject( NormalExcelConstants.DATA_LIST, adminTopics4 );
-		 return null;
-	 }
+        List<AdminTopicTwo4> adminTopics4=  adminTopicService.exportXls1(request);
+
+        // Step.4 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, "问卷调查列表");
+        mv.addObject(NormalExcelConstants.CLASS, AdminTopicTwo4.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("问卷调查数据", "导出人:" + sysUser.getRealname(), "问卷调查"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, adminTopics4);
+        return mv;
+    }
 
 
 //	 @RequestMapping(value = "/exportXls")
@@ -918,21 +526,22 @@ public class AdminTopicController2 extends JeecgController<AdminTopicTwo, IAdmin
 //		 return mv;
 //	 }
 
-	 private String getId(AdminTopicTwo2 item) {
-		 try {
-			 return PropertyUtils.getProperty(item, "id").toString();
-		 } catch (Exception e) {
-			 e.printStackTrace();
-			 return null;
-		 }
-	 }
+    private String getId(AdminTopicTwo2 item) {
+        try {
+            return PropertyUtils.getProperty(item, "id").toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdminTopicTwo.class);

+ 1 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/entity/AdminTopicTwo.java

@@ -63,6 +63,7 @@ public class AdminTopicTwo implements Serializable {
     private Date createTime;
     /**性别*/
     @ApiModelProperty(value = "性别")
+    @Dict(dicCode = "ques_sex")
     private String sex;
     /**身高*/
     @ApiModelProperty(value = "身高")

+ 58 - 144
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/entity/AdminTopicTwo4.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.adminwjdc2.entity;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.jeecgframework.poi.excel.annotation.ExcelCollection;
 
@@ -33,19 +34,48 @@ public class AdminTopicTwo4 implements Serializable {
     @Excel(name = "提交日期", width = 12, format = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
-    @Excel(name = "调研人数(人)", width = 12)
-    private String diaoyan;
+
+    /**性别*/
+    @Excel(name = "性别", width = 12)
+    private String sex;
+    /**年龄*/
+    @Excel(name = "年龄", width = 12)
+    private String age;
+    /**身高*/
+    @Excel(name = "身高(cm)", width = 12)
+    private String height;
+    /**体重*/
+    @Excel(name = "体重(kg)", width = 12)
+    private String weight;
+    /**就诊原因*/
+    @Excel(name = "就诊原因", width = 12)
+    private String visitReason;
+    /**既往病史*/
+    @Excel(name = "既往病史", width = 12)
+    private String pastMedicalHistory;
+    /**内镜操作医师*/
+    @Excel(name = "内镜操作医师", width = 12)
+    private String endoscopicSurgeon;
+    /**职称*/
+    @Excel(name = "职称", width = 12)
+    private String title;
+    /**内镜手术累计(台/次)*/
+    @Excel(name = "内镜手术累计(台/次)", width = 12)
+    private String endoscopicSurgery;
+
 
 //    @ExcelCollection(name = "")
 ////    private List<A1> A1;
 //    private A1 A1;
 
 
-    @Excel(name = "A,胃部", width = 7, groupName = "1、检查部位?")
+    @Excel(name = "A:胃部", width = 7, groupName = "1、检查部位?")
     private String a1;
 
-    @Excel(name = "B,肠道", width = 7, groupName = "1、检查部位?")
+    @Excel(name = "B:肠道", width = 7, groupName = "1、检查部位?")
     private String a2;
+    @Excel(name = "C:胃部+肠道", width = 7, groupName = "1、检查部位?")
+    private String a3;
 //------------------------
     @Excel(name = "A.禁食______天", width = 12, groupName = "2、内镜检查前饮食状况?")
     private String b1;
@@ -59,10 +89,10 @@ public class AdminTopicTwo4 implements Serializable {
     @Excel(name = "D.正常饮食", width = 9, groupName = "2、内镜检查前饮食状况?")
     private String b4;
     //------------------------
-    @Excel(name = "A.", width = 12, groupName = "3、肠道清洁剂使用情况?")
+    @Excel(name = "A.", width = 12, groupName = "3、肠道清洁剂使用情况?")
     private String c1;
 
-    @Excel(name = "B.", width = 12, groupName = "3、肠道清洁剂使用情况?")
+    @Excel(name = "B.", width = 12, groupName = "3、肠道清洁剂使用情况?")
     private String c2;
 
 
@@ -73,10 +103,10 @@ public class AdminTopicTwo4 implements Serializable {
     @Excel(name = "B.硫酸镁    用量______g  次数  □一次  □分次 ", width = 15, groupName = "4、肠道清洁剂的种类和用量 (多选,如果第二题单选胃,即不填3.4.5)")
     private String d2;
 
-    @Excel(name = "C. 磷酸钠    用量______mL   次数  □一次  □分次   ", width = 12, groupName = "4、肠道清洁剂的种类和用量 (多选,如果第二题单选胃,即不填3.4.5)")
+    @Excel(name = "C.磷酸钠    用量______mL   次数  □一次  □分次   ", width = 12, groupName = "4、肠道清洁剂的种类和用量 (多选,如果第二题单选胃,即不填3.4.5)")
     private String d3;
 
-    @Excel(name = "D. 甘露醇    用量______L    次数  □一次  □分次", width = 15, groupName = "4、肠道清洁剂的种类和用量 (多选,如果第二题单选胃,即不填3.4.5)")
+    @Excel(name = "D.甘露醇    用量______L    次数  □一次  □分次", width = 15, groupName = "4、肠道清洁剂的种类和用量 (多选,如果第二题单选胃,即不填3.4.5)")
     private String d4;
 
     @Excel(name = "E.中草药_______    用量______g  次数  □一次  □分次", width = 12, groupName = "4、肠道清洁剂的种类和用量 (多选,如果第二题单选胃,即不填3.4.5)")
@@ -89,32 +119,32 @@ public class AdminTopicTwo4 implements Serializable {
     @Excel(name = "A. __时__分", width = 30,groupName ="5、服药时间:最后一口服用泻药时间" )
     private String e1;
     //------------------------6
-    @Excel(name = "A. 无", width = 15, groupName = "6.消泡剂使用")
+    @Excel(name = "A. 无", width = 15, groupName = "6消泡剂使用")
     private String f1;
     @Excel(name = "B.西甲硅油", width = 15, groupName = "6、消泡剂使用")
     private String f2;
-    @Excel(name = "B.二甲硅油 ", width = 15, groupName = "6、消泡剂使用")
+    @Excel(name = "C.二甲硅油 ", width = 15, groupName = "6、消泡剂使用")
     private String f3;
-    @Excel(name = "B.其它", width = 15, groupName = "6、消泡剂使用")
+    @Excel(name = "D.其它", width = 15, groupName = "6、消泡剂使用")
     private String f4;
 
     //------------------------7
     @Excel(name = "A. __时__分", width = 15, groupName = "7、服用时间:最后一次服用消泡剂时间?")
     private String g1;
 
-    @Excel(name = "A. ", width = 15, groupName = "8、麻醉药物使用情况")
+    @Excel(name = "A. ", width = 15, groupName = "8、麻醉药物使用情况")
     private String h1;
 
-    @Excel(name = "B. ", width = 12, groupName = "8、麻醉药物使用情况")
+    @Excel(name = "B. ", width = 12, groupName = "8、麻醉药物使用情况")
     private String h2;
 
     @Excel(name = "A. __分钟", width = 15, groupName = "9、内镜检查持续时间?")
     private String i1;
 
-    @Excel(name = "A. 祛泡剂", width = 12, groupName = "10、接受消化内镜手术后,0.5-1小时是否出现了腹胀的症状?")
+    @Excel(name = "A. ", width = 12, groupName = "10、接受消化内镜手术后,0.5-1小时是否出现了腹胀的症状?")
     private String j1;
 
-    @Excel(name = "B. 抗生素", width = 9, groupName = "10、接受消化内镜手术后,0.5-1小时是否出现了腹胀的症状?")
+    @Excel(name = "B. ", width = 9, groupName = "10、接受消化内镜手术后,0.5-1小时是否出现了腹胀的症状?")
     private String j2;
 
     @Excel(name = "A. 上腹部", width = 15, groupName = "11、术后0.5-1小时腹胀症状出现的主要部位是?")
@@ -147,156 +177,40 @@ public class AdminTopicTwo4 implements Serializable {
     @Excel(name = "F. 严重持续腹胀,伴随胀痛(5分)", width = 12, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String l6;
 
-    @Excel(name = "A. ", width = 15, groupName = "13、.接受消化内镜手术后24小时,是否有腹胀的症状?")
+    @Excel(name = "A. ", width = 15, groupName = "13、.接受消化内镜手术后24小时,是否有腹胀的症状?")
     private String m1;
 
-    @Excel(name = "B. ", width = 12, groupName = "13、.接受消化内镜手术后24小时,是否有腹胀的症状?")
+    @Excel(name = "B. ", width = 12, groupName = "13、.接受消化内镜手术后24小时,是否有腹胀的症状?")
     private String m2;
 
-    @Excel(name = "A. 上腹部", width = 15, groupName = "8、术后24小时腹胀的主要部位是?")
+    @Excel(name = "A. 上腹部", width = 15, groupName = "14、术后24小时腹胀的主要部位是?")
     private String n1;
 
-    @Excel(name = "B. 腹部左侧", width = 12, groupName = "8、术后24小时腹胀的主要部位是?")
+    @Excel(name = "B. 腹部左侧", width = 12, groupName = "14、术后24小时腹胀的主要部位是?")
     private String n2;
 
-    @Excel(name = "C.  腹部右侧", width = 12, groupName = "8、术后24小时腹胀的主要部位是?")
+    @Excel(name = "C.  腹部右侧", width = 12, groupName = "14、术后24小时腹胀的主要部位是?")
     private String n3;
     //------------------------9
-    @Excel(name = "D、下腹部?", width = 30,groupName = "8、术后24小时腹胀的主要部位是?")
+    @Excel(name = "D.下腹部?", width = 30,groupName = "14、术后24小时腹胀的主要部位是?")
     private String n4;
 
-    @Excel(name = "A. 无腹胀(0分)", width = 12, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
+    @Excel(name = "A.无腹胀(0分)", width = 12, groupName = "15、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String p1;
 
-    @Excel(name = "B. 轻微腹胀不适(1分)", width = 12, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
+    @Excel(name = "B. 轻微腹胀不适(1分)", width = 12, groupName = "15、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String p2;
     //------------------------8
-    @Excel(name = "C. 腹胀不适明显(2分)", width = 15, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
+    @Excel(name = "C. 腹胀不适明显(2分)", width = 15, groupName = "15、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String p3;
 
-    @Excel(name = "D. 腹胀持续鼓胀(3分)", width = 15, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
+    @Excel(name = "D. 腹胀持续鼓胀(3分)", width = 15, groupName = "15、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String p4;
 
-    @Excel(name = "E. 腹胀持续鼓胀,经常有恶心呕吐感(4分)", width = 12, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
+    @Excel(name = "E. 腹胀持续鼓胀,经常有恶心呕吐感(4分)", width = 12, groupName = "15、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String p5;
 
-    @Excel(name = "F. 严重持续腹胀,伴随胀痛(5分)", width = 12, groupName = "12、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
+    @Excel(name = "F. 严重持续腹胀,伴随胀痛(5分)", width = 12, groupName = "15、请参考腹胀评分量表为术后0.5-1小时内的腹胀疼痛程度打分(0分表示无腹胀,5分表示最严重的腹胀)")
     private String p6;
-    //------------------------10
-//    @Excel(name = "10、您认为祛泡剂对这类患者最大的优势是什么?", width = 30)
-//    private String j1;
-//    //------------------------11
-//    @Excel(name = "A. 中上腹", width = 15, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k1;
-//
-//    @Excel(name = "B. 左上腹", width = 15, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k2;
-//
-//    @Excel(name = "C. 右上腹", width = 12, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k3;
-//
-//    @Excel(name = "D. 下腹", width = 15, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k4;
-//
-//    @Excel(name = "E. 左下腹", width = 12, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k5;
-//
-//    @Excel(name = "F. 右下腹", width = 15, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k6;
-//
-//    @Excel(name = "G. 脐周", width = 12, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k7;
-//
-//    @Excel(name = "H. 全腹", width = 12, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k8;
-//
-//    @Excel(name = "I. 不固定", width = 12, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k9;
-//
-//    @Excel(name = "J. 说不清部位", width = 12, groupName = "11、本次门诊中存在腹痛症状患者,以下部位腹痛发生的比例是?")
-//    private String k10;
-//    //------------------------12
-//    @Excel(name = "A.不考虑,认为亚型与治疗方案关系不大", width = 25, groupName = "12、在本次门诊诊断肠易激综合征(IBS)时,您是否会考虑患者的IBS亚型?如考虑,不同亚型的占比都是多少?")
-//    private String l1;
-//    @Excel(name = "B. IBS便秘型(IBS-C)", width = 25, groupName = "12、在本次门诊诊断肠易激综合征(IBS)时,您是否会考虑患者的IBS亚型?如考虑,不同亚型的占比都是多少?")
-//    private String l2;
-//    @Excel(name = "C. IBS腹泻型(IBS-D)", width = 25, groupName = "12、在本次门诊诊断肠易激综合征(IBS)时,您是否会考虑患者的IBS亚型?如考虑,不同亚型的占比都是多少?")
-//    private String l3;
-//    @Excel(name = "D. IBS混合型(IBS-M)", width = 25, groupName = "12、在本次门诊诊断肠易激综合征(IBS)时,您是否会考虑患者的IBS亚型?如考虑,不同亚型的占比都是多少?")
-//    private String l4;
-//    @Excel(name = "E. IBS不定型(IBS-U)", width = 25, groupName = "12、在本次门诊诊断肠易激综合征(IBS)时,您是否会考虑患者的IBS亚型?如考虑,不同亚型的占比都是多少?")
-//    private String l5;
-//
-//    //------------------------13
-//    @Excel(name = "A. 不考虑亚型,只要有腹痛症状即使用", width = 25, groupName = "13、有证据表明解痉剂可改善肠易激综合征(IBS)的症状,对腹痛的疗效显著。若选择奥替溴铵治疗IBS" +
-//            "相关的腹痛,您会考虑给以下哪些亚型的肠易激综合征(IBS)患者使用奥替溴铵?")
-//    private String m1;
-//
-//    @Excel(name = "B. IBS便秘型(IBS-C)", width = 20, groupName = "13、有证据表明解痉剂可改善肠易激综合征(IBS)的症状,对腹痛的疗效显著。若选择奥替溴铵治疗IBS" +
-//            "相关的腹痛,您会考虑给以下哪些亚型的肠易激综合征(IBS)患者使用奥替溴铵?")
-//    private String m2;
-//
-//    @Excel(name = "C. IBS腹泻型(IBS-D)", width = 18, groupName = "13、有证据表明解痉剂可改善肠易激综合征(IBS)的症状,对腹痛的疗效显著。若选择奥替溴铵治疗IBS" +
-//            "相关的腹痛,您会考虑给以下哪些亚型的肠易激综合征(IBS)患者使用奥替溴铵?")
-//    private String m3;
-//
-//    @Excel(name = "D. IBS混合型(IBS-M)", width = 18, groupName = "13、有证据表明解痉剂可改善肠易激综合征(IBS)的症状,对腹痛的疗效显著。若选择奥替溴铵治疗IBS" +
-//            "相关的腹痛,您会考虑给以下哪些亚型的肠易激综合征(IBS)患者使用奥替溴铵?")
-//    private String m4;
-//
-//    @Excel(name = "E. IBS不定型(IBS-U)", width = 18, groupName = "13、有证据表明解痉剂可改善肠易激综合征(IBS)的症状,对腹痛的疗效显著。若选择奥替溴铵治疗IBS" +
-//            "相关的腹痛,您会考虑给以下哪些亚型的肠易激综合征(IBS)患者使用奥替溴铵?")
-//    private String m5;
-//
-//    @Excel(name = "F. 不使用奥替溴铵", width = 18, groupName = "13、有证据表明解痉剂可改善肠易激综合征(IBS)的症状,对腹痛的疗效显著。若选择奥替溴铵治疗IBS" +
-//            "相关的腹痛,您会考虑给以下哪些亚型的肠易激综合征(IBS)患者使用奥替溴铵?")
-//    private String m6;
-//    //------------------------14
-//    @Excel(name = "14、您认为奥替溴铵对肠易激综合征(IBS)患者最大的优势是什么?", width = 40)
-//    private String n1;
-//    //------------------------15
-//    @Excel(name = "A. 轻度", width = 15, groupName = "15、本次门诊溃疡性结肠炎(UC)患者群中,按疾病程度分类,分别占比多少?")
-//    private String o1;
-//
-//    @Excel(name = "B. 轻中度", width = 15, groupName = "15、本次门诊溃疡性结肠炎(UC)患者群中,按疾病程度分类,分别占比多少?")
-//    private String o2;
-//
-//    @Excel(name = "C. 中重度", width = 15, groupName = "15、本次门诊溃疡性结肠炎(UC)患者群中,按疾病程度分类,分别占比多少?")
-//    private String o3;
-//    //------------------------16
-//    @Excel(name = "A. 疾病活动期", width = 20, groupName = "16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比?")
-//    private String p1;
-//
-//    @Excel(name = "B. 便血", width = 15, groupName = "16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比?")
-//    private String p2;
-//
-//    @Excel(name = "C. 长期用药出现副作用", width = 25, groupName = "16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比?")
-//    private String p3;
-//
-//    @Excel(name = "D. 原治疗方案使用不方便", width = 25, groupName = "16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比?")
-//    private String p4;
-//
-//    @Excel(name = "E. 维持期定期复诊", width = 20, groupName = "16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比?")
-//    private String p5;
-//    //------------------------17
-//    @Excel(name = "A. 氨基水杨酸制剂", width = 20, groupName = "17、本次门诊针对溃疡性结肠炎(UC)患者所使用的不同治疗方案的占比?")
-//    private String q1;
-//
-//    @Excel(name = "B. 激素类", width = 15, groupName = "17、本次门诊针对溃疡性结肠炎(UC)患者所使用的不同治疗方案的占比?")
-//    private String q2;
-//
-//    @Excel(name = "C. 硫嘌呤类药物", width = 20, groupName = "17、本次门诊针对溃疡性结肠炎(UC)患者所使用的不同治疗方案的占比?")
-//    private String q3;
-//
-//    @Excel(name = "D. 沙利度胺", width = 20, groupName = "17、本次门诊针对溃疡性结肠炎(UC)患者所使用的不同治疗方案的占比?")
-//    private String q4;
-//
-//    @Excel(name = "E. 生物制剂类", width = 20, groupName = "17、本次门诊针对溃疡性结肠炎(UC)患者所使用的不同治疗方案的占比?")
-//    private String q5;
-//
-//    @Excel(name = "F. 其他方案", width = 15, groupName = "17、本次门诊针对溃疡性结肠炎(UC)患者所使用的不同治疗方案的占比?")
-//    private String q6;
-//    //------------------------18
-//    @Excel(name = "18、您认为美沙拉秦对溃疡性结肠炎(UC)患者最大的优势是什么?", width = 40)
-//    private String x1;
+
 }

+ 3 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/service/IAdminTopicaTwoService.java

@@ -3,7 +3,9 @@ package org.jeecg.modules.adminwjdc2.service;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.jeecg.modules.adminwjdc2.entity.AdminTopicTwo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.adminwjdc2.entity.AdminTopicTwo4;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -16,4 +18,5 @@ public interface IAdminTopicaTwoService extends IService<AdminTopicTwo> {
 
     List<AdminTopicTwo> listNum(QueryWrapper<AdminTopicTwo> queryWrapper);
 
+    List<AdminTopicTwo4> exportXls1(HttpServletRequest request);
 }

+ 457 - 1
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminwjdc2/service/impl/AdminTopicServiceTwoImplTopic.java

@@ -1,7 +1,13 @@
 package org.jeecg.modules.adminwjdc2.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import net.sf.json.JSONArray;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.adminwjdc2.entity.AdminTopicTwo;
+import org.jeecg.modules.adminwjdc2.entity.AdminTopicTwo2;
+import org.jeecg.modules.adminwjdc2.entity.AdminTopicTwo4;
 import org.jeecg.modules.adminwjdc2.mapper.AdminTopicMapper2;
 import org.jeecg.modules.adminwjdc2.service.IAdminTopicaTwoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -9,12 +15,15 @@ import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
  * @Description: 问卷调查
  * @Author: jeecg-boot
- * @Date:   2023-02-25
+ * @Date: 2023-02-25
  * @Version: V1.0
  */
 @Service
@@ -22,9 +31,456 @@ public class AdminTopicServiceTwoImplTopic extends ServiceImpl<AdminTopicMapper2
 
     @Autowired
     private AdminTopicMapper2 adminTopicMapper2;
+
     @Override
     public List<AdminTopicTwo> listNum(QueryWrapper<AdminTopicTwo> queryWrapper) {
         return adminTopicMapper2.listNum(queryWrapper);
     }
 
+    @Override
+    public List<AdminTopicTwo4> exportXls1(HttpServletRequest request) {
+
+        String selections = request.getParameter("selections");
+        List<AdminTopicTwo> adminTopics = new ArrayList<AdminTopicTwo>();
+        List<AdminTopicTwo4> adminTopics4 = new ArrayList<AdminTopicTwo4>();
+        if (oConvertUtils.isEmpty(selections)) {
+//			 adminTopics = queryList;
+        } else {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+//			 adminTopics = queryList.stream().filter( item -> selectionList.contains( item.getId() ) ).collect( Collectors.toList() );
+
+            QueryWrapper<AdminTopicTwo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.in("id", selectionList);
+            List<AdminTopicTwo> queryList = this.list(queryWrapper);
+            adminTopics = queryList;
+        }
+        //下面对数据做处理
+//		 转成AdminTopic4对象的类型
+        int a = adminTopics.size();
+        for (int i = 0; i < a; i++) {
+            AdminTopicTwo4 adminTopic4 = new AdminTopicTwo4();
+            adminTopic4.setXuhao(i + 1);
+            adminTopic4.setName(adminTopics.get(i).getUsername());
+            adminTopic4.setPhone(adminTopics.get(i).getPhone());
+            adminTopic4.setHospital(adminTopics.get(i).getHospital());
+            adminTopic4.setOutpatientServiceTime(adminTopics.get(i).getOutpatientServiceTime());
+            adminTopic4.setCreateTime(adminTopics.get(i).getCreateTime());
+            String sex = adminTopics.get(i).getSex();
+            if ("1".equals(sex)){
+                adminTopic4.setSex("男");
+            }else if ("0".equals(sex)){
+                adminTopic4.setSex("女");
+            }
+            adminTopic4.setAge(adminTopics.get(i).getAge());
+            adminTopic4.setHeight(adminTopics.get(i).getHeight());
+            adminTopic4.setWeight(adminTopics.get(i).getWeight());
+            adminTopic4.setVisitReason(adminTopics.get(i).getVisitReason());
+            adminTopic4.setEndoscopicSurgeon(adminTopics.get(i).getEndoscopicSurgeon());
+            adminTopic4.setEndoscopicSurgery(adminTopics.get(i).getEndoscopicSurgery());
+            adminTopic4.setTitle(adminTopics.get(i).getTitle());
+            adminTopic4.setPastMedicalHistory(adminTopics.get(i).getPastMedicalHistory());
+
+
+
+            String topic = adminTopics.get(i).getTopicTwo();
+            String res = StringEscapeUtils.unescapeJava(topic);
+            List<AdminTopicTwo2> exportList = null;
+            JSONArray jsonArray = JSONArray.fromObject(res);//把String转换为json
+            exportList = JSONArray.toList(jsonArray, AdminTopicTwo2.class);
+            //1、
+            AdminTopicTwo2 adminTopic1 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("1、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic1 != null) {
+                String[] split = adminTopic1.getTopicD().split(",");
+                String s1 = split[0];
+                if (StringUtils.isNotBlank(s1)){
+                    String substring = s1.substring(0, s1.indexOf("."));
+                    if ("A".equals(substring)) {
+                        adminTopic4.setA1(split[0]);
+                    } else if ("B".equals(substring)) {
+                        adminTopic4.setA2(split[0]);
+                    }else if ("C".equals(substring)) {
+                        adminTopic4.setA3(split[0]);
+                    }
+                }
+
+
+            } else {
+                adminTopic4.setA1("");
+                adminTopic4.setA2("");
+                adminTopic4.setA3("");
+            }
+            //2、
+            AdminTopicTwo2 adminTopic2 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("2、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic2 != null) {
+                String[] split = adminTopic2.getTopicD().split(",");
+                for (int j = 0; j < split.length; j++) {
+                    String s1 = split[j];
+                    if (StringUtils.isNotBlank(s1)){
+                        String substring = s1.substring(0, s1.indexOf("."));
+                        if ("A".equals(substring)) {
+                            adminTopic4.setB1(s1);
+                        } else if ("B".equals(substring)) {
+                            adminTopic4.setB2(s1);
+                        } else if ("C".equals(substring)) {
+                            adminTopic4.setB3(s1);
+                        } else if ("D".equals(substring)) {
+                            adminTopic4.setB4(s1);
+                        }
+                    }
+                }
+
+            } else {
+                adminTopic4.setB1("");
+                adminTopic4.setB2("");
+                adminTopic4.setB3("");
+                adminTopic4.setB4("");
+            }
+            //3、
+            AdminTopicTwo2 adminTopic3 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("3、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic3 != null) {
+                String[] split = adminTopic3.getTopicD().split(",");
+                String s1 = split[0];
+                if (StringUtils.isNotBlank(s1)){
+                    String substring = s1.substring(0, s1.indexOf("."));
+                    if ("A".equals(substring)) {
+                        adminTopic4.setC1(split[0]);
+                    } else if ("B".equals(substring)) {
+                        adminTopic4.setC2(split[0]);
+                    }
+                }
+
+            } else {
+                adminTopic4.setC1("");
+                adminTopic4.setC2("");
+
+            }
+            //4、
+            AdminTopicTwo2 adminTopic44 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("4、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic44 != null) {
+                String[] split = adminTopic44.getTopicD().split(",");
+                for (int j = 0; j < split.length; j++) {
+                    String s1 = split[j];
+                    if (StringUtils.isNotBlank(s1)){
+                        String substring = s1.substring(0, s1.indexOf("."));
+                        if ("A".equals(substring)) {
+                            adminTopic4.setD1(s1);
+                        } else if ("B".equals(substring)) {
+                            adminTopic4.setD2(s1);
+                        } else if ("C".equals(substring)) {
+                            adminTopic4.setD3(s1);
+                        } else if ("D".equals(substring)) {
+                            adminTopic4.setD4(s1);
+                        } else if ("E".equals(substring)) {
+                            adminTopic4.setD5(s1);
+                        } else if ("F".equals(substring)) {
+                            adminTopic4.setD6(s1);
+                        }
+                    }
+
+                }
+            } else {
+                adminTopic4.setD1("");
+                adminTopic4.setD2("");
+                adminTopic4.setD3("");
+                adminTopic4.setD4("");
+                adminTopic4.setD5("");
+                adminTopic4.setD6("");
+
+            }
+            //5、
+            AdminTopicTwo2 adminTopic5 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("5、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic5 != null) {
+                String[] split = adminTopic5.getTopicD().split(",");
+                adminTopic4.setE1(split[0]);
+            } else {
+                adminTopic4.setE1("");
+            }
+            //6、
+            AdminTopicTwo2 adminTopic6 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("6、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic6 != null) {
+                String[] split = adminTopic6.getTopicD().split(",");
+                for (int j = 0; j < split.length; j++) {
+                    String s1 = split[j];
+                    if (StringUtils.isNotBlank(s1)){
+                        String substring = s1.substring(0, s1.indexOf("."));
+                        if ("A".equals(substring)) {
+                            adminTopic4.setF1(s1);
+                        } else if ("B".equals(substring)) {
+                            adminTopic4.setF2(s1);
+                        } else if ("C".equals(substring)) {
+                            adminTopic4.setF3(s1);
+                        } else if ("D".equals(substring)) {
+                            adminTopic4.setF4(s1);
+                        }
+                    }
+
+                }
+            } else {
+                adminTopic4.setF1("");
+                adminTopic4.setF2("");
+                adminTopic4.setF3("");
+                adminTopic4.setF4("");
+            }
+            //7、
+            AdminTopicTwo2 adminTopic7 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("7、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic7 != null) {
+                String[] split = adminTopic7.getTopicD().split(",");
+                adminTopic4.setG1(split[0]);
+            } else {
+                adminTopic4.setG1("");
+
+            }
+            //8、
+            AdminTopicTwo2 adminTopic8 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("8、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic8 != null) {
+                String[] split = adminTopic8.getTopicD().split(",");
+                String s1 = split[0];
+                if (StringUtils.isNotBlank(s1)){
+                    String substring = s1.substring(0, s1.indexOf("."));
+                    if ("A".equals(substring)) {
+                        adminTopic4.setH1(split[0]);
+                    } else if ("B".equals(substring)) {
+                        adminTopic4.setH2(split[0]);
+                    }
+                }
+
+            } else {
+                adminTopic4.setH1("");
+                adminTopic4.setH2("");
+
+            }
+            //9、
+            AdminTopicTwo2 adminTopic9 = exportList.stream()
+                    .filter(p -> p.getTopicT().matches("9、" + ".*"))
+                    .findFirst()
+                    .orElse(null);
+
+            if (adminTopic9 != null) {
+                String[] split = adminTopic9.getTopicD().split(",");
+                adminTopic4.setI1(split[0]);
+            } else {
+                adminTopic4.setI1("");
+            }
+            //10、
+            AdminTopicTwo2 adminTopic10 = exportList.get(9);
+
+//            AdminTopicTwo2 adminTopic10 = exportList.stream()
+//                    .filter(p -> p.getTopicT().matches("10、" + ".*"))
+//                    .findFirst()
+//                    .orElse(null);
+
+            if (adminTopic10 != null) {
+                String[] split = adminTopic10.getTopicD().split(",");
+                String s1 = split[0];
+                if (StringUtils.isNotBlank(s1)){
+                    String substring = s1.substring(0, s1.indexOf("."));
+                    if ("A".equals(substring)) {
+                        adminTopic4.setJ1(split[0]);
+                    } else if ("B".equals(substring)) {
+                        adminTopic4.setJ2(split[0]);
+                    }
+                }
+
+            } else {
+                adminTopic4.setJ1("");
+                adminTopic4.setJ2("");
+            }
+            //11、
+            AdminTopicTwo2 adminTopic11 = exportList.get(10);
+
+//            AdminTopicTwo2 adminTopic11 = exportList.stream()
+//                    .filter(p -> p.getTopicT().matches("11、" + ".*"))
+//                    .findFirst()
+//                    .orElse(null);
+
+            if (adminTopic11 != null) {
+                String[] split = adminTopic11.getTopicD().split(",");
+                for (int j = 0; j < split.length; j++) {
+                    String s1 = split[j];
+                    if (StringUtils.isNotBlank(s1)){
+                        String substring = s1.substring(0, s1.indexOf("."));
+                        if ("A".equals(substring)) {
+                            adminTopic4.setK1(s1);
+                        } else if ("B".equals(substring)) {
+                            adminTopic4.setK2(s1);
+                        } else if ("C".equals(substring)) {
+                            adminTopic4.setK3(s1);
+                        } else if ("D".equals(substring)) {
+                            adminTopic4.setK4(s1);
+                        }
+                    }
+                }
+            } else {
+                adminTopic4.setK1("");
+                adminTopic4.setK2("");
+                adminTopic4.setK3("");
+                adminTopic4.setK4("");
+
+            }
+            //12、
+            AdminTopicTwo2 adminTopic12 = exportList.get(11);
+
+//            AdminTopicTwo2 adminTopic12 = exportList.stream()
+//                    .filter(p -> p.getTopicT().matches("12、" + ".*"))
+//                    .findFirst()
+//                    .orElse(null);
+
+            if (adminTopic12 != null) {
+                String[] split = adminTopic12.getTopicD().split(",");
+                String s1 = split[0];
+                if (StringUtils.isNotBlank(s1)){
+                    String substring = s1.substring(0, s1.indexOf("."));
+                    if ("A".equals(substring)) {
+                        adminTopic4.setL1(split[0]);
+                    } else if ("B".equals(substring)) {
+                        adminTopic4.setL2(split[0]);
+                    } else if ("C".equals(substring)) {
+                        adminTopic4.setL3(split[0]);
+                    } else if ("D".equals(substring)) {
+                        adminTopic4.setL4(split[0]);
+                    } else if ("E".equals(substring)) {
+                        adminTopic4.setL5(split[0]);
+                    } else if ("F".equals(substring)) {
+                        adminTopic4.setL6(split[0]);
+                    }
+                }
+            } else {
+                adminTopic4.setL1("");
+                adminTopic4.setL2("");
+                adminTopic4.setL3("");
+                adminTopic4.setL4("");
+                adminTopic4.setL5("");
+                adminTopic4.setL6("");
+            }
+            //13、
+//            AdminTopicTwo2 adminTopic13 = exportList.stream()
+//                    .filter(p -> p.getTopicT().matches("13、" + ".*"))
+//                    .findFirst()
+//                    .orElse(null);
+            AdminTopicTwo2 adminTopic13 = exportList.get(12);
+
+            if (adminTopic13 != null) {
+                String[] split = adminTopic13.getTopicD().split(",");
+                String s1 = split[0];
+                if (StringUtils.isNotBlank(s1)){
+                    String substring = s1.substring(0, s1.indexOf("."));
+                    if ("A".equals(substring)) {
+                        adminTopic4.setM1(split[0]);
+                    } else if ("B".equals(substring)) {
+                        adminTopic4.setM2(split[0]);
+                    }
+                }
+            } else {
+                adminTopic4.setM1("");
+                adminTopic4.setM2("");
+
+            }
+            if (exportList.size() > 13) {
+//                            AdminTopicTwo2 adminTopic14 = exportList.stream()
+//                    .filter(p -> p.getTopicT().matches("14、" + ".*"))
+//                    .findFirst()
+//                    .orElse(null);
+                //14、
+
+                AdminTopicTwo2 adminTopic14 = exportList.get(13);
+
+                if (adminTopic14 != null) {
+                    String[] split = adminTopic14.getTopicD().split(",");
+                    for (int j = 0; j < split.length; j++) {
+                        String s1 = split[j];
+                        if (StringUtils.isNotBlank(s1)){
+                            String substring = s1.substring(0, s1.indexOf("."));
+                            if ("A".equals(substring)) {
+                                adminTopic4.setN1(s1);
+                            } else if ("B".equals(substring)) {
+                                adminTopic4.setN2(s1);
+                            } else if ("C".equals(substring)) {
+                                adminTopic4.setN3(s1);
+                            } else if ("D".equals(substring)) {
+                                adminTopic4.setN4(s1);
+                            }
+                        }
+                    }
+                } else {
+                    adminTopic4.setN1("");
+                    adminTopic4.setN2("");
+                    adminTopic4.setN3("");
+                    adminTopic4.setN4("");
+                }
+                //15、
+//            AdminTopicTwo2 adminTopic15 = exportList.stream()
+//                    .filter(p -> p.getTopicT().matches("15、" + ".*"))
+//                    .findFirst()
+//                    .orElse(null);
+                AdminTopicTwo2 adminTopic15 = exportList.get(14);
+
+
+                if (adminTopic15 != null) {
+                    String[] split = adminTopic15.getTopicD().split(",");
+                    String s1 = split[0];
+                    if (StringUtils.isNotBlank(s1)){
+                        String substring = s1.substring(0, s1.indexOf("."));
+                        if ("A".equals(substring)) {
+                            adminTopic4.setP1(split[0]);
+                        } else if ("B".equals(substring)) {
+                            adminTopic4.setP2(split[0]);
+                        } else if ("C".equals(substring)) {
+                            adminTopic4.setP3(split[0]);
+                        } else if ("D".equals(substring)) {
+                            adminTopic4.setP4(split[0]);
+                        } else if ("E".equals(substring)) {
+                            adminTopic4.setP5(split[0]);
+                        } else if ("F".equals(substring)) {
+                            adminTopic4.setP6(split[0]);
+                        }
+                    }
+
+                } else {
+                    adminTopic4.setP1("");
+                    adminTopic4.setP2("");
+                    adminTopic4.setP3("");
+                    adminTopic4.setP4("");
+                    adminTopic4.setP5("");
+                    adminTopic4.setP6("");
+                }
+
+            }
+
+            adminTopics4.add(adminTopic4);
+        }
+        return adminTopics4;
+    }
+
 }

+ 131 - 12
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/APIController.java

@@ -1,19 +1,12 @@
 package org.jeecg.modules.api.controller;
 
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
-import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
 import com.aliyun.tea.TeaException;
-import com.aliyun.teautil.models.RuntimeOptions;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.Response;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.util.JwtUtil;
@@ -33,18 +26,18 @@ import org.jeecg.modules.adminuser.entity.AdminUser;
 import org.jeecg.modules.adminuser.service.IAdminUserService;
 import org.jeecg.modules.adminwjdc.entity.AdminTopic;
 import org.jeecg.modules.adminwjdc.service.IAdminTopicService;
+import org.jeecg.modules.adminwjdc2.entity.AdminTopicTwo;
+import org.jeecg.modules.adminwjdc2.service.IAdminTopicaTwoService;
 import org.jeecg.modules.api.entity.ForgetThePasswordDTO;
 import org.jeecg.modules.api.entity.SmsSendDTO;
 import org.jeecg.modules.api.entity.UserDTO;
 import org.jeecg.modules.base.service.BaseCommonService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.DigestUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.io.IOException;
-import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -70,8 +63,69 @@ public class APIController {
     private IAdminCaseNameService adminCaseNameService;
     @Autowired
     private IAdminTopicService adminTopicService;
+    @Autowired
+    private IAdminTopicaTwoService adminTopicaTwoService;
 
 
+    @GetMapping(value = "/a")
+    public void a(){
+        try {
+            QueryWrapper<AdminMedicalHistory> queryWrapper = new QueryWrapper<>();
+            queryWrapper.isNull( "submitter_name" );
+            List<AdminMedicalHistory> list = adminMedicalHistoryService.list(queryWrapper);
+            int a =list.size();
+            System.err.println(a);
+            for (int i = 0;i<a;i++){
+                System.err.println("i="+i);
+                QueryWrapper<AdminUser> queryWrapper2 = new QueryWrapper<>();
+
+                queryWrapper2.eq( "phone", list.get( i ).getPhone() );
+                queryWrapper2.eq( "doctor_and_specialist", "1" );
+                AdminUser storeMember1 = adminUserService.getOne( queryWrapper2 );
+                AdminMedicalHistory adminMedicalHistory =new AdminMedicalHistory();
+
+                if (storeMember1==null){
+                    adminMedicalHistory.setId( list.get( i ).getId() );
+                    adminMedicalHistory.setSubmitterName( "无" );
+                }else {
+                    adminMedicalHistory.setId( list.get( i ).getId() );
+                    adminMedicalHistory.setSubmitterName( storeMember1.getName() );
+                }
+
+                adminMedicalHistoryService.updateById( adminMedicalHistory );
+            }
+        }catch (Exception e){
+            System.err.println("错误");
+        }
+    }
+    @GetMapping(value = "/b")
+    public void b(){
+        try {
+            QueryWrapper<AdminTopic> queryWrapper = new QueryWrapper<>();
+            queryWrapper.isNull( "phone" );
+            List<AdminTopic> list = adminTopicService.list( queryWrapper );
+            int a =list.size();
+            System.err.println(a);
+            for (int i = 0;i<a;i++){
+                System.err.println("i="+i);
+                QueryWrapper<AdminUser> queryWrapper2 = new QueryWrapper<>();
+
+                queryWrapper2.eq( "name", list.get( i ).getUsername() );
+                queryWrapper2.eq( "doctor_and_specialist", "1" );
+
+                List<AdminUser> list1 = adminUserService.list( queryWrapper2 );
+                if (list1.size()==1){
+                    AdminTopic adminTopic =new AdminTopic();
+                    adminTopic.setId( list.get( i ).getId() );
+                    adminTopic.setPhone( list1.get( 0 ).getPhone() );
+                    adminTopicService.updateById(adminTopic);
+                }
+            }
+        }catch (Exception e){
+            System.err.println("错误");
+        }
+    }
+
     @ApiOperation(value="上传附件和图片到OSS", notes="上传附件和图片到OSS")
     @PostMapping(value = "/uploadLocality")
     public Result<String> uploadLocality(MultipartFile file){
@@ -508,6 +562,7 @@ public class APIController {
                 return result;
             }
             adminMedicalHistory.setPhone(userPhone);
+            adminMedicalHistory.setSubmitterName(storeMember1.getName());
             //初始化状态数据
             adminMedicalHistory.setIsSecondaryUpload("3");
             adminMedicalHistory.setFirstTrial("0");
@@ -533,6 +588,9 @@ public class APIController {
     @ApiOperation(value = "病例编辑", notes = "病例编辑")
     @PostMapping(value = "/patientQuideEdit")
     public Result<String> patientQuideEdit(@RequestBody AdminMedicalHistory adminMedicalHistory) {
+        if (adminMedicalHistory.getType()!=null){
+            adminMedicalHistory.setZjspTime( new Date(  ) );
+        }
         adminMedicalHistoryService.updateById(adminMedicalHistory);
         return Result.OK("编辑成功!");
     }
@@ -555,7 +613,6 @@ public class APIController {
             return result;
         }
         try {
-
             //1. 校验用户是否有效
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq( "phone", userPhone );
@@ -730,6 +787,68 @@ public class APIController {
         }
     }
 
+
+    @ApiOperation(value = "问卷调查二", notes = "问卷调查二")
+    @PostMapping(value = "/topicAdd2")
+    public Result<Boolean> topicAdd2(@RequestHeader("Authorization") String Authorization,
+                                    @RequestBody AdminTopicTwo adminTopic) {
+        Result<Boolean> result = new Result<Boolean>();
+        if (Authorization.equals( "" )) {
+            result.setMessage( "token不能为空" );
+            return result;
+        }
+
+        String userPhone = JwtUtil.getUsername( Authorization );
+
+        //校验token==================
+        if (!redisUtil.hasKey( CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone )) {
+            result.setMessage( "TOKEN失效" );
+            result.setCode( 201 );
+            return result;
+        }
+        try {
+
+            //1. 校验用户是否有效
+            QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq( "phone", userPhone );
+            AdminUser storeMember1 = adminUserService.getOne( queryWrapper );
+
+            if (storeMember1 == null) {
+                result.setMessage( "token校验该用户不存在" );
+                baseCommonService.addLog( "用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null );
+                return result;
+            }
+            adminTopic.setUsername( storeMember1.getName() );
+            adminTopic.setPhone( storeMember1.getPhone() );
+
+            String outpatientServiceTime = adminTopic.getOutpatientServiceTime();
+            String age = adminTopic.getAge();
+            String height = adminTopic.getHeight();
+            String weight = adminTopic.getWeight();
+            String endoscopicSurgeon = adminTopic.getEndoscopicSurgeon();
+            String hospital = adminTopic.getHospital();
+            String title = adminTopic.getTitle();
+            String endoscopicSurgery = adminTopic.getEndoscopicSurgery();
+            String visitReason = adminTopic.getVisitReason();
+            String pastMedicalHistory = adminTopic.getPastMedicalHistory();
+
+            adminTopic.setTopicTop("本次报告检查时间:"+outpatientServiceTime+",  检查医院:"+hospital+",  年龄:"+age+",  身高:"+height+"cm"+",  体重:"+weight+"kg"+
+                    ",  内镜操作医师:"+endoscopicSurgeon+",  职称:"+title+",  内镜手术累计"+endoscopicSurgery+"台/次"+",  就诊原因:"+visitReason+",  既往病史:"+pastMedicalHistory);
+            adminTopicaTwoService.save(adminTopic);
+
+            result.setMessage( "问卷调查提交成功" );
+            result.setResult( true );
+            result.setCode( 200 );
+            return result;
+        } catch (Exception e) {
+            result.setMessage( "问卷调查提交失败" );
+            result.setResult( null );
+            result.setCode( 0 );
+            return result;
+        }
+    }
+
+
     @ApiOperation(value = "获取个人问卷调查次数", notes = "获取个人问卷调查次数")
     @PostMapping(value = "/getTopicNum")
     public Result<Integer> getTopicNum(@RequestHeader("Authorization") String Authorization) {
@@ -749,7 +868,6 @@ public class APIController {
         }
         try {
 
-
             //1. 校验用户是否有效
             //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
             QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
@@ -764,6 +882,7 @@ public class APIController {
 
             QueryWrapper<AdminTopic> queryWrapper2 = new QueryWrapper<>();
             queryWrapper2.eq( "username", storeMember1.getName() );
+            queryWrapper2.eq( "phone", storeMember1.getPhone() );
             List<AdminTopic> list = adminTopicService.listNum( queryWrapper2 );
 
             result.setMessage( "获取个人问卷调查次数成功" );