Ver Fonte

企业微信登录身份

seyason há 2 anos atrás
pai
commit
3203c2385a

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

@@ -342,7 +342,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                         User localUser = new User();
                         localUser.setId(finance.getUserId());
                         localUser.setMonthCost(total);
-                        if (companyId == 936) {
+                        if (companyId == 936 || companyId == 10) {
                             //威派格导入薪资时,按照每月设置的工作天数来计算时薪
                             BigDecimal db = timeType.getMonthDays().multiply(new BigDecimal(timeType.getAllday()));
                             localUser.setCost(total.divide(db, 6, BigDecimal.ROUND_HALF_UP));

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

@@ -205,45 +205,48 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司工时");
             if (functionList.size() == 0) {
                 String leaderId = user.getId();
-
-                //查看自己的日报
-                Map<String, Object> map = new HashMap<>();
-                map.put("id", user.getId());
-                map.put("name", user.getName());
                 //不是项目经理,只看自己的报告
                 List<Map<String, Object>> list = new ArrayList<>();
-                list = reportMapper.getReportByDate(date, (String) map.get("id"));
-                if (list.size() > 0) {
-                    //个人日报
-                    nameList.add(map);
-                    map.put("data", list);
-                    double reportTime = 0;
-                    BigDecimal total = new BigDecimal(0);
-                    int state = (int)list.get(0).get("state");
-                    boolean hasDeny = false;
-                    boolean hasWaiting = false;
-                    for (Map<String, Object> m : list) {
-                        double t = (double) m.get("time");
-                        reportTime += t;
-                        total = total.add((BigDecimal)m.get("cost"));
-                        int curState = (int)m.get("state");
-                        if (curState == 2) {
-                            hasDeny = true;
+                //没有指定员工或者指定的就是自己
+                if (targetUid == null || targetUid.equals(user.getId())) {
+                    //查看自己的日报
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("id", user.getId());
+                    map.put("name", user.getName());
+                    list = reportMapper.getReportByDate(date, (String) map.get("id"));
+                    if (list.size() > 0) {
+                        //个人日报
+                        nameList.add(map);
+                        map.put("data", list);
+                        double reportTime = 0;
+                        BigDecimal total = new BigDecimal(0);
+                        int state = (int)list.get(0).get("state");
+                        boolean hasDeny = false;
+                        boolean hasWaiting = false;
+                        for (Map<String, Object> m : list) {
+                            double t = (double) m.get("time");
+                            reportTime += t;
+                            total = total.add((BigDecimal)m.get("cost"));
+                            int curState = (int)m.get("state");
+                            if (curState == 2) {
+                                hasDeny = true;
+                            }
+                            if (curState == 0) {
+                                hasWaiting = true;
+                            }
                         }
-                        if (curState == 0) {
-                            hasWaiting = true;
+                        if(hasDeny) {
+                            state = 2;
+                        } else if (hasWaiting) {
+                            state = 0;
                         }
+                        DecimalFormat df = new DecimalFormat("0.00");
+                        map.put("reportTime", df.format(reportTime));
+                        map.put("cost", total);
+                        map.put("state", state);
                     }
-                    if(hasDeny) {
-                        state = 2;
-                    } else if (hasWaiting) {
-                        state = 0;
-                    }
-                    DecimalFormat df = new DecimalFormat("0.00");
-                    map.put("reportTime", df.format(reportTime));
-                    map.put("cost", total);
-                    map.put("state", state);
                 }
+
                 List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
                 //需要看可见部门(部门主要负责人和其他负责人以及查看本部门工时权限)所有人员的日报
                 if (allVisibleDeptIdList.size() > 0) {
@@ -1492,15 +1495,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 }
                                 for (int m=0;m<settings.size(); m++) {
                                     if (settings.get(m).getIsDeptAudit()== 0) {//找到项目审核的那个节点
-                                        AuditWorkflowTimeSetting nextNode = settings.get(m + 1);
-                                        upR.setIsDeptAudit(nextNode.getIsDeptAudit());
-                                        if (upR.getIsDeptAudit() == 1) {
-                                            upR.setAuditDeptid(nextNode.getAuditDeptId());
-                                            upR.setAuditDeptManagerid(allDepts.stream()
-                                                    .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
+                                        //有些情况下,人员切换部门,之前是项目审核后进入部门审核,isFinalAudit 非1,就走到这里来了。这时候需要判断下个节点是否存在
+                                        if (m + 1< settings.size()) {
+                                            AuditWorkflowTimeSetting nextNode = settings.get(m + 1);
+                                            upR.setIsDeptAudit(nextNode.getIsDeptAudit());
+                                            if (upR.getIsDeptAudit() == 1) {
+                                                upR.setAuditDeptid(nextNode.getAuditDeptId());
+                                                upR.setAuditDeptManagerid(allDepts.stream()
+                                                        .filter(ad->ad.getDepartmentId().equals(nextNode.getAuditDeptId())).findFirst().get().getManagerId());
+                                            }
+                                            upR.setIsFinalAudit(nextNode.getIsFinal());
+                                            break;
+                                        } else {
+                                            System.out.println("存在换部门情况,新的部门审批流项目审核后无节点,无需处理");
+                                            upR.setIsFinalAudit(1);
+                                            upR.setState(1);
                                         }
-                                        upR.setIsFinalAudit(nextNode.getIsFinal());
-                                        break;
                                     }
                                 }
                                 //判断下一个审核节点(部门审核)的审核人和当前审核的是不是同一个人,如果是的,则可直接进入下一步审核或者结束

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

@@ -1181,7 +1181,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 if (jobNumberCell != null) {
                     jobNumberCell.setCellType(CellType.STRING);
                     jobNumber = jobNumberCell.getStringCellValue();
-                    jobNumList.add(jobNumber);
+                    if (!StringUtils.isEmpty(jobNumber)) {
+                        //只校验非空工号
+                        jobNumList.add(jobNumber);
+                    }
                 }
 
                 nameCell.setCellType(CellType.STRING);
@@ -1189,13 +1192,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 if (phoneCell != null) {
                     phoneCell.setCellType(CellType.STRING);
                     phone = phoneCell.getStringCellValue();
-                    System.out.println("phone=="+phone);
                 } else {
 
                 }
 
                 String name = nameCell.getStringCellValue();
-
                 String dept = null;
                 if (deptCell != null) {
                     deptCell.setCellType(CellType.STRING);

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

@@ -542,15 +542,18 @@ public class TimingTask {
     //推送到开发环境,每10分钟一次
     @Scheduled(fixedRate = 600 * 1000)
     private void pushSysConfigToDev() {
-        if (isDev) {
+        if (isDev || isPrivateDeploy) {
             return;
         }
-        String url = "http://47.101.180.183:10010/wxcorp/updateSuiteTicket?suiteTicket="
-                +sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", "wx_suite_ticket")).getParamValue();
-        String forObject = this.restTemplate.getForObject(url, String.class);
-        JSONObject json = JSONObject.parseObject(forObject);
-        if (json.getString("code").equals("error")) {
-            System.out.println("推送失败:"+json.getString("msg"));
+        SysConfig config = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", "wx_suite_ticket"));
+        if (config != null) {
+            String url = "http://47.101.180.183:10010/wxcorp/updateSuiteTicket?suiteTicket="
+                    +config.getParamValue();
+            String forObject = this.restTemplate.getForObject(url, String.class);
+            JSONObject json = JSONObject.parseObject(forObject);
+            if (json.getString("code").equals("error")) {
+                System.out.println("推送失败:"+json.getString("msg"));
+            }
         }
     }
     //每分钟校验是否有需要提醒的填报

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties

@@ -19,7 +19,7 @@ register.phoneExist=该电话号码已注册
 register.phoneError=该电话号码已存在
 register.companyExist=该公司已注册,请联系管理员为您添加账号
 register.peopleFull=公司人员已达上限
-register.jobNoExist=该工号已存在
+register.jobNoExist=该工号已存在
 register.peopleFullAndCallRoot=人数已达上限,无法导入.请联系客服提高人数上限。
 register.peopleNoEnough=仅剩余"{0}"人可添加,请减少本次导入的人员数量或者联系客服提高人数上限。
 register.phoneRepeat=手机号有重复 批量新建账号失败:{0}

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties

@@ -19,7 +19,7 @@ register.phoneExist=The phone number is already registered.
 register.phoneError=The phone number already exists.
 register.companyExist=The company has been registered, please contact the administrator to add your account.
 register.peopleFull=Company personnel has reached the upper limit.
-register.jobNoExist=The job number already exists.
+register.jobNoExist=The job number already exists:
 register.peopleFullAndCallRoot=The number of people has reached the upper limit and cannot be imported. Please contact customer service to increase the upper limit.
 register.peopleNoEnough=Only "{0}" people can be added. Please reduce the number of people imported this time or contact customer service to increase the maximum number of people.
 register.phoneRepeat=Failed to batch create accounts with duplicate mobile phone numbers: {0}.

+ 6 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -100,7 +100,7 @@
                         <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-medal" ></i>{{user.jobNumber}}</span></el-dropdown-item>
                         <el-dropdown-item @click.native="reset">{{$t('other.changeThePassword')}}</el-dropdown-item>
                         <!-- <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item> -->
-                        <el-dropdown-item divided @click.native="logout">{{$t('other.launchTheLogin')}}</el-dropdown-item>
+                        <el-dropdown-item divided @click.native="logout" v-if="!isCorpWX" >{{$t('other.launchTheLogin')}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
             </el-col>
@@ -222,6 +222,7 @@
         inject:['reloads'],
         data() {
             return {
+                isCorpWX: false,
                 // roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员","公司领导"],
                 roleArray:[this.$t('role.ordinaryEmployees'),this.$t('role.superAdministrator'),this.$t('role.systemAdministrator'),this.$t('role.companyTop'),this.$t('role.financialAdministrator'),this.$t('role.projectManager'),this.$t('role.companyLeadership')],
                 helpImg: '../assets/image/userHead.png',
@@ -576,7 +577,10 @@
         mounted() {
             // console.log(this.$router.options.routes, '看看')
             console.log(this.$router.options.routes, '路由')
-
+            var ua = navigator.userAgent.toLowerCase();
+            if (ua.indexOf("wxwork") > 0) {
+                this.isCorpWX = true;
+            } 
             let langse = localStorage.getItem("lang") || 'zh'
             if(langse == 'en') {
                 this.language = 'English'

+ 5 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -357,14 +357,14 @@
                     <vueCascader :size="'medium'" :widthStr="'430'" :clearable="true" :subject="option" :subjectId="insertForm.departmentId" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
 
                 </el-form-item>
-                <el-form-item :label="$t('immediatesuperior')">
+                <!-- <el-form-item :label="$t('immediatesuperior')">
                     <el-select v-model="insertForm.superiorId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" filterable clearable>
                         <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
                             <span style="float: left">{{item.name}}</span>
                             <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
                         </el-option>
                     </el-select>
-                </el-form-item>
+                </el-form-item> -->
                 <el-form-item :label="$t('jiao-se')" prop="roleId">
                     <el-select v-model="insertForm.roleId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%">
                         <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
@@ -446,14 +446,14 @@
                     :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" 
                     clearable></el-cascader>
                 </el-form-item>
-                <el-form-item :label="$t('immediatesuperior')">
+                <!-- <el-form-item :label="$t('immediatesuperior')">
                     <el-select v-model="insertForm.superiorId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" filterable clearable>
                         <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
                             <span style="float: left">{{item.name}}</span>
                             <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
                         </el-option>
                     </el-select>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible1=false">{{ $t('btn.cancel') }}</el-button>
@@ -1986,6 +1986,7 @@ export default {
               });
               //重新读取列表
               this.getUser();
+              this.importDialog = false;
             } else {
               this.$message({
                 message: res.msg,

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

@@ -31,7 +31,7 @@
                             
                             </div> -->
                             <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
-                                <el-input placeholder="请输入姓名" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
+                                <el-input placeholder="请输入姓名" v-if="user.userNameNeedTranslate != 1" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
                                     <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
                                 </el-input>
                                 <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

@@ -24,7 +24,7 @@
                     <span v-if="(isCorpWX && userInfo.corpwxUserid != null) || (isWX && userInfo.wxOpenid != null)" style="color:#7CCD7C;">已绑定</span>
                 </template>
             </van-cell>
-            <van-button class="logout" @click="logout" block round type="danger" >退出登录</van-button>
+            <van-button class="logout" @click="logout" block round type="danger" v-if="!isCorpWX">退出登录</van-button>
         </main>
 
         <Footer page="my" />

+ 17 - 82
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -49,11 +49,6 @@
                 <van-button @click="batchAgree(false)" :disabled="!isCanAgree || report.length == 0" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button>
                 </div>
             </div>
-
-            <van-pull-refresh v-model="downLoading" @refresh="onDownRefresh">
-                <!-- 列表 -->
-                <van-list v-model="upLoading" :finished="upFinished" :immediate-check="false" :offset="100" finished-text="没有更多了" @load="onLoadList">
-
             <van-skeleton  v-for="(item,index) in report" :key="index" title avatar :row="3" :loading="false">
                 <van-panel class="one_report">
                     <template #header>
@@ -157,11 +152,6 @@
                     </van-popup>
                 </van-panel>
             </van-skeleton>
-
-                </van-list>
-            </van-pull-refresh>
-
-            
             <van-popup v-model="denyReasonDialog" position="bottom" closeable >
                 <van-cell>请输入原因</van-cell>
                 <van-field class="form_input"
@@ -198,15 +188,6 @@
                 nowTime: this.format(new Date(new Date()),"yyyy-MM-dd"),
                 showPicker: false,
                 report: [],
-
-                // 懒加载
-                total: 0,               // 列表总数据长度
-                pageIndex: 1,           // 页码,每页数据固定为25
-                upLoading: false,       // 上拉加载
-                upFinished: false,      // 上拉加载完毕
-                downLoading: false,     // 下拉刷新
-                listReLoading: false,   // 是否重新加载列表数据
-
                 flg: false,
                 isCanAgree: false,
                 approveinData: null,
@@ -227,42 +208,17 @@
         created() {
         },
         methods: {
-
-            onDownRefresh() {
-                this.pageIndex = 1
-                this.listReLoading = true
-                this.upLoading = true
-                this.upFinished = false // 不写这句会导致你上拉到底过后在下拉刷新将不能触发下拉加载事件
-                this.getReport()
-            },
-            onLoadList(){
-                if(this.total <= this.report.length) {
-                    this.upFinished = true
-                    this.upLoading = false
-                    return
-                }
-                this.pageIndex += 1
-                this.listReLoading = false
-                this.getReport()
-            },
-
-
-
             selectDateClear(){
                 this.selectDate = []
                 this.selectDateValue = ''
-
-                this.listReLoading = true
-                this.onDownRefresh()
+                this.getReport()
             },
             selectUserClear(){
                 this.userNameValue = ''
                 this.userIdList = []
                 this.userList.forEach(item => {delete item.isChecked})
                 this.showUserList = this.userList
-
-                this.listReLoading = true
-                this.onDownRefresh()
+                this.getReport()
             },
             selectUserClick(){
                 this.selectUserShow = true
@@ -274,9 +230,7 @@
                 this.selectShow = false;
                 this.selectDate = [this.getSelectDateStr(start),this.getSelectDateStr(end)]
                 this.selectDateValue = `${this.selectDate[0]} 至 ${this.selectDate[1]}`;
-                
-                this.listReLoading = true
-                this.onDownRefresh()
+                this.getReport()
             },
             getSelectDateStr(date){
                 return `${date.getFullYear()}-${(date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}`;
@@ -299,12 +253,9 @@
                     this.userNameValue = this.userNameValue.substring(0, this.userNameValue.length-1);
                     this.userIdList = this.userIdList.substring(0, this.userIdList.length-1);
                 }
-                this.selectUserShow = false
-
-                this.listReLoading = true
-                this.onDownRefresh()
-
                 this.$forceUpdate()
+                this.selectUserShow = false
+                this.getReport()
                 
             },
 
@@ -465,9 +416,7 @@
             getReport() {
                 const toast = this.$toast.loading({
                     forbidClick: true,
-                    duration: 0,
-                    pageIndex: this.pageIndex,
-                    pageSize: 25
+                    duration: 0
                 });
                 let parameter = {
                     state: 0
@@ -483,36 +432,19 @@
                 .then(res => {
                     if(res.code == "ok") {
                         this.$toast.clear();
-                        // this.total = res.data.total
-                        this.downLoading = false
-                        this.upLoading = false
-
-                        this.isAllChecked = false
-                        if(this.listReLoading){
-                            this.report = res.data;
-                            document.documentElement.scrollTop = 0
-                            for(let i in this.report){
-                                this.$set(this.report[i],'checked',false)
-                            }
-                        }else{
-                            for(let i in res.data){
-                                this.report.push(res.data[i])
-                            }
-                            
-                        }
-
+                        this.report = res.data;
                         // this.isAllChecked = this.report.length == 0 ? false : true
-                        
-                        
+                        if(this.report.length == 0){
+                            this.isAllChecked = false
+                        }
+                        for(let i in this.report){
+                            this.$set(this.report[i],'checked',false)
+                        }
                     } else {
                         this.$toast.clear();
                         this.$toast.fail('获取失败:'+res.msg);
-                        this.downLoading = false
-                        this.upLoading = false
                     }
-                }).catch(err=> {this.$toast.clear();
-                    this.downLoading = false
-                    this.upLoading = false});
+                }).catch(err=> {this.$toast.clear();});
             },
 
             approve(id, item) {
@@ -616,6 +548,9 @@
 </script>
 
 <style lang="less" scoped>
+.dateSelectCell{
+    display: -webkit-box;
+}
 .userCheckbox {
         padding: 10px;;
     }