Browse Source

用车申请及用车结算

sangwenwei 1 year ago
parent
commit
a08179c1ac
20 changed files with 1206 additions and 12 deletions
  1. 126 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveController.java
  2. 54 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveAccount.java
  3. 74 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveApply.java
  4. 18 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveAccountMapper.java
  5. 33 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveApplyMapper.java
  6. 45 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveAccountMapper.xml
  7. 137 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/JyDriveApplyMapper.xml
  8. 7 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveAccountService.java
  9. 439 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveApplyService.java
  10. 53 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveAccountDTO.java
  11. 113 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveApplyDTO.java
  12. 9 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveDTO.java
  13. 1 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/meetingRoom/domain/MeetingRoom.java
  14. 10 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java
  15. 3 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java
  16. 42 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml
  17. 28 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java
  18. 11 7
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java
  19. 2 2
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java
  20. 1 1
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

+ 126 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveController.java

@@ -0,0 +1,126 @@
+package com.jeeplus.business.drive.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.drive.service.DriveAccountService;
+import com.jeeplus.business.drive.service.DriveApplyService;
+import com.jeeplus.business.drive.service.dto.DriveAccountDTO;
+import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
+import com.jeeplus.business.drive.service.dto.DriveDTO;
+import com.jeeplus.business.meetingRoom.service.dto.MeetingRoomDTO;
+import com.jeeplus.common.utils.ResponseUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Slf4j
+@Api(tags ="用车管理")
+@RestController
+@RequestMapping(value = "/drive")
+public class DriveController {
+
+    @Resource
+    private DriveAccountService driveAccountService;
+
+    @Resource
+    private DriveApplyService driveApplyService;
+
+
+    /**
+     * 用车申请列表
+     */
+    @ApiOperation(value = "用车申请列表")
+    @GetMapping(value = "/applyList")
+    public ResponseEntity<IPage<DriveApplyDTO>> applyList(DriveApplyDTO driveApplyDTO, Page<DriveApplyDTO> page) throws Exception {
+        IPage<DriveApplyDTO> pageList=driveApplyService.findPageList(driveApplyDTO,page);
+        return ResponseEntity.ok(pageList);
+    }
+
+    /**
+     * 新增/修改
+     */
+    @ApiOperation(value = "新增或修改")
+    @PostMapping(value = "/saveForm")
+    public ResponseEntity saveForm(@RequestBody DriveApplyDTO driveApplyDTO){
+        String id=driveApplyService.save(driveApplyDTO);
+        return ResponseUtil.newInstance().add("businessTable","jy_drive_apply").add("businessId",id).ok("操作成功");
+    }
+
+
+    /**
+     * 根据id查找用车申请信息
+     */
+    @ApiOperation(value = "根据id查找用车申请")
+    @GetMapping(value = "findById")
+    public ResponseEntity<DriveApplyDTO> findById(@RequestParam String id){
+        DriveApplyDTO applyDTO=driveApplyService.findById(id);
+        return ResponseEntity.ok(applyDTO);
+    }
+
+    /**
+     * 根据id修改状态status
+     * @param
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "/updateStatusById")
+    public void updateStatusById(@RequestBody DriveApplyDTO driveApplyDTO) {
+        driveApplyService.updateStatusById(driveApplyDTO);
+    }
+
+    /**
+     * 根据id进行删除
+     */
+    @ApiOperation(value = "根据id进行删除")
+    @DeleteMapping(value = "/delete")
+    public ResponseEntity<String> deleteById(@RequestParam String id){
+        String s = driveApplyService.deleteById(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 新增/修改  用车结算
+     */
+    @ApiOperation(value = "新增或修改 用车结算")
+    @PostMapping(value = "/saveAccountForm")
+    public ResponseEntity saveAccountForm(@RequestBody DriveAccountDTO driveAccountDTO){
+        String id=driveApplyService.saveAccountForm(driveAccountDTO);
+        return ResponseUtil.newInstance().add("businessTable","jy_drive_account").add("businessId",id).ok("操作成功");
+    }
+
+    /**
+     * 根据申请id修改状态status
+     * @param
+     */
+    @ApiOperation(value = "根据申请id修改状态status")
+    @PostMapping(value = "/updateStatusByApplyId")
+    public void updateStatusByApplyId(@RequestBody DriveAccountDTO driveAccountDTO) {
+        driveApplyService.updateStatusByApplyId(driveAccountDTO);
+    }
+
+
+    /**
+     * 管理员修改
+     */
+    @ApiOperation(value = "管理员修改")
+    @PostMapping(value = "/adminEditForm")
+    public ResponseEntity adminEditForm(@RequestBody DriveDTO driveDTO){
+        driveApplyService.adminEditForm(driveDTO);
+        return ResponseEntity.ok("操作成功");
+    }
+
+
+
+
+
+
+
+
+
+
+}

+ 54 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveAccount.java

@@ -0,0 +1,54 @@
+package com.jeeplus.business.drive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 嘉溢-用车结算
+ */
+
+@Data
+@TableName("jy_drive_account")
+public class DriveAccount extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 起使里程数
+     */
+    private String startMileage;
+
+    /**
+     * 截至里程数
+     */
+    private String endMileage;
+
+    /**
+     * 历程总数
+     */
+    private String mileageCount;
+
+    /**
+     * 关联申请表id
+     */
+    private String applyId;
+
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+}

+ 74 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveApply.java

@@ -0,0 +1,74 @@
+package com.jeeplus.business.drive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 用车申请表
+ */
+@Data
+@TableName("jy_drive_apply")
+public class DriveApply extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关联项目id
+     */
+    private String projectId;
+
+    /**
+     * 用车人员id
+     */
+    private String useMen;
+
+    /**
+     * 用车起使时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date useStartTime;
+
+    /**
+     * 用车截至时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date useEndTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 用车原因
+     */
+    private String useReason;
+
+
+
+
+}

