浏览代码

出差审批流

seyason 2 年之前
父节点
当前提交
575f92777d
共有 14 个文件被更改,包括 316 次插入24 次删除
  1. 6 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/BusinessTripController.java
  2. 39 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/BustripAuditLogController.java
  3. 67 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/BustripAuditLog.java
  4. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/BustripAuditLogMapper.java
  5. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/BusinessTripService.java
  6. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/BustripAuditLogService.java
  7. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/WxCorpInfoService.java
  8. 48 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java
  9. 20 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BustripAuditLogServiceImpl.java
  10. 3 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  11. 25 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  12. 22 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/BustripAuditLogMapper.xml
  13. 50 14
      fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue
  14. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/BusinessTripController.java

@@ -2,6 +2,7 @@ package com.management.platform.controller;
 
 
 import com.management.platform.entity.BusinessTrip;
+import com.management.platform.entity.LeaveSheet;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.BusinessTripService;
 import com.management.platform.util.HttpRespMsg;
@@ -55,6 +56,11 @@ public class BusinessTripController {
         return businessTripService.queryList(sheet, pageIndex, pageSize,checkState);
     }
 
+    @RequestMapping("/auditList")
+    public HttpRespMsg auditList(BusinessTrip sheet, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, @RequestParam(defaultValue = "0") Integer checkState) {
+        return businessTripService.auditList(sheet, pageIndex, pageSize, checkState);
+    }
+
     @RequestMapping("/approve")
     public HttpRespMsg approve(Integer id) {
 

+ 39 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/BustripAuditLogController.java

@@ -0,0 +1,39 @@
+package com.management.platform.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.BustripAuditLog;
+import com.management.platform.entity.LeaveAuditLog;
+import com.management.platform.mapper.BustripAuditLogMapper;
+import com.management.platform.mapper.LeaveAuditLogMapper;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-12-12
+ */
+@RestController
+@RequestMapping("/bustrip-audit-log")
+public class BustripAuditLogController {
+    @Resource
+    BustripAuditLogMapper bustripAuditLogMapper;
+
+    @RequestMapping("/getBySheetId")
+    public HttpRespMsg getBySheetId(int sheetId) {
+        List<BustripAuditLog> list = bustripAuditLogMapper.selectList(new QueryWrapper<BustripAuditLog>().eq("sheet_id", sheetId));
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = list;
+        return msg;
+    }
+}
+

+ 67 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/BustripAuditLog.java

@@ -0,0 +1,67 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-12-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BustripAuditLog extends Model<BustripAuditLog> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 表单id
+     */
+    @TableField("sheet_id")
+    private Integer sheetId;
+
+    /**
+     * 审批节点id
+     */
+    @TableField("audit_node_id")
+    private Integer auditNodeId;
+
+    @TableField("auditor_id")
+    private String auditorId;
+
+    @TableField("auditor_name")
+    private String auditorName;
+
+    /**
+     * 是否审核通过,1-通过,0-驳回
+     */
+    @TableField("is_pass")
+    private Integer isPass;
+
+    @TableField("indate")
+    private LocalDateTime indate;
+
+    @TableField("deny_reason")
+    private String denyReason;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/BustripAuditLogMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.BustripAuditLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-12-12
+ */
+public interface BustripAuditLogMapper extends BaseMapper<BustripAuditLog> {
+
+}

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/BusinessTripService.java

@@ -29,4 +29,6 @@ public interface BusinessTripService extends IService<BusinessTrip> {
     HttpRespMsg modifyProject(BusinessTrip sheet);
 
     HttpRespMsg exportData(BusinessTrip sheet,Integer keyword, String startDate, String endDate, String userId);
+
+    HttpRespMsg auditList(BusinessTrip sheet, Integer pageIndex, Integer pageSize, Integer checkState);
 }

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/BustripAuditLogService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.BustripAuditLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-12-12
+ */
+public interface BustripAuditLogService extends IService<BustripAuditLog> {
+
+}

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

@@ -22,7 +22,7 @@ import java.util.List;
  */
 public interface WxCorpInfoService extends IService<WxCorpInfo> {
 
-    public void sendWXCorpMsg(WxCorpInfo corpInfo, String corpUserid, String msg);
+    public void sendWXCorpMsg(WxCorpInfo corpInfo, String corpUserid, String msg, String pageRouter, Integer msgType);
 
     public void sendWXCorpTemplateCardMsg(WxCorpInfo corpInfo, String corpUserid, JSONObject msg);
 

+ 48 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java

@@ -153,6 +153,54 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
         return httpRespMsg;
     }
 
+    @Override
+    public HttpRespMsg auditList(BusinessTrip sheet, Integer pageIndex, Integer pageSize, Integer checkState) {
+        QueryWrapper<BusinessTrip> queryWrapper = new QueryWrapper<BusinessTrip>();
+        String token = request.getHeader("TOKEN");
+        User user = userMapper.selectById(token);
+
+        sheet.setCompanyId(user.getCompanyId());
+
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        queryWrapper.eq("company_id", sheet.getCompanyId()).orderByDesc("id");
+        queryWrapper.eq("status", 1);
+        queryWrapper.eq("auditor_id", user.getId());
+
+        if (!StringUtils.isEmpty(sheet.getOwnerId())) {
+            queryWrapper.eq("owner_id", sheet.getOwnerId());
+        }
+        if (sheet.getStartDate() != null && sheet.getEndDate() != null) {
+            queryWrapper.le("start_date", sheet.getEndDate()).ge("end_date", sheet.getStartDate());
+        }
+        if (!StringUtils.isEmpty(sheet.getWay())) {
+            queryWrapper.eq("way", sheet.getWay());
+        }
+        if (checkState==1){
+            queryWrapper.ge("day_count",10);
+        }
+        IPage<BusinessTrip> listIPager = businessTripMapper.selectPage(new Page<>(pageIndex, pageSize),
+                queryWrapper);
+        List<BusinessTrip> records = listIPager.getRecords();
+//        List<String> userIds = records.stream().map(BusinessTrip::getOwnerId).collect(Collectors.toList());
+//        if (userIds.size() > 0) {
+//            List<User> userList = userMapper.getUserWithDept(new QueryWrapper<User>().in("id", userIds));
+//            records.stream().forEach(r->{
+//                Optional<User> find = userList.stream().filter(u->u.getId().equals(r.getOwnerId())).findFirst();
+//                if (find.isPresent()) {
+//                    r.setDept(find.get().getDepartmentName());
+//                }
+//            });
+//        }
+
+        Long total = listIPager.getTotal();
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("records", records);
+        map.put("total", total);
+        httpRespMsg.data = map;
+        return httpRespMsg;
+    }
+
     @Override
     public HttpRespMsg add(BusinessTrip sheet) {
         HttpRespMsg msg = new HttpRespMsg();

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BustripAuditLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.BustripAuditLog;
+import com.management.platform.mapper.BustripAuditLogMapper;
+import com.management.platform.service.BustripAuditLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-12-12
+ */
+@Service
+public class BustripAuditLogServiceImpl extends ServiceImpl<BustripAuditLogMapper, BustripAuditLog> implements BustripAuditLogService {
+
+}

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

@@ -1815,7 +1815,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         User user = userList.stream().filter(u -> u.getId().equals(uid)).findFirst().get();
                         //优先企业微信推送消息
                         if (wxCorpInfo != null && user.getCorpwxUserid() != null) {
-                            wxCorpInfoService.sendWXCorpMsg(wxCorpInfo, user.getCorpwxUserid(), msg);
+                            wxCorpInfoService.sendWXCorpMsg(wxCorpInfo, user.getCorpwxUserid(), msg, null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_AGREE);
                         } else if (user.getWxOpenid() != null){
                             pushPass(p.getProjectName(), user);
                         }
@@ -2030,7 +2030,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         }
         if (corpwxUserid != null) {
             WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
-            wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str);
+            wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str, null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
         } else if (reporter.getWxOpenid() != null){
             //发送个人微信通知
             pushReject(str, reporter, user.getName(), reason);
@@ -4754,7 +4754,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             if (corpwxUserid != null) {
                 WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
-                wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str);
+                wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid, str, null, WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
             } else if (reporter.getWxOpenid() != null){
                 //发送个人微信通知
                 pushReject(str, reporter, user.getName(), reason);

+ 25 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -66,6 +66,7 @@ import java.util.stream.Collectors;
 @Service
 @Slf4j
 public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpInfo> implements WxCorpInfoService {
+
     public static String URL_SEND_WXCORP_MSG = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN";
     //获取临时素材url
     public static String URL_GET_MEDIA = "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
@@ -82,6 +83,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
 
     public static final String GET_USER_INFO_WITHDP = "https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID";
 
+    public static final int TEXT_CARD_MSG_BUSTRIP_WAITING_AUDIT = 0;//出差待审核
+    public static final int TEXT_CARD_MSG_BUSTRIP_AGREE = 1;//出差审核通过
+    public static final int TEXT_CARD_MSG_BUSTRIP_DENY = 2;//出差审核驳回
+    public static final int TEXT_CARD_MSG_REPORT_DENY = 10;//日报驳回
+    public static final int TEXT_CARD_MSG_REPORT_AGREE = 11; //日报审核通过
 
     @Value("${suitId}")
     private String suitId;
@@ -236,7 +242,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         return resultUrl;
     }
     @Override
-    public void sendWXCorpMsg(WxCorpInfo corpInfo, String corpUserid, String msg) {
+    public void sendWXCorpMsg(WxCorpInfo corpInfo, String corpUserid, String msg, String pageRouter, Integer msgType) {
         try {
             if (isDev) return;
             log.info("发送企业微信消息===" + corpUserid);
@@ -247,12 +253,26 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             headers.setContentType(MediaType.APPLICATION_JSON);
             JSONObject reqParam = new JSONObject();
             reqParam.put("touser", corpUserid);
-            reqParam.put("msgtype", "text");
+            reqParam.put("msgtype", "textcard");
             reqParam.put("enable_id_trans", 1);
             reqParam.put("agentid", corpInfo.getAgentid());
-            JSONObject contentJson = new JSONObject();
-            contentJson.put("content", msg);
-            reqParam.put("text", contentJson);
+            JSONObject cardJson = new JSONObject();
+            String title = "";
+            String jumpUrl = "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=STATE#wechat_redirect";
+
+            if (StringUtils.isEmpty(pageRouter)) {
+                title = "通知";
+                jumpUrl = jumpUrl.replace("STATE", "0");
+            } else {
+                jumpUrl = jumpUrl.replace("STATE", pageRouter);
+                if ("awayOffice".equals(pageRouter)) {
+                    //出差
+                    title = "出差通知";
+                }
+            }
+            cardJson.put("title", title);
+            cardJson.put("description", msg);
+            reqParam.put("textcard", cardJson);
 
             HttpEntity<String> requestEntity = new HttpEntity<String>(reqParam.toJSONString(), headers);
             ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,

+ 22 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/BustripAuditLogMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.BustripAuditLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.BustripAuditLog">
+        <id column="id" property="id" />
+        <result column="sheet_id" property="sheetId" />
+        <result column="audit_node_id" property="auditNodeId" />
+        <result column="auditor_id" property="auditorId" />
+        <result column="auditor_name" property="auditorName" />
+        <result column="is_pass" property="isPass" />
+        <result column="indate" property="indate" />
+        <result column="deny_reason" property="denyReason" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, sheet_id, audit_node_id, auditor_id, auditor_name, is_pass, indate, deny_reason
+    </sql>
+
+</mapper>

+ 50 - 14
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -9,31 +9,27 @@
                     <i class="iconfont firerock-icontianbao"></i>
                     <span slot="title">{{ $t('businesstriisallowed') }}</span>
                 </el-menu-item>
-                <el-submenu index="2" v-if="permissions.awayOfficeAll">
-                    <template slot="title">
-                        <i class="iconfont firerock-iconbaoxiaodan"></i>
-                        <span>{{ $t('businesstriplist') }}</span>
-                    </template>
-                    <!-- 导航切换 -->
-                    <el-menu-item index="2-1" v-if="permissions.awayOfficeAll"><p @click="bills(false, 2)">{{ $t('all') }}</p></el-menu-item>
-                    <el-menu-item index="2-2" v-if="permissions.awayOfficeAudit && !isSyncData"><p @click="bills(true, 1)">{{ $t('state.WaitingAudit') }}</p></el-menu-item>
-                </el-submenu>
-                <el-menu-item index="3" @click="bills(false, 2)" v-if="!permissions.awayOfficeAll">
-                    <i class="iconfont firerock-iconbaoxiaodan"></i>
-                    <span slot="title">{{ $t('mbusinesstrip') }}</span>
+                <el-menu-item index="2" @select="bills" @click="auditList()" v-if="permissions.awayOfficeAudit">
+                <i class="iconfont firerock-iconbaoxiaodan"></i>
+                <span slot="title">出差审核</span>
                 </el-menu-item>
+                <el-menu-item index="3" @select="bills" @click="bills(false, 2)" >
+                <i class="iconfont firerock-iconbaoxiaodan"></i>
+                <span slot="title">{{ $t('businesstriplist') }}</span>
+                </el-menu-item>
+                
                 <el-menu-item index="4" v-if="permissions.awayOfficeStatistical">
                     <template slot="title">
                         <i class="iconfont firerock-icontianbao"></i>
                         <span slot="title">{{ $t('businessstatistics') }}</span>
                     </template>
                 </el-menu-item>
-                <!-- <el-menu-item index="5" v-if="permissions.awayOfficeProcess">
+                <el-menu-item index="5" v-if="permissions.awayOfficeProcess">
                     <template slot="title">
                         <i class="iconfont firerock-iconliucheng"></i>
                         <span slot="title">{{ $t('businesstriApprovalProcess') }}</span>
                     </template>
-                </el-menu-item> -->
+                </el-menu-item>
             </el-menu>
         </el-col>
     </div>
@@ -1116,6 +1112,46 @@ export default {
                 this.apk = 2
             }
         },
+        auditList() {
+            this.falg = 1
+            this.code = 1
+            this.tableData = []
+            this.displayTable = true;
+            this.isAuditList = true;
+            this.loading = true
+            this.page = '1'
+            var param = { pageIndex: this.page,
+                            pageSize: this.size,
+                            // createDate: this.createDate,
+                            startDate: this.createDate == null ? '' : this.createDate[0],
+                            endDate: this.createDate == null ? '' : this.createDate[1],
+                            ownerId: this.ownerIds,
+                            leaveType: this.type,
+                        };
+            this.list = [];
+            // this.total = 0;
+            this.http.post('/business-trip/auditList', param,
+                res => {
+                    if (res.code == "ok") {
+                    this.tableData = res.data.records
+                    this.total = res.data.total
+                    this.loading = false
+                    } else {
+                    this.loading = false
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                this.loading = false
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+            });
+        },
         // 导航切换
         bills(audit, tr){
             if(tr) {

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

@@ -1670,7 +1670,7 @@ export default {
                     startDate: this.createDate == null ? '' : this.createDate[0],
                     endDate: this.createDate == null ? '' : this.createDate[1],
                     ownerId: this.ownerIds,
-                    leaveType: this.type,
+                    way: this.type,
                   };
       this.list = [];
       // this.total = 0;