Min 1 سال پیش
والد
کامیت
90b800b05a

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/UserMapper.java

@@ -28,7 +28,7 @@ public interface UserMapper extends BaseMapper<User> {
                                                       @Param("companyId") Integer companyId,
                                                       @Param("departmentIds") List departmentIds, String keyword, Integer status, @Param("roleId") Integer roleId);
 
-    List<Map<String, Object>> getPushUserList(@Param("companyId") Integer companyId,Integer alertType, String date);
+    List<Map<String, Object>> getPushUserList(@Param("companyId") Integer companyId, String date);
 
     List<Map<String, Object>> getPushDingdingUserList(@Param("alertTime") String alertTime, String date);
 

+ 35 - 68
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java

@@ -1,5 +1,6 @@
 package com.management.platform.task;
 
+import com.alibaba.excel.util.DateUtils;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -83,34 +84,13 @@ public class TimingTask {
     @Resource
     private UserMapper userMapper;
     @Resource
-    private DepartmentMapper departmentMapper;
-    @Resource
-    private ReportMapper reportMapper;
-    @Resource
-    private TimeAutoExcludeMapper timeAutoExcludeMapper;
-    @Resource
     private WxCorpInfoService wxCorpInfoService;
     @Resource
     private WxCorpInfoMapper wxCorpInfoMapper;
-    @Resource
-    private ReportLogMapper reportLogMapper;
-    @Resource
-    private OperationRecordService operationRecordService;
     @Value(value = "${upload.path}")
     private String path;
-
-    @Resource
-    private SysConfigMapper sysConfigMapper;
-    @Resource
-    private ThirdPartyInterfaceMapper thirdPartyInterfaceMapper;
-    @Resource
-    private ThirdPartyInterfaceService thirdPartyInterfaceService;
     @Resource
     private TimeTypeService timeTypeService;
-    @Resource
-    private SysRoleMapper sysRoleMapper;
-    @Resource
-    private UserService userService;
 
     private static final List<Integer> VALID_TOKEN_CHARS = new ArrayList<>();
     static {
@@ -187,54 +167,41 @@ public class TimingTask {
         DateTimeFormatter dt = DateTimeFormatter.ofPattern("HH:mm");
         String str = dt.format(now);
         String date = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(localDate);
-        List<TimeType> typeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().isNotNull("alert_time")
-                .ge("alert_time", str));
-        typeList.forEach(t->{
-            if (str.equals(t.getAlertTime())) {
-                //节假日是否提醒
-                Boolean workDay = timeTypeService.isWorkDay(t.getCompanyId(), localDate);
-                if (!workDay){
-                    return;
-                }
-                //发送推送提醒
-                Company company = companyMapper.selectById(t.getCompanyId());
-                //过期公司不提醒
-                if(company.getExpirationDate().isBefore(LocalDateTime.now())){
-                    return;
-                }
-                //开通了OA功能,有请假模块的,需要把当前请假的排除掉
-                List<Map<String, Object>> userList = null;
-                if (company.getPackageOa() == 1) {
-                    userList = userMapper.getPushUserList(t.getCompanyId(),t.getAlertType(), date);
-                } else {
-                    userList = userMapper.getPushUserList(t.getCompanyId(),t.getAlertType(), null);
-                }
-
-                List<WxCorpInfo> cpList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", t.getCompanyId()));
-                userList.forEach(u->{
-                    if (u.get("corpwxUserid") != null){
-                        //推送到企业微信
-                        String corpUid = (String) u.get("corpwxUserid");
-                        JSONObject json=new JSONObject();
-                        JSONArray dataJson=new JSONArray();
-                        JSONObject jsonObj=new JSONObject();
-                        jsonObj.put("key", "提示");
-                        jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
-                        dataJson.add(jsonObj);
-                        if(isPrivateDeploy){
-                            json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+suitId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
-                        }else {
-                            json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
-                            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);
-                        }
-                        if (cpList.size() > 0) {
-                            wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
-                        }
-                    }
-                });
+        List<WxCorpInfo> wxCorpInfoList = wxCorpInfoMapper.selectList(null);
+        for (WxCorpInfo wxCorpInfo : wxCorpInfoList) {
+            //节假日是否提醒
+            boolean workDay = WorkDayCalculateUtils.isWorkDay(localDate);
+            if (!workDay){
+                return;
+            }
+            //发送推送提醒
+            Company company = companyMapper.selectById(wxCorpInfo.getCompanyId());
+            //过期公司不提醒
+            if(company.getExpirationDate().isBefore(LocalDateTime.now())){
+                return;
             }
-        });
+            List<Map<String, Object>> userList = userMapper.getPushUserList(wxCorpInfo.getCompanyId(), date);
+            userList.forEach(u->{
+                if (u.get("corpwxUserid") != null){
+                    //推送到企业微信
+                    String corpUid = (String) u.get("corpwxUserid");
+                    JSONObject json=new JSONObject();
+                    JSONArray dataJson=new JSONArray();
+                    JSONObject jsonObj=new JSONObject();
+                    jsonObj.put("key", "提示");
+                    jsonObj.put("value", "请尽快填写昨日的报工");
+                    dataJson.add(jsonObj);
+                    if(isPrivateDeploy){
+                        json.put("content","请尽快填写昨日的报工"+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+suitId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
+                    }else {
+                        json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
+                        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, corpUid, json);
+                }
+            });
+        }
     }
 
 }

+ 1 - 13
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/UserMapper.xml

@@ -123,19 +123,7 @@
         WHERE a.company_id = #{companyId}
         AND (a.wx_openid IS NOT NULL or corpwx_userid is not null)
         AND a.is_active = 1
-        AND a.report_status =0
-        <choose>
-            <when test="alertType!=null and alertType==1">
-                AND NOT EXISTS(SELECT 1 FROM report WHERE report.`creator_id` = a.id AND report.`create_date` = DATE_FORMAT(date_sub(NOW(),interval 1 day), '%Y-%m-%d'))
-            </when>
-            <otherwise>
-                AND NOT EXISTS(SELECT 1 FROM report WHERE report.`creator_id` = a.id AND report.`create_date` = DATE_FORMAT(NOW(), '%Y-%m-%d'))
-            </otherwise>
-        </choose>
-        <if test="date != null">
-            and not exists (select 1 from leave_sheet where owner_id = a.id and start_date &lt;= #{date} and end_date &gt;= #{date} and leave_sheet.status = 0)
-        </if>
-
+        AND NOT EXISTS(SELECT 1 FROM report WHERE report.`creator_id` = a.id AND report.`create_date` = DATE_FORMAT(NOW(), '%Y-%m-%d'))
     </select>
 
 

+ 27 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue

@@ -99,7 +99,33 @@ export default {
     },
     // 下单计划
     placeAnOrder() {
-      console.log('点击了下单计划')
+      let ids=[this.id];
+      this.$axios.post(
+        "/plan/allocationPlan",
+        {
+          ids: ids.join(","),
+          planType: this.type
+        },
+        (res) => {
+          if (res.code == "ok") {
+            this.$message({
+              message: '下发成功',
+              type: "success",
+            });
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error",
+            });
+          }
+        },
+        (error) => {
+          this.$message({
+            message: error,
+            type: "error",
+          });
+        }
+      );
     },
     distributionProp(item, index) {
       if(this.beDeptList) {