瀏覽代碼

车辆保养,出差申请,外出申请

sangwenwei 1 年之前
父節點
當前提交
3c4fef6c2a
共有 26 個文件被更改,包括 2453 次插入2 次删除
  1. 1 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveController.java
  2. 70 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveInfoController.java
  3. 92 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveMaintainController.java
  4. 20 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveInfo.java
  5. 74 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveMaintain.java
  6. 1 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveApplyMapper.java
  7. 21 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveInfoMapper.java
  8. 37 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveMaintainMapper.java
  9. 48 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveInfoMapper.xml
  10. 96 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveMaintainMapper.xml
  11. 3 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveApplyService.java
  12. 81 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveInfoService.java
  13. 299 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveMaintainService.java
  14. 84 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveMaintainDTO.java
  15. 94 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/controller/EvectionController.java
  16. 74 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/domain/Evection.java
  17. 34 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/mapper/EvectionMapper.java
  18. 122 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/mapper/xml/EvectionMapper.xml
  19. 340 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/service/EvectionService.java
  20. 102 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/service/dto/EvectionDTO.java
  21. 92 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/controller/GoOutController.java
  22. 71 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/domain/GoOut.java
  23. 34 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/mapper/GoOutMapper.java
  24. 122 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/mapper/xml/GoOutMapper.xml
  25. 339 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/service/GoOutService.java
  26. 102 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/service/dto/GoOutDTO.java

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

@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 
 @Slf4j
-@Api(tags ="用车管理")
+@Api(tags ="用车申请及结算管理")
 @RestController
 @RequestMapping(value = "/drive")
 public class DriveController {

+ 70 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveInfoController.java

@@ -0,0 +1,70 @@
+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.domain.DriveInfo;
+import com.jeeplus.business.drive.service.DriveInfoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Slf4j
+@Api(tags ="用车信息")
+@RestController
+@RequestMapping(value = "/driveInfo")
+public class DriveInfoController {
+
+    @Resource
+    private DriveInfoService driveInfoService;
+
+
+    /**
+     * 车辆列表信息
+     */
+    @ApiOperation(value = "车辆信息列表")
+    @GetMapping(value = "/list")
+    public ResponseEntity<IPage<DriveInfo>> list( DriveInfo driveInfo, Page<DriveInfo> page) throws Exception {
+        IPage<DriveInfo> iPage=driveInfoService.findPageList(driveInfo,page);
+        return ResponseEntity.ok(iPage);
+    }
+
+
+    /**
+     * 车辆信息添加/修改
+     */
+    @ApiOperation(value = "车辆信息添加/修改")
+    @PostMapping(value = "/saveOrUpdate")
+    public String saveOrUpdate(@RequestBody DriveInfo driveInfo){
+        driveInfoService.saveOrUpdate(driveInfo);
+        return "操作成功";
+    }
+
+
+    /**
+     * 车辆信息删除
+     */
+    @ApiOperation(value = "车辆信息删除/修改")
+    @DeleteMapping(value = "/deleteById")
+    public String deleteById(@RequestParam String id){
+        driveInfoService.deleteById(id);
+        return "操作成功";
+    }
+
+    /**
+     * 根据id查询车辆信息
+     */
+    @ApiOperation(value = "根据id查询车辆信息")
+    @GetMapping(value = "findById")
+    public ResponseEntity<DriveInfo> findById(@RequestParam String id){
+        DriveInfo driveInfo=driveInfoService.findById(id);
+        return ResponseEntity.ok(driveInfo);
+    }
+
+
+
+}

+ 92 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/controller/DriveMaintainController.java

@@ -0,0 +1,92 @@
+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.DriveMaintainService;
+import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
+import com.jeeplus.business.drive.service.dto.DriveMaintainDTO;
+import com.jeeplus.common.utils.ResponseUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Slf4j
+@Api(tags ="车辆保养维护")
+@RestController
+@RequestMapping(value = "/driveMaintain")
+public class DriveMaintainController {
+
+    @Resource
+    private DriveMaintainService driveMaintainService;
+
+
+    /**
+     * 车辆维护列表
+     */
+    @ApiOperation(value = "车辆维护列表")
+    @GetMapping(value = "/list")
+    public ResponseEntity<IPage<DriveMaintainDTO>> applyList(DriveMaintainDTO driveMaintainDTO, Page<DriveMaintainDTO> page) throws Exception {
+        IPage<DriveMaintainDTO> pageList=driveMaintainService.findPageList(driveMaintainDTO,page);
+        return ResponseEntity.ok(pageList);
+    }
+
+
+    /**
+     * 车辆维护新增或修改
+     */
+    @ApiOperation(value = "车辆维护新增或修改")
+    @PostMapping(value = "/saveForm")
+    public ResponseEntity saveForm(@RequestBody DriveMaintainDTO driveMaintainDTO){
+        String id=driveMaintainService.save(driveMaintainDTO);
+        return ResponseUtil.newInstance().add("businessTable","jy_drive_maintain").add("businessId",id).ok("操作成功");
+    }
+
+    /**
+     * 根据id查询维护数据
+     */
+    @ApiOperation(value = "根据id查询维护数据")
+    @GetMapping(value = "findById")
+    public ResponseEntity<DriveMaintainDTO> findById(@RequestParam String id){
+        DriveMaintainDTO maintainDTO=driveMaintainService.findById(id);
+        return ResponseEntity.ok(maintainDTO);
+    }
+
+    /**
+     * 根据id修改状态status
+     * @param
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "/updateStatusById")
+    public void updateStatusById(@RequestBody DriveMaintainDTO maintainDTO) {
+        driveMaintainService.updateStatusById(maintainDTO);
+    }
+
+    /**
+     * 根据id进行删除
+     */
+    @ApiOperation(value = "根据id进行删除")
+    @DeleteMapping(value = "/delete")
+    public ResponseEntity<String> deleteById(@RequestParam String id){
+        String s = driveMaintainService.deleteById(id);
+        return ResponseEntity.ok(s);
+    }
+
+
+    /**
+     * 管理员修改
+     */
+    @ApiOperation(value = "管理员修改")
+    @PostMapping(value = "/updateInfo")
+    public void updateInfo(@RequestBody DriveMaintainDTO maintainDTO) {
+        driveMaintainService.updateInfo(maintainDTO);
+    }
+
+
+
+
+
+}

+ 20 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveInfo.java

@@ -0,0 +1,20 @@
+package com.jeeplus.business.drive.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_drive_info")
+public class DriveInfo extends BaseEntity {
+
+    /*
+    车牌号
+     */
+    private String driveNumber;
+
+    /**
+     * 车辆识别号
+     */
+    private String driveIdentifyNumber;
+}

+ 74 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/domain/DriveMaintain.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_maintain")
+public class DriveMaintain extends BaseEntity {
+
+    /**
+     * 车辆信息id
+     */
+    private String driveInfoId;
+
+    /**
+     * 车辆维护类型
+     */
+    private String driveMaintainType;
+
+
+    /**
+     * 维护开始时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 维护结束时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 车牌号
+     */
+    @TableField(exist = false)
+    private String driveNumber;
+
+
+
+
+
+
+
+}

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

@@ -28,6 +28,7 @@ public interface DriveApplyMapper extends BaseMapper<DriveApply> {
     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);
 }

