Преглед изворни кода

Merge remote-tracking branch 'origin/master'

kouchengxing пре 4 година
родитељ
комит
345f8f593b

+ 4 - 1
dgtis-common/dgtis-common-core/src/main/java/com/dgtis/common/core/utils/DateUtils.java

@@ -52,7 +52,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     {
         return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
     }
-
+    public static final String getTime(Date date)
+    {
+        return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
+    }
     public static final String dateTimeNow()
     {
         return dateTimeNow(YYYYMMDDHHMMSS);

+ 101 - 0
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/api/CustomerApiController.java

@@ -0,0 +1,101 @@
+package com.dgtis.data.api;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.arronlong.httpclientutil.HttpClientUtil;
+import com.arronlong.httpclientutil.common.HttpConfig;
+import com.arronlong.httpclientutil.exception.HttpProcessException;
+import com.dgtis.common.core.utils.DateUtils;
+import com.dgtis.common.core.web.domain.AjaxResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description:客户信息列表api
+ * @author:qxm
+ * @date:2021/1/22 10:24
+ */
+@Controller
+@RequestMapping("/customer")
+public class CustomerApiController {
+
+    private static Logger logger = LoggerFactory.getLogger(CustomerApiController.class);
+
+    @Value("${elasticsearch.host}")
+    private String host;
+    @Value("${elasticsearch.port}")
+    private String port;
+
+    @GetMapping("/getCustomerList")
+    @ResponseBody
+    public AjaxResult getCustomerList(int pageNum,int pageSize) {
+        // 获取索引的别名,字段,创建时间
+        HttpConfig config = HttpConfig.custom().url("http://"+host+":"+port+"/shanglifeecif.individual/_search?from="+pageNum+"&size="+pageSize);
+        try {
+            String result = HttpClientUtil.get(config);
+            JSONObject jsonObject = JSON.parseObject(result);
+            JSONObject hitsobject = (JSONObject) jsonObject.get("hits");
+            JSONArray array = JSON.parseArray(hitsobject.get("hits").toString());
+            List listMap = new ArrayList<>();
+            Map map = new HashMap();
+            for (int i = 0; i <array.size() ; i++) {
+                JSONObject json = (JSONObject)array.get(i);
+                Map mp = new HashMap();
+                mp.put("id",json.getString("_id"));
+                JSONObject jsonOb = JSON.parseObject(json.getString("_source"));;
+                mp.putAll(JSON.parseObject(json.getString("_source"),Map.class));
+                mp.put("birthday", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",jsonOb.getDate("birthday")));
+                listMap.add(mp);
+            }
+            long total = hitsobject.getLong("total");
+
+            map.put("list",listMap);
+            map.put("total",total);
+
+            return AjaxResult.success(map);
+        } catch (HttpProcessException e) {
+            e.printStackTrace();
+            return AjaxResult.error();
+        }
+    }
+
+    @GetMapping("/getCustomerById")
+    @ResponseBody
+    public AjaxResult getCustomerById(String id) {
+        // 获取索引的别名,字段,创建时间http://10.32.2.231:9200/shanglifeecif.individual/default_type_/1
+        HttpConfig config = HttpConfig.custom().url("http://"+host+":"+port+"/shanglifeecif.individual/default_type_/"+id);
+        try {
+            Map map = new HashMap();
+            String result = HttpClientUtil.get(config);
+            JSONObject jsonObject = JSON.parseObject(result);
+            Map mpInfo = new HashMap();
+            mpInfo.put("id",jsonObject.getString("_id"));
+            mpInfo.putAll(JSON.parseObject(jsonObject.getString("_source"),Map.class));
+            mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",jsonObject.getDate("birthday")));
+            map.put("custInfo",mpInfo);
+            map.put("custInfo1",null);
+            map.put("custInfo2",null);
+            map.put("custInfo3",null);
+            map.put("custInfo4",null);
+            map.put("custInfo5",null);
+            map.put("custInfo6",null);
+            map.put("custInfo7",null);
+            map.put("custInfo8",null);
+            return AjaxResult.success(map);
+        } catch (HttpProcessException e) {
+            e.printStackTrace();
+            return AjaxResult.error();
+        }
+    }
+}

+ 8 - 8
dgtis-modules/dgtis-modules-data/src/main/resources/banner.txt

@@ -1,10 +1,10 @@
 Spring Boot Version: ${spring-boot.version}
 Spring Application Name: ${spring.application.name}
-                                 _                _           _
-                                (_)              | |         | |
-  _ __   _   _    ___    _   _   _   ______    __| |   __ _  | |_    __ _
- | '__| | | | |  / _ \  | | | | | | |______|  / _` |  / _` | | __|  / _` |
- | |    | |_| | | (_) | | |_| | | |          | (_| | | (_| | | |_  | (_| |
- |_|     \__,_|  \___/   \__, | |_|           \__,_|  \__,_|  \__|  \__,_|
-                          __/ |
-                         |___/
+                             _              _         _
+                            (_)            | |       | |
+  _ __  _   _   ___   _   _  _  ______   __| |  __ _ | |_   __ _
+ | '__|| | | | / _ \ | | | || ||______| / _` | / _` || __| / _` |
+ | |   | |_| || (_) || |_| || |        | (_| || (_| || |_ | (_| |
+ |_|    \__,_| \___/  \__, ||_|         \__,_| \__,_| \__| \__,_|
+                       __/ |
+                      |___/

+ 6 - 95
dgtis-ui/src/api/customerInformation/customerInformation.js

@@ -1,110 +1,21 @@
 import request from '@/utils/request'
-import { praseStrEmpty } from "@/utils/ruoyi";
 
 // 查询用户列表
-export function listUser(query) {
+export function listCustomer(query) {
   return request({
-    url: '/system/user/list',
+    url: '/data/customer/getCustomerList',
     method: 'get',
     params: query
   })
 }
 
 // 查询用户详细
-export function getUser(userId) {
+export function getCustomerById(query) {
   return request({
-    url: '/system/user/' + praseStrEmpty(userId),
-    method: 'get'
-  })
-}
-
-// 新增用户
-export function addUser(data) {
-  return request({
-    url: '/system/user',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改用户
-export function updateUser(data) {
-  return request({
-    url: '/system/user',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除用户
-export function delUser(userId) {
-  return request({
-    url: '/system/user/' + userId,
-    method: 'delete'
-  })
-}
-
-// 用户密码重置
-export function resetUserPwd(userId, password) {
-  const data = {
-    userId,
-    password
-  }
-  return request({
-    url: '/system/user/resetPwd',
-    method: 'put',
-    data: data
-  })
-}
-
-// 用户状态修改
-export function changeUserStatus(userId, status) {
-  const data = {
-    userId,
-    status
-  }
-  return request({
-    url: '/system/user/changeStatus',
-    method: 'put',
-    data: data
-  })
-}
-
-// 查询用户个人信息
-export function getUserProfile() {
-  return request({
-    url: '/system/user/profile',
-    method: 'get'
-  })
-}
-
-// 修改用户个人信息
-export function updateUserProfile(data) {
-  return request({
-    url: '/system/user/profile',
-    method: 'put',
-    data: data
+    url: '/data/customer/getCustomerById',
+    method: 'get',
+    params: query
   })
 }
 
-// 用户密码重置
-export function updateUserPwd(oldPassword, newPassword) {
-  const data = {
-    oldPassword,
-    newPassword
-  }
-  return request({
-    url: '/system/user/profile/updatePwd',
-    method: 'put',
-    params: data
-  })
-}
 
-// 用户头像上传
-export function uploadAvatar(data) {
-  return request({
-    url: '/system/user/profile/avatar',
-    method: 'post',
-    data: data
-  })
-}

+ 13 - 0
dgtis-ui/src/api/index.js

@@ -0,0 +1,13 @@
+import request from '@/utils/request'
+
+// 险种类别
+export function riskcode(query) {
+  return request({
+    url: '/data/index/riskcode',
+    method: 'get',
+    params: query
+  })
+}
+
+
+

+ 3 - 1
dgtis-ui/src/views/dashboard/BarChart2.vue

@@ -35,7 +35,9 @@
       };
     },
     mounted() {
-      this.initChart();
+        this.$nextTick(() => {
+            this.initChart();
+        })
     },
     beforeDestroy() {
       if (!this.chart) {

+ 3 - 1
dgtis-ui/src/views/dashboard/BarChart3.vue

@@ -35,7 +35,9 @@
       };
     },
     mounted() {
-      this.initChart();
+        this.$nextTick(() => {
+            this.initChart();
+        })
     },
     beforeDestroy() {
       if (!this.chart) {

+ 16 - 13
dgtis-ui/src/views/index.vue

@@ -207,6 +207,7 @@
   import BarChart from './dashboard/BarChart2'
   import BarChart3 from './dashboard/BarChart3'
   import PieChart from './dashboard/PieChart2'
+  import { riskcode } from "@/api/index";
   export default {
     name: "UserInfoDetails",
     components: {
@@ -228,19 +229,10 @@
         },
         // 险种类别
         barChartData:{
-          yAxisName:'单位:',
+          yAxisName:'单位:',
           color:['#028FF3','#F29700'],
-          xAxisData:['人寿保险', '年金保险', '健康险','意外伤害保险','重疾保险','万能保险'],
-          seriesData:[
-            {
-              name:'客户数量',
-              data: [ 390, 330, 220,390, 330, 220]
-            },
-            {
-              name:'保单总金额',
-              data: [80, 52, 200,80, 52, 200]
-            },
-          ]
+          xAxisData:[],
+          seriesData:[]
         },
         // 拥有保单件数分布
         pieChartData:{
@@ -322,6 +314,7 @@
     },
     mounted() {
       this.lunboFn();
+      this.getRiskcode();
     },
     methods: {
       _$ (el) {
@@ -365,7 +358,17 @@
       },
       toUserInfoList(){
         this.$router.push({ path:'/userInfoList'})
-      }
+      },
+        getRiskcode(){
+          let that = this;
+            riskcode().then(response => {
+                    console.log(response);
+                    that.barChartData.xAxisData =  response.data.xaxisData;
+                    that.barChartData.seriesData =  response.data.seriesData;
+                    this.loading = false;
+                }
+            );
+        },
     }
   };
 </script>

+ 35 - 5
dgtis-ui/src/views/system/userInfo/index.vue

@@ -2,11 +2,15 @@
   <div class="app-container">
     <div class="conPanel">
       <div class="userInfoPanel">
-        <div class="title">张大川<span class="num">(cp0185210402)</span><span class="tag">2孩儿</span><span class="tag">关注官微</span></div>
+        <div class="title">{{custInfo.name}}<span class="num">({{custInfo.custid}})</span>
+<!--          <span class="tag">2孩儿</span>-->
+          <span class="tag" v-for="item in 120" :key="item" v-if="labelPD(item)" v-text="labeText(item)"></span>
+        </div>
         <el-row class="userInfo">
           <el-col :span="12">
             <span class="name">性别</span>
-            <span class="value">男</span>
+            <span class="value" v-if="custInfo.gender == 0">男</span>
+            <span class="value" v-else>女</span>
           </el-col>
           <el-col :span="12">
             <span class="name">民族</span>
@@ -14,8 +18,8 @@
           </el-col>
           <el-col :span="12">
             <span class="name">出生日期</span>
-            <span class="value">1965-10-08</span>
-            <el-tag type="warning" effect="dark" size="mini">60后</el-tag>
+            <span class="value">{{custInfo.birthday}}</span>
+            <el-tag type="warning" effect="dark" size="mini">{{custInfo.label3}}</el-tag>
           </el-col>
           <el-col :span="12">
             <span class="name">国籍</span>
@@ -109,6 +113,7 @@
 </template>
 
 <script>
+import { getCustomerById } from "@/api/customerInformation/customerInformation.js";
 import habit from './components/habit'
 import health from './components/health'
 import contractInformation from './components/contractInformation'
@@ -131,6 +136,7 @@ export default {
   },
   data() {
     return {
+        custInfo:{},
       tabActive:'hyxx',
       habitData:[],
       healthData:[],
@@ -257,9 +263,33 @@ export default {
 
   },
   mounted() {
-
+      this.getCustomerByIdData();
   },
   methods: {
+      getCustomerByIdData(){
+          this.loading = true;
+          let id = this.$route.query.id;
+          getCustomerById({id:id}).then(response => {
+                  console.log(response);
+                  this.custInfo = response.data.custInfo
+                  this.loading = false;
+              }
+          );
+      },
+      labelPD(index){
+          var that = this;
+          var label = 'label'+index;
+          if(that.custInfo[label] && that.custInfo[label] != ""){
+              return true;
+          }else{
+              return false;
+          }
+      },
+      labeText(index){
+          var that = this;
+          var label = 'label'+index;
+          return that.custInfo[label];
+      },
     tabChange(tab, event){
       console.log(tab, event);
     },

+ 37 - 58
dgtis-ui/src/views/system/userInfoList/index.vue

@@ -17,19 +17,33 @@
                 v-hasPermi="['system:role:export']"
               >导出</el-button>
             </div>
-            <el-table v-loading="loading" :data="userList">
-              <el-table-column label="客户号" width="120" align="center" prop="userId" />
-              <el-table-column label="姓名" align="center" prop="userName" :show-overflow-tooltip="true" />
-              <el-table-column label="证件类型" align="center" prop="IDType" :show-overflow-tooltip="true" />
-              <el-table-column label="证件号码" width="160" align="center" prop="IDNum" :show-overflow-tooltip="true" />
-              <el-table-column label="性别" align="center" prop="sex" width="70" />
-              <el-table-column label="出生日期" align="center" prop="birthday" width="150">
-<!--                <template slot-scope="scope">-->
-<!--                  <span>{{ parseTime(scope.row.createTime) }}</span>-->
-<!--                </template>-->
+            <el-table v-loading="loading" :data="customerList">
+              <el-table-column label="客户号" width="120" align="center" prop="custid" />
+              <el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true" />
+              <el-table-column label="证件类型" align="center" prop="idtype" :show-overflow-tooltip="true" >
+                <template slot-scope="scope">
+                  <span>身份证</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="证件号码" width="160" align="center" prop="idcard" :show-overflow-tooltip="true" />
+              <el-table-column label="性别" align="center" prop="gender" width="70">
+                  <template slot-scope="scope">
+                    <span v-if="scope.row.gender == 0">男</span>
+                    <span v-else>女</span>
+                  </template>
+              </el-table-column>
+              <el-table-column label="出生日期" align="center" width="150">
+                <template slot-scope="scope">
+                  <span>{{ parseTime(scope.row.birthday,'{yy}-{mm}-{dd}') }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="年龄" align="center" prop="label3" width="70" />
+              <el-table-column label="客户层级" align="center" prop="level" width="80">
+                <template slot-scope="scope">
+                  <span v-if="scope.row.gender == 0">男</span>
+                  <span v-else>女</span>
+                </template>
               </el-table-column>
-              <el-table-column label="年龄" align="center" prop="age" width="70" />
-              <el-table-column label="客户层级" align="center" prop="level" width="80" />
               <el-table-column
                 label="操作"
                 align="center"
@@ -70,9 +84,9 @@
 </template>
 
 <script>
-  import { listUser } from "@/api/system/user";
+  import { listCustomer } from "@/api/customerInformation/customerInformation.js";
 export default {
-  name: "UserList",
+  name: "CustomerList",
   data() {
     return {
       // 遮罩层
@@ -81,46 +95,11 @@ export default {
       total: 0,
       // 用户表格数据
       // userList: null,
-      userList: [
-        {
-          userId:'CP0185210401',
-          userName:'刘德华',
-          IDType:'身份证',
-          IDNum:'410326****2345',
-          sex:'男',
-          birthday:'2020-01-01',
-          age:30,
-          level:'白金'
-        },
-        {
-          userId:'CP0185210401',
-          userName:'刘德华',
-          IDType:'身份证',
-          IDNum:'410326****2345',
-          sex:'男',
-          birthday:'2020-01-01',
-          age:30,
-          level:'白金'
-        },
-        {
-          userId:'CP0185210401',
-          userName:'刘德华',
-          IDType:'身份证',
-          IDNum:'410326****2345',
-          sex:'男',
-          birthday:'2020-01-01',
-          age:30,
-          level:'白金'
-        },
-      ],
+      customerList: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 10,
-        userName: undefined,
-        phonenumber: undefined,
-        status: undefined,
-        deptId: undefined
+        pageSize: 10
       },
     };
   },
@@ -128,16 +107,16 @@ export default {
 
   },
   created() {
-    // this.getList();
-    this.total = 3;
+    this.getList();
   },
   methods: {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-          this.userList = response.rows;
-          this.total = response.total;
+        listCustomer(this.queryParams).then(response => {
+            console.log(response);
+          this.customerList = response.data.list;
+          this.total = response.data.total;
           this.loading = false;
         }
       );
@@ -151,8 +130,8 @@ export default {
     toOverview(){
       this.$router.push({ path:'/system/userInfoDetails'  })
     },
-    toDetail(){
-      this.$router.push({ path:'/system/userInfo'  })
+    toDetail(row){
+      this.$router.push({ path:'/system/userInfo', query: {id: row.id}  })
     }
   }
 };