Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

yusm 4 nedēļas atpakaļ
vecāks
revīzija
9e49d6de3b

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1888,7 +1888,7 @@ public class ReportController {
         }
 
         //成都明夷电子,按比例分配的情况,需要重新计算每日的工作时长和分配的时长
-        if (company.getCompanyName().equals("成都明夷电子科技有限公司") && comTimeType.getType() == 3) {
+        if (company.getCompanyName().equals("成都明夷电子科技股份有限公司") && comTimeType.getType() == 3) {
             for (Report r : reportList) {
                 UserFvTime fvTime = userFvTimeService.getOne(new QueryWrapper<UserFvTime>().eq("work_date", r.getCreateDate()).eq("company_id", user.getCompanyId()).eq("user_id", r.getCreatorId()));
                 if (fvTime == null) {

+ 33 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserFvTimeController.java

@@ -325,7 +325,7 @@ public class UserFvTimeController {
     }
 
     @RequestMapping("syncAttendanceForMingYi")
-    public HttpRespMsg getAttendanceForMingYi( String startDate,String endDate,String userId, HttpServletRequest request) throws Exception {
+    public HttpRespMsg getAttendanceForMingYi(Integer isBatch,String startDate,String endDate,String userId, HttpServletRequest request) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         JSONObject reqParam = new JSONObject();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
@@ -335,7 +335,7 @@ public class UserFvTimeController {
         DateTimeFormatter time=DateTimeFormatter.ofPattern("HH:mm");
         reqParam.put("startDate",startDate);
         reqParam.put("endDate",endDate);
-        reqParam.put("userId",userId);
+        userList.stream().filter(u->u.getId().equals(userId)).findFirst().ifPresent(u->reqParam.put("userId",u.getJobNumber()));
         HttpHeaders headers = new HttpHeaders();
         String url="http://localhost:10020/attendance/getAttendanceList";
         headers.setContentType(MediaType.APPLICATION_JSON);
@@ -382,6 +382,10 @@ public class UserFvTimeController {
                 }
             }
         }
+        if (userFvTimeList.size() == 0 && userFvTimeUpdateList.size() == 0) {
+            httpRespMsg.setError("暂无考勤记录");
+            return httpRespMsg;
+        }
         if(!userFvTimeService.saveBatch(userFvTimeList)){
             httpRespMsg.setError("验证失败");
             return httpRespMsg;
@@ -404,27 +408,45 @@ public class UserFvTimeController {
             }
         }
         int workDayCount = workDaysListInRange.size();
-        HashMap map = new HashMap();
-        map.put("workHours", df.format(sum));
-        map.put("workDayCount", workDayCount);
-        if (workDayCount == 0) {
-            map.put("avgWorkDayHours", 0);
+        if (isBatch == 1) {
+            HashMap map = new HashMap();
+            map.put("workHours", df.format(sum));
+            map.put("workDayCount", workDayCount);
+            if (workDayCount == 0) {
+                map.put("avgWorkDayHours", 0);
+            } else {
+                map.put("avgWorkDayHours", df.format(sum / workDayCount));
+            }
+            httpRespMsg.setData(map);
         } else {
-            map.put("avgWorkDayHours", df.format(sum / workDayCount));
+            //单人单日的获取
+            List<UserFvTime> curUserTimeList = userFvTimeService.list(new QueryWrapper<UserFvTime>()
+                    .eq("user_id", userId).eq("work_date", startDate));
+            System.out.println("userFvTimeList:"+curUserTimeList.size());
+            if (userFvTimeList.size() > 0) {
+                UserFvTime item = userFvTimeList.get(0);
+                httpRespMsg.setData(item);
+            } else {
+                httpRespMsg.setError("暂无考勤记录");
+            }
         }
-        httpRespMsg.setData(map);
         return httpRespMsg;
     }
 
     @RequestMapping("/getMinYiWorkHour")
-    public HttpRespMsg getMinYiWorkHour(HttpServletRequest request, String startDate,String endDate){
+    public HttpRespMsg getMinYiWorkHour(HttpServletRequest request, String startDate,String endDate, String userId){
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         DecimalFormat df = new DecimalFormat("#0.0");
         User user = userMapper.selectById(request.getHeader("token"));
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
         //根据配置决定是否过滤掉周末
         List<LocalDate> workDaysListInRange = WorkDayCalculateUtils.getWorkDaysListInRange(startDate, endDate, timeType.getIncludeWeekends());
-        List<UserFvTime> userFvTimeList = userFvTimeService.list(new QueryWrapper<UserFvTime>().in("work_date", workDaysListInRange).eq("company_id", user.getCompanyId()).eq("user_id", user.getId()));
+        List<UserFvTime> userFvTimeList = null;
+        if (workDaysListInRange.size() > 0) {
+            userFvTimeList = userFvTimeService.list(new QueryWrapper<UserFvTime>().in("work_date", workDaysListInRange).eq("company_id", user.getCompanyId()).eq("user_id", userId));
+        } else {
+            userFvTimeList = new ArrayList<>();
+        }
 
         double sum = 0;
         for (LocalDate workDay : workDaysListInRange) {

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

@@ -1763,8 +1763,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             }
             long end = System.currentTimeMillis();
             List<String> stringList = providerCategoryList.stream().map(ProviderCategory::getProviderCategoryName).distinct().collect(Collectors.toList());
-            //针对成都明夷电子科技有限公司,显示项目日报审核人
-            if (company.getCompanyName().equals("成都明夷电子科技有限公司")) {
+            //针对成都明夷电子科技股份有限公司,显示项目日报审核人
+            if (company.getCompanyName().equals("成都明夷电子科技股份有限公司")) {
                 if(projectIds.size()>0){
                     List<ProjectAuditor> projectAuditorList = projectAuditorMapper.selectList(new LambdaQueryWrapper<ProjectAuditor>().in(ProjectAuditor::getProjectId, projectIds));
                     list.forEach(l->{

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

@@ -1268,7 +1268,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             reportService.saveOrUpdateBatch(reportList);
             //成都明夷电子,需要生成批量记录
             Company company = companyMapper.selectById(companyId);
-            if (company.getCompanyName().equals("成都明夷电子科技有限公司") || timeType.getEnableNewWeeklyfill() == 1 || timeType.getWeeklyChargeFilter() == 1) {//物奇需要填写周总结
+            if (company.getCompanyName().equals("成都明夷电子科技股份有限公司") || timeType.getEnableNewWeeklyfill() == 1 || timeType.getWeeklyChargeFilter() == 1) {//物奇需要填写周总结
                 if (date.contains("@")) {
                     //批量填报
                     String[] split = date.split("\\@");

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -623,7 +623,7 @@ public class TimingTask {
         JSONObject reqParam = new JSONObject();
         DateTimeFormatter date=DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DateTimeFormatter time=DateTimeFormatter.ofPattern("HH:mm");
-        List<Company> companyList = companyMapper.selectList(new QueryWrapper<Company>().eq("company_name", "成都明夷电子科技有限公司"));
+        List<Company> companyList = companyMapper.selectList(new QueryWrapper<Company>().eq("company_name", "成都明夷电子科技股份有限公司"));
         if(companyList.size()>0){
             Company company = companyList.get(0);
             Integer companyId = company.getId();

+ 0 - 28
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/GsonUtils.java

@@ -1,28 +0,0 @@
-///*
-// * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
-// */
-//package com.management.platform.util;
-//
-//import com.google.gson.Gson;
-//import com.google.gson.GsonBuilder;
-//import com.google.gson.JsonParseException;
-//import java.lang.reflect.Type;
-//
-///**
-// * Json工具类.
-// */
-//public class GsonUtils {
-//    private static Gson gson = new GsonBuilder().create();
-//
-//    public static String toJson(Object value) {
-//        return gson.toJson(value);
-//    }
-//
-//    public static <T> T fromJson(String json, Class<T> classOfT) throws JsonParseException {
-//        return gson.fromJson(json, classOfT);
-//    }
-//
-//    public static <T> T fromJson(String json, Type typeOfT) throws JsonParseException {
-//        return (T) gson.fromJson(json, typeOfT);
-//    }
-//}

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -5022,7 +5022,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         String lastJobNum = null;
         for (Map<String, Object> map : reportList) {
             List<String> item=new ArrayList<>();
-            String departmentName = convertDepartmentIdToCascade(Integer.valueOf(String.valueOf(map.get("departmentId"))), departmentList);
+            String departmentName = map.get("departmentId") == null ? "" : convertDepartmentIdToCascade(Integer.valueOf(String.valueOf(map.get("departmentId"))), departmentList);
             item.add(departmentName);
             String curJobBNum = String.valueOf(map.get("jobNumber"));
             Integer planManNum = map.get("planManNum")==null?0:(Integer) map.get("planManNum");

+ 53 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -33,6 +33,7 @@
                         <el-radio-button :label="$t('lable.department')"
                             v-if="(permissions.viewAllSummary || permissions.viewMagDeptSummary)"></el-radio-button>
                         <el-radio-button :label="$t('ren-yuan')" v-if="permissions.countPersonnel"></el-radio-button>
+                        <el-radio-button label="工单" v-if="user.companyId == 7536"></el-radio-button>
                         <el-radio-button :label="namess"
                             v-if="jichu.customDegreeActive == 1 && !jichu.customDegreeMultiple"></el-radio-button>
                         <el-radio-button v-for="item in theCustomList" :key="item.id"
@@ -57,8 +58,10 @@
                         @change="filterPersonnel"></select-personnel>
                 </el-col>
                 <el-col :span="2" style="display: flex;justify-content: flex-end;">
+                    <el-button @click="reportExportCustomization" size="small" :loading="reportExportLoading"
+                        v-if="user.companyId == 7536">报表导出</el-button>
                     <el-button @click="exportTheCustomListFlg" size="small" :loading="theCustomListFlgBtnLoading"
-                        v-if="theCustomListFlg">报表导</el-button>
+                        v-else-if="theCustomListFlg">报表导</el-button>
                     <el-button @click="showExportDialog" size="small" v-else>报表导出</el-button>
                 </el-col>
             </el-row>
@@ -215,6 +218,10 @@ export default {
                     url: '/device-log/getDeviceTimeCost',
                     extraParams: { projectId: this.chartProjectId }
                 },
+                ['工单']: {
+                    url: '/project/getTimeCostByWorkNum',
+                    extraParams: { }
+                },
                 [this.namess]: {
                     url: '/project/getDegreeCost',
                     extraParams: { projectId: this.chartProjectId }
@@ -347,11 +354,39 @@ export default {
                 this.pageTotal = this.allListData ? this.allListData.length : 0
                 list = this.allListData.slice(0 + 10 * (this.pageIndex - 1), 49 + 50 * (this.pageIndex - 1))
                 newBarChartOptions = this.namessChartData(list, totalMoneyCost, newBarChartOptions)
-            }
+            } else if (this.singleChoiceType == '工单') {
+                newBarChartOptions = this.workOrderChartData(list, totalMoneyCost, newBarChartOptions)
+            } 
 
             console.log({ ...newBarChartOptions }, '<==== 图表数据')
             this.echartsEcharData = { ...newBarChartOptions }
         },
+        workOrderChartData(list, totalMoneyCost = 0, chartData) { // 工单图表数据
+            let xList = [], yList = [], totalHours = 0;
+            const yAxisValue = this.chartYAxisVal[this.chartYAxis]
+            const { countCost, countHours } = this.permissions
+            for (let i in list) {
+                xList.push(this.nameNumber == '1' ? list[i].workNum : list[i].workNum);
+
+                let item = {
+                    "value": yAxisValue == 0 ? (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney : (list[i].cost ? list[i].cost.toFixed(1) : 0),
+                    "id": list[i].id || i,
+                }
+                if (countCost) {
+                    item.money = (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0)
+                }
+                if (countHours) {
+                    item.cost = list[i].cost
+                    totalHours += parseFloat(list[i].cost);
+                }
+                yList.push(item);
+            }
+
+            totalHours = this.totalHours.toFixed(1);
+            totalMoneyCost = totalMoneyCost.toFixed(2)
+
+            return { ...this.sameChartProcessing(xList, yList, totalHours, totalMoneyCost, chartData) }
+        },
         equipmentChartData(list, totalMoneyCost = 0, chartData) { // 设备图表数据
             let xList = [], yList = [], totalHours = 0;
             const yAxisValue = this.chartYAxisVal[this.chartYAxis]
@@ -1041,6 +1076,22 @@ export default {
         showExportDialog() { // 显示报表导出
             this.reportExportVisable = true
         },
+        reportExportCustomization() { // 报表导出
+            var url = '/project/exportTimeCostByWorkNum';
+            var fileName = this.chartDate.join('至') + '工单统计表.xlsx';
+            this.reportExportLoading = true;
+            this.postData(url, {
+                startDate: this.chartDate[0],
+                endDate: this.chartDate[1],
+            }).then((res) => {
+                const aTag = document.createElement('a');
+                aTag.download = fileName;
+                aTag.href = res.data;
+                aTag.click()
+            }).finally(() => {
+                this.reportExportLoading = false
+            })
+        },
         // 单独封装请求
         async postData(urls, param) {
             return new Promise((resolve, reject) => {

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -3519,6 +3519,7 @@ export default {
     // 关键搜索
     searchList() {
       this.listLoading = true;
+      this.page = 1
       this.http.post(
         this.port.manage.list,
         {

+ 41 - 14
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -139,7 +139,7 @@
                                     <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
                                     <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
-                                    <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
+                                    <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481 || user.companyName == mingyiName)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
                                     <!-- 苏州景昱,按周填报的模式进行代填日报 -->
                                     <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
                                     
@@ -416,12 +416,18 @@
                         <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
                         <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
                         <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
-
+                        <template v-if="user.company.companyName === mingyiName">
+                            <span v-if="isBatch">,考勤时长:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
+                            <span v-if="!isBatch"> 考勤时长:<span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}},{{workForm.time.workHours}}{{$t('time.hour')}}</span> </span>
+                            <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"  icon="el-icon-refresh" 
+                                    @click="refreshAttendance(workForm.createDate)"></el-button>
+                        </template>
+                        
                         <!-- AI智能填报 -->
                         <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
                     </el-form-item>
                     <!--考勤时长显示-->
-                    <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh">
+                    <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh && user.company.companyName != mingyiName">
                         <template v-if="user.companyId != 7536">
                             <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
                                 <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
@@ -435,9 +441,9 @@
                         </template>
 
                         <!--批量填报不显示考勤记录-->
-                        <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
+                        <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
                         <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
-                        <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
+                        
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
                         v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh" 
                                 @click="refreshWXCardTime(workForm.createDate)"></el-button>
@@ -445,9 +451,6 @@
                         v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh" 
                                 @click="refreshDDCardTime(workForm.createDate)"></el-button>
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
-                        v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh" 
-                                @click="refreshAttendance(workForm.createDate)"></el-button>
-                        <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
                         v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh" 
                                 @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
@@ -2375,7 +2378,7 @@
                 jobResponseList:[],
                 yisibeiCompId: 3092,
                 yuzhongCompId: 3385,
-                mingyiName : '成都明夷电子科技有限公司',
+                mingyiName : '成都明夷电子科技股份有限公司',
                 // mingyiName : '明夷',
                 modItemDataId: null,
                 modImportTime: null,
@@ -3356,11 +3359,26 @@
             },
              refreshAttendance(workdate) {
                  if (!workdate) return;
+                 if (this.isSubstitude && this.workForm.userId == null) return;
                 this.syncTimeLoading = true;
-                this.http.post('/user-fv-time/syncAttendanceForMingYi',{
-                    startDate: workdate[0],
-                    endDate: workdate[1]
-                },res => {
+                var param = {};
+                if (this.isBatch) {
+                    param = {
+                        startDate: workdate[0],
+                        endDate: workdate[1],
+                        userId: this.isSubstitude? this.workForm.userId[0] : this.user.id,
+                        isBatch: this.isBatch
+                    }
+                } else {
+                    param = {
+                        startDate: workdate,
+                        endDate: workdate,
+                        userId: this.user.id,
+                        isBatch: this.isBatch
+                    }
+                }
+
+                this.http.post('/user-fv-time/syncAttendanceForMingYi',param,res => {
                     this.syncTimeLoading = false;
                     if(res.code == 'ok'){
                         this.workTimeForMinYi = parseFloat(res.data.workHours);
@@ -3987,9 +4005,18 @@
                 }
             },
             getWorkTimeForMinYi(){
+                if (this.isSubstitude && this.workForm.userId == null) {
+                    this.$message({
+                        message: "请先选择代填人员",
+                        type: "error"
+                    });
+                    this.workForm.createDate = null;
+                    return;
+                }
                 this.http.post('/user-fv-time/getMinYiWorkHour',{ 
                     startDate: this.workForm.createDate[0],
-                    endDate: this.workForm.createDate[1]
+                    endDate: this.workForm.createDate[1],
+                    userId: this.isSubstitude?this.workForm.userId[0]:this.user.id
                 },
                 res => {
                     if (res.code == "ok") {