+ 21 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveInfoMapper.java

@@ -0,0 +1,21 @@
+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.DriveInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface DriveInfoMapper extends BaseMapper<DriveInfo> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<DriveInfo> findPageList(Page<DriveInfo> page,@Param(Constants.WRAPPER) QueryWrapper<DriveInfo> queryWrapper);
+
+    void updateInfoById(@Param("info") DriveInfo info);
+
+    DriveInfo findById(@Param("id") String id);
+}

+ 37 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/DriveMaintainMapper.java

@@ -0,0 +1,37 @@
+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.DriveMaintain;
+import com.jeeplus.business.drive.service.dto.DriveMaintainDTO;
+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 DriveMaintainMapper extends BaseMapper<DriveMaintain> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<DriveMaintainDTO> findPageList(Page<DriveMaintainDTO> page, @Param(Constants.WRAPPER) QueryWrapper<DriveMaintainDTO> queryWrapper);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<WorkAttachmentInfo> findList(@Param("id") String id);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<WorkAttachmentInfo> findDtos(@Param("id") String id);
+
+    @InterceptorIgnore(tenantLine = "true")
+    DriveMaintain findById(@Param("id") String id);
+
+    void updateStatusById(@Param("status") String status,@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    void updateInfo(@Param("maintain") DriveMaintain maintain);
+}

+ 48 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveInfoMapper.xml

@@ -0,0 +1,48 @@
+<?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.DriveInfoMapper">
+
+    <select id="findPageList" resultType="com.jeeplus.business.drive.domain.DriveInfo">
+        select
+            id,
+            create_by_id,
+            create_time,
+            update_by_id,
+            update_time,
+            drive_number,
+            drive_identify_number
+        from
+            jy_drive_info
+        ${ew.customSqlSegment}
+        ORDER BY update_time DESC
+    </select>
+
+    <update id="updateInfoById">
+        update
+            jy_drive_info
+        set
+            update_by_id =#{info.updateById},
+            update_time = #{info.updateTime},
+            drive_number = #{info.driveNumber},
+            drive_identify_number = #{info.driveIdentifyNumber}
+        where id = #{info.id}
+    </update>
+
+    <select id="findById" resultType="com.jeeplus.business.drive.domain.DriveInfo">
+        select
+            id,
+            create_by_id,
+            create_time,
+            update_by_id,
+            update_time,
+            drive_number,
+            drive_identify_number
+        from
+            jy_drive_info
+        where id=#{id}
+    </select>
+
+
+</mapper>

+ 96 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/mapper/xml/DriveMaintainMapper.xml

@@ -0,0 +1,96 @@
+<?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.DriveMaintainMapper">
+
+    <select id="findPageList" resultType="com.jeeplus.business.drive.service.dto.DriveMaintainDTO">
+        select
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.drive_info_id,
+            a.drive_maintain_type,
+            a.start_time,
+            a.end_time,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.status,
+            art.ID_ as task_id,
+            di.drive_number
+        from jy_drive_maintain a
+        left join jy_drive_info di on a.drive_info_id = di.id
+        left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+        ${ew.customSqlSegment}
+        ORDER BY a.update_time DESC
+    </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="findList" resultType="com.jeeplus.sys.domain.WorkAttachmentInfo">
+		SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+	</select>
+
+    <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>
+
+    <select id="findById" resultType="com.jeeplus.business.drive.domain.DriveMaintain">
+        select
+            a.id,
+            a.create_by_id,
+            a.create_time,
+            a.drive_info_id,
+            a.drive_maintain_type,
+            a.start_time,
+            a.end_time,
+            a.proc_ins_id,
+            a.process_definition_id,
+            a.status,
+            art.ID_ as task_id,
+            di.drive_number
+        from jy_drive_maintain a
+        left join jy_drive_info di on a.drive_info_id = di.id
+        left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+        where a.id=#{id}
+    </select>
+
+    <update id="updateStatusById">
+        update jy_drive_maintain set status =#{status} where id=#{id}
+    </update>
+
+    <update id="updateInfo">
+        update
+            jy_drive_maintain
+        set
+            update_by_id = #{maintain.updateById},
+            update_time = #{maintain.updateTime},
+            drive_info_id = #{maintain.driveInfoId},
+            drive_maintain_type = #{maintain.driveMaintainType},
+            start_time = #{maintain.startTime},
+            end_time = #{maintain.endTime},
+            remarks = #{maintain.remarks}
+        where
+            id=#{maintain.id}
+    </update>
+
+</mapper>

+ 3 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveApplyService.java

