소스 검색

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

# Conflicts:
#	fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
seyason 2 년 전
부모
커밋
716219a4b0

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

@@ -9,10 +9,7 @@ import com.management.platform.entity.*;
 import com.management.platform.entity.vo.SysRichFunction;
 import com.management.platform.entity.vo.WorktimeItem;
 import com.management.platform.mapper.*;
-import com.management.platform.service.CompanyService;
-import com.management.platform.service.ReportService;
-import com.management.platform.service.UserSalaryService;
-import com.management.platform.service.UserService;
+import com.management.platform.service.*;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.WorkDayCalculateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -58,6 +55,8 @@ public class ReportController {
     @Resource
     private DepartmentMapper departmentMapper;
     @Resource
+    private BusinessTripService businessTripService;
+    @Resource
     private ProjectCurrentcostMapper projectCurrentcostMapper;
     @Resource
     private UserSalaryService userSalaryService;
@@ -915,6 +914,33 @@ public class ReportController {
 
         }
 
+        //自定义数值为餐补的情况下,如果是出差则不能填餐补
+        if (comTimeType.getCustomDataActive() == 1 && comTimeType.getCustomDataName().contains("餐补")) {
+            if (company.getPackageOa() == 1) {
+                //含OA模块的才有出差
+                for (Report r : reportList) {
+                    if (r.getCustomData() > 0) {
+                        //检查出差记录
+                        LocalDate workDate = r.getCreateDate();
+                        String ownerId = r.getCreatorId();
+                        int cnt = businessTripService.count(new QueryWrapper<BusinessTrip>().eq("owner_id", ownerId).le("start_date", workDate).ge("end_date", workDate));
+                        System.out.println("检查出差条数=="+cnt);
+                        if (cnt > 0) {
+                            //返回错误提示
+                            HttpRespMsg msg = new HttpRespMsg();
+                            if (ownerId.equals(token)) {
+                                //自己填报自己的
+                                msg.setError(dtf.format(workDate)+"有出差,餐补必须为0");
+                            } else {
+                                msg.setError(userService.getById(ownerId) + "在" + dtf.format(workDate)+"有出差,餐补必须为0");
+                            }
+                            return msg;
+                        }
+                    }
+                }
+            }
+        }
+
         return reportService.editReport(reportList, createDate.length > 0 ? createDate[0] : null, targetUserList, hourCost, user.getCompanyId());
     }
 

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

