Ver código fonte

实时提醒审核日报

QuYueTing 1 mês atrás
pai
commit
d9e713ce52

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2025-04-13
+ * @since 2025-04-14
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -668,6 +668,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("report_extra_field5_name")
     private String reportExtraField5Name;
 
+    /**
+     * 审核提醒方式:0-定时提醒,1-实时提醒
+     */
+    @TableField("alert_audit_mode")
+    private Integer alertAuditMode;
+
 
     @TableField(exist = false)
     private List<User> userList;

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

@@ -1338,6 +1338,44 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                 }
             }
+            //如果是实时提醒审核,需要立即发送消息通知
+            if (timeType.getAlertAuditMode() == 1 && reportList.get(0).getState() == 0) {
+                //检查是否为企业微信用户
+                WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+                if (wxCorpInfo != null) {
+                    for (Report report : reportList) {
+                        String corpwxUserid = userMapper.selectById(report.getProjectAuditorId()).getCorpwxUserid();
+                        //推送到企业微信
+                        JSONObject json=new JSONObject();
+                        JSONArray dataJson=new JSONArray();
+                        JSONObject jsonObj=new JSONObject();
+                        if (timeType.getAlertType() == 4) {
+                            jsonObj.put("key", "提示");
+                            String msgContent = timeType.getAlertCheckMsg();
+                            if (StringUtils.isEmpty(msgContent)) {
+                                msgContent = "待审核数量:"+1;
+                            } else {
+                                msgContent = msgContent.replace("{0}", "1");
+                            }
+                            jsonObj.put("value",msgContent);
+                        } else {
+                            jsonObj.put("key", "待审核数量");
+                            jsonObj.put("value","1");
+                        }
+                        dataJson.add(jsonObj);
+//                        if(isPrivateDeploy){
+//                            json.put("content","待审核数量: "+1+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri="+pcUrl+"/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去审核</a>");
+//                        }else {
+                            String templateId = timeType.getAlertType() == 4 ? "tty9TkCAAAtDDCqY796mGulF9c5Jmwng":"tty9TkCAAAuPvPjabDdQXGocnG0K24EQ";
+                            json.put("template_id",templateId);
+                            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=review#wechat_redirect");
+                            json.put("content_item",dataJson);
+//                        }
+//                        System.out.println("发送企业微信消息==用户:"+corpwxUserid+", "+json.toJSONString());
+                        wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
+                    }
+                }
+            }
         } else {
             //没有需要更新的,则
         }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -952,7 +952,7 @@ public class TimingTask {
         if (isDev) return;
         LocalDateTime now = LocalDateTime.now();
         DateTimeFormatter df = DateTimeFormatter.ofPattern("HH:mm");
-        List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("wait_check_alert_time", df.format(now.toLocalTime())));
+        List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("wait_check_alert_time", df.format(now.toLocalTime())).eq("alert_audit_mode", 0));
         List<Integer> companyIds = timeTypeList.stream().map(TimeType::getCompanyId).distinct().collect(Collectors.toList());
         companyIds.add(-1);
         List<CompanyDingding> list = companyDingdingMapper.getDingdingCompanyList(companyIds);

Diferenças do arquivo suprimidas por serem muito extensas
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 10 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -539,9 +539,10 @@ export default {
                                     if (!name) {
                                         return ''
                                     }
-                                    const unit = yAxisValue == 0 ? _this.$t('yuan') : _this.$t('time.hour');
+                                    const unit = yAxisValue == 0 ? _this.$t('yuan') : 'h';
                                     const totalValue = yAxisValue == 0 ? nameObj[name] && nameObj[name].moneyTol : nameObj[name] && nameObj[name].timeTol;
-                                    return seriesName === cerName ? `${totalValue ? totalValue.toFixed(0) : 0} ${unit}` : '';
+                                    const dayValue = yAxisValue == 0 ? 0 : nameObj[name] && (nameObj[name].timeTol/_this.user.timeType.allday).toFixed(1);
+                                    return seriesName === cerName ? `${totalValue ? totalValue.toFixed(1) : 0} ${unit}${yAxisValue == 0?'':('/'+dayValue+'人天')}` : '';
                                 }
                             }
                         }
@@ -716,7 +717,6 @@ export default {
 
                 let item = {
                     "value": yAxisValue == 0 ? (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney : (list[i].cost ? list[i].cost.toFixed(1) : 0),
-                    "dayValue": yAxisValue == 0 ? 0 : (list[i].cost/this.user.timeType.allDay).toFixed(1),//人天单位
                     "id": list[i].id || i,
                 }
                 if (countCost) {
@@ -740,7 +740,7 @@ export default {
             const { countCost, countHours } = this.permissions
             const { userNameNeedTranslate } = this.user
             chartData.title = {
-                text: `工时成本总计:${countCost ? `成本 ${totalMoneyCost},` : ''} ${countHours ? `时长 ${totalHours} 小时` : ''}`,
+                text: `工时成本总计:${countCost ? `成本 ${totalMoneyCost},` : ''} ${countHours ? `时长 ${totalHours} 小时/${(totalHours/_this.user.timeType.allday).toFixed(1)}人天` : ''}`,
                 left: 'left',
             }
 
@@ -795,7 +795,12 @@ export default {
                     normal: {
                         show: true,
                         position: 'top',
-                        formatter: `{c} ${yAxisValue == 0 ? '元' : '小时'}`,
+                        // formatter: ` ${yAxisValue == 0 ? '{c}元' : '{c}小时/{{c}/8}人天'}`,
+
+                        formatter: function(params) {
+                            var dayValue = yAxisValue == 0?0:(params.value/_this.user.timeType.allday).toFixed(1);
+                            return ` ${yAxisValue == 0 ? (params.value + '元') : (params.value + 'h/'+dayValue+'人天')}`; // params.value 等价于 {c}
+                        }
                     }
                 }
             }]

+ 5 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -258,7 +258,11 @@
 
                         <div style="width:100%;margin-top: 10px;">
                             <span style="color: #606266;margin-right: 5px">{{ $t('checkRemindertime') }}</span>
-                            <el-time-picker 
+                            <el-radio-group v-model="timeType.alertAuditMode">
+                                <el-radio :label="1" class="rala2">实时提醒</el-radio>
+                                <el-radio :label="0" class="rala1">定时提醒</el-radio>
+                            </el-radio-group>
+                            <el-time-picker v-if="timeType.alertAuditMode == 0"
                                     v-model="timeType.waitCheckAlertTime"
                                     :placeholder="$t('checkRemindertime')"
                                     style="width:150px;"