@@ -102,7 +102,9 @@ public class DriveApplyService {
         //修改项目信息
         String project="";
         DriveApply driveApply = new DriveApply();
+
         BeanUtils.copyProperties(driveApplyDTO,driveApply);
+
         driveApply.setUpdateById(userDTO.getId());
         driveApply.setUpdateTime(new Date());
         //处理关联项目项目
@@ -273,7 +275,7 @@ public class DriveApplyService {
                 applyDTO.setProjectList(projects);
             }
             //设置用车起使时间
-            if (ObjectUtil.isNotEmpty(driveApplyDTO.getUseEndTime()) && ObjectUtil.isNotEmpty(driveApplyDTO.getUseEndTime())){
+            if (ObjectUtil.isNotEmpty(driveApplyDTO.getUseStartTime()) && ObjectUtil.isNotEmpty(driveApplyDTO.getUseEndTime())){
                 Date[] dates = new Date[2];
                 dates[0]=driveApplyDTO.getUseStartTime();
                 dates[1]=driveApplyDTO.getUseEndTime();

+ 81 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveInfoService.java

@@ -0,0 +1,81 @@
+package com.jeeplus.business.drive.service;
+
+import cn.hutool.extra.spring.SpringUtil;
+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.business.drive.domain.DriveInfo;
+import com.jeeplus.business.drive.mapper.DriveInfoMapper;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+@Service
+public class DriveInfoService {
+
+    @Resource
+    private DriveInfoMapper driveInfoMapper;
+
+    public IPage<DriveInfo> findPageList(DriveInfo driveInfo, Page<DriveInfo> page) throws Exception {
+        QueryWrapper<DriveInfo> queryWrapper = QueryWrapperGenerator.buildQueryCondition(driveInfo, DriveInfo.class);
+        queryWrapper.eq("del_flag",0);
+        if (StringUtils.isNotBlank(driveInfo.getDriveNumber())){
+            queryWrapper.like("drive_number",driveInfo.getDriveNumber());
+        }
+        if (StringUtils.isNotBlank(driveInfo.getDriveIdentifyNumber())){
+            queryWrapper.like("drive_identify_number",driveInfo.getDriveIdentifyNumber());
+        }
+        IPage<DriveInfo> iPage=driveInfoMapper.findPageList(page,queryWrapper);
+        return iPage;
+
+
+    }
+
+    /**}
+     * 添加车辆信息
+     * @param driveInfo
+     */
+    public void saveOrUpdate(DriveInfo driveInfo) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+
+        DriveInfo info = new DriveInfo();
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
+        info.setDriveNumber(driveInfo.getDriveNumber());
+        info.setDriveIdentifyNumber(driveInfo.getDriveIdentifyNumber());
+        //判断id是否存在
+        if (StringUtils.isNotBlank(driveInfo.getId())){
+            info.setId(driveInfo.getId());
+            driveInfoMapper.updateInfoById(info);
+        }else {
+            info.setCreateById(userDTO.getId());
+            info.setCreateTime(new Date());
+            driveInfoMapper.insert(info);
+        }
+    }
+
+    /**
+     * 根据id删除车辆信息
+     * @param id
+     */
+    public void deleteById(String id) {
+        driveInfoMapper.deleteById(id);
+    }
+
+    /**
+     * 根据id查询车辆信息
+     * @param id
+     * @return
+     */
+    public DriveInfo findById(String id) {
+        DriveInfo driveInfo=driveInfoMapper.findById(id);
+        return driveInfo;
+    }
+}

+ 299 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/DriveMaintainService.java

@@ -0,0 +1,299 @@
+package com.jeeplus.business.drive.service;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.UUID;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+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.DriveMaintain;
+import com.jeeplus.business.drive.mapper.DriveMaintainMapper;
+import com.jeeplus.business.drive.service.dto.DriveMaintainDTO;
+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 org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+import java.util.*;
+
+import static com.baomidou.mybatisplus.core.toolkit.Wrappers.update;
+
+@Service
+public class DriveMaintainService {
+
+    @Resource
+    private DriveMaintainMapper driveMaintainMapper;
+
+    /**
+     * 车辆维护列表
+     * @param driveMaintainDTO
+     * @param page
+     * @return
+     */
+    public IPage<DriveMaintainDTO> findPageList(DriveMaintainDTO driveMaintainDTO, Page<DriveMaintainDTO> page) throws Exception {
+        QueryWrapper<DriveMaintainDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(driveMaintainDTO, DriveMaintainDTO.class);
+        queryWrapper.eq("a.del_flag",0);
+        //车牌号查询
+        if (StringUtils.isNotBlank(driveMaintainDTO.getDriveNumber())){
+            queryWrapper.like("di.drive_number",driveMaintainDTO.getDriveNumber());
+        }
+        //维护类型
+        if (StringUtils.isNotBlank(driveMaintainDTO.getDriveMaintainType())){
+            queryWrapper.eq("a.drive_maintain_type",driveMaintainDTO.getDriveMaintainType());
+        }
+        //维护时间
+        if (driveMaintainDTO.getDates() != null && driveMaintainDTO.getDates().length>0){
+            queryWrapper.between("a.start_time",driveMaintainDTO.getDates()[0],driveMaintainDTO.getDates()[1]).or().between("a.end_time",driveMaintainDTO.getDates()[0],driveMaintainDTO.getDates()[1]);
+        }
+        IPage<DriveMaintainDTO> pageList=driveMaintainMapper.findPageList(page,queryWrapper);
+        return pageList;
+    }
+
+    /**
+     * 新增或修改
+     * @param driveMaintainDTO
+     * @return
+     */
+    public String save(DriveMaintainDTO driveMaintainDTO) {
+        if (StringUtils.isNotBlank(driveMaintainDTO.getId())){
+            return update(driveMaintainDTO);
+        }
+        return add(driveMaintainDTO);
+    }
+
+    private String add(DriveMaintainDTO driveMaintainDTO){
+        DriveMaintain maintainDTO = new DriveMaintain();
+
+        String currentToken = TokenProvider.getCurrentToken();
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(currentToken);
+
+        //id
+        String id = UUID.randomUUID().toString().replace("-", "");
+        maintainDTO.setId(id);
+        maintainDTO.setCreateById(userDTO.getId());
+        maintainDTO.setCreateTime(new Date());
+        maintainDTO.setUpdateById(userDTO.getId());
+        maintainDTO.setUpdateTime(new Date());
+        maintainDTO.setDriveInfoId(driveMaintainDTO.getDriveInfoId()); //车辆信息
+        maintainDTO.setDriveMaintainType(driveMaintainDTO.getDriveMaintainType()); //维护类型
+        maintainDTO.setStartTime(driveMaintainDTO.getStartTime()); //维护开始时间
+        maintainDTO.setEndTime(driveMaintainDTO.getEndTime()); //维护结束时间
+        maintainDTO.setStatus(driveMaintainDTO.getStatus());
+        maintainDTO.setRemarks(driveMaintainDTO.getRemarks());
+        driveMaintainMapper.insert(maintainDTO);
+
+        //附件新增
+        List<WorkAttachmentInfo> files = driveMaintainDTO.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(java.util.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("driveMaintain");
+            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 update(DriveMaintainDTO driveMaintainDTO){
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改信息
+        DriveMaintain driveMaintain = new DriveMaintain();
+
+        BeanUtil.copyProperties(driveMaintainDTO,driveMaintain);
+
+        driveMaintain.setUpdateById(userDTO.getId());
+        driveMaintain.setUpdateTime(new Date());
+        driveMaintainMapper.updateById(driveMaintain);
+        //附件修改
+        List<WorkAttachmentInfo> files = driveMaintainDTO.getFiles();
+        if (CollectionUtil.isNotEmpty(files)) {
+            updateFiles(files, userDTO, driveMaintainDTO.getId());
+        }
+        return driveMaintainDTO.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 = driveMaintainMapper.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 = driveMaintainMapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
+                //包含了url、size、name
+                i.setId(java.util.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("driveMaintain");
+                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 DriveMaintainDTO findById(String id) {
+        DriveMaintainDTO maintainDTO = new DriveMaintainDTO();
+        DriveMaintain driveMaintain=driveMaintainMapper.findById(id);
+        BeanUtils.copyProperties(driveMaintain,maintainDTO);
+        if (ObjectUtil.isNotEmpty(driveMaintain)){
+            //设置起止时间
+            if (ObjectUtil.isNotEmpty(driveMaintain.getStartTime()) && ObjectUtil.isNotEmpty(driveMaintain.getEndTime())) {
+                Date[] dates=new Date[2];
+                dates[0]=driveMaintain.getStartTime();
+                dates[1]=driveMaintain.getEndTime();
+                maintainDTO.setMaintainDates(dates);
+            }
+            // 查询附件信息
+            List<WorkAttachmentInfo> files = driveMaintainMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+                maintainDTO.setFiles(files);
+            }
+        }
+        return maintainDTO;
+
+    }
+
+    /**
+     * 根据id修改状态
+     * @param maintainDTO
+     */
+    public void updateStatusById(DriveMaintainDTO maintainDTO) {
+        driveMaintainMapper.updateStatusById(maintainDTO.getStatus(),maintainDTO.getId());
+    }
+
+    /**
+     * 根据id进行删除
+     * @param id
+     * @return
+     */
+    public String deleteById(String id) {
+        driveMaintainMapper.deleteById(id);
+        //删除附件
+        SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(id);
+        return "操作成功";
+    }
+
+    /**
+     * 管理员修改
+     * @param maintainDTO
+     */
+    public void updateInfo(DriveMaintainDTO maintainDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+
+        DriveMaintain maintain = new DriveMaintain();
+        //修改信息
+        maintain.setUpdateById(userDTO.getId());
+        maintain.setUpdateTime(new Date());
+        maintain.setDriveInfoId(maintainDTO.getDriveInfoId()); //车辆信息
+        maintain.setDriveMaintainType(maintainDTO.getDriveMaintainType()); //维护类型
+        maintain.setStartTime(maintainDTO.getStartTime()); //维护开始时间
+        maintain.setEndTime(maintainDTO.getEndTime()); //维护结束时间
+        maintain.setId(maintainDTO.getId());
+        maintainDTO.setRemarks(maintainDTO.getRemarks());
+        driveMaintainMapper.updateInfo(maintain);
+
+        //附件修改
+        List<WorkAttachmentInfo> files = maintainDTO.getFiles();
+        if (CollectionUtil.isNotEmpty(files)) {
+            updateFiles(files, userDTO, maintainDTO.getId());
+        }
+    }
+}

+ 84 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/drive/service/dto/DriveMaintainDTO.java

@@ -0,0 +1,84 @@
+package com.jeeplus.business.drive.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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 DriveMaintainDTO extends BaseDTO {
+    /**
+     * 车辆信息id
+     */
+    private String driveInfoId;
+
+    /**
+     * 车辆维护类型
+     */
+    private String driveMaintainType;
+
+
+    /**
+     * 维护开始时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 维护结束时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 车牌号
+     */
+    private String driveNumber;
+
+    /**
+     * 维护时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date[] maintainDates;
+
+    private String[] dates;
+
+
+    private String createById;
+    private String updateById;
+
+    //附件
+    private List<WorkAttachmentInfo> files;
+
+
+
+}

+ 94 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/controller/EvectionController.java

@@ -0,0 +1,94 @@
+package com.jeeplus.business.evection.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
+import com.jeeplus.business.drive.service.dto.DriveDTO;
+import com.jeeplus.business.evection.service.EvectionService;
+import com.jeeplus.business.evection.service.dto.EvectionDTO;
+import com.jeeplus.common.utils.ResponseUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Slf4j
+@Api(tags ="出差申请")
+@RestController
+@RequestMapping(value = "/evection")
+public class EvectionController {
+
+    @Resource
+    private EvectionService evectionService;
+
+
+
+    /**
+     * 出差申请列表
+     */
+    @ApiOperation(value = "出差申请列表")
+    @GetMapping(value = "/evectionList")
+    public ResponseEntity<IPage<EvectionDTO>> applyList(EvectionDTO evectionDTO, Page<EvectionDTO> page) throws Exception {
+        IPage<EvectionDTO> pageList=evectionService.findPageList(evectionDTO,page);
+        return ResponseEntity.ok(pageList);
+    }
+
+
+    /**
+     * 新增/修改
+     */
+    @ApiOperation(value = "新增或修改")
+    @PostMapping(value = "/saveForm")
+    public ResponseEntity saveForm(@RequestBody EvectionDTO evectionDTO){
+        String id=evectionService.save(evectionDTO);
+        return ResponseUtil.newInstance().add("businessTable","jy_evection").add("businessId",id).ok("操作成功");
+    }
+
+
+    /**
+     * 根据id查找用车申请信息
+     */
+    @ApiOperation(value = "根据id查找用车申请")
+    @GetMapping(value = "findById")
+    public ResponseEntity<EvectionDTO> findById(@RequestParam String id){
+        EvectionDTO evectionDTO=evectionService.findById(id);
+        return ResponseEntity.ok(evectionDTO);
+    }
+
+    /**
+     * 根据id修改状态status
+     * @param
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "/updateStatusById")
+    public void updateStatusById(@RequestBody EvectionDTO evectionDTO) {
+        evectionService.updateStatusById(evectionDTO);
+    }
+
+    /**
+     * 根据id进行删除
+     */
+    @ApiOperation(value = "根据id进行删除")
+    @DeleteMapping(value = "/delete")
+    public ResponseEntity<String> deleteById(@RequestParam String id){
+        String s = evectionService.deleteById(id);
+        return ResponseEntity.ok(s);
+    }
+
+
+    /**
+     * 管理员修改
+     */
+    @ApiOperation(value = "管理员修改")
+    @PostMapping(value = "/adminEditForm")
+    public ResponseEntity adminEditForm(@RequestBody EvectionDTO evectionDTO){
+        evectionService.adminEditForm(evectionDTO);
+        return ResponseEntity.ok("操作成功");
+    }
+
+
+
+}

+ 74 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/domain/Evection.java

@@ -0,0 +1,74 @@
+package com.jeeplus.business.evection.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_evection")
+public class Evection  extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关联项目id
+     */
+    private String projectId;
+
+    /**
+     * 出差人员id
+     */
+    private String evectionMen;
+
+    /**
+     * 出差起使时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 出差截至时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 出差原因
+     */
+    private String evectionReason;
+
+    /**
+     * 目的地
+     */
+    private String targetCity;
+
+
+}

+ 34 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/mapper/EvectionMapper.java

@@ -0,0 +1,34 @@
+package com.jeeplus.business.evection.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.evection.domain.Evection;
+import com.jeeplus.business.evection.service.dto.EvectionDTO;
+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 EvectionMapper extends BaseMapper<Evection> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<EvectionDTO> findPageList(@Param(Constants.WRAPPER) QueryWrapper<EvectionDTO> queryWrapper, Page<EvectionDTO> page);
+
+    List<WorkAttachmentInfo> findList(@Param("id")String id);
+
+    Integer findIsExit(@Param("id")String id, @Param("name")String name);
+
+    List<WorkAttachmentInfo> findDtos(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    EvectionDTO findById(@Param("id") String id);
+
+    void updateStatusById(@Param("id") String id, @Param("status") String status);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void updateInfoById(@Param("evection") Evection evection);
+}

+ 122 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/mapper/xml/EvectionMapper.xml

@@ -0,0 +1,122 @@
+<?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.evection.mapper.EvectionMapper">
+
+    <select id="findPageList" resultType="com.jeeplus.business.evection.service.dto.EvectionDTO">
+        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_evection where id=a.id))) as projectName,
+            a.evection_men,
+            (select group_concat(name) from sys_user su where FIND_IN_SET(su.id,(select evection_men from jy_evection where id=a.id))) as userName,
+            a.start_time,
+            a.end_time,
+            a.remarks,
+            a.target_city,
+            a.status,
+            a.proc_ins_id,
+            a.evection_reason,
+            a.process_definition_id,
+            so.name as createOffice,
+            art1.ID_ as task_id,
+            b.name as cityName,
+            so.name as officeName
+        from
+            jy_evection 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 sys_area b ON a.target_city = b.`code`
+        LEFT JOIN act_ru_task art1 ON a.proc_ins_id = art1.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="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>
+
+    <select id="findById" resultType="com.jeeplus.business.evection.service.dto.EvectionDTO">
+        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_evection where id=a.id))) as projectName,
+            a.evection_men,
+            (select group_concat(name) from sys_user su where FIND_IN_SET(su.id,(select evection_men from jy_evection where id=a.id))) as userName,
+            a.start_time,
+            a.end_time,
+            a.remarks,
+            a.target_city,
+            a.status,
+            a.proc_ins_id,
+            a.evection_reason,
+            a.process_definition_id,
+            so.name as createOffice,
+            art1.ID_ as task_id,
+            so.name as officeName
+        from
+            jy_evection 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_
+         where a.id=#{id}
+    </select>
+
+    <update id="updateStatusById">
+        update jy_evection set status = #{status} where id=#{id}
+    </update>
+
+    <update id="updateInfoById">
+        UPDATE
+            jy_evection
+        SET
+            update_by_id =#{evection.updateById},
+            update_time = #{evection.updateTime},
+            project_id = #{evection.projectId},
+            evection_men = #{evection.evectionMen},
+            start_time = #{evection.startTime},
+            end_time = #{evection.endTime},
+            evection_reason = #{evection.evectionReason},
+            target_city = #{evection.targetCity},
+            remarks = #{evection.remarks}
+        WHERE id = #{evection.id}
+    </update>
+
+
+</mapper>

