Explorar o código

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

Min hai 1 ano
pai
achega
a7b991f12c

+ 10 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/DepartmentController.java

@@ -165,5 +165,15 @@ public class DepartmentController {
         }
         return httpRespMsg;
     }
+
+    /**
+     * 获取当前用户的班组人员
+     * @param request
+     * @return
+     */
+    @RequestMapping("getMyGroups")
+    public  HttpRespMsg getMyGroups(HttpServletRequest request){
+        return  departmentService.getMyGroups(request);
+    }
 }
 

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

@@ -77,6 +77,8 @@ public class UserController {
     private ExpenseMainTypeService expenseMainTypeService;
     @Resource
     private ExpenseTypeService expenseTypeService;
+    @Resource
+    private UserWorkTypeService userWorkTypeService;
 
     @Value("${spring.ldap.urls}")
     private String ldapUrl;
@@ -114,6 +116,20 @@ public class UserController {
         return userService.getUserInfo(userId);
     }
 
+    @RequestMapping("/getBaseInfo")
+    public HttpRespMsg getBaseInfo(@RequestParam String userId){
+        HttpRespMsg msg=new HttpRespMsg();
+        User user = userService.getById(userId);
+        UserWorkType workType = userWorkTypeService.getById(user.getWorkTypeId());
+        if(workType!=null){
+            user.setWorkType(workType.getName());
+        }
+
+        msg.setData(user);
+
+        return msg;
+    }
+
     /**
      * 获取员工的列表
      * departmentId 检索的部门id -1为全部 0为其他

+ 10 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/User.java

@@ -289,7 +289,16 @@ public class User extends Model<User> {
     */
     @TableField(exist = false)
     private Integer isExistsReport;
-
+    /**
+     * 工种id
+     */
+    @TableField("work_type_id")
+    private Integer workTypeId;
+    /**
+     * 工种名
+     */
+    @TableField(exist = false)
+    private String workType;
 
     @Override
     protected Serializable pkVal() {

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/DepartmentService.java

@@ -61,4 +61,6 @@ public interface DepartmentService extends IService<Department> {
     String exportWxDepartment(Department department,List<Department> departmentList);
 
     HttpRespMsg sortList(HttpServletRequest request,List<DepartmentVO> list);
+
+    HttpRespMsg getMyGroups(HttpServletRequest request);
 }

+ 36 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -2,6 +2,7 @@ package com.management.platform.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.entity.*;
@@ -31,6 +32,7 @@ import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * <p>
@@ -69,6 +71,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
     private ExcelExportService excelExportService;
     @Resource
     private WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private UserWorkTypeMapper userWorkTypeMapper;
 
     @Value("${corpId}")
     private String corpId;
@@ -1516,6 +1520,38 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         return msg;
     }
 
+    /**
+     * 获取当前班组人员
+     * @param request
+     * @return
+     */
+    @Override
+    public HttpRespMsg getMyGroups(HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        User user = userMapper.selectById(request.getHeader("token"));
+        ArrayList<User> departmentUserList = new ArrayList<>();
+
+        List<User> groupList = userMapper.selectList(new LambdaQueryWrapper<User>()
+                .eq(user.getCompanyId() != null, User::getCompanyId, user.getCompanyId())
+                .eq(user.getDepartmentId() != null, User::getDepartmentId, user.getDepartmentId())
+                .select(User::getId, User::getName,User::getJobNumber,User::getWorkTypeId)
+        );
+
+        List<UserWorkType> userWorkTypeList = userWorkTypeMapper.selectList(null);
+
+        groupList.stream().forEach(member->{
+            List<UserWorkType> workTypeList = userWorkTypeList.stream().filter(userWorkType -> userWorkType.getId() == member.getWorkTypeId()).collect(Collectors.toList());
+            if(workTypeList!=null&&workTypeList.size()>0){
+                member.setWorkType(workTypeList.get(0).getName());
+            }
+        });
+
+
+        msg.setData(groupList);
+
+        return msg;
+    }
+
     /**
      * 递归对返回的部门数据进行排序
      * @param list

+ 14 - 6
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -13,6 +13,7 @@ import com.management.platform.service.ProdMaterialService;
 import com.management.platform.service.ProdProcedureService;
 import com.management.platform.service.ProductService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
@@ -715,18 +716,25 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                     case 1: item.add("互检");break;
                     case 2: item.add("专检");break;
                 }
+                dataProcedureList.add(item);
             }
 
-        }
+            HttpRespMsg msg=new HttpRespMsg();
+            String fileName = "产品详情"+"_"+System.currentTimeMillis();
+            String sheetOneName="产品基本信息";
+            String sheetTwoName="派工单";
 
 
+            String result = ExcelUtil.exportTwoSheetGeneralExcelByTitleAndList(fileName, dataProductList, dataProcedureList, path, sheetOneName, sheetTwoName);
 
+            msg.setData(result);
 
-     /*       //导出excel
-            String result="系统提示:Excel文件导出成功!";
-            //生成Excel文件
-            String fileName = "产品详情"+System.currentTimeMillis();
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);*/
+            return msg;
+        }
+
+
+
+           /* return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);*/
         return null;
     }
 