@@ -686,7 +686,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 //新增
                 //电话号码列 检测重名
                 if (!StringUtils.isEmpty(phone) && userMapper.selectList(new QueryWrapper<User>().eq("phone", phone)).size() > 0) {
-                    httpRespMsg.setError("电话号码重复");
+                    httpRespMsg.setError("该电话号码已存在");
                 } else {
                     //只计算活跃的用户
                     if (userMapper.selectCount(new QueryWrapper<User>()
@@ -741,6 +741,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 }
             } else {
                 //修改
+                if (!StringUtils.isEmpty(phone) && userMapper.selectList(new QueryWrapper<User>().eq("phone", phone).ne("id", targetId)).size() > 0) {
+                    httpRespMsg.setError("该电话号码已存在");
+                    return httpRespMsg;
+                }
+
                 User oldUser = userMapper.selectById(targetId);
                 boolean salaryChange = false;
 

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

@@ -519,6 +519,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                     if ("00:00".equals(leaveStart)) {
                                         leaveStart = baseMorningStart;
                                     }
+                                    System.out.println("leaveStart=="+leaveStart+", leaveEnd="+leaveEnd);
                                 } else {
                                     if (showLog)System.out.println("跨天请假@@@@");
                                     if (showLog)System.out.println("当天=="+localDate+", sDate=" + sDate+", 比较="+(localDate.isEqual(sDate)));
@@ -609,7 +610,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                 if (leaveTime == null) {
                                     leaveTime = 0.0;
                                 }
-                                ct.setAskLeaveTime(leaveTime + DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration")));
+                                ct.setAskLeaveTime(leaveTime + convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration"))));
                                 break;
                             case 2://补卡
                             case 3://出差
@@ -619,7 +620,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                 if (outdoorTime == null) {
                                     outdoorTime = 0.0;
                                 }
-                                double otTime = DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration"));
+                                double otTime = convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration")));
                                 if (otTime > 8.0) {
                                     otTime = 8.0;
                                 }
@@ -667,6 +668,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     if (ct.getAskLeaveTime() != null && ct.getAskLeaveTime() == 24.0) {
                         ct.setAskLeaveTime(8.0);//24小时为一天,修正为8小时
                     }
+                    if (ct.getAskLeaveTime() > 8.0) {
+                        ct.setAskLeaveTime(8.0);//超过8小时都以8小时计算
+                    }
+                    if (showLog)System.out.println("校正后请假时长="+ct.getAskLeaveTime());
                     //如果有出差的,但是没有打卡,则用出差的时间作为timeDelta
                     if (timeDelta < 8.0 && ct.getOutdoorTime() > 0) {
                         timeDelta += ct.getOutdoorTime();
@@ -675,6 +680,13 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     if (workHours < 0) {
                         workHours = 0;
                     }
+                    if (ct.getAskLeaveTime() >= 8.0) {
+                        //全天请假了,就不算打卡工作时长了。
+                        workHours = 0;
+                        //重新校正开始时间和结束时间
+                        ct.setStartTime(baseMorningStart);
+                        ct.setEndTime(baseAfternoonEnd);
+                    }
                     if (showLog)System.out.println("工作时长=="+workHours);
                     ct.setWorkHours(DateTimeUtil.getHoursFromDouble(workHours));
 //                        if (regular_work_sec < standard_work_sec) {
@@ -711,4 +723,14 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             }
         }
     }
+
+    private double convertDayTimeToHours(double d) {
+        if (d == 12) {
+            return 4.0;
+        } else if (d == 24) {
+            return 8.0;
+        } else {
+            return d;
+        }
+    }
 }

+ 81 - 14
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -62,8 +62,9 @@
                     <el-button size="mini"  @click="editClick('B', scope.row)">修改有效期</el-button>
                     <el-button size="mini"  @click="editClick('F', scope.row)" :disabled="!(scope.row.dingdingCorpid || scope.row.wxCorpid)">考勤同步</el-button>
                     <el-button size="mini"  @click="editClick('C', scope.row)">修改版本</el-button>
-                    <el-button size="mini"  @click="editClick('D', scope.row)" v-if="!scope.row.setMeal">设为已签约</el-button>
+                    <el-button size="mini"  @click="editClick('D', scope.row)" :disabled="scope.row.setMeal">设为已签约</el-button>
                     <el-button size="mini"  @click="editClick('G', scope.row)">其他设置</el-button>
+                    <el-button size="mini"  @click="editClick('H', scope.row)">报表配置</el-button>
                     <el-button size="mini"  @click="editClick('E', scope.row)" v-loading="dingdingSync" v-if="scope.row.dingdingCorpid">同步钉钉人员</el-button>
                 </template>
             </el-table-column>
@@ -209,6 +210,18 @@
                 <el-button type="primary" @click="ConfirmG()">确 定</el-button>
             </span>
         </el-dialog>
+        <!-- 报表配置 -->
+        <el-dialog v-if="editDialogH" :visible.sync="editDialogH" title="报表配置">
+            <el-form label-width="50px" style="">
+                <el-form-item v-for="item in reportFormList" :key="item.id" style="width:33%;display:inline-block;">
+                    <el-checkbox v-model="item.owned">{{item.reportFormName}}</el-checkbox>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="editDialogH = false">取 消</el-button>
+                <el-button type="primary" @click="ConfirmH()">确 定</el-button>
+            </span>
+        </el-dialog>
     </section>
 </template>
 <script>
@@ -224,6 +237,7 @@
                 editDialogD: false,
                 editDialogF: false,
                 editDialogG: false,
+                editDialogH: false,
 
 
 
@@ -233,6 +247,8 @@
                 // 修改有效期
                 expirationNewDate: null,
 
+                reportFormList: [],
+
 
 
                 keyword:null,
@@ -262,8 +278,8 @@
                 this.dialogData = JSON.parse(JSON.stringify(obj))
                 console.log("data",this.dialogData);
                 if(i == 'A'){ this.editDialogA = true, this.addStaffCountMaxNum = 0 }
-                if(i == 'B'){ this.editDialogB = true, this.expirationNewDate = this.dialogData.expirationDate }
-                if(i == 'C'){ this.editDialogC = true,
+                else if(i == 'B'){ this.editDialogB = true, this.expirationNewDate = this.dialogData.expirationDate }
+                else if(i == 'C'){ this.editDialogC = true,
                     this.dialogData.packageWorktime = this.dialogData.packageWorktime ? true : false,
                     this.dialogData.packageProject = this.dialogData.packageProject ? true : false,
                     this.dialogData.packageContract = this.dialogData.packageContract ? true : false,
@@ -276,12 +292,12 @@
                     this.dialogData.packageFinance = this.dialogData.packageFinance ? true : false,
                     this.dialogData.packageProvider = this.dialogData.packageProvider ? true : false
                 }
-                if(i == 'D'){ this.editDialogD = true }
-                if (i=='E') {
+                else if(i == 'D'){ this.editDialogD = true }
+                else if (i=='E') {
                     //同步钉钉的组织架构人员
                     this.startSyncDDMembs(obj);
                 }
-                if(i == 'F'){
+                else if(i == 'F'){
                     // 考勤同步
                     this.editDialogF = true
                     this.http.post('/time-type/get',{
@@ -307,7 +323,7 @@
                     
 
                 }
-                if(i == 'G'){
+                else if(i == 'G'){
                     // 其他设置
                     this.editDialogG = true
                     this.http.post('/time-type/get',{
@@ -336,6 +352,10 @@
                     })
                     
                 }
+                else if(i == 'H'){
+                    this.editDialogH = true
+                    this.getReoprtFormList(obj)
+                }
                 
             },
 
@@ -366,6 +386,28 @@
                     });
                 });
             },
+            getReoprtFormList(row){
+                this.http.post('/company-report/list',{
+                    companyId: row.id
+                },res => {
+                    if(res.code == 'ok'){
+                        this.reportFormList = res.data
+                        for(let i in this.reportFormList){
+                            this.reportFormList[i].owned = this.reportFormList[i].owned ? true : false
+                        }
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
 
             // 增加人数上限
             ConfirmA(){
@@ -395,8 +437,6 @@
                     });
                 });
             },
-
-
             // 修改有效期
             ConfirmB(){
                 this.listLoading = true;
@@ -425,8 +465,6 @@
                     });
                 });
             },