+ 340 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/service/EvectionService.java

@@ -0,0 +1,340 @@
+package com.jeeplus.business.evection.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.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.DriveApply;
+import com.jeeplus.business.drive.service.dto.DriveApplyDTO;
+import com.jeeplus.business.evection.domain.Evection;
+import com.jeeplus.business.evection.mapper.EvectionMapper;
+import com.jeeplus.business.evection.service.dto.EvectionDTO;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.mapper.JyProjectMapper;
+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 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 EvectionService {
+
+    @Resource
+    private EvectionMapper evectionMapper;
+
+    @Resource
+    private JyProjectMapper jyProjectMapper;
+
+    /**
+     * 出差申请列表
+     * @param evectionDTO
+     * @param page
+     * @return
+     */
+    public IPage<EvectionDTO> findPageList(EvectionDTO evectionDTO, Page<EvectionDTO> page) throws Exception {
+        QueryWrapper<EvectionDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(evectionDTO, EvectionDTO.class);
+        queryWrapper.eq("a.del_flag",0);
+        //关联项目
+        if (StringUtils.isNotBlank(evectionDTO.getProjectId())){
+            queryWrapper.like("a.project_id",evectionDTO.getProjectId());
+        }
+        //出差人员
+        if (StringUtils.isNotBlank(evectionDTO.getEvectionMen())){
+            queryWrapper.like("a.evection_men",evectionDTO.getEvectionMen());
+        }
+        //申请人
+        if (StringUtils.isNotBlank(evectionDTO.getCreateById())){
+            queryWrapper.eq("a.create_by_id",evectionDTO.getCreateById());
+        }
+        //申请人部门
+        if (StringUtils.isNotBlank(evectionDTO.getOfficeId())){
+            queryWrapper.eq("so.id",evectionDTO.getOfficeId());
+        }
+        //目的地
+        if (StringUtils.isNotBlank(evectionDTO.getTargetCity())){
+            queryWrapper.eq("a.target_city",evectionDTO.getTargetCity());
+        }
+        //申请时间
+        if (evectionDTO.getCreateDates() != null && evectionDTO.getCreateDates().length > 0) {
+            queryWrapper.between("a.create_time", evectionDTO.getCreateDates()[0], evectionDTO.getCreateDates()[1]);
+        }
+        IPage<EvectionDTO> iPage=evectionMapper.findPageList(queryWrapper,page);
+        return iPage;
+
+    }
+
+    /**
+     * 新增或修改
+     * @param evectionDTO
+     * @return
+     */
+    public String save(EvectionDTO evectionDTO) {
+        if (StringUtils.isNotEmpty(evectionDTO.getId())) {
+            return update(evectionDTO);
+        }
+        return add(evectionDTO);
+    }
+
+    //修改
+    private String update(EvectionDTO evectionDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改项目信息
+        String project="";
+        Evection evection = new Evection();
+
+        BeanUtils.copyProperties(evectionDTO,evection);
+
+        evection.setUpdateById(userDTO.getId());
+        evection.setUpdateTime(new Date());
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(evectionDTO.getProjectList())){
+            for (JyProject jyProject : evectionDTO.getProjectList()) {
+                project+=jyProject.getProjectId()+",";
+            }
+            evection.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        evectionMapper.updateById(evection);
+        //修改附件
+        List<WorkAttachmentInfo> files = evectionDTO.getFiles();
+        updateFiles(files, userDTO, evectionDTO.getId());
+        return evectionDTO.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 = evectionMapper.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 = evectionMapper.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("evection");
+                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(EvectionDTO evectionDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        Evection evection = new Evection();
+        String project="";
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(evectionDTO.getProjectList())){
+            for (JyProject jyProject : evectionDTO.getProjectList()) {
+                project+=jyProject.getProjectId()+",";
+            }
+            evection.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        //id
+        String id = UUID.randomUUID().toString().replace("-", "");
+
+        evection.setId(id);
+        evection.setCreateById(userDTO.getId());
+        evection.setCreateTime(new Date());
+        evection.setUpdateById(userDTO.getId());
+        evection.setUpdateTime(new Date());
+        evection.setStartTime(evectionDTO.getStartTime());//开始时间
+        evection.setEndTime(evectionDTO.getEndTime());//结束时间
+        evection.setEvectionMen(evectionDTO.getEvectionMen());//用车人员
+        evection.setEvectionReason(evectionDTO.getEvectionReason());//用车原因
+        evection.setRemarks(evectionDTO.getRemarks());//备注
+        evection.setStatus(evectionDTO.getStatus());//状态
+        evection.setTargetCity(evectionDTO.getTargetCity());//目的地
+        evectionMapper.insert(evection);
+        //保存附件
+        List<WorkAttachmentInfo> files = evectionDTO.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("evection");
+            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 EvectionDTO findById(String id) {
+        EvectionDTO evectionDTO = new EvectionDTO();
+        EvectionDTO dto=evectionMapper.findById(id);
+        BeanUtils.copyProperties(dto, evectionDTO);
+        if (ObjectUtil.isNotEmpty(dto)){
+            //查询项目信息
+            if (StringUtils.isNotBlank(dto.getProjectId())){
+                String[] split = dto.getProjectId().split(",");
+                ArrayList<JyProject> projects = new ArrayList<>();
+                for (String s : split) {
+                    JyProject jyProject=jyProjectMapper.getById(s);
+                    projects.add(jyProject);
+                }
+                evectionDTO.setProjectList(projects);
+            }
+            //设置出差起使时间
+            if (ObjectUtil.isNotEmpty(dto.getStartTime()) && ObjectUtil.isNotEmpty(dto.getEndTime())){
+                Date[] dates = new Date[2];
+                dates[0]=dto.getStartTime();
+                dates[1]=dto.getEndTime();
+                evectionDTO.setUseDate(dates);
+            }
+            // 查询附件信息
+            List<WorkAttachmentInfo> files = evectionMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+                evectionDTO.setFiles(files);
+            }
+        }
+        return evectionDTO;
+    }
+
+    /**
+     * 根据id修改状态
+     * @param evectionDTO
+     */
+    public void updateStatusById(EvectionDTO evectionDTO) {
+        evectionMapper.updateStatusById(evectionDTO.getId(),evectionDTO.getStatus());
+    }
+
+    /**
+     * 根据id进行删除
+     * @param id
+     * @return
+     */
+    public String deleteById(String id) {
+        evectionMapper.deleteById(id);
+        return "操作成功";
+    }
+
+
+    /**
+     * 管理员修改信息
+     * @param evectionDTO
+     */
+    public void adminEditForm(EvectionDTO evectionDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改项目信息
+        String project="";
+        Evection evection = new Evection();
+        evection.setUpdateById(userDTO.getId());
+        evection.setUpdateTime(new Date());
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(evectionDTO.getProjectList())){
+            for (JyProject jyProject : evectionDTO.getProjectList()) {
+                project+=jyProject.getId()+",";
+            }
+            evection.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        evection.setStartTime(evectionDTO.getStartTime());
+        evection.setEndTime(evectionDTO.getEndTime());
+        evection.setEvectionMen(evectionDTO.getEvectionMen());
+        evection.setEvectionReason(evectionDTO.getEvectionReason());
+        evection.setRemarks(evectionDTO.getRemarks());
+        evection.setTargetCity(evectionDTO.getTargetCity());
+        evection.setId(evectionDTO.getId());
+        evectionMapper.updateInfoById(evection);
+        //修改申请附件
+        List<WorkAttachmentInfo> files = evectionDTO.getFiles();
+        updateFiles(files, userDTO, evectionDTO.getId());
+    }
+}

+ 102 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/evection/service/dto/EvectionDTO.java

@@ -0,0 +1,102 @@
+package com.jeeplus.business.evection.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.domain.BaseEntity;
+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 EvectionDTO extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关联项目id
+     */
+    private String projectId;
+    private String projectName;
+
+    /**
+     * 出差人员id
+     */
+    private String evectionMen;
+    private String userName;
+
+    /**
+     * 出差起使时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 出差截至时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 备注
+     */
+    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 evectionReason;
+
+    private List<JyProject> projectList;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date[] useDate;
+
+    /**
+     * 目的地
+     */
+    private String targetCity;
+    private String cityName;
+
+    /*
+    申请时间
+     */
+    private String[] createDates;
+
+    private List<WorkAttachmentInfo> files;
+}

