Переглянути джерело

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

seyason 2 роки тому
батько
коміт
ea5c5fb3a8

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

@@ -170,7 +170,7 @@ public class UserController {
     }
 
     @RequestMapping("/pushFillReport")
-    public HttpRespMsg pushFillReport(String ids, String date) {return userService.pushFillReport(ids, request, date); }
+    public HttpRespMsg pushFillReport(String ids, String date,Integer code) {return userService.pushFillReport(ids, request, date,code); }
 
     @RequestMapping("/exportMembList")
     public HttpRespMsg exportMembList(boolean isFill, String ids, String date) {return userService.exportMembList(isFill, ids, request, date); }

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

@@ -51,7 +51,7 @@ public interface UserService extends IService<User> {
 
     HttpRespMsg sendVcode(String mobile);
 
-    HttpRespMsg pushFillReport(String ids, HttpServletRequest request, String date);
+    HttpRespMsg pushFillReport(String ids, HttpServletRequest request, String date,Integer code);
 
     HttpRespMsg exportMembList(boolean isFill, String ids, HttpServletRequest request, String date);
 

+ 49 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -38,7 +38,6 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.ZoneOffset;
@@ -124,6 +123,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     private UserCertService userCertService;
     @Resource
     private TaskGroupMapper taskGroupMapper;
+    @Resource
+    private WxCorpInfoMapper wxCorpInfoMapper;
+    @Resource
+    private CompanyDingdingService companyDingdingService;
+    @Resource
+    private WxCorpInfoService wxCorpInfoService;
     //登录网页端
     @Override
     public HttpRespMsg loginAdmin(String username, String password) {
@@ -1278,26 +1283,57 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     }
 
     @Override
-    public HttpRespMsg pushFillReport(String ids, HttpServletRequest request, String date) {
+    public HttpRespMsg pushFillReport(String ids, HttpServletRequest request, String date,Integer code) {
         List<String> strings = ListUtil.convertLongIdsArrayToList(ids);
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
         List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", strings));
         HttpRespMsg msg = new HttpRespMsg();
-        for (User u : userList) {
-            if (!StringUtils.isEmpty(u.getWxOpenid())) {
-                Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(u.getDepartmentId())).findFirst();
-                if (first.isPresent()) {
-                    u.setDepartmentName(first.get().getDepartmentName());
+        List<WxCorpInfo> cpList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        //企业微信消息推送
+            userList.forEach(u->{
+                if(code==0){
+                        if (u.getCorpwxUserid() != null) {
+                            //推送到企业微信
+                            String corpUid = (String) u.getCorpwxUserid();
+                            JSONObject json=new JSONObject();
+                            JSONArray dataJson=new JSONArray();
+                            JSONObject jsonObj=new JSONObject();
+                            jsonObj.put("key", "提示");
+                            jsonObj.put("value", "您"+(StringUtils.isEmpty(date)?"":date)+"的工时报告还未填写");
+                            dataJson.add(jsonObj);
+                            json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
+                            json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                            json.put("content_item",dataJson);
+                            if (cpList.size() > 0) {
+                                wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
+                            }
+                        }
                 }
-                boolean result = push(u, date);
-                if (!result) {
-                    System.out.println("!!!!!!!!!!!==================");
-                    msg.setError("推送失败,请检查日志");
+                //钉钉消息推送  可优化批量发送消息
+                else if(code==1){
+                    Integer companyId = u.getCompanyId();
+                    Long agentId = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId)).getAgentId();;
+                    String dingUid = (String) u.getDingdingUserid();
+                    String alertMsg = "您"+(StringUtils.isEmpty(date)?"":date)+"的工时报告还未填写";
+                    companyDingdingService.sendFillReportAlertMsg(companyId, agentId, alertMsg, dingUid);
                 }
-            }
-        }
+                //微信公众号消息推送
+                else if(code==2){
+                        if (!StringUtils.isEmpty(u.getWxOpenid())) {
+                            Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(u.getDepartmentId())).findFirst();
+                            if (first.isPresent()) {
+                                u.setDepartmentName(first.get().getDepartmentName());
+                            }
+                            boolean result = push(u, date);
+                            if (!result) {
+                                System.out.println("!!!!!!!!!!!==================");
+                                msg.setError("推送失败,请检查日志");
+                            }
+                        }
+                }
+            });
         return msg;
     }
 