+ 18 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveAccountMapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.business.drive.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.drive.domain.DriveAccount;
+import com.jeeplus.business.drive.service.dto.DriveAccountDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface DriveAccountMapper extends BaseMapper<DriveAccount> {
+    @InterceptorIgnore(tenantLine = "true")
+    DriveAccountDTO findByApplyId(@Param("applyId") String applyId);
+
+    void updateStatusByApplyId(@Param("applyId")String applyId,@Param("status") String status);
+    @InterceptorIgnore(tenantLine = "true")
+    void updateInfoById(@Param("driveAccount") DriveAccount driveAccount);
+}

+ 33 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveApplyMapper.java

@@ -0,0 +1,33 @@
+package com.jeeplus.business.drive.mapper;
+
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+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.business.drive.domain.DriveApply;
+import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface DriveApplyMapper extends BaseMapper<DriveApply> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<DriveApplyDTO> findPageList(@Param(Constants.WRAPPER)QueryWrapper<DriveApplyDTO> queryWrapper, Page<DriveApplyDTO> page);
+
+    List<WorkAttachmentInfo> findList(@Param("id")String id);
+
+    Integer findIsExit(@Param("id")String id, @Param("name")String name);
+    @InterceptorIgnore(tenantLine = "true")
+    DriveApplyDTO findById(@Param("id") String id);
+
+    void updateStatusById(@Param("id")String id, @Param("status")String status);
+
+    List<WorkAttachmentInfo> findDtos(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    void updateInfoById(@Param("driveApply") DriveApply driveApply);
+}

+ 45 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveAccountMapper.xml

@@ -0,0 +1,45 @@
+<?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.business.drive.mapper.DriveAccountMapper">
+    <select id="findByApplyId" resultType="com.jeeplus.business.drive.service.dto.DriveAccountDTO">
+        select
+            id,
+            start_mileage,
+            end_mileage,
+            mileage_count,
+            apply_id,
+            proc_ins_id,
+            process_definition_id,
+            status
+        from jy_drive_account where apply_id=#{applyId}
+    </select>
+
+    <update id="updateStatusByApplyId">
+        update jy_drive_account set status=#{status} where apply_id = #{applyId}
+    </update>
+
+    <update id="updateInfoById">
+        UPDATE
+            jy_drive_account
+        SET
+            <if test="null != driveAccount.updateById and driveAccount.updateById != '' ">
+                  update_by_id =#{driveAccount.updateById},
+            </if>
+            <if test="null != driveAccount.updateTime">
+                  update_time = #{driveAccount.updateTime},
+            </if>
+            <if test="null != driveAccount.startMileage and driveAccount.startMileage != '' ">
+                  start_mileage = #{driveAccount.startMileage},
+            </if>
+            <if test="null != driveAccount.endMileage and driveAccount.endMileage != '' ">
+                  end_mileage = #{driveAccount.endMileage},
+            </if>
+            <if test="null != driveAccount.mileageCount and driveAccount.mileageCount != '' ">
+                  mileage_count = #{driveAccount.mileageCount}
+            </if>
+        WHERE
+            id = #{driveAccount.id}
+    </update>
+</mapper>

+ 137 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/JyDriveApplyMapper.xml

