Parcourir la source

Merge remote-tracking branch 'origin/master'

yusm il y a 1 mois
Parent
commit
8c6cfcfffc

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/components/AIChat.vue

@@ -54,10 +54,10 @@
         <el-select v-model="systemTable" size="small" style="width: 120px">
           <el-option label="线索" value="clue" />
           <el-option label="商机" value="business_opportunity" />
-          <el-option label="客户" value="customer" />
-          <el-option label="联系人" value="contact" />
+          <el-option label="客户" value="custom" />
+          <el-option label="联系人" value="contacts" />
           <el-option label="合同" value="contract" />
-          <el-option label="销售订单" value="order" />
+          <el-option label="销售订单" value="sales_order" />
           <el-option label="产品" value="product" />
         </el-select>
       </div>
@@ -265,7 +265,7 @@ const exportToWord = async (content: string) => {
 };
 
 type DataSourceType = 'system' | 'custom' | 'upload' | 'free';
-type SystemTableType = 'clue' | 'business_opportunity' | 'customer' | 'contact' | 'contract' | 'order' | 'product';
+type SystemTableType = 'clue' | 'business_opportunity' | 'custom' | 'contacts' | 'contract' | 'sales_order' | 'product';
 
 interface ChatMessage {
   role: 'user' | 'assistant';

+ 1 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -705,7 +705,6 @@ public class WeiXinCorpController {
             // 解密失败,失败原因请查看异常
             e.printStackTrace();
         }
-        System.out.println("dataCallback POST立即返回");
         return "success";
     }
 
@@ -1188,7 +1187,7 @@ public class WeiXinCorpController {
                             } else if (!StringUtils.isEmpty(department)){
                                 curUserWXDeptid = Integer.valueOf(department);
                             }
-                        } else if (jsonObject.has("MainDepartment") && !StringUtils.isEmpty(jsonObject.getString("MainDepartment"))) {
+                        } else if (jsonObject.has("MainDepartment") && !StringUtils.isEmpty(jsonObject.get("MainDepartment"))) {
                             //取主部门
                             curUserWXDeptid = jsonObject.getInt("MainDepartment");
                         } else {
@@ -2105,7 +2104,6 @@ public class WeiXinCorpController {
         } else {
             end = LocalDateTime.parse(startDate + " 23:59:59", dtf);
         }
-
         return wxCorpInfoService.getUserPunchRecord(companyId, userId, start, end, true);
     }
 

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

@@ -276,11 +276,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 //需要看可见部门(部门主要负责人和其他负责人以及查看本部门工时权限)所有人员的日报
                 nameList = reportMapper.getReportNameByDateAndDept(date,
                         allVisibleDeptIdList.size() > 0?allVisibleDeptIdList:null, targetUid, companyId, (deptId == null?viewUserId:null), pageStart, pageSize);
