Prechádzať zdrojové kódy

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper into master

seyason 2 rokov pred
rodič
commit
2316383c35

+ 23 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -4,6 +4,8 @@ package com.management.platform.controller;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.FeishuInfo;
 import com.management.platform.entity.User;
+import com.management.platform.entity.UserCustom;
+import com.management.platform.mapper.UserCustomMapper;
 import com.management.platform.service.FeishuInfoService;
 import com.management.platform.service.UserService;
 import com.management.platform.util.HttpRespMsg;
@@ -40,6 +42,9 @@ public class UserController {
     @Resource
     private FeishuInfoService feishuInfoService;
 
+    @Resource
+    private UserCustomMapper userCustomMapper;
+
     /**
      * 登录网页端
      * username 用户名
@@ -278,5 +283,23 @@ public class UserController {
         return userService.areaData(token);
     }
 
+    /**
+     * 返回用户自定义的地区名称
+     * @return
+     */
+    @RequestMapping("/areaName")
+    public HttpRespMsg areaName(HttpServletRequest request){
+        HttpRespMsg httpRespMsg=new HttpRespMsg();
+        String token = request.getHeader("token");
+        User user = userService.getById(token);
+        List<UserCustom> userCustoms = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", user.getCompanyId()).orderByAsc("id"));
+        String customName = "";
+        if (userCustoms.size() != 0){
+            customName = userCustoms.get(0).getName();
+        }
+        httpRespMsg.data = customName;
+        return httpRespMsg;
+    }
+
 }
 

+ 15 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.util.StringUtil;
 import com.management.platform.entity.*;
 import com.management.platform.entity.vo.*;
 import com.management.platform.mapper.*;
@@ -9809,6 +9810,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        List<UserCustom> userCustoms = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", user.getCompanyId()).orderByAsc("id"));
+        String customName = "";
+        if (userCustoms.size() != 0){
+            customName = userCustoms.get(0).getName();
+        }
         HttpRespMsg fteData = getFTEData(null, null, month, area, request);
         Map<String, Object> data = (Map<String, Object>) (Map<String, Object>) fteData.data;
         List<Map<String, Object>> resultList = (List<Map<String, Object>>) data.get("resultList");
@@ -9817,7 +9823,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<String> titleList=new ArrayList<>();
         List<String> subtitle=new ArrayList<>();
         Integer no = 0;
-        titleList.add("地区");
+        titleList.add(customName);
         titleList.add("序号");
         titleList.add("CRC姓名");
         titleList.add("项目号");
@@ -9839,10 +9845,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Float aTimeSum = 0.0F;
         Float aFteSum = 0.0F;
         for (int i = 0; i < resultList.size(); i++) {
+            if (!resultList.get(i).containsKey("area")){
+                resultList.get(i).put("area","无");
+            }else if(org.apache.commons.lang3.StringUtils.isBlank(resultList.get(i).get("area").toString())){
+                resultList.get(i).put("area","无");
+            }
             ArrayList<String> row = new ArrayList<>();
             if (i == 0){
                 no += 1;
-                row.add(resultList.get(i).get("area")==null?"无":resultList.get(i).get("area").toString());
+                row.add(resultList.get(i).get("area").toString());
                 row.add(no + "");
                 if (wxCorpInfo != null && wxCorpInfo.getSaasSyncContact().equals(1)){
                     row.add(resultList.get(i).get("corpwx_userid") + "");
@@ -9944,7 +9955,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 ArrayList<String> sum = new ArrayList<>();
                 sum.add("");
                 sum.add("");
-                sum.add("地区合计");
+                sum.add(customName + "合计");
                 sum.add("");
                 sum.add("");
                 sum.add(aTimeSum.toString());
@@ -10002,7 +10013,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 ArrayList<String> sum = new ArrayList<>();
                 sum.add("");
                 sum.add("");
-                sum.add("地区合计");
+                sum.add(customName + "合计");
                 sum.add("");
                 sum.add("");
                 sum.add(aTimeSum.toString());

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -2829,7 +2829,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         List<User> items = userMapper.selectList(new QueryWrapper<User>().select("DISTINCT plate1").eq("company_id", user.getCompanyId()));
         ArrayList<String> areas = new ArrayList<String>();
         for (User item : items) {
-            areas.add(item.getPlate1());
+            if (item!= null && item.getPlate1()!= null && org.apache.commons.lang3.StringUtils.isNotBlank(item.getPlate1())){
+                areas.add(item.getPlate1());
+            }
         }
         httpRespMsg.data = areas;
         return httpRespMsg;

+ 25 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -120,7 +120,7 @@
           </el-select>
 
           <!-- 地区筛选 -->
-          <el-select v-if="ins == 19" v-model="areaName" placeholder="请选择地区" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
+          <el-select v-if="ins == 19" v-model="areaName" :placeholder="customNameChoose" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
             <el-option :label="item" :value="item" v-for="item,index in areaList" :key="index"></el-option>
           </el-select>
 
@@ -841,7 +841,7 @@
 
             <!-- ETF报表 -->
             <el-table v-if="ins == 19"  key="19" border :data="fTEDataList" highlight-current-row v-loading="listLoading" :height="+tableHeight - 1" style="width: 100%;">
-                <el-table-column align="center" prop="area" label="地区" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="area" :label="customName" min-width="150"></el-table-column>
                 <el-table-column align="center" prop="projectCode" label="项目编号" min-width="150"></el-table-column>
                 <el-table-column align="center" prop="projectName" label="项目名称" min-width="250"></el-table-column>
                 <el-table-column align="center" prop="userName" label="人名" min-width="150">
@@ -1086,7 +1086,9 @@ export default {
   props: {},
   data() {
     return {
+      customNameChoose: '',
       areaName: '',
+      customName: '',
       permissions: JSON.parse(sessionStorage.getItem("permissions")),
       curProject:{},
       feeType:[this.$t('generalcost'), this.$t('travelexpenses'), this.$t('outsourcingcost')],
@@ -1336,7 +1338,26 @@ export default {
       }
     },
 
-
+    getCustomName(){
+      this.http.post('/user/areaName', {},
+      res => {
+          if (res.code == "ok") {
+              this.customName = res.data
+              this.customNameChoose = "请选择" + res.data
+          } else {
+              this.$message({
+                message: res.msg,
+                type: "error"
+              });
+          }
+      },
+      error => {
+          this.$message({
+              message: error,
+              type: "error"
+          });
+      });
+    },
 
     getUserList() {
       console.log(this.shuzArr[this.ins])
@@ -1769,6 +1790,7 @@ export default {
     },
     // 获取EFT报表的数据
     getETF() {
+      this.getCustomName();
       this.listLoading = true;
       let parameter = {
         month: this.monthPersonnel + '-01',