Forráskód Böngészése

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

yurk 2 éve
szülő
commit
a1f084fba4

+ 2 - 2
fhKeeper/formulahousekeeper/inva_4_tivo/index.html

@@ -16,7 +16,7 @@
     <script src="js/jquery1.42.min.js"></script>
     <script src="js/jquery.SuperSlide.2.1.3.js"></script>
     <!-- 统计文件 -->
-    <!-- <script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
+    <script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
     <script>LA.init({id: "Jk62Sh8gvUhl1xcU",ck: "Jk62Sh8gvUhl1xcU"})</script>
     <script>
         let str = (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) ? 'app': 'pc';
@@ -28,7 +28,7 @@
             let url = urlArr[0] + 'ttkuaiban.com/homemovement.html'
             window.location.replace(url)
         }
-    </script> -->
+    </script>
     <script>
         function bodyScale() {
             var devicewidth = document.documentElement.clientWidth;

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

@@ -1234,8 +1234,8 @@ public class ReportController {
             }
         }
         HttpRespMsg httpRespMsg = reportService.editReport(reportList, createDate.length > 0 ? createDate[0] : null, targetUserList, hourCost, user.getCompanyId());
-        //先给【上海绎维】使用
-        if (company.getId() == 862 || company.getId() == 10) {
+        //【上海绎维】、【火石演示】、【博通容合】使用
+        if (company.getId() == 862 || company.getId() == 10 || company.getId() == 3344) {
             //项目审核人是提交人的情况,直接审核
             List<String> reportIds = new ArrayList<>();
             for (int i = 0; i<id.length; i++) {

+ 13 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -2082,13 +2082,13 @@ public class WeiXinCorpController {
                     JSONArray jsonArray = json.getJSONObject("auth_info").getJSONArray("agent");
                     for (int i=0;i<jsonArray.size(); i++) {
                         JSONObject jsonObject = jsonArray.getJSONObject(i);
-                        if (jsonObject.getString("name").equals("工时管家")) {
-                            System.out.println(jsonObject);
+//                        if (jsonObject.getString("name").equals("工时管家")) {
+//                            System.out.println(jsonObject);
                             JSONObject privilege = jsonObject.getJSONObject("privilege");
                             allowUserList = privilege.getJSONArray("allow_user");
                             allowPartyList = privilege.getJSONArray("allow_party");
-                            break;
-                        }
+//                            break;
+//                        }
                     }
                 }
             } catch (Exception exception) {
@@ -2218,13 +2218,14 @@ public class WeiXinCorpController {
                     JSONArray jsonArray = json.getJSONObject("auth_info").getJSONArray("agent");
                     for (int i=0;i<jsonArray.size(); i++) {
                         JSONObject jsonObject = jsonArray.getJSONObject(i);
-                        if (jsonObject.getString("name").equals("工时管家")) {
-                            System.out.println(jsonObject);
+                        //用户可能会自定义应用名称,不一定是工时管家。
+//                        if (jsonObject.getString("name").equals("工时管家")) {
+//                            System.out.println(jsonObject);
                             JSONObject privilege = jsonObject.getJSONObject("privilege");
                             allowUserList = privilege.getJSONArray("allow_user");
                             allowPartyList = privilege.getJSONArray("allow_party");
-                            break;
-                        }
+//                            break;
+//                        }
                     }
                 }
             } catch (Exception exception) {
@@ -3293,7 +3294,7 @@ public class WeiXinCorpController {
             JSONArray jsonArray = json.getJSONObject("auth_info").getJSONArray("agent");
             for (int i=0;i<jsonArray.size(); i++) {
                 JSONObject jsonObject = jsonArray.getJSONObject(i);
-                if (jsonObject.getString("name").equals("工时管家")) {
+//                if (jsonObject.getString("name").equals("工时管家")) {
                     System.out.println(jsonObject);
                     Integer authMode = jsonObject.getInteger("auth_mode");
                     if (!wxCorpInfo.getAuthMode().equals(authMode)) {
@@ -3301,8 +3302,8 @@ public class WeiXinCorpController {
                         wxCorpInfoMapper.updateById(wxCorpInfo);
                     }
                     msg.data = jsonObject.toString();
-                    break;
-                }
+//                    break;
+//                }
             }
         }
         return msg;
@@ -3753,6 +3754,7 @@ public class WeiXinCorpController {
     @RequestMapping("/sendCardMsg")
     public HttpRespMsg sendCardMsg(String corpwxOpenId) {
         User user = userMapper.selectOne(new QueryWrapper<User>().eq("corpwx_userid", corpwxOpenId));
+        if (user == null) return new HttpRespMsg().fail("用户不存在");
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         JSONObject data = new JSONObject();
         data.put("card_type", "news_notice");

+ 65 - 50
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -91,10 +91,13 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(userId);
         List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "费用审核");
+        boolean isAuditor = functionDeptList.size() > 0;
         boolean isNew = false;
         if (sheet.getId() == null) {
-            if(functionDeptList.size()>0){
+            if (isAuditor) {
                 sheet.setStatus(0);
+            } else {
+                sheet.setStatus(1);
             }
             isNew = true;
             //检查code不能重复
@@ -104,8 +107,18 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 msg.setError(MessageUtils.message("other.billNoExist"));
                 return msg;
             }
+        } else {
+            //如果是驳回状态,改成待审核,否则不变
+            if (sheet.getStatus() == 2) {
+                if (isAuditor) {
+                    sheet.setStatus(0);
+                } else {
+                    sheet.setStatus(1);
+                }
+            }
         }
-        sheet.setStatus(1);
+
+
         sheet.setDenyReason(null);
         sheet.setOperatorId(userId);//设置操作人id
         JSONArray array = JSONArray.parseArray(items);
@@ -113,55 +126,57 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
         sheet.setCompanyId(user.getCompanyId());
         if (isNew) {
             expenseSheetMapper.insert(sheet);
-            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-            if(wxCorpInfo!=null){
-                //获取具有费用报销审核权限的人员
-                SysFunction sysFunction = sysFunctionMapper.selectOne(new QueryWrapper<SysFunction>().eq("name", "费用审核"));
-                List<SysRoleFunction> sysRoleFunctions = sysRoleFunctionMapper.selectList(new QueryWrapper<SysRoleFunction>().eq("function_id", sysFunction.getId()));
-                List<Integer> roleIds = sysRoleFunctions.stream().map(sf -> sf.getRoleId()).distinct().collect(Collectors.toList());
-                List<Integer> targetRoleIds = sysRoleMapper.selectList(new QueryWrapper<SysRole>().eq("company_id", user.getCompanyId()).in("id", roleIds))
-                        .stream().map(sl -> sl.getId()).distinct().collect(Collectors.toList());
-                List<User> targetUserList = userMapper.selectList(new QueryWrapper<User>().in("role_id", targetRoleIds));
-                String corpUserString = targetUserList.stream().map(tl -> tl.getCorpwxUserid()).collect(Collectors.joining("|"));
-                User targetUser = userMapper.selectById(sheet.getOwnerId());
-                //推送到企业微信
-                JSONObject json=new JSONObject();
-                JSONArray dataJson=new JSONArray();
-                JSONObject jsonObj=new JSONObject();
-                jsonObj.put("key", "报销人");
-                jsonObj.put("value",("$userName="+targetUser.getCorpwxUserid()+"$"));
-                JSONObject jsonObj1=new JSONObject();
-                jsonObj1.put("key", "填报日期");
-                jsonObj1.put("value",sheet.getCreateDate());
-                JSONObject jsonObj2=new JSONObject();
-                jsonObj2.put("key", "票据类型");
-                jsonObj2.put("value",sheetTypes[sheet.getType()]);
-                JSONObject jsonObj3=new JSONObject();
-                jsonObj3.put("key", "金额");
-                jsonObj3.put("value",sheet.getTotalAmount());
-                JSONObject jsonObj4=new JSONObject();
-                jsonObj4.put("key", "备注");
-                jsonObj4.put("value",sheet.getRemark()==null?"":sheet.getRemark());
-                dataJson.add(jsonObj);
-                dataJson.add(jsonObj1);
-                dataJson.add(jsonObj2);
-                dataJson.add(jsonObj3);
-                dataJson.add(jsonObj4);
-                json.put("template_id","tty9TkCAAALUiWvjdoDg_PZf48gwucZA");
-                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=expense#wechat_redirect");
-                json.put("content_item",dataJson);
-                wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,corpUserString, json);
-                List<Information> informationList=new ArrayList<>();
-                for (User item : targetUserList) {
-                    Information information=new Information();
-                    information.setUserId(item.getId());
-                    information.setTime(LocalDateTime.now());
-                    information.setMsg("费用报销待审核");
-                    information.setType(3);
-                    information.setContent(sheet.getCreateDate()+"");
-                    informationList.add(information);
+            if (!isAuditor) {
+                WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+                if(wxCorpInfo!=null){
+                    //获取具有费用报销审核权限的人员
+                    SysFunction sysFunction = sysFunctionMapper.selectOne(new QueryWrapper<SysFunction>().eq("name", "费用审核"));
+                    List<SysRoleFunction> sysRoleFunctions = sysRoleFunctionMapper.selectList(new QueryWrapper<SysRoleFunction>().eq("function_id", sysFunction.getId()));
+                    List<Integer> roleIds = sysRoleFunctions.stream().map(sf -> sf.getRoleId()).distinct().collect(Collectors.toList());
+                    List<Integer> targetRoleIds = sysRoleMapper.selectList(new QueryWrapper<SysRole>().eq("company_id", user.getCompanyId()).in("id", roleIds))
+                            .stream().map(sl -> sl.getId()).distinct().collect(Collectors.toList());
+                    List<User> targetUserList = userMapper.selectList(new QueryWrapper<User>().in("role_id", targetRoleIds));
+                    String corpUserString = targetUserList.stream().map(tl -> tl.getCorpwxUserid()).collect(Collectors.joining("|"));
+                    User targetUser = userMapper.selectById(sheet.getOwnerId());
+                    //推送到企业微信
+                    JSONObject json=new JSONObject();
+                    JSONArray dataJson=new JSONArray();
+                    JSONObject jsonObj=new JSONObject();
+                    jsonObj.put("key", "报销人");
+                    jsonObj.put("value",("$userName="+targetUser.getCorpwxUserid()+"$"));
+                    JSONObject jsonObj1=new JSONObject();
+                    jsonObj1.put("key", "填报日期");
+                    jsonObj1.put("value",sheet.getCreateDate());
+                    JSONObject jsonObj2=new JSONObject();
+                    jsonObj2.put("key", "票据类型");
+                    jsonObj2.put("value",sheetTypes[sheet.getType()]);
+                    JSONObject jsonObj3=new JSONObject();
+                    jsonObj3.put("key", "金额");
+                    jsonObj3.put("value",sheet.getTotalAmount());
+                    JSONObject jsonObj4=new JSONObject();
+                    jsonObj4.put("key", "备注");
+                    jsonObj4.put("value",sheet.getRemark()==null?"":sheet.getRemark());
+                    dataJson.add(jsonObj);
+                    dataJson.add(jsonObj1);
+                    dataJson.add(jsonObj2);
+                    dataJson.add(jsonObj3);
+                    dataJson.add(jsonObj4);
+                    json.put("template_id","tty9TkCAAALUiWvjdoDg_PZf48gwucZA");
+                    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=expense#wechat_redirect");
+                    json.put("content_item",dataJson);
+                    wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,corpUserString, json);
+                    List<Information> informationList=new ArrayList<>();
+                    for (User item : targetUserList) {
+                        Information information=new Information();
+                        information.setUserId(item.getId());
+                        information.setTime(LocalDateTime.now());
+                        information.setMsg("费用报销待审核");
+                        information.setType(3);
+                        information.setContent(sheet.getCreateDate()+"");
+                        informationList.add(information);
+                    }
+                    informationService.saveBatch(informationList);
                 }
-                informationService.saveBatch(informationList);
             }
         } else {
             expenseSheetMapper.updateById(sheet);

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/HttpRespMsg.java

@@ -53,6 +53,10 @@ public class HttpRespMsg implements Serializable {
         msg = errorMsg;
     }
 
+    public HttpRespMsg fail(String errorMsg) {
+        setError(errorMsg);
+        return this;
+    }
 
     public String toJSONStr() {
         JSONObject json = new JSONObject();

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

@@ -1338,7 +1338,7 @@ import { error } from 'dingtalk-jsapi';
                     if (res.code == "ok") {
                         this.exportFinanceDialog = false;
                         var aTag = document.createElement('a');
-                        aTag.download = this.$t('financialcoststatisticss')+".xls";
+                        aTag.download = this.$t('financialcoststatisticss')+".xlsx";
                         aTag.href = res.data;
                         aTag.click();
                     } else {

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

@@ -528,7 +528,7 @@
                         <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit"></selectCat>
                     </el-form-item>
                     <el-form-item :label="$t('newspaperauditor')" v-show="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
-                        <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.auditUserIds" multiple="true" :disabled=" permissions.projectParticipator || (!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId))" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" >
+                        <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.auditUserIds" multiple="true" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" >
                             <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
                         </el-select>
 

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

@@ -343,7 +343,8 @@
             <el-tab-pane :label="$t('overviewoftheproject')" name="info"><ProjectInfo ref="projectInfo" @basecost-change="changeBase"></ProjectInfo></el-tab-pane>
             <el-tab-pane :label="$t('datastatistics')" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
             <el-tab-pane :label="$t('costmanagement')" name="costbaseline" v-if="permissions.projectBaseline"><CostBaseline ref="costbaseline"></CostBaseline></el-tab-pane>
-            <el-tab-pane :label="$t('valueanalysis')" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane>
+            <!--去掉挣值分析模块-->
+            <!-- <el-tab-pane :label="$t('valueanalysis')" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane> -->
         </el-tabs>