+ 8 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/router/index.js

@@ -89,6 +89,14 @@ const router = new Router({
             title: "班组人员",
             keepAlive: false
         }
+    },
+     {
+        path: "/MemberInfo",
+        component: () => import("@/views/groupView/info"),
+        meta: {
+            title: "通讯录",
+            keepAlive: false
+        }
     },
     {
         path: "/workView",

+ 47 - 4
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/groupView/groupView.vue

@@ -1,9 +1,16 @@
 <template>
   <div>
-    <van-nav-bar title="班组成员" left-text="返回"  @click-left="back" fixed left-arrow/>
+    <van-nav-bar  title="班组成员" left-text="返回"  @click-left="back" fixed left-arrow/>
     <div style="margin-top: 44px;">
       <van-list  :finished="true" >
-      <van-cell v-for="item in list" :key="item" :title="item" />
+      <van-cell v-for="item in list" :key="item.id" :id="item.id" :title="item.name" @click="onClick">
+        <template>
+          <div style="width:100%;text-align: left;" >
+            <span style="width:50%;color:#323232;">{{item.workType}}</span>
+            <span style="float:right;color:#323232;">{{ item.jobNumber }}</span>
+          </div>
+        </template>
+      </van-cell>
       </van-list>
     </div>
     
@@ -16,17 +23,53 @@ export default {
   components: {},
   data() {
     return {
-        list:['张三','李四','王五']
+        list:[]
     };
   },
   computed: {},
   watch: {},
   created() {},
-  mounted() {},
+  mounted() {
+    this.getMyGroupList();
+  },
   methods: {
     back() {
       this.$router.go(-1);
     },
+    getMyGroupList(){
+      this.$axios.post('/department/getMyGroups',{})
+      .then(res=>{
+        if (res.code == "ok") {
+          this.list=res.data.map(item=>{
+            return {
+              name: item.name,
+              id: item.id,
+              jobNumber: item.jobNumber,
+              workType: item.workType
+            }
+          })
+          console.log(this.list)
+
+        } else {
+            this.$toast.clear();
+            this.$toast.fail(res.msg);
+          }
+        }).catch(err => { this.$toast.clear(); 
+      })
+    },
+    onClick(e){
+      console.log(e.currentTarget.innerText, '点击的数据')
+      this.$router.push({
+        path: '/MemberInfo',
+        query: {
+          id: e.currentTarget.id
+        }
+      })
+
+     /*  console.log(e)
+      console.log(e.currentTarget.id)
+      console.log(e.currentTarget.innerText) */
+    }
 
   },
 };

+ 59 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/groupView/info.vue

@@ -0,0 +1,59 @@
+<template>
+    <div>
+        <van-nav-bar title="通讯录" left-text="返回" @click-left="back" fixed left-arrow />
+        <div style="margin-top: 44px;">
+            <van-list :finished="true">
+                <van-cell  title="员工名称" ><div>{{ user.name }}</div></van-cell>
+                <van-cell  title="工种" ><div>{{ user.jobNumber }}</div></van-cell>
+                <van-cell  title="工号" ><div>{{ user.workType }}</div></van-cell>
+                <van-cell  title="手机号码" ><div>{{ user.phone }}</div></van-cell>
+                <van-cell  title="性别" ><div>{{ user.gender==1?'男':'女' }}</div></van-cell>
+            </van-list>
+        </div>
+
+    </div>
+</template>
+<script>
+export default {
+    props: {},
+    components: {},
+    data() {
+        return {
+            id: null,
+            user:{},
+            list: []
+        };
+    },
+    computed: {},
+    watch: {},
+    created() { },
+    mounted() {
+        this.id = this.$route.query.id,
+        this.getMemberInfo();
+        
+    },
+    methods: {
+         
+        back() {
+            this.$router.go(-1);
+        },
+        getMemberInfo() {
+            this.$axios.post('/user/getBaseInfo', { userId : this.id})
+                .then(res => {
+                    if (res.code == "ok") {
+                        this.user = res.data
+                        console.log(this.user)
+                    } else {
+                        this.$toast.clear();
+                        this.$toast.fail(res.msg);
+                    }
+                }).catch(err => {
+                    this.$toast.clear();
+                })
+        }
+
+    },
+};
+</script>
+
+<style scoped></style>

+ 39 - 5
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -18,7 +18,7 @@
                 </el-form-item>
                 <!--操作按钮-->
                 <el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false"  :disabled="productSelections.length==0" @click="importProduct()">导出产品</el-link>
+                    <el-link type="primary" :underline="false"  :disabled="productSelections.length==0" @click="exportProduct()">导出产品</el-link>
                 </el-form-item>
                 <el-form-item style="float:right;">
                     <el-upload class="filter-item" name="file" action :on-error="uploadFalse" :on-success="uploadSuccess"
@@ -752,7 +752,7 @@ export default {
             listLoading: false,
             total: 0,
             page: 1,
-            size: localStorage.getItem("projectPageSize") == null ? 20 : parseInt(localStorage.getItem("projectPageSize")),
+            size: localStorage.getItem("projectPageSize") == null ? 10 : parseInt(localStorage.getItem("projectPageSize")),
             list: [
                 {
                     tableProdProcedure: {
@@ -972,9 +972,43 @@ export default {
 
 
         },
-        importProduct() {
+        exportProduct() {
+
             let productSelectionString = JSON.stringify(this.productSelections);
-            this.http.post("/product/exportData", {
+            
+            this.exportDisabled = true
+            this.exportNotification = this.$notify({
+                title: '导出产品',
+                message: '产品导出中、请稍后...',
+                duration: 0,
+                showClose: false
+            });
+            //导出产品
+            this.http.post('/product/exportData', {date: productSelectionString,productType: this.category},
+                res => {
+                    this.exportDisabled = false
+                    this.exportNotification.close()
+                    if (res.code == "ok") {
+                        this.$refs.productTbl.clearSelection();
+                        // this.productSelections=[]
+                        var filePath = res.data;
+                        const a = document.createElement('a'); // 创建a标签
+                        a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
+                        a.setAttribute('href', filePath);// href链接
+                        a.click(); //自执行点击事件
+                        a.remove();
+                    }
+                },
+                error => {
+                    this.exportNotification.close()
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                }
+            );
+            
+          /*   this.http.post("/product/exportData", {
                 date: productSelectionString,
                 productType: this.category
             },
@@ -986,7 +1020,7 @@ export default {
                             type: 'success'
                         });
                     }
-                })
+                }) */
         },
         handleSelectionChange(val) {
             this.productSelections = []