+ 92 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/controller/GoOutController.java

@@ -0,0 +1,92 @@
+package com.jeeplus.business.goOut.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.goOut.service.GoOutService;
+import com.jeeplus.business.goOut.service.dto.GoOutDTO;
+import com.jeeplus.common.utils.ResponseUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Slf4j
+@Api(tags ="外出申请")
+@RestController
+@RequestMapping(value = "/goOut")
+public class GoOutController {
+
+    @Resource
+    private GoOutService goOutService;
+
+
+
+    /**
+     * 出差申请列表
+     */
+    @ApiOperation(value = "出差申请列表")
+    @GetMapping(value = "/goOutList")
+    public ResponseEntity<IPage<GoOutDTO>> applyList(GoOutDTO goOutDTO, Page<GoOutDTO> page) throws Exception {
+        IPage<GoOutDTO> pageList=goOutService.findPageList(goOutDTO,page);
+        return ResponseEntity.ok(pageList);
+    }
+
+
+    /**
+     * 新增/修改
+     */
+    @ApiOperation(value = "新增或修改")
+    @PostMapping(value = "/saveForm")
+    public ResponseEntity saveForm(@RequestBody GoOutDTO goOutDTO){
+        String id=goOutService.save(goOutDTO);
+        return ResponseUtil.newInstance().add("businessTable","jy_go_out").add("businessId",id).ok("操作成功");
+    }
+
+
+    /**
+     * 根据id查找用车申请信息
+     */
+    @ApiOperation(value = "根据id查找用车申请")
+    @GetMapping(value = "findById")
+    public ResponseEntity<GoOutDTO> findById(@RequestParam String id){
+        GoOutDTO goOutDTO=goOutService.findById(id);
+        return ResponseEntity.ok(goOutDTO);
+    }
+
+    /**
+     * 根据id修改状态status
+     * @param
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "/updateStatusById")
+    public void updateStatusById(@RequestBody GoOutDTO goOutDTO) {
+        goOutService.updateStatusById(goOutDTO);
+    }
+
+    /**
+     * 根据id进行删除
+     */
+    @ApiOperation(value = "根据id进行删除")
+    @DeleteMapping(value = "/delete")
+    public ResponseEntity<String> deleteById(@RequestParam String id){
+        String s = goOutService.deleteById(id);
+        return ResponseEntity.ok(s);
+    }
+
+
+    /**
+     * 管理员修改
+     */
+    @ApiOperation(value = "管理员修改")
+    @PostMapping(value = "/adminEditForm")
+    public ResponseEntity adminEditForm(@RequestBody GoOutDTO goOutDTO){
+        goOutService.adminEditForm(goOutDTO);
+        return ResponseEntity.ok("操作成功");
+    }
+
+
+
+}