-
-
             // 修改版本
             ConfirmC(){
                 this.listLoading = true;
@@ -469,8 +507,6 @@
                     });
                 });
             },
-
-
             // 设为已签约
             ConfirmD(){
                 this.listLoading = true;
@@ -499,7 +535,6 @@
                     });
                 });
             },
-
             // 考勤同步
             ConfirmF(){
                 let parameter = {
@@ -571,6 +606,38 @@
                     })
                 })
             },
+            // 报表配置
+            ConfirmH(){
+                let ids = ''
+                for(let i in this.reportFormList){
+                    if(this.reportFormList[i].owned){
+                        ids += this.reportFormList[i].id + ','
+                    }
+                }
+                if(ids){ids = ids.substring(0,ids.length - 1)}
+                this.http.post('/company-report/update',{
+                    companyId: this.dialogData.id,
+                    formIds: ids
+                },res => {
+                    if(res.code == 'ok'){
+                        this.editDialogH = false
+                        this.$message({
+                            message: '更新成功',
+                            type: 'success'
+                        })
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
 
 
 

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

@@ -188,7 +188,7 @@
                 </template>
             </el-table-column>
 
-            <el-table-column prop="participator" label="参与者" :min-width="user.company.packageCustomer != 1 ? '' : '300'" sortable v-if="user.company.packageProject==0">
+            <el-table-column prop="participator" label="参与者" :min-width="user.company.packageCustomer != 1 ? '100' : '300'" sortable v-if="user.company.packageProject==0">
                 <template slot-scope="scope">
                     <!-- <v-for v-for="par in scope.row.participator" :key="par.id" >
                         <el-link style="margin-right:10px;" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
@@ -2804,7 +2804,7 @@ a {
                     }else if(this.sortProp == 'status'){
                         parameter.sortProp = 'status'
                     }else if(this.sortProp == 'currentStage'){
-                        parameter.sortProp = 'current_stage'
+                        parameter.sortProp = 'current_stage_name'
                     }
 
                     if(this.sortOrder == 'descending'){