@@ -0,0 +1,137 @@
+<?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.business.drive.mapper.DriveApplyMapper">
+
+    <select id="findPageList" resultType="com.jeeplus.business.drive.service.dto.DriveApplyDTO">
+        select distinct
+            a.id,
+            a.create_by_id as createById,
+            su.name as createName,
+            a.create_time,
+            a.update_by_id as updateById,
+            a.update_time,
+            a.project_id,
+            (select group_concat(name) from jy_project_record pr where FIND_IN_SET(pr.id,(select project_id from jy_drive_apply where id=a.id))) as projectName,
+            a.use_men,
+            (select group_concat(name) from sys_user su where FIND_IN_SET(su.id,(select use_men from jy_drive_apply where id=a.id))) as userName,
+            a.use_start_time,
+            a.use_end_time,
+            a.remarks,
+            a.status,
+            a.proc_ins_id,
+            a.use_reason,
+            a.process_definition_id,
+            so.name as createOffice,
+            art1.ID_ as task_id,
+            art2.ID_ as task_id_account,
+            da.process_definition_id as processDefinitionIdAccount,
+            da.proc_ins_id as procInsIdAccount,
+            da.status as accountStatus,
+            da.id as accountId,
+            so.name as officeName
+        from
+            jy_drive_apply a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        LEFT JOIN act_ru_task art1 ON a.proc_ins_id = art1.PROC_INST_ID_
+        left join jy_drive_account da on a.id = da.apply_id and da.del_flag = 0
+        LEFT JOIN act_ru_task art2 ON da.proc_ins_id = art2.PROC_INST_ID_
+         ${ew.customSqlSegment}
+        ORDER BY a.update_time DESC
+    </select>
+
+    <select id="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+	</select>
+
+    <select id="findIsExit" resultType="java.lang.Integer">
+		SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+	</select>
+
+    <select id="findById" resultType="com.jeeplus.business.drive.service.dto.DriveApplyDTO">
+        select
+            a.id,
+            a.create_by_id,
+            su.name as createName,
+            a.create_time,
+            a.update_by_id,
+            a.update_time,
+            a.project_id,
+            (select group_concat(name) from jy_project_record pr where FIND_IN_SET(pr.id,(select project_id from jy_drive_apply where id=a.id))) as projectName,
+            a.use_men,
+            (select group_concat(name) from sys_user su where FIND_IN_SET(su.id,(select use_men from jy_drive_apply where id=a.id))) as userName,
+            a.use_start_time,
+            a.use_end_time,
+            a.remarks,
+            a.status,
+            a.use_reason,
+            a.proc_ins_id,
+            a.process_definition_id,
+            so.name as createOffice,
+            art1.ID_ as task_id,
+            art2.ID_ as task_id_account,
+            da.process_definition_id as processDefinitionIdAccount,
+            da.proc_ins_id as procInsIdAccount,
+            da.status as accountStatus,
+            da.id as accountId,
+            da.apply_id,
+            da.start_mileage,
+            da.end_mileage,
+            da.mileage_count,
+            so.name as officeName
+        from
+            jy_drive_apply a
+        left join sys_user su on a.create_by_id = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        LEFT JOIN act_ru_task art1 ON a.proc_ins_id = art1.PROC_INST_ID_
+        left join jy_drive_account da on a.id = da.apply_id and da.del_flag = 0
+        LEFT JOIN act_ru_task art2 ON da.proc_ins_id = art2.PROC_INST_ID_
+        where (a.id=#{id} or da.id=#{id})
+    </select>
+    
+    <update id="updateStatusById">
+        update jy_drive_apply set status =#{status} where id=#{id}
+    </update>
+
+    <select id="findDtos" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
+    <update id="updateInfoById">
+        UPDATE
+            jy_drive_apply
+        SET
+            update_by_id =#{driveApply.updateById},
+            update_time = #{driveApply.updateTime},
+            project_id = #{driveApply.projectId},
+            use_men = #{driveApply.useMen},
+            use_start_time = #{driveApply.useStartTime},
+            use_end_time = #{driveApply.useEndTime},
+            use_reason = #{driveApply.useReason},
+            remarks = #{driveApply.remarks}
+        WHERE id = #{driveApply.id}
+    </update>
+
+
+
+
+</mapper>

+ 7 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveAccountService.java

@@ -0,0 +1,7 @@
+package com.jeeplus.business.drive.service;
+
+import org.springframework.stereotype.Service;
+
+@Service
+public class DriveAccountService {
+}

+ 439 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveApplyService.java

@@ -0,0 +1,439 @@
+package com.jeeplus.business.drive.service;
+
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.drive.domain.DriveAccount;
+import com.jeeplus.business.drive.domain.DriveApply;
+import com.jeeplus.business.drive.mapper.DriveAccountMapper;
+import com.jeeplus.business.drive.mapper.DriveApplyMapper;
+import com.jeeplus.business.drive.service.dto.DriveAccountDTO;
+import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
+import com.jeeplus.business.drive.service.dto.DriveDTO;
+import com.jeeplus.business.meetingRoom.domain.MeetingRoom;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.mapper.JyProjectMapper;
+import com.jeeplus.business.project.service.JyProjectService;
+import com.jeeplus.business.project.service.dto.JyProjectDTO;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import com.sun.mail.imap.protocol.ID;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Service
+public class DriveApplyService {
+
+    @Resource
+    private DriveApplyMapper driveApplyMapper;
+
+    @Resource
+    private DriveAccountMapper driveAccountMapper;
+
+    @Resource
+    private JyProjectService jyProjectService;
+
+    @Resource
+    private JyProjectMapper jyProjectMapper;
+
+
+    /**
+     * 用车申请列表
+     * @param driveApplyDTO
+     * @param page
+     * @return
+     */
+    public IPage<DriveApplyDTO> findPageList(DriveApplyDTO driveApplyDTO, Page<DriveApplyDTO> page) throws Exception {
+        QueryWrapper<DriveApplyDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(driveApplyDTO, DriveApplyDTO.class);
+        queryWrapper.eq("a.del_flag",0);
+        //用车项目
+        if (StringUtils.isNotBlank(driveApplyDTO.getProjectId())){
+            queryWrapper.like("a.project_id",driveApplyDTO.getProjectId());
+        }
+        //用车人员
+        if (StringUtils.isNotBlank(driveApplyDTO.getUseMen())){
+            queryWrapper.like("a.use_men",driveApplyDTO.getUseMen());
+        }
+        //申请人
+        if (StringUtils.isNotBlank(driveApplyDTO.getCreateById())){
+            queryWrapper.eq("a.create_by_id",driveApplyDTO.getCreateById());
+        }
+        //申请人部门
+        if (StringUtils.isNotBlank(driveApplyDTO.getOfficeId())){
+            queryWrapper.eq("so.id",driveApplyDTO.getOfficeId());
+        }
+        IPage<DriveApplyDTO> iPage=driveApplyMapper.findPageList(queryWrapper,page);
+        return iPage;
+    }
+
+    /**
+     * 新增或修改
+     * @param driveApplyDTO
+     * @return
+     */
+    public String save(DriveApplyDTO driveApplyDTO) {
+        if (StringUtils.isNotEmpty(driveApplyDTO.getId())) {
+            return update(driveApplyDTO);
+        }
+        return add(driveApplyDTO);
+    }
+
+    //修改
+    private String update(DriveApplyDTO driveApplyDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改项目信息
+        String project="";
+        DriveApply driveApply = new DriveApply();
+        BeanUtils.copyProperties(driveApplyDTO,driveApply);
+        driveApply.setUpdateById(userDTO.getId());
+        driveApply.setUpdateTime(new Date());
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(driveApplyDTO.getProjectList())){
+            for (JyProject jyProject : driveApplyDTO.getProjectList()) {
+                project+=jyProject.getProjectId()+",";
+            }
+            driveApply.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        driveApplyMapper.updateById(driveApply);
+        //修改附件
+        List<WorkAttachmentInfo> files = driveApplyDTO.getFiles();
+        updateFiles(files, userDTO, driveApplyDTO.getId());
+        return driveApplyDTO.getId();
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentInfo dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachmentInfo> infoList = driveApplyMapper.findList(id);
+        if (CollectionUtil.isNotEmpty(infoList)) {
+            for (WorkAttachmentInfo i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentInfo dto : list) {
+            //判断是否存在
+            Integer isExit = driveApplyMapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtil.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("driveApply");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                Map<String,String> map = new HashMap<>();
+                String workAttachment = JSON.toJSONString((i));
+                String userDTOInfo = JSON.toJSONString((userDTO));
+                map.put("workAttachment",workAttachment);
+                map.put("userDTO",userDTOInfo);
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+                j++;
+            }
+        }
+    }
+
+    private String add(DriveApplyDTO driveApplyDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        DriveApply driveApply = new DriveApply();
+        String project="";
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(driveApplyDTO.getProjectList())){
+            for (JyProject jyProject : driveApplyDTO.getProjectList()) {
+                project+=jyProject.getProjectId()+",";
+            }
+            driveApply.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        //id
+        String id = UUID.randomUUID().toString().replace("-", "");
+
+        driveApply.setId(id);
+        driveApply.setCreateById(userDTO.getId());
+        driveApply.setCreateTime(new Date());
+        driveApply.setUpdateById(userDTO.getId());
+        driveApply.setUpdateTime(new Date());
+        driveApply.setUseStartTime(driveApplyDTO.getUseStartTime());//开始时间
+        driveApply.setUseEndTime(driveApplyDTO.getUseEndTime());//结束时间
+        driveApply.setUseMen(driveApplyDTO.getUseMen());//用车人员
+        driveApply.setUseReason(driveApplyDTO.getUseReason());//用车原因
+        driveApply.setRemarks(driveApplyDTO.getRemarks());//备注
+        driveApply.setStatus(driveApplyDTO.getStatus());//状态
+        driveApplyMapper.insert(driveApply);
+        //保存附件
+        List<WorkAttachmentInfo> files = driveApplyDTO.getFiles();
+        if (CollectionUtil.isNotEmpty(files)) {
+            saveFiles(files, userDTO, id);
+        }
+        return id;
+    }
+
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentInfo dto : list) {
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtil.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("driveApply");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            Map<String,String> map = new HashMap<>();
+            String workAttachment = JSON.toJSONString((i));
+            String userDTOInfo = JSON.toJSONString((userDTO));
+            map.put("workAttachment",workAttachment);
+            map.put("userDTO",userDTOInfo);
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
+            j++;
+        }
+    }
+
+    /**
+     * 根据id查找用车申请
+     * @param id
+     * @return
+     */
+    public DriveApplyDTO findById(String id) {
+        DriveApplyDTO applyDTO = new DriveApplyDTO();
+        DriveApplyDTO driveApplyDTO=driveApplyMapper.findById(id);
+        BeanUtils.copyProperties(driveApplyDTO, applyDTO);
+        if (ObjectUtil.isNotEmpty(driveApplyDTO)){
+            //查询项目信息
+            if (StringUtils.isNotBlank(driveApplyDTO.getProjectId())){
+                String[] split = driveApplyDTO.getProjectId().split(",");
+                ArrayList<JyProject> projects = new ArrayList<>();
+                for (String s : split) {
+                    JyProject jyProject=jyProjectMapper.getById(s);
+                    projects.add(jyProject);
+                }
+                applyDTO.setProjectList(projects);
+            }
+            //设置用车起使时间
+            if (ObjectUtil.isNotEmpty(driveApplyDTO.getUseEndTime()) && ObjectUtil.isNotEmpty(driveApplyDTO.getUseEndTime())){
+                Date[] dates = new Date[2];
+                dates[0]=driveApplyDTO.getUseStartTime();
+                dates[1]=driveApplyDTO.getUseEndTime();
+                applyDTO.setUseDate(dates);
+            }
+            // 查询附件信息
+            List<WorkAttachmentInfo> files = driveApplyMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+                applyDTO.setFiles(files);
+            }
+            //查询结算附件信息
+            List<WorkAttachmentInfo> files1 = driveApplyMapper.findDtos(driveApplyDTO.getAccountId());
+            if (CollectionUtils.isNotEmpty(files1)) {
+                for (WorkAttachmentInfo i : files1) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+                applyDTO.setAccountFiles(files1);
+            }
+        }
+        return applyDTO;
+    }
+
+    /**
+     * 根据id修改状态
+     * @param driveApplyDTO
+     */
+    public void updateStatusById(DriveApplyDTO driveApplyDTO) {
+        driveApplyMapper.updateStatusById(driveApplyDTO.getId(),driveApplyDTO.getStatus());
+    }
+
+    /**
+     * 根据id进行删除
+     * @param id
+     * @return
+     */
+    public String deleteById(String id) {
+        driveApplyMapper.deleteById(id);
+        //删除附件
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
+        return "操作成功";
+    }
+
+    /**
+     * 新增或修改用车结算
+     * @param driveAccountDTO
+     * @return
+     */
+
+    public String saveAccountForm(DriveAccountDTO driveAccountDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        DriveAccount driveAccount = new DriveAccount();
+        driveAccount.setCreateById(userDTO.getId());
+        driveAccount.setCreateTime(new Date());
+        driveAccount.setUpdateById(userDTO.getId());
+        driveAccount.setUpdateTime(new Date());
+        driveAccount.setStartMileage(driveAccountDTO.getStartMileage());
+        driveAccount.setEndMileage(driveAccountDTO.getEndMileage());
+        driveAccount.setApplyId(driveAccountDTO.getApplyId());
+        driveAccount.setMileageCount(driveAccountDTO.getMileageCount());
+        driveAccount.setStatus(driveAccountDTO.getStatus());
+        DriveAccountDTO accountDTO = driveAccountMapper.findByApplyId(driveAccountDTO.getApplyId());
+        //判断结算表中是否有该条数据
+        if (ObjectUtil.isNotEmpty(accountDTO)){
+            driveAccount.setId(accountDTO.getId());
+            driveAccountMapper.updateById(driveAccount);
+            //附件
+            Map<String,String> map = new HashMap<>();
+            String fileList = JSON.toJSONString((driveAccountDTO.getAccountFiles()));
+            String attachmentId = accountDTO.getId();
+            String attachmentFlag = "driveAccount";
+            map.put("fileList",fileList);
+            map.put("attachmentId",attachmentId);
+            map.put("attachmentFlag",attachmentFlag);
+            map.put("currentToken", TokenProvider.getCurrentToken ( ));
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
+
+        }else {
+            //id
+            String id = UUID.randomUUID().toString().replace("-", "");
+            driveAccount.setId(id);
+            driveAccountMapper.insert(driveAccount);
+            //附件
+            Map<String,String> map = new HashMap<>();
+            String fileList = JSON.toJSONString((driveAccountDTO.getAccountFiles()));
+            String attachmentId = id;
+            String attachmentFlag = "driveAccount";
+            map.put("fileList",fileList);
+            map.put("attachmentId",attachmentId);
+            map.put("attachmentFlag",attachmentFlag);
+            map.put("currentToken", TokenProvider.getCurrentToken ( ));
+            SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
+            return id;
+        }
+        return accountDTO.getId();
+
+    }
+
+    /**
+     * 根据id修改状态
+     * @param driveAccountDTO
+     */
+    public void updateStatusByApplyId(DriveAccountDTO driveAccountDTO) {
+        driveAccountMapper.updateStatusByApplyId(driveAccountDTO.getApplyId(),driveAccountDTO.getStatus());
+    }
+
+    /**
+     * 管理员修改
+     * @param driveDTO
+     */
+    public void adminEditForm(DriveDTO driveDTO) {
+        //修改用车申请数据
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改项目信息
+        String project="";
+        DriveApply driveApply = new DriveApply();
+        driveApply.setUpdateById(userDTO.getId());
+        driveApply.setUpdateTime(new Date());
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(driveDTO.getDriveApplyDTO().getProjectList())){
+            for (JyProject jyProject : driveDTO.getDriveApplyDTO().getProjectList()) {
+                project+=jyProject.getId()+",";
+            }
+            driveApply.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        driveApply.setUseStartTime(driveDTO.getDriveApplyDTO().getUseStartTime());
+        driveApply.setUseEndTime(driveDTO.getDriveApplyDTO().getUseEndTime());
+        driveApply.setUseMen(driveDTO.getDriveApplyDTO().getUseMen());
+        driveApply.setUseReason(driveDTO.getDriveApplyDTO().getUseReason());
+        driveApply.setRemarks(driveDTO.getDriveApplyDTO().getRemarks());
+        driveApply.setId(driveDTO.getDriveApplyDTO().getId());
+        driveApplyMapper.updateInfoById(driveApply);
+        //修改申请附件
+        List<WorkAttachmentInfo> files = driveDTO.getDriveApplyDTO().getFiles();
+        updateFiles(files, userDTO, driveDTO.getDriveApplyDTO().getId());
+
+        //修改用车结算数据
+        DriveAccountDTO accountDTO = driveAccountMapper.findByApplyId(driveDTO.getDriveAccountDTO().getApplyId());
+        DriveAccount driveAccount = new DriveAccount();
+        driveAccount.setId(accountDTO.getId());
+        driveAccount.setUpdateById(userDTO.getId());
+        driveAccount.setUpdateTime(new Date());
+        driveAccount.setStartMileage(driveDTO.getDriveAccountDTO().getStartMileage());
+        driveAccount.setEndMileage(driveDTO.getDriveAccountDTO().getEndMileage());
+        driveAccount.setMileageCount(driveDTO.getDriveAccountDTO().getMileageCount());
+        driveAccountMapper.updateInfoById(driveAccount);
+
+        //附件
+        Map<String,String> map = new HashMap<>();
+        String fileList = JSON.toJSONString((driveDTO.getDriveAccountDTO().getAccountFiles()));
+        String attachmentId = accountDTO.getId();
+        String attachmentFlag = "driveAccount";
+        map.put("fileList",fileList);
+        map.put("attachmentId",attachmentId);
+        map.put("attachmentFlag",attachmentFlag);
+        map.put("currentToken", TokenProvider.getCurrentToken ( ));
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
+    }
+}