+ 71 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/domain/GoOut.java

@@ -0,0 +1,71 @@
+package com.jeeplus.business.goOut.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_go_out")
+public class GoOut extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关联项目id
+     */
+    private String projectId;
+
+    /**
+     * 出差人员id
+     */
+    private String OutMen;
+
+    /**
+     * 出差起使时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 出差截至时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 出差原因
+     */
+    private String outReason;
+
+    /**
+     * 目的地
+     */
+    private String targetCity;
+}

+ 34 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/mapper/GoOutMapper.java

@@ -0,0 +1,34 @@
+package com.jeeplus.business.goOut.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.goOut.domain.GoOut;
+import com.jeeplus.business.goOut.service.dto.GoOutDTO;
+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 GoOutMapper extends BaseMapper<GoOut> {
+    @InterceptorIgnore(tenantLine = "true")
+    IPage<GoOutDTO> findPageList(@Param(Constants.WRAPPER) QueryWrapper<GoOutDTO> queryWrapper, Page<GoOutDTO> page);
+
+    List<WorkAttachmentInfo> findList(@Param("id")String id);
+
+    Integer findIsExit(@Param("id")String id, @Param("name")String name);
+
+    List<WorkAttachmentInfo> findDtos(@Param("id") String id);
+    @InterceptorIgnore(tenantLine = "true")
+    GoOutDTO findById(@Param("id") String id);
+
+    void updateStatusById(@Param("id") String id, @Param("status") String status);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void updateInfoById(@Param("goOut") GoOut goOut);
+}

