Browse Source

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

seyason 2 years ago
parent
commit
7c76e2c1cf

+ 32 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/InformationServiceImpl.java

@@ -3,8 +3,12 @@ package com.management.platform.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.entity.Information;
 import com.management.platform.entity.Information;
+import com.management.platform.entity.TaskComment;
+import com.management.platform.entity.User;
+import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.mapper.InformationMapper;
 import com.management.platform.mapper.InformationMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.UserMapper;
+import com.management.platform.mapper.WxCorpInfoMapper;
 import com.management.platform.service.InformationService;
 import com.management.platform.service.InformationService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
 import com.management.platform.util.MessageUtils;
@@ -12,6 +16,7 @@ import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -30,13 +35,37 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
     @Resource
     @Resource
     private UserMapper userMapper;
     private UserMapper userMapper;
 
 
+    @Resource
+    private WxCorpInfoMapper wxCorpInfoMapper;
+
     @Override
     @Override
     public HttpRespMsg getInformationList(HttpServletRequest request) {
     public HttpRespMsg getInformationList(HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
         try {
-            String userId = userMapper.selectById(request.getHeader("Token")).getId();
-            httpRespMsg.data = informationMapper.selectList(new QueryWrapper<Information>()
-                    .eq("user_id", userId).orderByDesc("time").last("LIMIT 10"));
+            User user = userMapper.selectById(request.getHeader("token"));
+            List<Information> information = informationMapper.selectList(new QueryWrapper<Information>()
+                    .eq("user_id", user.getId()).orderByDesc("time").last("LIMIT 10"));
+            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
+            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id",user.getCompanyId()));
+                for (Information info : information) {
+                    if (info.getMsg() == null){
+                        continue;
+                    }
+                    String name = info.getMsg().substring(0, info.getMsg().indexOf("更新任务进展为"));
+                    String userWxId = "";
+                    for (User item : users) {
+                        if (item.getName().equals(name)){
+                            userWxId = item.getCorpwxRealUserid();
+                            break;
+                        }
+                    }
+                    String msg = info.getMsg();
+                    String newMsg = msg.replace(name, "$userName=" + userWxId + "$");
+                    info.setMsg(newMsg);
+                }
+            }
+            httpRespMsg.data = information;
         } catch (NullPointerException e) {
         } catch (NullPointerException e) {
             //httpRespMsg.setError("验证失败");
             //httpRespMsg.setError("验证失败");
             httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             httpRespMsg.setError(MessageUtils.message("access.verificationError"));

+ 45 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskProgressServiceImpl.java

@@ -1,11 +1,14 @@
 package com.management.platform.service.impl;
 package com.management.platform.service.impl;
 
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.*;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.TaskProgressService;
 import com.management.platform.service.TaskProgressService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.TprogressPaticipatorsService;
 import com.management.platform.service.TprogressPaticipatorsService;
+import com.management.platform.service.WxCorpInfoService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.ListUtil;
 import com.management.platform.util.ListUtil;
 import com.management.platform.util.MessageUtils;
 import com.management.platform.util.MessageUtils;
@@ -45,6 +48,10 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
     private ProjectMapper projectMapper;
     private ProjectMapper projectMapper;
     @Resource
     @Resource
     private TaskCommentMapper taskCommentMapper;
     private TaskCommentMapper taskCommentMapper;
+    @Resource
+    private WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private WxCorpInfoMapper wxCorpInfoMapper;
     //String[] statusList = new String[]{"状态正常", "存在风险", "进展逾期"};
     //String[] statusList = new String[]{"状态正常", "存在风险", "进展逾期"};
     @Override
     @Override
     public HttpRespMsg addProgress(TaskProgress progress, String participatorIds, HttpServletRequest request) {
     public HttpRespMsg addProgress(TaskProgress progress, String participatorIds, HttpServletRequest request) {
@@ -77,7 +84,9 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
         String updateStr = creator.getName()+MessageUtils.message("stages.upTask") + status;
         String updateStr = creator.getName()+MessageUtils.message("stages.upTask") + status;
         comment.setContent(updateStr);
         comment.setContent(updateStr);
         taskCommentMapper.insert(comment);
         taskCommentMapper.insert(comment);
-
+        Task task = taskMapper.selectById(progress.getTaskId());
+        Project project = projectMapper.selectById(task.getProjectId());
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", creator.getCompanyId()));
         if (!StringUtils.isEmpty(participatorIds)) {
         if (!StringUtils.isEmpty(participatorIds)) {
             List<String> ids = ListUtil.convertLongIdsArrayToList(participatorIds);
             List<String> ids = ListUtil.convertLongIdsArrayToList(participatorIds);
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", ids));
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", ids));
@@ -87,7 +96,6 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
                 item.setUserId(user.getId());
                 item.setUserId(user.getId());
                 item.setUserName(user.getName());
                 item.setUserName(user.getName());
                 tprogressPaticipatorsMapper.insert(item);
                 tprogressPaticipatorsMapper.insert(item);
-
                 //发消息通知进展
                 //发消息通知进展
                 Information information = new Information();
                 Information information = new Information();
                 information.setContent(""+progress.getTaskId());
                 information.setContent(""+progress.getTaskId());
@@ -95,8 +103,42 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
                 information.setUserId(user.getId());
                 information.setUserId(user.getId());
                 information.setType(2);
                 information.setType(2);
                 informationMapper.insert(information);
                 informationMapper.insert(information);
-
                 //TODO:如果关联了微信或者企业微信,可以推送通知
                 //TODO:如果关联了微信或者企业微信,可以推送通知
+                if(user.getCorpwxUserid()!=null){
+                    String corpwxUserid = user.getCorpwxUserid();
+                    //推送到企业微信
+                    JSONObject json=new JSONObject();
+                    JSONArray dataJson=new JSONArray();
+                    JSONObject jsonObj=new JSONObject();
+                    jsonObj.put("key", "项目名称");
+                    jsonObj.put("value",project.getProjectName());
+
+                    JSONObject jsonObj1=new JSONObject();
+                    jsonObj1.put("key", "任务名称");
+                    jsonObj1.put("value",task.getName());
+
+                    JSONObject jsonObj2=new JSONObject();
+                    jsonObj2.put("key", "进展内容");
+                    jsonObj2.put("value",progress.getContent());
+
+                    JSONObject jsonObj3=new JSONObject();
+                    jsonObj3.put("key", "任务状态");
+                    switch (progress.getStatus()){
+                        case 0:jsonObj3.put("value","状态正常");
+                        break;
+                        case 1:jsonObj3.put("value","存在风险");
+                        break;
+                        case 2:jsonObj3.put("value","进展逾期");
+                    }
+                    dataJson.add(jsonObj);
+                    dataJson.add(jsonObj1);
+                    dataJson.add(jsonObj2);
+                    dataJson.add(jsonObj3);
+                    json.put("template_id","tty9TkCAAASja8aiHGlheqEHQ7OIpRyg");
+                    json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                    json.put("content_item",dataJson);
+                    wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
+                }
             }
             }
         }
         }
 
 

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -321,14 +321,14 @@
         <div class="informant"><!--  报销人 -->
         <div class="informant"><!--  报销人 -->
           <el-form :model="ParticularsList" label-width="80px">
           <el-form :model="ParticularsList" label-width="80px">
             <el-form-item :label="$t('peopleconcerned')" style="width: 270px" :rules="{ required: true, message: $t('pleaseselecttheapplicant'), trigger: 'blur' }">
             <el-form-item :label="$t('peopleconcerned')" style="width: 270px" :rules="{ required: true, message: $t('pleaseselecttheapplicant'), trigger: 'blur' }">
-              <!-- <el-input v-show="flg" v-model="ParticularsList.ownerName" disabled ></el-input> -->
+              <el-input v-show="flg" v-model="ParticularsList.ownerName" disabled v-if="user.userNameNeedTranslate != '1'"></el-input>
               <!-- <el-select v-model="ParticularsList.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
               <!-- <el-select v-model="ParticularsList.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
                 <span v-for="(item, index) in users" :key="index">
                 <span v-for="(item, index) in users" :key="index">
                   <el-option :label="item.name" :value="item.id"></el-option>
                   <el-option :label="item.name" :value="item.id"></el-option>
                 </span>
                 </span>
               </el-select> -->
               </el-select> -->
 
 
-              <selectCat v-if="user.userNameNeedTranslate != '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'" :subject="users" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId" :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
+              <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'" :subject="users" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId" :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
 
 
             </el-form-item>
             </el-form-item>
             <el-form-item :label="$t('fillinthedate')">
             <el-form-item :label="$t('fillinthedate')">

+ 9 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -1,5 +1,7 @@
 <template>
 <template>
     <section class="sectionaa">
     <section class="sectionaa">
+        <div v-loading="!componentFlg" :style="'width: 100%;height:'+tableHeight+'px'" id="components">
+        <div v-if="componentFlg">
         <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tabs v-model="activeName" @tab-click="handleClick">
             <el-tab-pane :label="$t('maincontent')" name="project" @click="null" disabled=true>
             <el-tab-pane :label="$t('maincontent')" name="project" @click="null" disabled=true>
                 <template slot="label">
                 <template slot="label">
@@ -1041,6 +1043,8 @@
                 </el-upload>
                 </el-upload>
             </div>
             </div>
         </el-dialog>
         </el-dialog>
+        </div>
+        </div>
     </section>
     </section>
 </template>
 </template>
 <script>
 <script>
@@ -1084,6 +1088,7 @@
         
         
         data() {
         data() {
             return {
             return {
+                componentFlg: false,
                 mileageCup: false,
                 mileageCup: false,
                 loadingExport : false,
                 loadingExport : false,
                 saveTemplateLoading: false,
                 saveTemplateLoading: false,
@@ -3305,6 +3310,10 @@
                 that.stageListHeight = that.tableHeight - 45;
                 that.stageListHeight = that.tableHeight - 45;
                 that.taskListinH = that.stageListHeight - 75;
                 that.taskListinH = that.stageListHeight - 75;
             };
             };
+
+            setTimeout(function(){
+                that.componentFlg = true
+            }, 1000)
         },
         },
         mounted() {
         mounted() {
 
 
@@ -3317,7 +3326,6 @@
             
             
             this.getInsideData();
             this.getInsideData();
             this.getGroupTemplate();
             this.getGroupTemplate();
-            
         }
         }
     };
     };
 </script>
 </script>