+ 53 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveAccountDTO.java

@@ -0,0 +1,53 @@
+package com.jeeplus.business.drive.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.business.drive.domain.DriveAccount;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class DriveAccountDTO extends BaseDTO<DriveAccount> {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 起使里程数
+     */
+    private String startMileage;
+
+    /**
+     * 截至里程数
+     */
+    private String endMileage;
+
+    /**
+     * 历程总数
+     */
+    private String mileageCount;
+
+    /**
+     * 关联申请表id
+     */
+    private String applyId;
+
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    private List<WorkAttachmentInfo> accountFiles;
+}

+ 113 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveApplyDTO.java

@@ -0,0 +1,113 @@
+package com.jeeplus.business.drive.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class DriveApplyDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关联项目id
+     */
+    private String projectId;
+    private String projectName;
+
+    /**
+     * 用车人员id
+     */
+    private String useMen;
+    private String userName;
+
+    /**
+     * 用车起使时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date useStartTime;
+
+    /**
+     * 用车截至时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date useEndTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 申请人
+     */
+    private String createById;
+    private String updateById;
+    /**
+     * 申请人部门
+     */
+    private String createOffice;
+
+    /**
+     * 申请人部门
+     */
+    private String officeId;
+
+    private String createName;
+    private String officeName;
+
+    private String status;
+
+    /**
+     * 用车原因
+     */
+    private String useReason;
+
+    private List<JyProject> projectList;
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date[] useDate;
+
+    private List<WorkAttachmentInfo> files;
+    private List<WorkAttachmentInfo> accountFiles;
+
+
+    /**
+     * 用车结算
+     */
+    private String taskIdAccount;
+    private String processDefinitionIdAccount;
+    private String procInsIdAccount;
+    private String accountStatus;
+    private String startMileage;
+    private String endMileage;
+    private String mileageCount;
+    private String accountId;
+    private String applyId;
+
+
+
+
+
+
+}

