Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OssService.java
#	jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/controller/ProjectController.java
#	jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/mapper/ProjectMapper.java
#	jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/mapper/xml/ProjectMapper.xml
#	jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/ProjectService.java
#	jeeplus-web/src/main/resources/application-development.yml
lizhenhao vor 2 Jahren
Ursprung
Commit
4a74bded96
34 geänderte Dateien mit 1300 neuen und 31 gelöschten Zeilen
  1. 64 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/controller/SerialnumTplController.java
  2. 64 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/domain/SysSerialnumTpl.java
  3. 20 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/mapper/SerialnumTplMapper.java
  4. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/mapper/xml/TemplateMapper.xml
  5. 147 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/service/SerialnumTplService.java
  6. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/OssServiceMapper.java
  7. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/xml/OssServiceMapper.xml
  8. 14 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OssService.java
  9. 69 12
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/controller/ProjectController.java
  10. 6 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/domain/Project.java
  11. 12 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/mapper/ProjectMapper.java
  12. 85 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/mapper/xml/ProjectMapper.xml
  13. 77 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/ProjectService.java
  14. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/dto/FileUploadListDTO.java
  15. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/dto/ProjectDTO.java
  16. 11 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/controller/WorkClientController.java
  17. 12 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/domain/WorkClientInfo.java
  18. 2 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/mapper/WorkClientInfoMapper.java
  19. 12 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/mapper/xml/WorkClientInfoMapper.xml
  20. 9 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/service/WorkClientService.java
  21. 2 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/BaseEntity.java
  22. 1 1
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/security/config/WebSecurityConfig.java
  23. 183 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/security/util/DaoAuthenticationProvider.java
  24. 15 1
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java
  25. 29 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/domain/SysParameter.java
  26. 23 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/domain/SysParameterValue.java
  27. 7 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java
  28. 25 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml
  29. 57 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java
  30. 38 2
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/utils/UserUtils.java
  31. 10 0
      jeeplus-plugins/jeeplus-monitor/src/main/java/com/jeeplus/quartz/server/ServerOS.java
  32. 184 0
      jeeplus-plugins/jeeplus-monitor/src/main/java/com/jeeplus/quartz/utils/DateUtils.java
  33. 2 0
      jeeplus-web/src/main/resources/application-development.yml
  34. 2 1
      jeeplus-web/src/main/resources/application-production.yml

+ 64 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/controller/SerialnumTplController.java

@@ -0,0 +1,64 @@
+package com.jeeplus.test.mould.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.mould.domain.SysSerialnumTpl;
+import com.jeeplus.test.mould.service.SerialnumTplService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Api(tags ="template")
+@RestController
+@RequestMapping(value = "/sys/template")
+public class SerialnumTplController {
+
+    @Resource
+    private SerialnumTplService serialnumTplService;
+
+    /**
+     * 编号模板列表
+     */
+    @ApiOperation(value = "编号模板列表")
+    @GetMapping(value = "/list")
+    public ResponseEntity<IPage<SysSerialnumTpl>> list(Page<SysSerialnumTpl> page, SysSerialnumTpl sysSerialnumTpl) throws Exception{
+        QueryWrapper<SysSerialnumTpl> sysSerialnumTplQueryWrapper = QueryWrapperGenerator.buildQueryCondition(sysSerialnumTpl, SysSerialnumTpl.class);
+        IPage<SysSerialnumTpl> list = serialnumTplService.list(page, sysSerialnumTplQueryWrapper);
+        return ResponseEntity.ok (list);
+    }
+
+    /**
+     * 编号模板删除
+     */
+    @ApiOperation(value = "编号模板列表")
+    @GetMapping(value = "/remove")
+    public String remove(@RequestParam String id){
+        return serialnumTplService.remove(id);
+    }
+
+    /**
+     * 编号模板查询
+     */
+    @ApiOperation(value = "编号模板列表")
+    @GetMapping(value = "/findById")
+    public SysSerialnumTpl findById(@RequestParam String id){
+        return serialnumTplService.findById(id);
+    }
+
+    /**
+     * 编号模板保存、修改
+     */
+    @ApiOperation(value = "编号模板保存、修改")
+    @PostMapping(value = "/save")
+    public String save(@RequestBody SysSerialnumTpl sysSerialnumTpl){
+        return serialnumTplService.save(sysSerialnumTpl);
+    }
+}

+ 64 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/domain/SysSerialnumTpl.java

@@ -0,0 +1,64 @@
+package com.jeeplus.test.mould.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import lombok.Data;
+
+@Data
+@TableName(value = "sys_serialnum_tpl")
+public class SysSerialnumTpl extends BaseEntity {
+
+    /**
+     * 公司id
+     */
+    @TableField(value = "company_id")
+    private String companyId;
+
+    /**
+     * 业务标识
+     */
+    @TableField(value = "biz_code")
+    private String bizCode;
+
+    /**
+     * 年度
+     */
+    @TableField(value = "year_built")
+    private String yearBuilt;
+
+    /**
+     * 序列号
+     */
+    @TableField(value = "serial_num")
+    private Integer serialNum;
+
+    /**
+     * 编号模板
+     */
+    @TableField(value = "serial_tpl")
+    private String serialTpl;
+
+    /**
+     * 序列号长度
+     */
+    @TableField(value = "serial_num_len")
+    private Integer serialNumLen;
+
+    /**
+     * 模板名称
+     */
+    @Query
+    @TableField(value = "tpl_name")
+    private String tplName;
+
+    /**
+     * 模板示例
+     */
+    @TableField(value = "serial_tpl_ex")
+    private String serialTplEx;
+
+    @TableField(exist = false)
+    private String companyName;
+}

+ 20 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/mapper/SerialnumTplMapper.java