+ 11 - 11
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,18 +1,18 @@
 var path = require('path')
 
 //  var ip = '127.0.0.1'
-// var ip = '192.168.2.15'
-// var ip = '192.168.2.39'
+// var ip = '192.168.2.9'
+var ip = '192.168.2.39'
 
-var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-for (var i in ifaces) {
-    for (var j in ifaces[i]) {
-        var val = ifaces[i][j]
-        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-            ip = val.address
-        }
-    }
-}
+// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+// for (var i in ifaces) {
+//     for (var j in ifaces[i]) {
+//         var val = ifaces[i][j]
+//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+//             ip = val.address
+//         }
+//     }
+// }
 
 module.exports = {
   build: {

BIN
fhKeeper/formulahousekeeper/timesheet/src/assets/image/jiazai.gif


+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/http.js

@@ -87,7 +87,7 @@ export default {
                                 flgs = 0
                             }, 12000)
                         }
-
+                        exception(false)
                     } else {
                         exception(error)
                     }

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -287,6 +287,7 @@
                         this.http.post(this.port.manage.login, this.ruleForm , res => {
                             this.logining = false;
                             if (res.code == "ok") {
+                                console.log('执行')
                                 if(res.data.moduleList.length == 0){
                                     this.$message({
                                         message: '请联系管理员为\u3000' + res.data.roleName + '\u3000分配权限',
@@ -308,12 +309,14 @@
                                     }
                                 }
                             } else {
+                                this.logining = false;
                                 this.$message({
                                     message: res.msg,
                                     type: 'error'
                                 });
                             }
                         }, error => {
+                            console.log('执行1')
                             this.logining = false;
                             this.$message({
                                 message: error,

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

@@ -5,7 +5,7 @@
             <el-card class="box-card daily" shadow="never">
                 <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
                 <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;"> -->
-                <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 43px;">
+                <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
                         <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
                          style="width:190px;"
                          @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
@@ -33,8 +33,8 @@
                 </div>
                 </div>
                 <div style="display:flex;">
-                <div v-if="permissions.reportsCompany || user.manageDeptId != 0" >
-                    <div style="width:190px;">
+                <div v-if="permissions.reportsCompany || user.manageDeptId != 0" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
+                    <div style="width:205px;">
                         <el-select v-model="selectState" size="small" @change="stateChange" >
                         <el-option value="-1" label="全部状态" >全部状态</el-option>
                         <el-option value="-2" label="未填报">未填报</el-option>
@@ -70,7 +70,7 @@
                     </div>
                 </div>
                 
-                <div :style="'height:'+tableHeight+'px;width:0.5px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
+                <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
                 <div class="allDaily" style="float:left;flex-grow:1">
                     <!--系统管理员和部门负责人 -->
                     <div class="report_title" >
@@ -820,7 +820,9 @@
 
             </el-table>
             <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="weixinNotify"  v-if="!isFill" :disabled="fillMembList == 0">微信催填</el-button>
+                <el-button type="primary" @click="Notify(0)"  v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">企业微信催填</el-button>
+                <el-button type="primary" @click="Notify(1)"  v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">钉钉催填</el-button>
+                <el-button type="primary" @click="Notify(2)"  v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">微信催填</el-button>
                 <el-button type="default" @click="exportMemb"  :disabled="fillMembList == 0">导出</el-button>
             </div>
         </el-dialog>
@@ -2405,14 +2407,15 @@
             },
 
             //微信通知人员填写
-            weixinNotify() {
+            Notify(code) {
                 if (this.fillMembList.length == 0) return;
                 var ids = '';
                 this.fillMembList.forEach(f=>{
                     ids += f.id+',';
                 })
                 this.http.post('/user/pushFillReport',{ 
-                        ids: ids, date: this.curDate
+                        ids: ids, date: this.curDate,
+                        code: code
                     },
                     res => {
                         if (res.code == "ok") {