+ 9 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveDTO.java

@@ -0,0 +1,9 @@
+package com.jeeplus.business.drive.service.dto;
+
+import lombok.Data;
+
+@Data
+public class DriveDTO {
+    private DriveApplyDTO driveApplyDTO;
+    private DriveAccountDTO driveAccountDTO;
+}

+ 1 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/meetingRoom/domain/MeetingRoom.java

@@ -53,6 +53,7 @@ public class MeetingRoom extends BaseEntity {
      * 流程信息
      * 流程信息
      */
      */
     private String processDefinitionId;
     private String processDefinitionId;
+    @TableField(exist = false)
     private String taskId;
     private String taskId;
 
 
     /**
     /**

+ 10 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java

@@ -159,6 +159,16 @@ public class JyProjectController {
     }
     }
 
 
     /**
     /**
+     * 根据当前登陆人所在部门获取项目
+     */
+    @ApiOperation(value = "根据当前登陆人所在部门获取项目")
+    @GetMapping(value = "/getByCreateOffice")
+    public ResponseEntity<IPage<JyProject>> getByCreateOffice(JyProject info, Page<JyProject> page) throws Exception {
+        IPage<JyProject> list = jyProjectService.getByCreateOffice(page, info);
+        return ResponseEntity.ok (list);
+    }
+
+    /**
      * 根据当前登录人获取外审通过的项目
      * 根据当前登录人获取外审通过的项目
      */
      */
     @ApiOperation(value = "根据当前登录人获取外审通过的项目")
     @ApiOperation(value = "根据当前登录人获取外审通过的项目")

+ 3 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java

@@ -25,7 +25,7 @@ public interface JyProjectMapper extends BaseMapper<JyProject> {
     IPage<JyWorkContractInfo> findContractPageList(Page<JyWorkContractInfo> page, @Param("dto") JyWorkContractInfoDto dto);
     IPage<JyWorkContractInfo> findContractPageList(Page<JyWorkContractInfo> page, @Param("dto") JyWorkContractInfoDto dto);
 
 
     Integer getProByContractId(@Param("contractId")String contractId);
     Integer getProByContractId(@Param("contractId")String contractId);
-
+    @InterceptorIgnore(tenantLine = "true")
     JyProject getById(String id);
     JyProject getById(String id);
 
 
     @InterceptorIgnore(tenantLine = "true")
     @InterceptorIgnore(tenantLine = "true")
@@ -45,4 +45,6 @@ public interface JyProjectMapper extends BaseMapper<JyProject> {
     IPage<JyProject> getByCreateOut(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);
     IPage<JyProject> getByCreateOut(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);
 
 
     void updateReportsSubmit(@Param("id")String s, @Param("status")String status);
     void updateReportsSubmit(@Param("id")String s, @Param("status")String status);
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<JyProject> getByCreateOffice(@Param("id")String id, Page<JyProject> page,  @Param(Constants.WRAPPER)QueryWrapper<JyProject> wrapper);
 }
 }

+ 42 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml

@@ -802,6 +802,48 @@
     </update>
     </update>
 
 
 
 
+    <select id="getByCreateOffice" resultType="com.jeeplus.business.project.domain.JyProject">
+        SELECT
+           a.id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
+           a.del_flag,
+           a.name,
+           a.no,
+           a.contract_id,
+           a.contract_name,
+           a.client,
+           a.client_name,
+           a.status,
+           a.first_instance_status,
+           a.second_instance_status,
+           a.third_instance_status,
+           a.report_issuance,
+           a.out_instance,
+           a.reports_submit,
+           a.review_status,
+           a.contract_status,
+           a.project_place,
+           a.build_place,
+           a.project_overview,
+           a.special,
+           a.contract_project_no,
+           (SELECT su.name from sys_user su where a.project_leader = su.id) as projectLeader,
+           a.proc_ins_id,
+           a.process_definition_id,
+           b.name AS create_by_id
+        FROM
+            jy_project_record a
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
+            LEFT JOIN sys_user c ON a.project_leader = c.id
+            left join sys_office so on b.office_id = so.id
+            left join jy_project_audit pa on a.id=pa.project_id and pa.audit_level = '3'
+             ${ew.customSqlSegment}
+            ORDER BY a.update_time DESC
+    </select>
+
 
 
 
 
 </mapper>
 </mapper>

+ 28 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -822,7 +822,6 @@ public class JyProjectService {
             map.put("attachmentFlag",attachmentFlag);
             map.put("attachmentFlag",attachmentFlag);
             map.put("currentToken", TokenProvider.getCurrentToken ( ));
             map.put("currentToken", TokenProvider.getCurrentToken ( ));
             SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
             SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
-
         }
         }
         return jyProjectAudit.getId();
         return jyProjectAudit.getId();
     }
     }