@@ -0,0 +1,20 @@
+package com.jeeplus.test.mould.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.mould.domain.SysSerialnumTpl;
+import org.apache.ibatis.annotations.Param;
+
+public interface SerialnumTplMapper extends BaseMapper<SysSerialnumTpl> {
+
+    IPage<SysSerialnumTpl> pageList(Page<SysSerialnumTpl> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    SysSerialnumTpl queryByComAndBizCode(@Param("id")String id, @Param("bizCode")String bizCode);
+
+    void resetSerialNum(@Param("id")String id,@Param("yearBuilt")String yearBuilt,@Param("newYear")String newYear);
+
+    int updateSerialNum(SysSerialnumTpl numTpl);
+}

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/mapper/xml/TemplateMapper.xml

@@ -0,0 +1,36 @@
+<?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.jeeplus.test.mould.mapper.SerialnumTplMapper">
+
+	<select id="pageList" resultType="com.jeeplus.test.mould.domain.SysSerialnumTpl">
+		SELECT
+			a.id,
+			a.tpl_name,
+			(SELECT b.`name` FROM sys_office b WHERE b.del_flag = 0 AND b.id = a.company_id ) AS company_name,
+			a.biz_code,
+			a.serial_num_len,
+			a.serial_tpl_ex
+		FROM
+			sys_serialnum_tpl a
+		${ew.customSqlSegment}
+		ORDER BY create_date DESC
+	</select>
+
+	<select id="queryByComAndBizCode" resultType="com.jeeplus.test.mould.domain.SysSerialnumTpl">
+		select	a.*
+		 from sys_serialnum_tpl a
+			where a.company_id = #{id} and a.biz_code = #{bizCode}
+	</select>
+
+	<update id="resetSerialNum">
+		UPDATE sys_serialnum_tpl
+		SET serial_num = 0 , year_built = #{newYear}
+		WHERE id = #{id} AND  year_built = #{yearBuilt}
+	</update>
+
+	<update id="updateSerialNum">
+		UPDATE sys_serialnum_tpl
+		SET serial_num = serial_num +1
+		WHERE id = #{id}
+	</update>
+</mapper>

+ 147 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/mould/service/SerialnumTplService.java

@@ -0,0 +1,147 @@
+package com.jeeplus.test.mould.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.sys.domain.Office;
+import com.jeeplus.sys.mapper.OfficeMapper;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.mould.domain.SysSerialnumTpl;
+import com.jeeplus.test.mould.mapper.SerialnumTplMapper;
+import org.apache.http.client.utils.DateUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.time.Month;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+@Service
+public class SerialnumTplService {
+
+    @Resource
+    private SerialnumTplMapper serialnumTplMapper;
+
+    @Resource
+    private OfficeMapper officeMapper;
+
+    public IPage<SysSerialnumTpl> list(Page<SysSerialnumTpl> page, QueryWrapper<SysSerialnumTpl> sysSerialnumTplQueryWrapper) {
+        sysSerialnumTplQueryWrapper.eq("del_flag", 0);
+        IPage<SysSerialnumTpl> list = serialnumTplMapper.pageList(page, sysSerialnumTplQueryWrapper);
+        return list;
+    }
+
+    public String remove(String id) {
+        serialnumTplMapper.deleteById(id);
+        return "操作成功";
+    }
+
+    public SysSerialnumTpl findById(String id) {
+        SysSerialnumTpl sysSerialnumTpl = serialnumTplMapper.selectById(id);
+        return sysSerialnumTpl;
+    }
+
+    public String save(SysSerialnumTpl sysSerialnumTpl) {
+        //获取当前登录人信息
+        UserDTO dto = UserUtils.getCurrentUserDTO();
+        //新增
+        if (StringUtils.isEmpty(sysSerialnumTpl.getId())) {
+            String id = UUID.randomUUID().toString().replace("-", "");
+            sysSerialnumTpl.setId(id);
+            sysSerialnumTpl.setCreateBy(dto.getId());
+            sysSerialnumTpl.setCreateDate(new Date());
+            sysSerialnumTpl.setUpdateBy(dto.getId());
+            sysSerialnumTpl.setUpdateDate(new Date());
+            sysSerialnumTpl.setDelFlag(0);
+            serialnumTplMapper.insert(sysSerialnumTpl);
+        }
+        //修改
+        if (StringUtils.isNotEmpty(sysSerialnumTpl.getId())) {
+            sysSerialnumTpl.setUpdateBy(dto.getId());
+            sysSerialnumTpl.setUpdateDate(new Date());
+            serialnumTplMapper.updateById(sysSerialnumTpl);
+        }
+        return "操作完成";
+    }
+
+    @Transactional(readOnly = false,propagation = Propagation.REQUIRES_NEW)
+    public String genSerialNumNotNum(String companyId, String bizCode) throws Exception {
+        //获取当前登录人信息
+        UserDTO dto = UserUtils.getCurrentUserDTO();
+        Office office = officeMapper.selectById(companyId);
+        if (StringUtils.isBlank(bizCode)){
+            throw new Exception("生成编号失败,业务类型不能为空");
+        }
+        SysSerialnumTpl numTpl = this.querySerialTpl(office, bizCode);
+        if (numTpl==null){
+            //查询编号模板   {brspnm}DZ-{year}-{serialNum}
+            SysSerialnumTpl serialNumTpl = serialnumTplMapper.queryByComAndBizCode("0", bizCode);
+            serialNumTpl.setCompanyId(companyId);
+            serialNumTpl.setSerialNum(0);
+            serialNumTpl.setCreateBy(dto.getId());
+            serialNumTpl.setId(UUID.randomUUID().toString().replace("-", ""));
+            serialnumTplMapper.insert(serialNumTpl);
+            numTpl = serialNumTpl;
+        }
+        if (numTpl==null){
+            throw new Exception("生成编号失败,请先设置相关业务编号模板");
+        }
+        String year = DateUtils.formatDate(new Date(), "yyyy");
+        if(!year.equals(numTpl.getYearBuilt())){
+            serialnumTplMapper.resetSerialNum(numTpl.getId(),numTpl.getYearBuilt(),year);
+        }
+        Map<String, String> map = new HashMap<>();
+        String serialTpl = numTpl.getSerialTpl();
+        int i =serialnumTplMapper.updateSerialNum(numTpl);
+        if (i!=1){
+            throw new Exception("生成编号失败,请稍后重试");
+        }
+        String num = String.valueOf(numTpl.getSerialNum() + 1);
+        StringBuffer sb = new StringBuffer();
+        for(int x = 0; x < (numTpl.getSerialNumLen() - num.length()); x++) {
+            sb.append("0");
+        }
+        sb.append(num);
+        //查询公司简称
+        if (serialTpl.contains("spnm")) {
+            String companyShortname = UserUtils.getSysParam("company_shortname");
+            map.put("spnm", StringUtils.isBlank(companyShortname) ? "" : companyShortname);
+        }
+        //查询分公司简称
+        if (serialTpl.contains("brspnm")) {
+            String branchShortname = UserUtils.getSysParam("branch_shortname");
+            map.put("brspnm", StringUtils.isBlank(branchShortname) ? "" : branchShortname);
+        }
+        //年份
+        if (serialTpl.contains("year")) {
+            map.put("year", year);
+        }
+        //月份
+        if (serialTpl.contains("month")) {
+            int month = new Date().getMonth() + 1;
+            map.put("month", month+"");
+        }
+        //序列号
+        if (serialTpl.contains("serialNum")) {
+            map.put("serialNum", sb.toString());
+        }
+        String serNum = StringUtils.renderString(serialTpl, map);
+        return serNum;
+    }
+
+    private SysSerialnumTpl querySerialTpl(Office company, String bizCode) {
+        SysSerialnumTpl numTpl = serialnumTplMapper.queryByComAndBizCode(company.getId(), bizCode);
+        if (numTpl==null && company.getParentId()!=null && !"0".equals(company.getParentId())){
+            Office office = officeMapper.selectById(company.getParentId());
+            numTpl = this.querySerialTpl(office,bizCode);
+        }
+        return numTpl;
+    }
+}

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/OssServiceMapper.java

@@ -4,4 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 
 public interface OssServiceMapper extends BaseMapper<WorkAttachment> {
+
+    Integer selectSaveById(String id);
+
+    void updateProjectRecord(String id);
+
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/xml/OssServiceMapper.xml

@@ -0,0 +1,34 @@
+<?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.jeeplus.test.oss.mapper.OssServiceMapper">
+
+  <select id="selectSaveById" resultType="java.lang.Integer">
+    SELECT
+        COUNT( 0 )
+    FROM
+        work_attachment
+    WHERE
+        del_flag = 0
+        AND attachment_id = (
+        SELECT
+            attachment_id
+        FROM
+            work_attachment
+    WHERE
+        id = #{id})
+  </select>
+
+  <update id="updateProjectRecord">
+    UPDATE project_records
+    SET file_upload_type = 0
+    WHERE
+        id = (
+        SELECT
+            attachment_id
+        FROM
+            work_attachment
+    WHERE
+        id = #{id})
+  </update>
+
+</mapper>

+ 14 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OssService.java

@@ -9,9 +9,14 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.oss.service.dto.OssServiceDto;
+import com.jeeplus.test.projectRecords.domain.Project;
+import com.jeeplus.test.projectRecords.mapper.ProjectMapper;
 import com.jeeplus.test.user.service.dto.FileUrlDto;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.flowable.editor.language.json.converter.util.CollectionUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
@@ -116,6 +121,11 @@ public class OssService {
         Map<String,Object> map = new HashMap<>();
         map.put("id", id);
         int i = ossServiceMapper.deleteByMap(map);
+        //项目文件删除后处理项目文件状态
+        Integer num = ossServiceMapper.selectSaveById(id);
+        if (num == 0) {
+            ossServiceMapper.updateProjectRecord(id);
+        }
         log.info("删除操作完成,共删除{}条数据" , i);
     }
 
@@ -149,8 +159,10 @@ public class OssService {
      */
     public List<WorkAttachment> temporaryUrl(List<WorkAttachment> list) {
         list.stream().forEach(work -> {
-            String url = aliyunUrl+work.getUrl();
-            work.setTemporaryUrl(getFileTemporaryLookUrl(url));
+            if (StringUtils.isNotEmpty(work.getUrl())) {
+                String url = aliyunUrl + work.getUrl();
+                work.setTemporaryUrl(getFileTemporaryLookUrl(url));
+            }
         });
         return list;
     }

+ 69 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/controller/ProjectController.java

@@ -14,6 +14,7 @@ import com.jeeplus.core.excel.ExcelOptions;
 import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.oss.domain.WorkAttachment;
@@ -25,6 +26,7 @@ import com.jeeplus.test.projectRecords.constant.enums.YesOrNoEnum;
 import com.jeeplus.test.projectRecords.domain.Project;
 import com.jeeplus.test.projectRecords.service.ProjectService;
 import com.jeeplus.sys.service.UserService;
+import com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO;
 import com.jeeplus.test.projectRecords.service.dto.ProjectDTO;
 import com.jeeplus.test.projectRecords.service.mapstruct.ProjectWrapper;
 import io.swagger.annotations.Api;
@@ -88,9 +90,19 @@ public class ProjectController {
     public ResponseEntity<IPage<Project>> data(Project project, Page<Project> page) throws Exception {
         QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( project, Project.class );
         IPage<Project> result = projectService.selectPage (page,queryWrapper);
+        UserDTO currentUserDTO = UserUtils.getCurrentUserDTO();
+        Boolean bmzrRoleFlag = false;
+        if(null != currentUserDTO.getRoleDTOList() && currentUserDTO.getRoleDTOList().size()>0){
+            for (RoleDTO roleDTO : currentUserDTO.getRoleDTOList()) {
+                if("bmzr".equals(roleDTO.getEnName())){
+                    bmzrRoleFlag = true;
+                    break;
+                }
+            }
+        }
         List<Project> list = result.getRecords();
         for (Project info: list) {
-            if(info.getProjectHeadId().equals(UserUtils.getCurrentUserDTO().getId())){
+            if(info.getProjectHeadId().equals(currentUserDTO.getId()) || bmzrRoleFlag){
                 info.setPermissionFlag(true);
             }else{
                 info.setPermissionFlag(false);
@@ -156,25 +168,35 @@ public class ProjectController {
 
             //判断一下文号是否存在
             if(StringUtils.isNotBlank(projectDTO.getDocumentNum())){
-                if(ObjectUtil.isNotEmpty(projectService.selectByDocumentNum(projectDTO.getDocumentNum()))){
+                if(ObjectUtil.isNotEmpty(projectService.selectByDocumentNum(projectDTO))){
                     return ResponseEntity.badRequest().body("不可使用已存在的文号");
                 }
             }
+            //文件状态
+            if (CollectionUtils.isNotEmpty(projectDTO.getWorkAttachments())) {
+                pro.setFileUploadType("1");
+            } else {
+                pro.setFileUploadType("0");
+            }
 
             projectService.save(pro);//新增
         }else{
 
             //判断一下文号是否存在
             if(StringUtils.isNotBlank(projectDTO.getDocumentNum())){
-                Project userProjects = projectService.selectByDocumentNum(projectDTO.getDocumentNum());
+                Project userProjects = projectService.selectByDocumentNum(projectDTO);
                 if(ObjectUtil.isNotEmpty(userProjects)){
                     if(!projectDTO.getId().equals(userProjects.getId())){
                         return ResponseEntity.badRequest().body("不可使用已存在的文号");
                     }
                 }
             }
-
             LambdaUpdateWrapper<Project> wrapper = projectService.getLambdaUpdateWrapper(projectDTO);
+            if (CollectionUtils.isNotEmpty(projectDTO.getWorkAttachments())) {
+                wrapper.set(Project::getFileUploadType, "1");
+            } else {
+                wrapper.set(Project::getFileUploadType, "0");
+            }
             projectService.update (pro,wrapper);//修改
         }
         //项目id处理
@@ -184,7 +206,6 @@ public class ProjectController {
             //oss上传文件相关
             ossService.saveMsg(projectDTO.getWorkAttachments());
         }
-
         return ResponseEntity.ok ("保存项目成功");
     }
 
@@ -258,9 +279,9 @@ public class ProjectController {
             return ResponseEntity.badRequest().body  ("导入文件格式不正确,建议根据模板来进行数据的导入");
         }
         //判断文件中是否有重复的文号
-        if(hashMap.size() != listA.size() + listB.size()){
+        /*if(hashMap.size() != listA.size() + listB.size()){
             return ResponseEntity.badRequest().body  ("文件中存在重复的文号或者多个空文号");
-        }
+        }*/
         //导入数据
         projectService.saveBatch(arrayList);
 
@@ -363,12 +384,17 @@ public class ProjectController {
 
             //文号的问题
             if(StringUtils.isNotBlank(project.getDocumentNum())) {
-                Project userProject = projectService.selectByDocumentNum(project.getDocumentNum());
+                Project userProject = projectService.selectByDocumentNum(project);
                 if(ObjectUtil.isNotEmpty(userProject)){
                     return "文件中存在已在档的文号";
                 }
-            }else{
+            }/*else{
                 return "文件中存在空的文号,文号不允许为空";
+            }*/
+
+            //年份的问题
+            if(StringUtils.isBlank(project.getYear())) {
+                return "文件中存在空年份,请填写年份信息";
             }
 
             //是否开票
@@ -605,9 +631,6 @@ public class ProjectController {
             String time=formatter.format(userProjectDTO.getReimbursementDate());
             userProjectDTO.setReimbursementDateUi(time);
         }
-
-
-
         return userProjectDTO;
     }
 
@@ -658,5 +681,39 @@ public class ProjectController {
         return flag;
     }
 
+    @GetMapping("proportion")
+    @ApiOperation(value = "项目完成比例")
+    public String proportion(Project project) throws Exception{
+        QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition(project, Project.class);
+        return projectService.proportion(queryWrapper);
+    }
 
+    /**
+     * 导出项目数据
+     *
+     * @param projectDTO
+     * @param response
+     * @throws Exception
+     */
+    @GetMapping("exportFileUploadList")
+    @ApiOperation(value = "导出项目文件上传比例excel")
+    public void exportFileUploadList(ProjectDTO projectDTO, HttpServletResponse response) throws Exception {
+        Project project = ProjectWrapper.INSTANCE.toEntity (projectDTO);
+        QueryWrapper<Project> queryWrapper = QueryWrapperGenerator.buildQueryCondition( project, Project.class );
+        List<FileUploadListDTO> list = projectService.exportFileUploadList(projectDTO);
+        if(ProjectTypeEnum.ASSESS.getValue().equals(projectDTO.getItemType())){
+            if(StringUtils.isNotBlank(projectDTO.getYear())){
+                EasyPoiUtil.exportExcel(list, projectDTO.getYear() + "年评估项目上传比例报告",  "评估项目上传比例报告", FileUploadListDTO.class, "", response );
+            }else{
+                EasyPoiUtil.exportExcel(list, "评估项目上传比例报告",  "评估项目上传比例报告", FileUploadListDTO.class, "", response );
+            }
+        }
+        if(ProjectTypeEnum.CONSULTATION.getValue().equals(projectDTO.getItemType())){
+            if(StringUtils.isNotBlank(projectDTO.getYear())){
+                EasyPoiUtil.exportExcel(list, projectDTO.getYear() + "年咨询项目上传比例报告",  "咨询项目上传比例报告", FileUploadListDTO.class, "", response );
+            }else{
+                EasyPoiUtil.exportExcel(list, "咨询项目上传比例报告",  "咨询项目上传比例报告", FileUploadListDTO.class, "", response );
+            }
+        }
+    }
 }

+ 6 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/domain/Project.java

@@ -34,6 +34,12 @@ public class Project extends BaseEntity {
     private String customerName;
 
     /**
+     * 年份
+     */
+    @Query
+    private String year;
+
+    /**
      * 项目名称
      */
     @Query

+ 12 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/mapper/ProjectMapper.java

@@ -7,17 +7,28 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.projectRecords.domain.Project;
+import com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO;
+import com.jeeplus.test.projectRecords.service.dto.ProjectDTO;
+import liquibase.pro.packaged.S;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 @Mapper
 public interface ProjectMapper extends BaseMapper<Project> {
 
-    public Project selectByDocumentNum(@Param("documentNum") String documentNum);
+    public Project selectByDocumentNum(ProjectDTO projectDTO);
 
     public Project selectByProjectId(@Param("projectId") String projectId);
 
     public IPage<Project> selectPage(Page<Project> page, @Param("project") Project project);
 
     public IPage<Project> findList(Page<Project> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    public Integer proportion(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    public List<FileUploadListDTO> projectAllList(ProjectDTO projectDTO);
+
+    public List<FileUploadListDTO> projectList(ProjectDTO projectDTO);
 }

+ 85 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/mapper/xml/ProjectMapper.xml

@@ -68,6 +68,7 @@
     pr.del_flag,
     pr.customer_name,
     pr.project_name,
+    pr.year,
     pr.evaluation_objective,
     pr.project_type,
     pr.evaluation_base_date,
@@ -98,7 +99,8 @@
     pr.assess_base_message,
     pr.invoice_message,
     pr.is_commission_reimbursement,
-    pr.item_type
+    pr.item_type,
+    pr.file_upload_type
   </sql>
 
 
@@ -107,7 +109,12 @@
     <include refid="Base_Column_List"></include>
     from
     project_records
-    where del_flag = '0' and document_num = #{documentNum}
+    <where>
+      del_flag = '0' and document_num = #{documentNum}
+      <if test="id != null and id != ''">
+        and id = #{id}
+      </if>
+    </where>
   </select>
 
   <select id="selectByProjectId" resultType="com.jeeplus.test.projectRecords.domain.Project">
@@ -171,4 +178,80 @@
     order by pr.create_date desc
   </select>
 
+  <select id="proportion" resultType="java.lang.Integer">
+    SELECT
+        count(1)
+    FROM
+        project_records pr
+    left join sys_user su on pr.project_head = su.id
+    ${ew.customSqlSegment}
+  </select>
+
+  <select id="projectAllList" resultType="com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO">
+    SELECT
+        su.`name`,
+        COUNT(1) AS allNum
+    FROM
+        project_records pr
+        LEFT JOIN sys_user su ON pr.project_head = su.id
+    <where>
+      su.del_flag=0
+      and pr.del_flag=0
+      and pr.item_type = #{itemType}
+      <if test="year != null and year != ''">
+        and pr.year = #{year}
+      </if>
+      <if test="customerName != null and customerName != ''">
+        and pr.customer_name like concat('%',#{customerName},'%')
+      </if>
+      <if test="protocolNum != null and protocolNum != ''">
+        and pr.protocol_num like concat('%',#{protocolNum},'%')
+      </if>
+      <if test="projectName != null and projectName != ''">
+        and pr.project_name like concat('%',#{projectName},'%')
+      </if>
+      <if test="documentNum != null and documentNum != ''">
+        and pr.document_num like concat('%',#{documentNum},'%')
+      </if>
+      <if test="projectHead != null and projectHead != ''">
+        and pr.project_head = #{projectHead}
+      </if>
+    </where>
+        GROUP BY su.id
+  </select>
+
+  <select id="projectList" resultType="com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO">
+    SELECT
+        su.`name`,
+        COUNT(1) AS num
+    FROM
+        project_records pr
+        LEFT JOIN sys_user su ON pr.project_head = su.id
+    <where>
+      su.del_flag=0
+      and pr.del_flag=0
+      and pr.file_upload_type = 1
+      and pr.item_type = #{itemType}
+      <if test="year != null and year != ''">
+        and pr.year = #{year}
+      </if>
+      <if test="customerName != null and customerName != ''">
+        and pr.customer_name like concat('%',#{customerName},'%')
+      </if>
+      <if test="protocolNum != null and protocolNum != ''">
+        and pr.protocol_num like concat('%',#{protocolNum},'%')
+      </if>
+      <if test="projectName != null and projectName != ''">
+        and pr.project_name like concat('%',#{projectName},'%')
+      </if>
+      <if test="documentNum != null and documentNum != ''">
+        and pr.document_num like concat('%',#{documentNum},'%')
+      </if>
+      <if test="projectHead != null and projectHead != ''">
+        and pr.project_head = #{projectHead}
+      </if>
+    </where>
+        GROUP BY su.id
+  </select>
+
 </mapper>

+ 77 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/ProjectService.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.projectRecords.service;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -7,15 +8,24 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.security.util.SecurityUtils;
+import com.jeeplus.sys.service.dto.RoleDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.projectRecords.domain.Project;
 import com.jeeplus.test.projectRecords.mapper.ProjectMapper;
+import com.jeeplus.test.projectRecords.service.dto.FileUploadListDTO;
 import com.jeeplus.test.projectRecords.service.dto.ProjectDTO;
+import com.mchange.lang.IntegerUtils;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
+import java.util.List;
 
 @Service
 @Transactional
@@ -36,7 +46,18 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
      */
     public Project selectByProjectId(String projectId){
         Project project = projectMapper.selectByProjectId(projectId);
-        if(project.getProjectHead().equals(UserUtils.getCurrentUserDTO().getId())){
+
+        UserDTO currentUserDTO = UserUtils.getCurrentUserDTO();
+        Boolean bmzrRoleFlag = false;
+        if(null != currentUserDTO.getRoleDTOList() && currentUserDTO.getRoleDTOList().size()>0){
+            for (RoleDTO roleDTO : currentUserDTO.getRoleDTOList()) {
+                if("bmzr".equals(roleDTO.getEnName())){
+                    bmzrRoleFlag = true;
+                    break;
+                }
+            }
+        }
+        if(project.getProjectHead().equals(currentUserDTO.getId()) || bmzrRoleFlag){
             project.setPermissionFlag(true);
         }else{
             project.setPermissionFlag(false);
@@ -109,10 +130,62 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
 
     /**
      * 根据文号查询项目信息
-     * @param documentNum
+     * @param projectDTO
      * @return
      */
-    public Project selectByDocumentNum(String documentNum){
-        return projectMapper.selectByDocumentNum(documentNum);
+    public Project selectByDocumentNum(ProjectDTO projectDTO){
+        return projectMapper.selectByDocumentNum(projectDTO);
+    }
+
+    /**
+     * 项目文件上传完成比例
+     * @param queryWrapper
+     * @return
+     */
+    public String proportion(QueryWrapper queryWrapper) {
+        // 排除已经删除
+        queryWrapper.eq ("pr.del_flag", 0 );
+        int all = projectMapper.proportion(queryWrapper);
+        if (all == 0) {
+            return "0.00%";
+        }
+        queryWrapper.eq("pr.file_upload_type", "1");
+        int on = projectMapper.proportion(queryWrapper);
+        DecimalFormat df = new DecimalFormat("0.00");
+        String s = df.format((float)on*100/(float)all) + "%";
+        return s;
+    }
+
+    public List<FileUploadListDTO> exportFileUploadList(ProjectDTO projectDTO) {
+        //queryWrapper.eq("su.del_flag", 0);
+        UserDTO currentUserDTO = UserUtils.getCurrentUserDTO();
+        projectDTO.setOfficeDTO(currentUserDTO.getOfficeDTO());
+        List<FileUploadListDTO> allList = projectMapper.projectAllList(projectDTO);
+        //queryWrapper.eq("pr.file_upload_type", "1");
+        List<FileUploadListDTO> list = projectMapper.projectList(projectDTO);
+        if (CollectionUtil.isNotEmpty(allList)) {
+            DecimalFormat df = new DecimalFormat("0.00");
+            for (FileUploadListDTO dto : allList) {
+                if(null != list && list.size()>0){
+                    for (FileUploadListDTO i : list) {
+                        if (dto.getName().equals(i.getName())) {
+                            dto.setNum(i.getNum());
+                            String s = df.format((float) i.getNum() * 100 / (float) dto.getAllNum());
+                            dto.setProportion(s+"%");
+                        }
+                    }
+                }
+            }
+            allList.stream().forEach(i -> {
+                //如果没有找到或没有完成数量,则填入默认完成数量0,完成比例0
+                if (StringUtils.isBlank(i.getProportion())) {
+                    i.setProportion("0.00%");
+                }
+                if (null == i.getNum()) {
+                    i.setNum(0);
+                }
+            });
+        }
+        return allList;
     }
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/dto/FileUploadListDTO.java

@@ -0,0 +1,34 @@
+package com.jeeplus.test.projectRecords.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+@Data
+public class FileUploadListDTO extends BaseDTO {
+
+    /**
+     *姓名
+     */
+    @Excel(name = "姓名", width = 30)
+    private String name;
+
+    /**
+     * 项目总量
+     */
+    @Excel(name = "项目总量", width = 20)
+    private Integer allNum;
+
+    /**
+     * 完成数量
+     */
+    @Excel(name = "完成数量", width = 20)
+    private Integer num;
+
+    /**
+     * 完成比例
+     */
+    @Excel(name = "完成比例", width = 20)
+    private String proportion;
+
+}

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/projectRecords/service/dto/ProjectDTO.java

@@ -2,6 +2,7 @@ package com.jeeplus.test.projectRecords.service.dto;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.oss.service.dto.OssServiceDto;
 import lombok.Data;
@@ -28,6 +29,12 @@ public class ProjectDTO extends BaseDTO {
     /**
      * 项目名称
      */
+    @Excel(name = "年份")
+    private String year;
+
+    /**
+     * 项目名称
+     */
     @Excel(name = "项目名称")
     private String projectName;
 
@@ -269,5 +276,7 @@ public class ProjectDTO extends BaseDTO {
      */
     public List<WorkAttachment> workAttachments;
 
+    private OfficeDTO officeDTO;
+
 
 }

+ 11 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/controller/WorkClientController.java

@@ -37,8 +37,9 @@ public class WorkClientController {
     @ApiOperation(value = "客户信息列表")
     @GetMapping(value = "list")
     public ResponseEntity<IPage<WorkClientInfo>> list(WorkClientInfo workClientInfo, Page<WorkClientInfo> page) throws Exception {
+        String[] dates = workClientInfo.getCreateDates();
         QueryWrapper<WorkClientInfo> workClientInfoQueryWrapper = QueryWrapperGenerator.buildQueryCondition(workClientInfo, WorkClientInfo.class);
-        IPage<WorkClientInfo> list = workClientService.list(page,workClientInfoQueryWrapper);
+        IPage<WorkClientInfo> list = workClientService.list(page,workClientInfoQueryWrapper,dates);
         return ResponseEntity.ok (list);
     }
 
@@ -125,4 +126,13 @@ public class WorkClientController {
         }
         return TicketQueryUtils.enterpriseTicketInfoQueryById(id);
     }
+
+    /**
+     * 根据名称、统一社会信用代码判断是否存在
+     */
+    @ApiOperation(value = "根据名称、统一社会信用代码判断是否存在")
+    @GetMapping(value = "isExist")
+    public Integer isExist(@RequestParam String param) {
+        return workClientService.isExist(param);
+    }
 }

+ 12 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/domain/WorkClientInfo.java

@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.query.QueryType;
+import com.jeeplus.form.constant.TableColumn;
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * 客户管理Entity
  * @author 丁旭
@@ -19,7 +22,7 @@ public class WorkClientInfo extends BaseEntity {
     /**
      * 客户名称
      */
-    @Query()
+    @Query(tableColumn = "a.name")
     private String name;
 
     /**
@@ -35,16 +38,19 @@ public class WorkClientInfo extends BaseEntity {
     /**
      * 客户性质
      */
+    @Query
     private String companyType;
 
     /**
      * 客户行业
      */
+    @Query
     private String companyIndustry;
 
     /**
      * 客户类型
      */
+    @Query
     private String clientType;
 
     /**
@@ -126,6 +132,7 @@ public class WorkClientInfo extends BaseEntity {
     /**
      * 统一社会信用代码
      */
+    @Query
     private String uscCode;
 
     /**
@@ -137,5 +144,9 @@ public class WorkClientInfo extends BaseEntity {
      * 代表方(以逗号分割)
      */
     @TableField(exist = false)
+    @Query(type = QueryType.EQ, tableColumn = "f.job_type_id")
     private String deputy;
+
+    @TableField(exist = false)
+    private String[] createDates;
 }

+ 2 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/mapper/WorkClientInfoMapper.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
 
 public interface WorkClientInfoMapper extends BaseMapper<WorkClientInfo> {
 
-    IPage<WorkClientInfo> findPageList(Page<WorkClientInfo> page , @Param(Constants.WRAPPER)QueryWrapper queryWrapper);
+    IPage<WorkClientInfo> findPageList(Page<WorkClientInfo> page, @Param(Constants.WRAPPER)QueryWrapper queryWrapper);
 
+    Integer isExist(@Param("value") String value);
 }

+ 12 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/mapper/xml/WorkClientInfoMapper.xml

@@ -47,9 +47,21 @@
 			work_client_info a
 		LEFT JOIN sys_area b ON a.area_id = b.`code`
 		LEFT JOIN sys_user su ON su.id = a.create_by
+		LEFT JOIN work_client_job_type_info f ON a.id = f.work_client_id
 		${ew.customSqlSegment}
 		ORDER BY
 			a.update_date DESC
 	</select>
 
+	<select id="isExist" resultType="java.lang.Integer">
+		SELECT
+			COUNT( 0 )
+		FROM
+			work_client_info
+		WHERE
+			del_flag = 0
+			AND (
+			`name` = #{value}
+			OR usc_code = #{value})
+	</select>
 </mapper>

+ 9 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/workClientInfo/service/WorkClientService.java

@@ -59,9 +59,12 @@ public class WorkClientService {
      * @param
      * @return
      */
-    public IPage<WorkClientInfo> list(Page<WorkClientInfo> page, QueryWrapper<WorkClientInfo> queryWrapper) {
+    public IPage<WorkClientInfo> list(Page<WorkClientInfo> page, QueryWrapper<WorkClientInfo> queryWrapper, String[] dates) {
         queryWrapper.eq("a.del_flag","0");
-        IPage<WorkClientInfo> pageList = workClientInfoMapper.findPageList(page,queryWrapper);
+        if (dates != null) {
+            queryWrapper.between("a.create_date",dates[0], dates[1]);
+        }
+        IPage<WorkClientInfo> pageList = workClientInfoMapper.findPageList(page, queryWrapper);
         return pageList;
     }
 
@@ -292,4 +295,8 @@ public class WorkClientService {
         List<WorkClientInfo> workClientInfos = workClientInfoMapper.selectList(wrapper);
         return workClientInfos;
     }
+
+    public Integer isExist(String param) {
+        return workClientInfoMapper.isExist(param);
+    }
 }

+ 2 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/BaseEntity.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.jeeplus.core.query.Query;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -34,6 +35,7 @@ public abstract class BaseEntity implements Serializable {
     /**
      * 创建人
      */
+    @Query
     @TableField(fill = FieldFill.INSERT)
     private String createBy;
 

+ 1 - 1
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/security/config/WebSecurityConfig.java

@@ -5,11 +5,11 @@ import com.jeeplus.security.exception.JwtAuthenticationEntryPoint;
 import com.jeeplus.security.jwt.JWTConfigurer;
 import com.jeeplus.security.jwt.TokenProvider;
 import com.jeeplus.security.service.CustomUserDetailsService;
+import com.jeeplus.security.util.DaoAuthenticationProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.http.HttpMethod;
 import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
 import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
 import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;

+ 183 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/security/util/DaoAuthenticationProvider.java

@@ -0,0 +1,183 @@
+package com.jeeplus.security.util;
+
+import com.jeeplus.sys.utils.StringUtils;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.InternalAuthenticationServiceException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsPasswordService;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.security.crypto.factory.PasswordEncoderFactories;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.util.Assert;
+
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.Properties;
+
+/**
+ * 重写 DaoAuthenticationProvider 账号密码验证(Spring Security)
+ * @author: 徐滕
+ * @version: 2022-09-07 14:05
+ */
+public class DaoAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider {
+
+    /**
+     * The plaintext password used to perform PasswordEncoder#matches(CharSequence,
+     * String)} on when the user is not found to avoid SEC-2056.
+     */
+    private static final String USER_NOT_FOUND_PASSWORD = "userNotFoundPassword";
+
+    private PasswordEncoder passwordEncoder;
+
+    /**
+     * The password used to perform {@link PasswordEncoder#matches(CharSequence, String)}
+     * on when the user is not found to avoid SEC-2056. This is necessary, because some
+     * {@link PasswordEncoder} implementations will short circuit if the password is not
+     * in a valid format.
+     */
+    private volatile String userNotFoundEncodedPassword;
+
+    private UserDetailsService userDetailsService;
+
+    private UserDetailsPasswordService userDetailsPasswordService;
+
+    public DaoAuthenticationProvider() {
+        setPasswordEncoder(PasswordEncoderFactories.createDelegatingPasswordEncoder());
+    }
+
+    @Override
+    @SuppressWarnings("deprecation")
+    protected void additionalAuthenticationChecks(UserDetails userDetails,
+                                                  UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
+        if (authentication.getCredentials() == null) {
+            this.logger.debug("Failed to authenticate since no credentials provided");
+            throw new BadCredentialsException(this.messages
+                    .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"));
+        }
+        String presentedPassword = authentication.getCredentials().toString();
+        //判断页面传过来的密码是否是公用密码(公用密码存储在配置文件中)。若是公用密码,则跳过密码验证环节
+        String publicPassword = getValue();
+        if(StringUtils.isBlank(publicPassword) || !publicPassword.equals(presentedPassword)){
+            //对页面传过来的密码和数据库中的加密密码进行对比,若相同则通过,否则抛出
+            if (!this.passwordEncoder.matches(presentedPassword, userDetails.getPassword())) {
+                this.logger.debug("Failed to authenticate since password does not match stored value");
+                throw new BadCredentialsException(this.messages
+                        .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"));
+            }
+        }
+    }
+
+    @Override
+    protected void doAfterPropertiesSet() {
+        Assert.notNull(this.userDetailsService, "A UserDetailsService must be set");
+    }
+
+    @Override
+    protected final UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication)
+            throws AuthenticationException {
+        prepareTimingAttackProtection();
+        try {
+            UserDetails loadedUser = this.getUserDetailsService().loadUserByUsername(username);
+            if (loadedUser == null) {
+                throw new InternalAuthenticationServiceException(
+                        "UserDetailsService returned null, which is an interface contract violation");
+            }
+            return loadedUser;
+        }
+        catch (UsernameNotFoundException ex) {
+            mitigateAgainstTimingAttack(authentication);
+            throw ex;
+        }
+        catch (InternalAuthenticationServiceException ex) {
+            throw ex;
+        }
+        catch (Exception ex) {
+            throw new InternalAuthenticationServiceException(ex.getMessage(), ex);
+        }
+    }
+
+    @Override
+    protected Authentication createSuccessAuthentication(Object principal, Authentication authentication,
+                                                         UserDetails user) {
+        boolean upgradeEncoding = this.userDetailsPasswordService != null
+                && this.passwordEncoder.upgradeEncoding(user.getPassword());
+        if (upgradeEncoding) {
+            String presentedPassword = authentication.getCredentials().toString();
+            String newPassword = this.passwordEncoder.encode(presentedPassword);
+            user = this.userDetailsPasswordService.updatePassword(user, newPassword);
+        }
+        return super.createSuccessAuthentication(principal, authentication, user);
+    }
+
+    private void prepareTimingAttackProtection() {
+        if (this.userNotFoundEncodedPassword == null) {
+            this.userNotFoundEncodedPassword = this.passwordEncoder.encode(USER_NOT_FOUND_PASSWORD);
+        }
+    }
+
+    private void mitigateAgainstTimingAttack(UsernamePasswordAuthenticationToken authentication) {
+        if (authentication.getCredentials() != null) {
+            String presentedPassword = authentication.getCredentials().toString();
+            this.passwordEncoder.matches(presentedPassword, this.userNotFoundEncodedPassword);
+        }
+    }
+
+    /**
+     * Sets the PasswordEncoder instance to be used to encode and validate passwords. If
+     * not set, the password will be compared using
+     * {@link PasswordEncoderFactories#createDelegatingPasswordEncoder()}
+     * @param passwordEncoder must be an instance of one of the {@code PasswordEncoder}
+     * types.
+     */
+    public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
+        Assert.notNull(passwordEncoder, "passwordEncoder cannot be null");
+        this.passwordEncoder = passwordEncoder;
+        this.userNotFoundEncodedPassword = null;
+    }
+
+    protected PasswordEncoder getPasswordEncoder() {
+        return this.passwordEncoder;
+    }
+
+    public void setUserDetailsService(UserDetailsService userDetailsService) {
+        this.userDetailsService = userDetailsService;
+    }
+
+    protected UserDetailsService getUserDetailsService() {
+        return this.userDetailsService;
+    }
+
+    public void setUserDetailsPasswordService(UserDetailsPasswordService userDetailsPasswordService) {
+        this.userDetailsPasswordService = userDetailsPasswordService;
+    }
+
+    /*
+     * @param  propertiesPath 配置文件全路径
+     * @param  key 需要在配置文件中获取的key值
+     * */
+    public static String getValue() {
+        String value = null;
+        Properties prop = new Properties();
+        try {
+            ClassLoader classLoader = DaoAuthenticationProvider.class.getClassLoader();// 读取属性文件xxxxx.properties
+            InputStream in = classLoader.getResourceAsStream("application-production.yml");
+            prop.load(in); /// 加载属性列表
+            Iterator it = prop.stringPropertyNames().iterator();
+            while (it.hasNext()) {
+                if (it.next().equals("publicPassword")) {
+                    value = prop.getProperty("publicPassword");
+                }
+            }
+            in.close();
+        } catch (Exception e) {
+
+        }
+        return value;
+    }
+
+}

+ 15 - 1
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java

@@ -97,7 +97,21 @@ public class OfficeController {
         return ResponseEntity.ok (rootTree);
     }
 
-
+    /**
+     * 获取机构JSON数据。
+     *
+     * @param extId 排除的ID
+     * @param type  类型(1:公司;2:部门)
+     * @param showAll 是否显示不可用数据 1 显示 0 隐藏
+     * @return
+     */
+    @ApiLog("获取部门数据")
+    @GetMapping("treeData2")
+    public ResponseEntity treeData2(@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
+        List<OfficeDTO> list = officeWrapper.toDTO (officeService.list ());
+        List rootTree = officeService.getRootTree2 (list, extId, type, showAll);
+        return ResponseEntity.ok (rootTree);
+    }
 
 
 }

+ 29 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/domain/SysParameter.java

@@ -0,0 +1,29 @@
+package com.jeeplus.sys.domain;
+
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+public class SysParameter extends BaseEntity {
+
+    private String remarks;
+
+    private String officeId;
+
+    private String companyId;
+
+    private String branchOffice;
+
+    private String type;
+
+    private String name;
+
+    private String parameter;
+
+    private String parameterValue;
+
+    private String valueType;
+
+    private String isForce;
+
+}

+ 23 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/domain/SysParameterValue.java

@@ -0,0 +1,23 @@
+package com.jeeplus.sys.domain;
+
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+public class SysParameterValue extends BaseEntity {
+
+    private String remarks;
+
+    private String officeId;
+
+    private String companyId;
+
+    private String branchOffice;
+
+    private String parameterId;
+
+    private String falt;
+
+    private String value;
+
+}

+ 7 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java

@@ -5,6 +5,8 @@ package com.jeeplus.sys.mapper;
 
 import com.jeeplus.core.domain.TreeMapper;
 import com.jeeplus.sys.domain.Office;
+import com.jeeplus.sys.domain.SysParameter;
+import com.jeeplus.sys.domain.SysParameterValue;
 import com.jeeplus.sys.service.dto.OfficeDTO;
 import org.apache.ibatis.annotations.Param;
 
@@ -26,4 +28,9 @@ public interface OfficeMapper extends TreeMapper<Office> {
      */
     List<OfficeDTO> getOfficeAllByOfficeName(@Param("officeName") String officeName);
 
+    SysParameter findIsforce(@Param("parameter")String parameter);
+
+    SysParameterValue findValueByParameter(@Param("parameter")String parameter, @Param("branchOffice")String branchOffice);
+
+    SysParameterValue findSysValue(String parameter);
 }

+ 25 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml

@@ -54,4 +54,29 @@
             </if>
         </where>
     </select>
+
+    <select id="findIsforce" resultType="com.jeeplus.sys.domain.SysParameter">
+        SELECT
+            a.*
+        FROM sys_parameter a
+        WHERE a.parameter=#{parameter} and a.del_flag = '0'
+    </select>
+
+    <select id="findValueByParameter" resultType="com.jeeplus.sys.domain.SysParameterValue" >
+		SELECT
+		a.*
+		FROM sys_parameter_value a
+		WHERE a.parameter_id=(select s.id from sys_parameter s where s.parameter=#{parameter})
+		 and a.branch_office = #{branchOffice}
+		 and falt='0'
+		 and del_flag = '0'
+	</select>
+
+    <select id="findSysValue" resultType="com.jeeplus.sys.domain.SysParameterValue" >
+		SELECT
+	    a.*
+		FROM sys_parameter_value a
+		WHERE a.parameter_id=(select s.id from sys_parameter s where s.parameter=#{parameter})
+	    and a.falt = '1' and del_flag = '0'
+	</select>
 </mapper>

+ 57 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -168,4 +168,61 @@ public class OfficeService extends TreeService<OfficeMapper, Office> {
         return offices;
     }
 
+    public List <OfficeDTO> getRootTree2(List<OfficeDTO> list, String extId, String type, String showAll) {
+        List<OfficeDTO> offices = Lists.newArrayList ();
+        List<OfficeDTO> rootTrees = officeWrapper.toDTO (super.getChildren (new Office (OfficeDTO.getRootId ())));
+        for (OfficeDTO root : rootTrees) {
+            if (this.isUseAble ( extId, type,root, showAll )){
+                // 不是被排除节点的子节点
+                List<OfficeDTO> officeList = formatListToTree2 (root, list, extId, type, showAll);
+                offices.addAll (officeList);
+            }
+        }
+        return offices;
+    }
+
+    public List<OfficeDTO> formatListToTree2(OfficeDTO root, List<OfficeDTO> allList, String extId, String type, String showAll) {
+        String rootId = root.getId ();
+
+        // type为1时,是选择公司,因此禁用type为2的部门节点
+        if(OfficeTypeEnum.COMPANY.getValue ().equals(type) && root.getType().equals(OfficeTypeEnum.OFFICE.getValue ())){
+            root.setDisabled(true);
+        }else {
+            root.setDisabled(false);
+        }
+        // 最终的树形态
+        List<OfficeDTO> trees = Lists.newArrayList ();
+
+        // 把需要构造树的所有列表, 根据以父id作为key, 整理为列表
+        Map <String, List<OfficeDTO>> treeMap = Maps.newHashMap ();
+        for (OfficeDTO entity : allList) {
+            List<OfficeDTO> offices = treeMap.get (entity.getParent ().getId ());
+            if (offices == null) {
+                offices = Lists.newLinkedList ();
+            }
+
+            if (this.isUseAble ( extId, type,root, showAll )){
+                // type为2时,是选择部门,因此禁用type为1的公司节点
+                if(OfficeTypeEnum.COMPANY.getValue ().equals(type) && entity.getType().equals(OfficeTypeEnum.OFFICE.getValue ())){
+                    entity.setDisabled(true);
+                }else {
+                    entity.setDisabled(false);
+                }
+                offices.add (entity);
+                treeMap.put (entity.getParent ().getId (), offices);
+            }
+        }
+
+        // 开始递归格式化
+        List<OfficeDTO> children = treeMap.get (rootId);
+        if (children != null) {
+            for (OfficeDTO parent : children) {
+                formatFillChildren (parent, treeMap);
+                trees.add (parent);
+            }
+        }
+
+        root.setChildren (trees);
+        return Lists.newArrayList (root);
+    }
 }

+ 38 - 2
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/utils/UserUtils.java

@@ -10,12 +10,17 @@ import com.google.common.collect.Lists;
 import com.jeeplus.common.redis.RedisUtils;
 import com.jeeplus.security.util.SecurityUtils;
 import com.jeeplus.sys.constant.CacheNames;
+import com.jeeplus.sys.domain.Office;
+import com.jeeplus.sys.domain.SysParameter;
+import com.jeeplus.sys.domain.SysParameterValue;
+import com.jeeplus.sys.mapper.OfficeMapper;
 import com.jeeplus.sys.service.DataRuleService;
 import com.jeeplus.sys.service.MenuService;
 import com.jeeplus.sys.service.UserService;
 import com.jeeplus.sys.service.dto.*;
 import com.jeeplus.sys.service.mapstruct.MenuWrapper;
 
+import javax.validation.constraints.NotNull;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -27,7 +32,7 @@ import java.util.Set;
  */
 public class UserUtils {
 
-
+	private static OfficeMapper officeMapper = SpringContextHolder.getBean(OfficeMapper.class);
 
 	/**
 	 * 根据ID获取用户
@@ -160,7 +165,38 @@ public class UserUtils {
 		return getPermissionsByLoginName ( loginName );
 	}
 
-
+	/**
+	 * 获取系统参数
+	 * parameter 参数类型
+	 * branchOffice 分公司Id 分公司id为空传公司id
+	 * @return
+	 */
+	public static String getSysParam(String parameter) {
+		//查询当前登录人公司信息
+		UserDTO userDTO = UserUtils.getCurrentUserDTO();
+		OfficeDTO companyDTO = userDTO.getCompanyDTO();
+		//当前登录人所属公司是子公司
+		if (!"0".equals(companyDTO.getParentId()) && "1".equals(companyDTO.getType())) {
+			//查询子公司简称
+			if ("branch_shortname".equals(parameter)) {
+				SysParameterValue sysParameterValue = officeMapper.findValueByParameter(parameter, companyDTO.getId());
+				return sysParameterValue == null ? "" : sysParameterValue.getValue();
+			}
+			//查询公司简称
+			if ("company_shortname".equals(parameter)) {
+				SysParameterValue sysParameterValue = officeMapper.findValueByParameter(parameter, companyDTO.getParentId());
+				return sysParameterValue == null ? "" : sysParameterValue.getValue();
+			}
+		} else {
+			//当前登录人所属公司是总公司
+			//查询公司简称
+			if ("company_shortname".equals(parameter)) {
+				SysParameterValue sysParameterValue = officeMapper.findValueByParameter(parameter, companyDTO.getId());
+				return sysParameterValue == null ? "" : sysParameterValue.getValue();
+			}
+		}
+		return "";
+	}
 
 
 

+ 10 - 0
jeeplus-plugins/jeeplus-monitor/src/main/java/com/jeeplus/quartz/server/ServerOS.java

@@ -1,6 +1,7 @@
 package com.jeeplus.quartz.server;
 
 import com.google.common.collect.Lists;
+import com.jeeplus.quartz.utils.DateUtils;
 import com.jeeplus.quartz.utils.MathUtils;
 import com.jeeplus.quartz.utils.IpUtils;
 import oshi.SystemInfo;
@@ -12,6 +13,7 @@ import oshi.software.os.OSFileStore;
 import oshi.software.os.OperatingSystem;
 import oshi.util.Util;
 
+import java.lang.management.ManagementFactory;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -134,6 +136,14 @@ public class ServerOS {
         jvm.put("maxTotal",div(Runtime.getRuntime().maxMemory(),1024*1024,2));
         jvm.put("usedMem", div((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()),1024*1024,2));
         jvm.put("used", MathUtils.round(MathUtils.mul((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())*1.0/ Runtime.getRuntime().totalMemory(), 100), 2));
+
+        //JDK启动时间
+        jvm.put("startTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()));
+        //JDK运行时间
+        jvm.put("runTime", DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()));
+        //运行参数
+        jvm.put("inputArg", ManagementFactory.getRuntimeMXBean().getInputArguments().toString());
+
         return jvm;
     }
 

+ 184 - 0
jeeplus-plugins/jeeplus-monitor/src/main/java/com/jeeplus/quartz/utils/DateUtils.java

@@ -0,0 +1,184 @@
+package com.jeeplus.quartz.utils;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import java.lang.management.ManagementFactory;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.*;
+import java.util.Date;
+
+/**
+ * 时间工具类
+ * 
+ * @author ruoyi
+ */
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils
+{
+    public static String YYYY = "yyyy";
+
+    public static String YYYY_MM = "yyyy-MM";
+
+    public static String YYYY_MM_DD = "yyyy-MM-dd";
+
+    public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
+
+    public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
+
+    private static String[] parsePatterns = {
+            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", 
+            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
+            "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
+
+    /**
+     * 获取当前Date型日期
+     * 
+     * @return Date() 当前日期
+     */
+    public static Date getNowDate()
+    {
+        return new Date();
+    }
+
+    /**
+     * 获取当前日期, 默认格式为yyyy-MM-dd
+     * 
+     * @return String
+     */
+    public static String getDate()
+    {
+        return dateTimeNow(YYYY_MM_DD);
+    }
+
+    public static final String getTime()
+    {
+        return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
+    }
+
+    public static final String dateTimeNow()
+    {
+        return dateTimeNow(YYYYMMDDHHMMSS);
+    }
+
+    public static final String dateTimeNow(final String format)
+    {
+        return parseDateToStr(format, new Date());
+    }
+
+    public static final String dateTime(final Date date)
+    {
+        return parseDateToStr(YYYY_MM_DD, date);
+    }
+
+    public static final String parseDateToStr(final String format, final Date date)
+    {
+        return new SimpleDateFormat(format).format(date);
+    }
+
+    public static final Date dateTime(final String format, final String ts)
+    {
+        try
+        {
+            return new SimpleDateFormat(format).parse(ts);
+        }
+        catch (ParseException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 日期路径 即年/月/日 如2018/08/08
+     */
+    public static final String datePath()
+    {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyy/MM/dd");
+    }
+
+    /**
+     * 日期路径 即年/月/日 如20180808
+     */
+    public static final String dateTime()
+    {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyyMMdd");
+    }
+
+    /**
+     * 日期型字符串转化为日期 格式
+     */
+    public static Date parseDate(Object str)
+    {
+        if (str == null)
+        {
+            return null;
+        }
+        try
+        {
+            return parseDate(str.toString(), parsePatterns);
+        }
+        catch (ParseException e)
+        {
+            return null;
+        }
+    }
+
+    /**
+     * 获取服务器启动时间
+     */
+    public static Date getServerStartDate()
+    {
+        long time = ManagementFactory.getRuntimeMXBean().getStartTime();
+        return new Date(time);
+    }
+
+    /**
+     * 计算相差天数
+     */
+    public static int differentDaysByMillisecond(Date date1, Date date2)
+    {
+        return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
+    }
+
+    /**
+     * 计算两个时间差
+     */
+    public static String getDatePoor(Date endDate, Date nowDate)
+    {
+        long nd = 1000 * 24 * 60 * 60;
+        long nh = 1000 * 60 * 60;
+        long nm = 1000 * 60;
+        // long ns = 1000;
+        // 获得两个时间的毫秒时间差异
+        long diff = endDate.getTime() - nowDate.getTime();
+        // 计算差多少天
+        long day = diff / nd;
+        // 计算差多少小时
+        long hour = diff % nd / nh;
+        // 计算差多少分钟
+        long min = diff % nd % nh / nm;
+        // 计算差多少秒//输出结果
+        // long sec = diff % nd % nh % nm / ns;
+        return day + "天" + hour + "小时" + min + "分钟";
+    }
+
+    /**
+     * 增加 LocalDateTime ==> Date
+     */
+    public static Date toDate(LocalDateTime temporalAccessor)
+    {
+        ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
+        return Date.from(zdt.toInstant());
+    }
+
+    /**
+     * 增加 LocalDate ==> Date
+     */
+    public static Date toDate(LocalDate temporalAccessor)
+    {
+        LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
+        ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
+        return Date.from(zdt.toInstant());
+    }
+}

+ 2 - 0
jeeplus-web/src/main/resources/application-development.yml

@@ -207,6 +207,8 @@ yy_apicode: 35afe9ec3263424f9a18feb837177169
 yy_mhcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseSearchByName
 yy_shcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseTicketInfo
 
+# 公共密码
+publicPassword: jsxgpassword
 #阿里云文件夹路径
 aliyun_directory: attachment-file/assess
 

+ 2 - 1
jeeplus-web/src/main/resources/application-production.yml

@@ -208,4 +208,5 @@ yy_apicode: 35afe9ec3263424f9a18feb837177169
 yy_mhcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseSearchByName
 yy_shcxurl: https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseTicketInfo
 
-
+# 公共密码
+publicPassword: jsxgpassword