+ 122 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/mapper/xml/GoOutMapper.xml

@@ -0,0 +1,122 @@
+<?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.goOut.mapper.GoOutMapper">
+
+    <select id="findPageList" resultType="com.jeeplus.business.goOut.service.dto.GoOutDTO">
+        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_go_out where id=a.id))) as projectName,
+            a.out_men,
+            (select group_concat(name) from sys_user su where FIND_IN_SET(su.id,(select out_men from jy_go_out where id=a.id))) as userName,
+            a.start_time,
+            a.end_time,
+            a.remarks,
+            a.target_city,
+            a.status,
+            a.proc_ins_id,
+            a.out_reason,
+            a.process_definition_id,
+            so.name as createOffice,
+            art1.ID_ as task_id,
+            b.name as cityName,
+            so.name as officeName
+        from
+            jy_go_out 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 sys_area b ON a.target_city = b.`code`
+        LEFT JOIN act_ru_task art1 ON a.proc_ins_id = art1.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="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>
+
+    <select id="findById" resultType="com.jeeplus.business.goOut.service.dto.GoOutDTO">
+        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_go_out where id=a.id))) as projectName,
+            a.out_men,
+            (select group_concat(name) from sys_user su where FIND_IN_SET(su.id,(select out_men from jy_go_out where id=a.id))) as userName,
+            a.start_time,
+            a.end_time,
+            a.remarks,
+            a.target_city,
+            a.status,
+            a.proc_ins_id,
+            a.out_reason,
+            a.process_definition_id,
+            so.name as createOffice,
+            art1.ID_ as task_id,
+            so.name as officeName
+        from
+            jy_go_out 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_
+         where a.id=#{id}
+    </select>
+
+    <update id="updateStatusById">
+        update jy_go_out set status = #{status} where id=#{id}
+    </update>
+
+    <update id="updateInfoById">
+        UPDATE
+            jy_go_out
+        SET
+            update_by_id =#{goOut.updateById},
+            update_time = #{goOut.updateTime},
+            project_id = #{goOut.projectId},
+            out_men = #{goOut.OutMen},
+            start_time = #{goOut.startTime},
+            end_time = #{goOut.endTime},
+            out_reason = #{goOut.outReason},
+            target_city = #{goOut.targetCity},
+            remarks = #{goOut.remarks}
+        WHERE id = #{goOut.id}
+    </update>
+
+
+</mapper>

+ 339 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/service/GoOutService.java