@@ -1831,4 +1830,32 @@ public class JyProjectService {
         jyProjectEiaQualificationMapper.update(jyProjectEiaQualification,new QueryWrapper<JyProjectEiaQualification>().lambda().eq(JyProjectEiaQualification::getId,jyProjectEiaQualification.getId()) );
         jyProjectEiaQualificationMapper.update(jyProjectEiaQualification,new QueryWrapper<JyProjectEiaQualification>().lambda().eq(JyProjectEiaQualification::getId,jyProjectEiaQualification.getId()) );
         return "操作成功";
         return "操作成功";
     }
     }
+
+    /**
+     * 根据当前登陆人所在部门获取项目
+     * @param page
+     * @param info
+     * @return
+     */
+    public IPage<JyProject> getByCreateOffice(Page<JyProject> page, JyProject info) throws Exception {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        QueryWrapper<JyProject> wrapper = QueryWrapperGenerator.buildQueryCondition(info, JyProject.class);
+        wrapper.eq("so.id",userDTO.getOfficeDTO().getId());
+        wrapper.eq("pa.status","5");
+        //创建时间
+        if (info.getCreateDates() != null && info.getCreateDates().length > 0) {
+            wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
+        }
+        //项目编号
+        if (StringUtils.isNotBlank(info.getNo())){
+            wrapper.like("a.no",info.getNo());
+        }
+        //项目名称
+        if (StringUtils.isNotBlank(info.getName())){
+            wrapper.like("a.name",info.getName());
+        }
+        IPage<JyProject> projectIPage=jyProjectMapper.getByCreateOffice(userDTO.getId(),page,wrapper);
+        return projectIPage;
+    }
 }
 }

