gaoxiong 1 سال پیش
والد
کامیت
d59497c994

+ 13 - 1
project_data/sql/0.1.0_zhulu/soc.sql

@@ -26,6 +26,16 @@ BEGIN
         add duration_total double(10,4) DEFAULT NULL COMMENT '调阅总时长' after sign_img;
     END IF;
 
+    IF
+    NOT EXISTS(SELECT *
+                      FROM information_schema.columns
+                      WHERE table_schema = DATABASE()
+                        AND table_name = 'sys_org_extend'
+                        AND column_name = 'alone_dept') THEN
+    alter table core_monitoring_retrieval_task
+        add sys_org_extend varchar(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '是否独立机构' after remote_control_count;
+    END IF;
+
 
 
 
@@ -34,4 +44,6 @@ DELIMITER ;
 CALL schema_change();
 
 
-DELETE FROM quartz.sys_job where job_name = '回归未完成的调阅任务';
+UPDATE `quartz`.`sys_job` SET  `status` = '1' where  `job_name` = '回归未完成的调阅任务';
+DELETE FROM quartz.sys_job where job_name = '每日定时清理未完成的调阅任务记录';
+INSERT INTO `quartz`.`sys_job`( `job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('每日定时清理未完成的调阅任务记录', 'DEFAULT', 'CoreMessageSendTask.dealTaskRegistration', '0 0 0 * * ? *', '1', '1', '0', '超级管理员', '2024-07-25 13:45:18', '', NULL);

+ 4 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysOrgExtend.java

@@ -50,6 +50,10 @@ public class SysOrgExtend extends BaseEntity {
     @ApiModelProperty(value = "天气区域编码")
     private String weatherAreaCode;
 
+
+    @ApiModelProperty(value = "是否独立机构")
+    private String aloneDept;
+
     /**
      * 营业场所面积
      */

+ 1 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/message/CoreAnnouncementNotificationMapper.xml

@@ -65,6 +65,7 @@
         <if test="request.messagStatus != null  and request.messagStatus != ''">
             and messag_status = #{request.messagStatus}
         </if>
+         order by messag_status asc ,publish_time desc
     </select>
     <select id="selectOrgIds"
             resultType="com.xunmei.common.core.domain.message.domain.CoreAnnouncementNotificationToOrg">

+ 6 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java

@@ -50,8 +50,14 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.net.URLEncoder;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.SimpleFormatter;
 import java.util.stream.Collectors;
 
 /**

+ 25 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java

@@ -52,6 +52,9 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Validator;
 import java.net.URLEncoder;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -710,6 +713,25 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return userMapper.select(user);
     }
 
+    public  String calculateWorkExperience(Date workStartDate) {
+        LocalDate startDate = workStartDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+        LocalDate currentDate = LocalDate.now();
+
+        long years = ChronoUnit.YEARS.between(startDate, currentDate);
+        LocalDate anniversary = startDate.plusYears(years);
+
+        long months = ChronoUnit.MONTHS.between(anniversary, currentDate);
+
+        if(years == 0){
+            return  months + "个月";
+        }else{
+            if(months == 0){
+                return years + "年";
+            }else{
+                return years + "年" + months + "个月";
+            }
+        }
+    }
     @Override
     public List<SecurityUserExport> downSecurityUser() {
         SysOrg sysOrg2 = orgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId());
@@ -757,6 +779,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             s.setEducationType(sysEducationType);
             String sysDuties = iSysDictDataService.selectDictLabel("sys_duties", s.getResponsibilitiesLeaderDuties());
             s.setResponsibilitiesLeaderDuties(sysDuties);
+            //工作年限
+            String workDuration = calculateWorkExperience(s.getWorkTime());
+            s.setWorkDuration(workDuration);
         });
         return securityUserExports;
     }

+ 2 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/SecurityUserExport.java

@@ -66,4 +66,6 @@ public class SecurityUserExport {
     private String responsibilitiesLeaderName;
     @ExcelProperty(value = "分管领导职务", index = 19)
     private String responsibilitiesLeaderDuties;
+
+    private Date workTime;
 }

+ 3 - 8
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -684,7 +684,7 @@
             and o.path like concat('%',#{org.path})
         </if>
             and o.name != '机关' and o.name != '各部门'
-        ORDER BY o.is_lock, isnull(o.sort),o.sort, o.path
+        ORDER BY o.affiliated_area desc,o.affiliated_bank desc, o.is_lock, isnull(o.sort),o.sort, o.path
 
     </select>
     <select id="getOrgIdByTaskId" resultType="java.lang.Long">
@@ -1186,13 +1186,8 @@ and
           AND a.drill_start_time BETWEEN #{startTime} and #{endTime}
     </select>
     <select id="getAlone" resultType="java.lang.Integer">
-        SELECT
-            COUNT( * )
-        FROM
-            sys_user_information a
-                LEFT JOIN sys_user b ON a.user_id = b.id
-                LEFT JOIN sys_org c ON b.org_id = c.id
-        WHERE c.deleted = 0 and c.is_lock = 0 and  a.alone_dept='Y' and b.is_manage = 'Y' AND c.path LIKE concat(#{orgPath}, '%')
+        select count(*) from sys_org_extend  a
+                                 LEFT JOIN sys_org b on a.org_id = b.id where a.alone_dept = 'Y' and b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getManager" resultType="java.lang.Integer">
         SELECT

+ 1 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -733,7 +733,7 @@
                a.is_full_time                           AS isFullTime,
                a.work_type                              AS workType,
                a.entry_time                             AS entryTime,
-               ROUND(TIMESTAMPDIFF(MONTH, a.work_time, NOW())/12,2) AS workDuration,
+               a.work_time as workTime,
                a.highest_education                      AS highestEducation,
                a.education_type                         AS educationType,
                a.professional_qualifications            AS professionalQualifications,