浏览代码

优立科技定制开发

Min 1 年之前
父节点
当前提交
ba982ec56e

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -1447,13 +1447,13 @@ public class ProjectController {
 
 
     @RequestMapping("/getMembProjectCateRatio")
-    public HttpRespMsg getMembProjectCateRatio(String startDate,String endDate, Integer onlyShowWarning){
-        return projectService.getMembProjectCateRatio(startDate,endDate, onlyShowWarning);
+    public HttpRespMsg getMembProjectCateRatio(String startDate,String endDate,Integer departmentId,String subUserCustomName, Integer onlyShowWarning){
+        return projectService.getMembProjectCateRatio(startDate,endDate,departmentId,subUserCustomName, onlyShowWarning);
     }
 
     @RequestMapping("/exportMembProjectCateRatio")
-    public HttpRespMsg exportMembProjectCateRatio(String startDate,String endDate, Integer onlyShowWarning){
-        return projectService.exportMembProjectCateRatio(startDate,endDate, onlyShowWarning);
+    public HttpRespMsg exportMembProjectCateRatio(String startDate,String endDate,Integer departmentId,String subUserCustomName, Integer onlyShowWarning){
+        return projectService.exportMembProjectCateRatio(startDate,endDate,departmentId,subUserCustomName, onlyShowWarning);
     }
 
     //依斯倍定制 员工项目进度表

+ 14 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/SubUserCustomController.java

@@ -1,6 +1,7 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.SubUserCustom;
 import com.management.platform.entity.User;
@@ -41,6 +42,8 @@ public class SubUserCustomController {
     private UserCustomMapper userCustomMapper;
     @Resource
     private UserMapper userMapper;
+    @Resource
+    private HttpServletRequest request;
     @RequestMapping("/addOrMod")
     public HttpRespMsg addOrMod(SubUserCustom subUserCustom){
         HttpRespMsg msg=new HttpRespMsg();
@@ -101,5 +104,16 @@ public class SubUserCustomController {
         msg.data=subUserCustomList;
         return msg;
     }
+    @RequestMapping("/listWithName")
+    public HttpRespMsg list(String userCustomName){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        UserCustom userCustom = userCustomMapper.selectOne(new LambdaQueryWrapper<UserCustom>().eq(UserCustom::getName, userCustomName).eq(UserCustom::getCompanyId,companyId));
+        if(userCustom!=null){
+            List<SubUserCustom> subUserCustomList = subUserCustomMapper.selectList(new QueryWrapper<SubUserCustom>().eq("user_custom_id", userCustom.getId()));
+            msg.data=subUserCustomList;
+        }
+        return msg;
+    }
 }
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -164,7 +164,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
     List<Map<String, Object>> getTimeCostByToken(Integer companyId, String startDate, String endDate);
 
-    List<UserCateTimeVo> getMembProjectCateTime(Integer companyId, String startDate, String endDate);
+    List<UserCateTimeVo> getMembProjectCateTime(Integer companyId, String startDate, String endDate,Integer departmentId,String subUserCustomName,Integer plateString);
 
     @Update("update project set incharger_id = null, finish_date = null, plan_start_date = null, plan_end_date=null, level=null,contract_amount=0.0,man_day=null where id = #{id} and is_public = 1")
     void cleanPublicProjectData(Integer id);

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -271,9 +271,9 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg getProjectFillTime(HttpServletRequest request, Integer projectId);
 
-    HttpRespMsg getMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning);
+    HttpRespMsg getMembProjectCateRatio(String startDate, String endDate,Integer departmentId,String subUserCustomName, Integer onlyShowWarning);
 
-    HttpRespMsg exportMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning);
+    HttpRespMsg exportMembProjectCateRatio(String startDate, String endDate,Integer departmentId,String subUserCustomName, Integer onlyShowWarning);
 
     HttpRespMsg userProjectProcessList(Integer deptId, String userId, Integer projectId, Integer pageIndex, Integer pageSize);
 

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

@@ -12231,11 +12231,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
 
     @Override
-    public HttpRespMsg getMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning) {
+    public HttpRespMsg getMembProjectCateRatio(String startDate, String endDate,Integer departmentId,String subUserCustomName, Integer onlyShowWarning) {
         HttpRespMsg msg = new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
-        List<UserCateTimeVo> timeList = projectMapper.getMembProjectCateTime(companyId, startDate, endDate);
+        Integer plateIndex=null;
+        for (UserCustom userCustom : userCustomList) {
+            if(userCustom.getName().equals("员工类型")){
+                plateIndex=userCustomList.indexOf(userCustom)+1;
+            }
+        }
+        List<UserCateTimeVo> timeList = projectMapper.getMembProjectCateTime(companyId, startDate, endDate,departmentId,subUserCustomName,plateIndex);
         if(!StringUtils.isEmpty(timeList)){
             for(UserCateTimeVo u:timeList) {
                 HashMap map=new HashMap();
@@ -12335,11 +12341,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
 
     @Override
-    public HttpRespMsg exportMembProjectCateRatio(String startDate, String endDate, Integer onlyShowWarning) {
+    public HttpRespMsg exportMembProjectCateRatio(String startDate, String endDate,Integer departmentId,String subUserCustomName, Integer onlyShowWarning) {
         HttpRespMsg msg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
-        HttpRespMsg respMsg = getMembProjectCateRatio(startDate, endDate, onlyShowWarning);
+        HttpRespMsg respMsg = getMembProjectCateRatio(startDate, endDate,departmentId,subUserCustomName, onlyShowWarning);
         Map<String,Object> resultMap= (Map<String, Object>) respMsg.getData();
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) resultMap.get("userList");
         List<ProjectCategory> categoryList = (List<ProjectCategory>) resultMap.get("categoryList");

+ 22 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -1794,6 +1794,28 @@
         WHERE report.`company_id` = #{companyId}
         AND report.`create_date` BETWEEN #{startDate} and #{endDate}
         AND report.state = 1
+        <if test="departmentId!=null">
+            AND user.department_id=#{departmentId}
+        </if>
+        <if test="subUserCustomName!=null and subUserCustomName!='' and plateString!=null">
+            <choose>
+                <when test="plateString==1">
+                    AND user.plate1=#{subUserCustomName}
+                </when>
+                <when test="plateString==2">
+                    AND user.plate2=#{subUserCustomName}
+                </when>
+                <when test="plateString==3">
+                    AND user.plate3=#{subUserCustomName}
+                </when>
+                <when test="plateString==4">
+                    AND user.plate4=#{subUserCustomName}
+                </when>
+                <otherwise>
+                    AND user.plate5=#{subUserCustomName}
+                </otherwise>
+            </choose>
+        </if>
         GROUP BY user.id, project.`category`
     </select>
 

+ 37 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -178,6 +178,11 @@
           <el-select v-if="(screeningCondition.staff.includes(ins))  && user.userNameNeedTranslate != '1'" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="width:100px">
             <el-option v-for="(item, index) in selUserList" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
+          <!-- 人员兹自定义配置 员工类型筛选 只针对优立科技 -->
+          <el-select v-if="user.companyId==4374&&ins == 21" v-model="subUserCustomName" :placeholder="'请选择员工类型'" clearable filterable size="small" @change="selcts()" style="margin-left:10px">
+            <el-option v-for="(item) in subUserCustom" :key="item.id" :label="item.name" :value="item.name">
+            </el-option>
+          </el-select>
 
           <selectCat :subject="selUserList" :filterable="true" :searchBoxTop="'1'" :subjectId="userId" :clearable="true" :size="mini" @selectCal="selectCal" v-if="(screeningCondition.staff.includes(ins)) && user.userNameNeedTranslate == '1'"></selectCat>
           
@@ -1501,7 +1506,7 @@ export default {
         months: [14, 15], // 月份筛选条件 (等于)
         monthRange: [19], // 月份区间筛选条件 (等于)
         staff: [6, 8, 9, 19, 11, 14, 18, 23, 25, 26], // 人员筛选条件 (等于)
-        departments: [14, 15, 23, 26], // 部门筛选条件 (等于)
+        departments: [14, 15, 23,21,26], // 部门筛选条件 (等于)
         timePeriod: [5, 6, 8, 9, 10, 11, 12, 16, 17, 18, 20, 21, 22, 24, 25, 26], // 时间段筛选条件 (等于)
       },
       efficentList:[],
@@ -1700,6 +1705,8 @@ export default {
         taskCompletionSheet: [], // 员工任务进度表
       },
       projectEstimatedWorkData: [], // 项目预估工时表
+      subUserCustom:[],
+      subUserCustomName:null,
     };
   },
   computed: {},
@@ -1729,6 +1736,7 @@ export default {
     // this.getcusProjectList()
     this.authorityToJudge()
     this.getProjectSort()
+    this.getSubUserCustom()
   },
   filters: {
       numberToCurrency(value) {
@@ -2305,6 +2313,8 @@ export default {
           sl.onlyShowWarning=0
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
+          sl.departmentId = this.departmentIdArray.length > 0 ? this.departmentIdArray[this.departmentIdArray.length - 1] : ''
+          sl.subUserCustomName = this.subUserCustomName ? this.subUserCustomName: null
         } else if(this.ins == 22) {
           fName = '分类工时明细表' + '.xlsx'
           url = "/report/exportUserWorkTimeByCategory"
@@ -2457,6 +2467,26 @@ export default {
           });
       });
     },
+    // 获取人员自定义 员工类型下的下拉数据
+    getSubUserCustom() {
+      this.http.post('/sub-user-custom/listWithName',{userCustomName:'员工类型'},
+      res => {
+          if (res.code == "ok") {
+              this.subUserCustom=res.data
+          } else {
+              this.$message({
+              message: res.msg,
+              type: "error"
+              });
+          }
+      },
+      error => {
+          this.$message({
+              message: error,
+              type: "error"
+          });
+      });
+    },
     // 获取EFT报表的数据
     getETF() {
       this.getCustomName();
@@ -3708,6 +3738,12 @@ export default {
         endDate: this.rangeDatas[1],
         onlyShowWarning: 0
       }
+      if(this.departmentIdArray.length != 0){
+        params.departmentId = this.departmentIdArray[this.departmentIdArray.length - 1]
+      }
+      if(this.subUserCustomName){
+        params.subUserCustomName=this.subUserCustomName
+      }
       this.listLoading = true
       let { data } = await this.postData('/project/getMembProjectCateRatio', params)
       let { categoryList, userList } = data