@@ -0,0 +1,339 @@
+package com.jeeplus.business.goOut.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.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.goOut.domain.GoOut;
+import com.jeeplus.business.goOut.mapper.GoOutMapper;
+import com.jeeplus.business.goOut.service.dto.GoOutDTO;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.mapper.JyProjectMapper;
+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 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 GoOutService {
+
+    @Resource
+    private GoOutMapper goOutMapper;
+
+    @Resource
+    private JyProjectMapper jyProjectMapper;
+
+    /**
+     * 出差申请列表
+     * @param goOutDTO
+     * @param page
+     * @return
+     */
+    public IPage<GoOutDTO> findPageList(GoOutDTO goOutDTO, Page<GoOutDTO> page) throws Exception {
+        QueryWrapper<GoOutDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(goOutDTO, GoOutDTO.class);
+        queryWrapper.eq("a.del_flag",0);
+        //关联项目
+        if (StringUtils.isNotBlank(goOutDTO.getProjectId())){
+            queryWrapper.like("a.project_id",goOutDTO.getProjectId());
+        }
+        //出差人员
+        if (StringUtils.isNotBlank(goOutDTO.getOutMen())){
+            queryWrapper.like("a.out_men",goOutDTO.getOutMen());
+        }
+        //申请人
+        if (StringUtils.isNotBlank(goOutDTO.getCreateById())){
+            queryWrapper.eq("a.create_by_id",goOutDTO.getCreateById());
+        }
+        //申请人部门
+        if (StringUtils.isNotBlank(goOutDTO.getOfficeId())){
+            queryWrapper.eq("so.id",goOutDTO.getOfficeId());
+        }
+        //目的地
+        if (StringUtils.isNotBlank(goOutDTO.getTargetCity())){
+            queryWrapper.eq("a.target_city",goOutDTO.getTargetCity());
+        }
+        //申请时间
+        if (goOutDTO.getCreateDates() != null && goOutDTO.getCreateDates().length > 0) {
+            queryWrapper.between("a.create_time", goOutDTO.getCreateDates()[0], goOutDTO.getCreateDates()[1]);
+        }
+        IPage<GoOutDTO> iPage=goOutMapper.findPageList(queryWrapper,page);
+        return iPage;
+
+    }
+
+    /**
+     * 新增或修改
+     * @param goOutDTO
+     * @return
+     */
+    public String save(GoOutDTO goOutDTO) {
+        if (StringUtils.isNotEmpty(goOutDTO.getId())) {
+            return update(goOutDTO);
+        }
+        return add(goOutDTO);
+    }
+
+    //修改
+    private String update(GoOutDTO goOutDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改项目信息
+        String project="";
+        GoOut goOut = new GoOut();
+
+        BeanUtils.copyProperties(goOutDTO,goOut);
+
+        goOut.setUpdateById(userDTO.getId());
+        goOut.setUpdateTime(new Date());
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(goOutDTO.getProjectList())){
+            for (JyProject jyProject : goOutDTO.getProjectList()) {
+                project+=jyProject.getProjectId()+",";
+            }
+            goOut.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        goOutMapper.updateById(goOut);
+        //修改附件
+        List<WorkAttachmentInfo> files = goOutDTO.getFiles();
+        updateFiles(files, userDTO, goOutDTO.getId());
+        return goOutDTO.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 = goOutMapper.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 = goOutMapper.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("goOut");
+                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(GoOutDTO goOutDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        GoOut goOut = new GoOut();
+        String project="";
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(goOutDTO.getProjectList())){
+            for (JyProject jyProject : goOutDTO.getProjectList()) {
+                project+=jyProject.getProjectId()+",";
+            }
+            goOut.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        //id
+        String id = UUID.randomUUID().toString().replace("-", "");
+
+        goOut.setId(id);
+        goOut.setCreateById(userDTO.getId());
+        goOut.setCreateTime(new Date());
+        goOut.setUpdateById(userDTO.getId());
+        goOut.setUpdateTime(new Date());
+        goOut.setStartTime(goOutDTO.getStartTime());//开始时间
+        goOut.setEndTime(goOutDTO.getEndTime());//结束时间
+        goOut.setOutMen(goOutDTO.getOutMen());//用车人员
+        goOut.setOutReason(goOutDTO.getOutReason());//用车原因
+        goOut.setRemarks(goOutDTO.getRemarks());//备注
+        goOut.setStatus(goOutDTO.getStatus());//状态
+        goOut.setTargetCity(goOutDTO.getTargetCity());//目的地
+        goOutMapper.insert(goOut);
+        //保存附件
+        List<WorkAttachmentInfo> files = goOutDTO.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("goOut");
+            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 GoOutDTO findById(String id) {
+        GoOutDTO goOutDTO = new GoOutDTO();
+        GoOutDTO dto=goOutMapper.findById(id);
+        BeanUtils.copyProperties(dto, goOutDTO);
+        if (ObjectUtil.isNotEmpty(dto)){
+            //查询项目信息
+            if (StringUtils.isNotBlank(dto.getProjectId())){
+                String[] split = dto.getProjectId().split(",");
+                ArrayList<JyProject> projects = new ArrayList<>();
+                for (String s : split) {
+                    JyProject jyProject=jyProjectMapper.getById(s);
+                    projects.add(jyProject);
+                }
+                goOutDTO.setProjectList(projects);
+            }
+            //设置出差起使时间
+            if (ObjectUtil.isNotEmpty(dto.getStartTime()) && ObjectUtil.isNotEmpty(dto.getEndTime())){
+                Date[] dates = new Date[2];
+                dates[0]=dto.getStartTime();
+                dates[1]=dto.getEndTime();
+                goOutDTO.setUseDate(dates);
+            }
+            // 查询附件信息
+            List<WorkAttachmentInfo> files = goOutMapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(files)) {
+                for (WorkAttachmentInfo i : files) {
+                    i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
+                }
+                goOutDTO.setFiles(files);
+            }
+        }
+        return goOutDTO;
+    }
+
+    /**
+     * 根据id修改状态
+     * @param goOutDTO
+     */
+    public void updateStatusById(GoOutDTO goOutDTO) {
+        goOutMapper.updateStatusById(goOutDTO.getId(),goOutDTO.getStatus());
+    }
+
+    /**
+     * 根据id进行删除
+     * @param id
+     * @return
+     */
+    public String deleteById(String id) {
+        goOutMapper.deleteById(id);
+        return "操作成功";
+    }
+
+
+    /**
+     * 管理员修改信息
+     * @param goOutDTO
+     */
+    public void adminEditForm(GoOutDTO goOutDTO) {
+        //获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        //修改项目信息
+        String project="";
+        GoOut goOut = new GoOut();
+
+        goOut.setUpdateById(userDTO.getId());
+        goOut.setUpdateTime(new Date());
+        //处理关联项目项目
+        if (ObjectUtil.isNotEmpty(goOutDTO.getProjectList())){
+            for (JyProject jyProject : goOutDTO.getProjectList()) {
+                project+=jyProject.getId()+",";
+            }
+            goOut.setProjectId(project.substring(0,project.lastIndexOf(",")));
+        }
+        goOut.setStartTime(goOutDTO.getStartTime());
+        goOut.setEndTime(goOutDTO.getEndTime());
+        goOut.setOutMen(goOutDTO.getOutMen());
+        goOut.setOutReason(goOutDTO.getOutReason());
+        goOut.setRemarks(goOutDTO.getRemarks());
+        goOut.setTargetCity(goOutDTO.getTargetCity());
+        goOut.setId(goOutDTO.getId());
+        goOutMapper.updateInfoById(goOut);
+        //修改申请附件
+        List<WorkAttachmentInfo> files = goOutDTO.getFiles();
+        updateFiles(files, userDTO, goOutDTO.getId());
+    }
+}

+ 102 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/goOut/service/dto/GoOutDTO.java

@@ -0,0 +1,102 @@
+package com.jeeplus.business.goOut.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.domain.BaseEntity;
+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 GoOutDTO extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 关联项目id
+     */
+    private String projectId;
+    private String projectName;
+
+    /**
+     * 出差人员id
+     */
+    private String outMen;
+    private String userName;
+
+    /**
+     * 出差起使时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 出差截至时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 备注
+     */
+    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 outReason;
+
+    private List<JyProject> projectList;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date[] useDate;
+
+    /**
+     * 目的地
+     */
+    private String targetCity;
+    private String cityName;
+
+    /*
+    申请时间
+     */
+    private String[] createDates;
+
+    private List<WorkAttachmentInfo> files;
+}