+ 11 - 7
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -422,14 +422,18 @@ public class UserController {
     @GetMapping("list3")
     @GetMapping("list3")
     public ResponseEntity list3(UserDTO userDTO, Page <UserDTO> page) throws Exception {
     public ResponseEntity list3(UserDTO userDTO, Page <UserDTO> page) throws Exception {
         QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
         QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
-        String id = UserUtils.getCurrentUserDTO().getCompanyDTO().getId();
-        queryWrapper.eq("a.company_id",id);
-        if (StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())){
-            queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
-        }
-        if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
-            queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
+        if (!UserUtils.getCurrentUserDTO().isAdmin()) {
+            queryWrapper.isNull("a.is_admin");
+            String id = UserUtils.getCurrentUserDTO().getCompanyDTO().getId();
+            queryWrapper.eq("a.company_id",id);
+            if (StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())){
+                queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
+            }
+            if ( userDTO.getTenantDTO ( ) != null && StrUtil.isNotBlank ( userDTO.getTenantDTO ( ).getId ( ) ) ) {
+                queryWrapper.eq ( "a.tenant_id", userDTO.getTenantDTO ( ).getId ( ) );
+            }
         }
         }
+
         IPage <UserDTO> result = userService.findPage2 ( page, queryWrapper );
         IPage <UserDTO> result = userService.findPage2 ( page, queryWrapper );
         return ResponseEntity.ok ( result );
         return ResponseEntity.ok ( result );
     }
     }

+ 2 - 2
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/UserMapper.java

@@ -114,9 +114,9 @@ public interface UserMapper extends BaseMapper <User> {
     @InterceptorIgnore(tenantLine = "true")
     @InterceptorIgnore(tenantLine = "true")
     IPage <UserDTO> findList(Page <UserDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
     IPage <UserDTO> findList(Page <UserDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
 
-
+    @InterceptorIgnore(tenantLine = "true")
     IPage <UserDTO> userFindPage(Page <UserDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
     IPage <UserDTO> userFindPage(Page <UserDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
-
+    @InterceptorIgnore(tenantLine = "true")
     IPage <UserDTO> findList2(Page <UserDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
     IPage <UserDTO> findList2(Page <UserDTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
 
     /**
     /**

+ 1 - 1
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -189,7 +189,7 @@
         FROM sys_user a
         FROM sys_user a
         <include refid="userJoins"/>
         <include refid="userJoins"/>
         ${ew.customSqlSegment}
         ${ew.customSqlSegment}
-        and (a.is_admin is null or a.is_admin = '' or a.is_admin != 1)
+
     </select>
     </select>
 
 
     <!-- 查询角色下的用户 -->
     <!-- 查询角色下的用户 -->