-                long middle = System.currentTimeMillis();
-                System.out.println("中间获取getReportNameByDateAndDept 耗时:" + (middle - start) + "ms");
-//                totalMembCount = reportMapper.getReportNameByDateAndDeptCount(date, allVisibleDeptIdList.size() > 0?allVisibleDeptIdList:null, targetUid, companyId, (deptId == null?viewUserId:null));
-                long end = System.currentTimeMillis();
-                System.out.println("获取totalMembCount 耗时:" + (end - middle) + "ms");
             } else {
                 //查看全公司的数据
                 List<Integer> ids = null;
@@ -306,10 +301,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 nameList = reportMapper.getReportNameByDateAndDept(date,
                         ids, targetUid, companyId, null, pageStart, pageSize);
                 long middle = System.currentTimeMillis();
-                System.out.println("中间获取getReportNameByDateAndDept 耗时:" + (middle - start) + "ms");
-//                totalMembCount = reportMapper.getReportNameByDateAndDeptCount(date, ids, targetUid, companyId, null);
-//                long end = System.currentTimeMillis();
-//                System.out.println("获取totalMembCount 耗时:" + (end - middle) + "ms");
             }
             if (nameList.size() > 0) {
                 List<String> userIds = new ArrayList<>();

+ 12 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -639,7 +639,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
 
     //获取企业AccessToken
     private String getCorpAccessToken(WxCorpInfo corpInfo) throws Exception {
-        System.out.println("in getCorpAccessToken=== ");
         if (corpInfo.getExpireTime().isBefore(LocalDateTime.now())) {
             String url = WeiXinCorpController.GET_CORP_ACCESSTOKEN_URL.replace("SUITE_ACCESS_TOKEN", getSuiteAccessToken());
             HttpHeaders headers = new HttpHeaders();
@@ -738,6 +737,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             msg.setError(MessageUtils.message("wx.dockError"));
             return msg;
         }
+        if (companyId == 469 && endDateTime.isBefore(LocalDateTime.of(2025, 4, 1, 0, 0, 0))) {
+            System.out.println("赛元刷新每日打卡,skip");
+            return msg;
+        }
         String url = null;
         try {
             startDateTime = startDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
@@ -1356,7 +1359,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     ct.setStartTime(DateTimeUtil.getTimeFromSeconds(sTime));
                     ct.setEndTime(DateTimeUtil.getTimeFromSeconds(eTime));
                     boolean isCrossDay = eTime >= 24 * 3600;//加班至第二天
-                    if (showLog) System.out.println("初始startTime="+ct.getStartTime()+", endTime="+ct.getEndTime());
                     //下班时间和上班时间不一样,正常应该有regular_work_sec,但是企业微信存在问题,传过来的是0,需要校正
                     if (regular_work_sec == 0 && ct.getEndTime() != null && !ct.getEndTime().equals(ct.getStartTime())) {
                         ct.setEndTime(ct.getStartTime());
@@ -1625,7 +1627,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         double timeDelta = 0;
                         //时间有变化,需要重新计算
                         if (needRecaculate) {
-                            System.out.println("corpwxUserId=="+ct.getCorpwxUserid()+", name=="+ct.getName()+"s=="+ct.getStartTime()+", e=="+ct.getEndTime());
                             timeDelta = DateTimeUtil.getHoursFromSeconds(DateTimeUtil.getSecondsFromTime(ct.getEndTime()) - DateTimeUtil.getSecondsFromTime(ct.getStartTime()));
                             //超过下午上班的开始时间,需要减去午休的时间
                             if (ct.getEndTime().compareTo(baseAfternoonStart) >= 0) {
@@ -1635,7 +1636,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         } else {
                             timeDelta = ct.getCardTime();
                         }
-                        if (showLog) System.out.println("上下班间隔时长为==" + timeDelta);
                         ct.setName(name);
                         //解析请假和外出的情况
                         JSONArray sp_items = jsonObject.getJSONArray("sp_items");
@@ -1654,7 +1654,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                         outdoorTime = 0.0;
                                     }
                                     double otTime = convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(spItem.getInteger("duration")));
-                                    if (showLog) System.out.println("补的时长:"+otTime);
                                     if (otTime > 8.0) {
                                         otTime = 8.0;
                                     }
@@ -1729,7 +1728,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         if (ct.getAskLeaveTime() > 8.0) {
                             ct.setAskLeaveTime(8.0);//超过8小时都以8小时计算
                         }
-                        if (showLog) System.out.println("校正后请假时长=" + ct.getAskLeaveTime());
+//                        if (showLog) System.out.println("校正后请假时长=" + ct.getAskLeaveTime());
                         //如果有出差的,但是没有打卡,则用出差的时间作为timeDelta
                         if (timeDelta < 7.5 && ct.getOutdoorTime() > 0) {
                             timeDelta += ct.getOutdoorTime();
@@ -1753,12 +1752,12 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                         if (showLog) System.out.println("工作时长==" + workHours);
 
                         if (corpInfo.getCompanyId() == 481) {
-                            //给盛立安元和赛元微电子0.5单位进位
+                            //给盛立安元0.5单位进位
                             ct.setWorkHours(DateTimeUtil.getHalfHoursFromDouble(workHours));
                         } else {
                             ct.setWorkHours(DateTimeUtil.getHoursFromDouble(workHours));
                         }
-                        if (showLog) System.out.println("ct.getStartTime()==" + ct.getStartTime()+", ct.getEndTime()="+ct.getEndTime());
+//                        if (showLog) System.out.println("ct.getStartTime()==" + ct.getStartTime()+", ct.getEndTime()="+ct.getEndTime());
 
                         //针对赛元微电子,请半天假的情况下。重新校正打卡和工作时长
                         if (corpInfo.getCorpid().equals("wpy9TkCAAAgNp4jvqxKTpXrhvwFvyFHg")) {
@@ -1866,6 +1865,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             .eq("create_date", localDate));
                     //有工作时长或者打卡时长或者请假时长,外出时长,都算有效时间
                     boolean hasTimeRecord = ct.getWorkHours() > 0 || ct.getCardTime() >= 1.0 || ct.getAskLeaveTime() > 0 || ct.getOutdoorTime() > 0;
+                    //对于赛元微电子,2025年4月1日之前的都不做处理,防止把数据覆盖掉
+                    if(corpInfo.getCompanyId() == 469 && ct.getCreateDate().isBefore(LocalDate.of(2025, 4, 1))) {
+                        System.out.println("赛元微电子Skip");
+                        continue;
+                    }
                     if (itemList.size() > 0) {
                         UserCorpwxTime item = itemList.get(0);
                         if (itemList.size() > 1) {

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

@@ -10,7 +10,7 @@
                 <el-form-item>
                     <span class="workName">{{detailName}}</span>
                 </el-form-item>
-                <el-form-item style="float:right;">
+                <el-form-item style="float:right;" v-if="permissions.countCost">
                     <span style="font-size:18px;">{{ $t('xiang-mu-cheng-ben') }}:<span class="themeFontColor">{{cost.toFixed(2)}}{{ $t('yuan') }}</span></span>
                 </el-form-item>
             </el-form>
@@ -194,13 +194,9 @@
                         formatter: function (params,ticket,callback) {
                             var res
                             if(_this.user.userNameNeedTranslate == 1 && _this.radio == _this.$t('ren-yuan')) {
-                                // res = '' + "<br/>"+_this.$t('workcost')+" : " + params[0].data.money 
-                                // + _this.$t('yuan')+"<br/>"+_this.$t('screening.workTime')+" : " + params[0].data.cost + _this.$t('time.hour');
                                 res = ((_this.permissions.countCost) ? _this.$t('workcost') + ":" + params[0].data.money + _this.$t('yuan') + "</br>" : '') + 
                                 ((_this.permissions.countHours) ? _this.$t('screening.workTime') + ":" + params[0].data.cost + _this.$t('time.hour') + "</br>" : '')
                             } else {
-                                // res = params[0].name + "<br/>"+_this.$t('workcost')+" : " + params[0].data.money 
-                                // + _this.$t('yuan')+"<br/>"+_this.$t('screening.workTime')+" : " + params[0].data.cost + _this.$t('time.hour');
                                 res = ((_this.permissions.countCost) ? _this.$t('workcost') + ":" + params[0].data.money + _this.$t('yuan') + "</br>" : '') + 
                                 ((_this.permissions.countHours) ? _this.$t('screening.workTime') + ":" + params[0].data.cost + _this.$t('time.hour') + "</br>" : '')
                             }