From 52dd054eabe9800ea5a4a5933c67cacd86d130ba Mon Sep 17 00:00:00 2001
From: yangman <15045099937@qq.com>
Date: 星期四, 06 七月 2023 15:03:25 +0800
Subject: [PATCH] 假期管理基础

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcVacationManagementMappper.java           |   24 ++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcVacationManagementService.java         |   62 ++++++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcTorqueConfigService.java               |    2 
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcVacationManagementMapper.xml         |   20 ++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcVacationManagementController.java    |  155 +++++++++++++++++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcTorqueConfigVo.java                          |    6 
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcVacationManagementServiceImpl.java |   98 ++++++++++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcVacationManagement.java                  |  123 +++++++++++++
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcTorqueConfigServiceImpl.java       |   11 
 9 files changed, 486 insertions(+), 15 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcVacationManagementController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcVacationManagementController.java
new file mode 100644
index 0000000..77413c3
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcVacationManagementController.java
@@ -0,0 +1,155 @@
+package org.jeecg.modules.mdc.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.mdc.entity.MdcVacationManagement;
+import org.jeecg.modules.mdc.service.IMdcVacationManagementService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @Description: 鍋囨湡绠$悊
+ * @Author: ym
+ * @Date: 2023-07-05
+ */
+@Slf4j
+@RestController
+@Api(tags = "鍋囨湡绠$悊")
+@RequestMapping("/mdc/MdcVacationManagement")
+public class MdcVacationManagementController extends JeecgController<MdcVacationManagement, IMdcVacationManagementService> {
+
+    @Resource
+    private IMdcVacationManagementService mdcVacationManagementService;
+
+    /**
+     * 鏍规嵁id鏌ヨ
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "鍋囨湡绠$悊-鏍规嵁id鏌ヨ")
+    @ApiOperation(value = "鍋囨湡绠$悊-鏍规嵁id鏌ヨ", notes = "鍋囨湡绠$悊-鏍规嵁id鏌ヨ")
+    @GetMapping("/queryById")
+    public Result<?> queryById(@RequestParam(required = true, name = "id") String id) {
+        MdcVacationManagement mdcVacationManagement = mdcVacationManagementService.queryById(id);
+        //鏌ヨ涓嶄负绌哄垯杩斿洖鏁版嵁
+        return null != mdcVacationManagement ? Result.OK(mdcVacationManagement) : Result.error("鏈壘鍒板搴旀暟鎹�");
+    }
+
+    /**
+     * 鏂板
+     *
+     * @param mdcVacationManagement
+     * @return
+     */
+    @AutoLog(value = "鍋囨湡绠$悊-鏂板")
+    @ApiOperation(value = "鍋囨湡绠$悊-鏂板", notes = "鍋囨湡绠$悊-鏂板")
+    @PostMapping("/addVacation")
+    public Result<?> addVacation(@RequestBody MdcVacationManagement mdcVacationManagement) {
+        boolean flag = mdcVacationManagementService.addVacation(mdcVacationManagement);
+        return flag ? Result.ok("鏂板鎴愬姛") : Result.error("鏂板澶辫触");
+    }
+
+    /**
+     * 淇敼
+     *
+     * @param mdcVacationManagement
+     * @return
+     */
+    @AutoLog(value = "鍋囨湡绠$悊-淇敼")
+    @ApiOperation(value = "鍋囨湡绠$悊-淇敼", notes = "鍋囨湡绠$悊-淇敼")
+    @PutMapping("/editVacation")
+    public Result<?> editVacation(@RequestBody MdcVacationManagement mdcVacationManagement) {
+        boolean flag = mdcVacationManagementService.editVacation(mdcVacationManagement);
+        return flag ? Result.ok("淇敼鎴愬姛") : Result.error("淇敼澶辫触");
+    }
+
+    /**
+     * 鏍规嵁id鍒犻櫎鍋囨湡绠$悊
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "鍋囨湡绠$悊-鏍规嵁id鍒犻櫎")
+    @ApiOperation(value = "鍋囨湡绠$悊-鏍规嵁id鍒犻櫎", notes = "鍋囨湡绠$悊-鏍规嵁id鍒犻櫎")
+    @DeleteMapping("/deleteVacation")
+    public Result<?> deleteVacation(@RequestParam(required = true, name = "id") String id) {
+        boolean flag = mdcVacationManagementService.deleteVacation(id);
+        return flag ? Result.ok("鍒犻櫎鎴愬姛") : Result.error("鍒犻櫎澶辫触");
+    }
+
+    /**
+     * 鎵归噺鍒犻櫎
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "鍋囨湡绠$悊-鎵归噺鍒犻櫎")
+    @ApiOperation(value = "鍋囨湡绠$悊-鎵归噺鍒犻櫎", notes = "鍋囨湡绠$悊-鎵归噺鍒犻櫎")
+    @DeleteMapping("/deleteBatchVacation")
+    public Result<?> deleteBatchVacation(@RequestParam(required = true, name = "ids") String ids) {
+        boolean flag = mdcVacationManagementService.deleteBatchVacation(ids);
+        return flag ? Result.ok("鎵归噺鍒犻櫎鎴愬姛") : Result.error("鎵归噺鍒犻櫎澶辫触");
+    }
+
+    /**
+     * 瀵煎嚭excel
+     *
+     * @param request
+     * @param mdcVacationManagement
+     * @return
+     */
+    @RequestMapping("/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, MdcVacationManagement mdcVacationManagement) {
+        return super.exportXls(request, mdcVacationManagement, MdcVacationManagement.class, "鍋囨湡绠$悊瀵煎嚭");
+    }
+
+    /**
+     * 瀵煎叆excel
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping("/importExcel")
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, MdcVacationManagement.class);
+    }
+
+    /**
+     * 鍒嗛〉鏌ヨ
+     * @param mdcVacationManagement
+     * @param pageNo
+     * @param pageSize
+     * @param request
+     * @return
+     */
+    @AutoLog(value = "鍋囨湡绠$悊-鍒嗛〉鏌ヨ")
+    @ApiOperation(value = "鍋囨湡绠$悊-鍒嗛〉鏌ヨ",notes = "鍋囨湡绠$悊-鍒嗛〉鏌ヨ")
+    @GetMapping("/pageList")
+    public Result<?> pageList(MdcVacationManagement mdcVacationManagement,
+                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                              HttpServletRequest request) {
+        if (mdcVacationManagement == null) {
+            return Result.error("璇蜂紶閫掓湁鏁堝弬鏁�");
+        }
+        LoginUser user=(LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId= user.getId();
+        Page page=new Page(pageNo,pageSize);
+        IPage<MdcVacationManagement> mdcVacationManagementIPage= mdcVacationManagementService.pageList(userId,page,request,mdcVacationManagement);
+        return Result.ok(mdcVacationManagementIPage);
+    }
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcVacationManagement.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcVacationManagement.java
new file mode 100644
index 0000000..689408d
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcVacationManagement.java
@@ -0,0 +1,123 @@
+package org.jeecg.modules.mdc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description: 鍋囨湡绠$悊
+ * @Author: ym
+ * @Date: 2023-07-04
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@TableName("mdc_vacation_management")
+@ApiModel(value = "mdc_vacation_management瀵硅薄",description = "鍋囨湡绠$悊")
+public class MdcVacationManagement implements Serializable {
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 涓婚敭
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty("涓婚敭")
+    private String id;
+
+    /**
+     * 璁惧缂栧彿
+     */
+    @Excel(name = "璁惧缂栧彿",width = 15)
+    @ApiModelProperty("璁惧缂栧彿")
+    private String equipmentId;
+
+    /**
+     * 璁惧缂栧彿
+     */
+    @Excel(name = "璁惧鍚嶇О",width = 15)
+    @ApiModelProperty("璁惧鍚嶇О")
+    private String equipmentName;
+
+    /**
+     * 鏃ユ湡
+     */
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "鏃ユ湡")
+    private Date vacationDate;
+
+    /**
+     * 绫诲瀷
+     */
+    @Excel(name = "绫诲瀷",width = 15)
+    @ApiModelProperty("绫诲瀷")
+    private String type;
+
+    /**
+     * 澶囨敞
+     */
+    @Excel(name = "澶囨敞",width = 15)
+    @ApiModelProperty("澶囨敞")
+    private String notes;
+
+    /**
+     * 鍒涘缓鏃堕棿
+     */
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("鍒涘缓鏃堕棿")
+    private Date createTime;
+
+    /**
+     * 鍒涘缓浜�
+     */
+    @Excel(name = "鍒涘缓浜�",width = 15)
+    @ApiModelProperty("鍒涘缓浜�")
+    private String createBy;
+
+    /**
+     * 鏇存柊鏃堕棿
+     */
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("鏇存柊鏃堕棿")
+    private Date updateTime;
+
+    /**
+     * 鏇存柊浜�
+     */
+    @Excel(name = "鏇存柊浜�",width = 15)
+    @ApiModelProperty("鏇存柊浜�")
+    private String updateBy;
+
+    /**
+     * 鍓嶅彴浼犲叆锛屽垽鏂瘡涓猧d
+     */
+    @TableField(exist = false)
+    private String parentId;
+
+    /**
+     * 鍓嶅彴浼犲叆 杞﹂棿灞傜骇锛�1锛岄儴闂ㄥ眰绾э細2
+     */
+    @TableField(exist = false)
+    private String typeTree;
+
+    /**
+     * 閮ㄩ棬parentId,鍏宠仈瀛愰泦id
+     */
+    @TableField(exist = false)
+    private List<String> mdcSectionIds;
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcVacationManagementMappper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcVacationManagementMappper.java
new file mode 100644
index 0000000..04e5894
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcVacationManagementMappper.java
@@ -0,0 +1,24 @@
+package org.jeecg.modules.mdc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.mdc.entity.MdcVacationManagement;
+
+/**
+ * @Description: 鍋囨湡绠$悊
+ * @Author: ym
+ * @Date: 2023-07-04
+ */
+@Mapper
+public interface MdcVacationManagementMappper extends BaseMapper<MdcVacationManagement> {
+
+    /**
+     * 鍒嗛〉鏌ヨ
+     * @param pageData
+     * @param vacation
+     * @return
+     */
+    IPage<MdcVacationManagement> pageList(IPage<MdcVacationManagement> pageData, @Param("vacation") MdcVacationManagement vacation);
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcVacationManagementMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcVacationManagementMapper.xml
new file mode 100644
index 0000000..82fab0e
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcVacationManagementMapper.xml
@@ -0,0 +1,20 @@
+<?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="org.jeecg.modules.mdc.mapper.MdcVacationManagementMappper">
+    <!--鏍规嵁杞﹂棿灞傜骇鏌ヨ鍋囨湡鍒楄〃-->
+    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcVacationManagement">
+        select mvm.* from mdc_vacation_management mvm,mdc_equipment me where mvm.equipment_id=me.equipment_id
+        <if test="vacation.equipmentName != null and vacation.equipmentName != '' ">
+            and mvm.equipment_name like concat(concat('%',#{vacation.equipmentName}),'%')
+        </if>
+        <if test="vacation.equipmentId != null and vacation.equipmentId !='' ">
+            and mvm.equipment_id like concat(concat('%',#{vacation.equipmentId}),'%')
+        </if>
+        <if test="vacation.mdcSectionIds != null || vacation.mdcSectionIds.size() > 0 ">
+            and mvm.equipment_id in
+            <foreach collection="vacation.mdcSectionIds" item="id" index="index" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+    </select>
+</mapper>
\ No newline at end of file
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcTorqueConfigService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcTorqueConfigService.java
index 3634546..b1a440d 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcTorqueConfigService.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcTorqueConfigService.java
@@ -27,7 +27,6 @@
 
     /**
      * 娣诲姞鎵煩閰嶇疆
-     *
      * @param torqueVo
      * @return
      */
@@ -35,7 +34,6 @@
 
     /**
      * 缂栬緫鎵煩閰嶇疆
-     *
      * @param mdcTorqueConfig
      * @return
      */
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcVacationManagementService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcVacationManagementService.java
new file mode 100644
index 0000000..9e66b47
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcVacationManagementService.java
@@ -0,0 +1,62 @@
+package org.jeecg.modules.mdc.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.mdc.entity.MdcVacationManagement;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @Description: 鍋囨湡绠$悊
+ * @Author: ym
+ * @Date: 2023-07-05
+ */
+public interface IMdcVacationManagementService extends IService<MdcVacationManagement> {
+
+    /**
+     * 鏍规嵁id鏌ヨ
+     * @param id
+     * @return
+     */
+    MdcVacationManagement queryById(String id);
+
+    /**
+     * 鏂板鍋囨湡绠$悊
+     * @param mdcVacationManagement
+     * @return
+     */
+    Boolean addVacation(MdcVacationManagement mdcVacationManagement);
+
+    /**
+     * 缂栬緫鍋囨湡绠$悊
+     * @param mdcVacationManagement
+     * @return
+     */
+    Boolean editVacation(MdcVacationManagement mdcVacationManagement);
+
+    /**
+     * 鏍规嵁id鍒犻櫎
+     * @param id
+     * @return
+     */
+    Boolean deleteVacation(String id);
+
+    /**
+     * 鎵归噺鍒犻櫎
+     * @param ids
+     * @return
+     */
+    Boolean deleteBatchVacation(String ids);
+
+    /**
+     * 鍒嗛〉鏌ヨ
+     * @param userId
+     * @param page
+     * @param req
+     * @param mdcVacationManagement
+     * @return
+     */
+    IPage<MdcVacationManagement> pageList(String userId, Page page, HttpServletRequest req,MdcVacationManagement mdcVacationManagement);
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcTorqueConfigServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcTorqueConfigServiceImpl.java
index 970eb35..dc553a2 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcTorqueConfigServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcTorqueConfigServiceImpl.java
@@ -1,13 +1,10 @@
 package org.jeecg.modules.mdc.service.impl;
 
 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.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.util.StringUtil;
 import org.jeecg.modules.mdc.entity.MdcEquipment;
 import org.jeecg.modules.mdc.entity.MdcTorqueConfig;
 import org.jeecg.modules.mdc.mapper.MdcTorqueConfigMapper;
@@ -19,7 +16,6 @@
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
-import java.lang.reflect.Array;
 import java.util.*;
 
 /**
@@ -44,8 +40,6 @@
         String[] equipmentIds = torqueVo.getEquipmentIds().split(",");
         List<MdcTorqueConfig> mdcTorqueConfigList = new ArrayList<>();
         for (String equipmentId : equipmentIds) {
-            Date startTime = DateUtils.getFormatDate(torqueVo.getStartTime(), DateUtils.STR_DATE_TIME_SMALL);
-            Date endTime = DateUtils.getFormatDate(torqueVo.getEndTime(), DateUtils.STR_DATE_TIME_SMALL);
             MdcEquipment mdcEquipment = mdcEquipmentService.findEquipmentNameByEquipmentId(equipmentId);
             //鏍规嵁Id鏌ヨ姝よ澶囦俊鎭�
             LambdaQueryWrapper<MdcTorqueConfig> queryWrapper = new LambdaQueryWrapper<>();
@@ -53,10 +47,11 @@
             queryWrapper.orderByAsc(MdcTorqueConfig::getStartTime);
             List<MdcTorqueConfig> mdcTorqueConfigs = this.baseMapper.selectList(queryWrapper);
             MdcTorqueConfig mdcTorqueConfig = new MdcTorqueConfig();
-            mdcTorqueConfig.setStartTime(startTime);
-            mdcTorqueConfig.setEndTime(endTime);
             mdcTorqueConfig.setEquipmentId(equipmentId);
             mdcTorqueConfig.setEquipmentName(mdcEquipment.getEquipmentName());
+            mdcTorqueConfig.setTorqueDate(torqueVo.getTorqueDate());
+            mdcTorqueConfig.setTorqueValue(torqueVo.getTorqueValue());
+            mdcTorqueConfig.setNotes(torqueVo.getNotes());
             boolean b = super.save(mdcTorqueConfig);
             if (b) {
                 result = true;
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcVacationManagementServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcVacationManagementServiceImpl.java
new file mode 100644
index 0000000..75df63e
--- /dev/null
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcVacationManagementServiceImpl.java
@@ -0,0 +1,98 @@
+package org.jeecg.modules.mdc.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.mdc.entity.MdcVacationManagement;
+import org.jeecg.modules.mdc.mapper.MdcVacationManagementMappper;
+import org.jeecg.modules.mdc.service.IMdcEquipmentService;
+import org.jeecg.modules.mdc.service.IMdcVacationManagementService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @Description: 鍋囨湡绠$悊
+ * @Author: ym
+ * @Date: 2023-07-05
+ */
+@Service
+public class MdcVacationManagementServiceImpl extends ServiceImpl<MdcVacationManagementMappper, MdcVacationManagement> implements IMdcVacationManagementService {
+
+    @Autowired
+    private IMdcEquipmentService equipmentService;
+
+    @Override
+    public MdcVacationManagement queryById(String id) {
+        return this.getById(id);
+    }
+
+    @Override
+    public Boolean addVacation(MdcVacationManagement mdcVacationManagement) {
+        return this.save(mdcVacationManagement);
+    }
+
+    @Override
+    public Boolean editVacation(MdcVacationManagement mdcVacationManagement) {
+        return this.updateById(mdcVacationManagement);
+    }
+
+    @Override
+    public Boolean deleteVacation(String id) {
+        return this.removeById(id);
+    }
+
+    @Override
+    public Boolean deleteBatchVacation(String ids) {
+        return this.removeBatchByIds(Arrays.asList(ids.split(",")));
+    }
+
+    @Override
+    public IPage<MdcVacationManagement> pageList(String userId, Page page, HttpServletRequest req, MdcVacationManagement mdcVacationManagement) {
+        //鏄剧ず鍙屼紤鏃�
+        Date vacationDate=mdcVacationManagement.getVacationDate();
+        String type= mdcVacationManagement.getType();
+        Calendar c=Calendar.getInstance();
+        c.setTime(vacationDate);
+        int day=c.get(Calendar.DAY_OF_WEEK)-1;
+        System.out.println(day);
+        if (day==6||day==7){
+            System.out.println("鍙屼紤鏃�");
+            mdcVacationManagement.setType("鍙屼紤鏃�");
+        }
+        //鏌ヨ鐢ㄦ埛鎵�鎷ユ湁鐨勮澶囦俊鎭�
+        List<String> equipmentIds=new ArrayList<>();
+        if (StringUtils.isNotEmpty(mdcVacationManagement.getParentId()) && StringUtils.isEmpty(mdcVacationManagement.getEquipmentId())){
+            if ("2".equals(mdcVacationManagement.getTypeTree())){
+                //閮ㄩ棬灞傜骇
+                equipmentIds=equipmentService.getEquipmentIdsByDepart(userId,mdcVacationManagement.getParentId());
+            }else {
+                //浜х嚎灞傜骇
+                equipmentIds=equipmentService.getEquipmentIdsProduction(userId,mdcVacationManagement.getParentId());
+            }
+        }else if (StringUtils.isNotEmpty(mdcVacationManagement.getEquipmentId())){
+            //鍗曞彴璁惧淇℃伅
+            mdcVacationManagement.setMdcSectionIds(Collections.singletonList(mdcVacationManagement.getEquipmentId()));
+        }else {
+            //鏌ヨ鐢ㄦ埛鎵�鎷ユ湁鐨勮澶囦俊鎭�
+            if ("2".equals(mdcVacationManagement.getTypeTree())){
+                //閮ㄩ棬灞傜骇
+                equipmentIds=equipmentService.getEquipmentIdsByDepart(userId,null);
+            }else {
+                equipmentIds=equipmentService.getEquipmentIdsProduction(userId,null);
+            }
+        }
+        if (mdcVacationManagement.getMdcSectionIds() == null || mdcVacationManagement.getMdcSectionIds().isEmpty()){
+            mdcVacationManagement.setMdcSectionIds(equipmentIds);
+        }
+        if (mdcVacationManagement.getMdcSectionIds() == null || mdcVacationManagement.getMdcSectionIds().isEmpty()){
+            return null;
+        }
+        return this.baseMapper.pageList(page,mdcVacationManagement);
+    }
+}
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcTorqueConfigVo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcTorqueConfigVo.java
index 3607a0e..a85d387 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcTorqueConfigVo.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcTorqueConfigVo.java
@@ -9,11 +9,6 @@
 
 @Data
 public class MdcTorqueConfigVo {
-    private String id;
-    private String startTime;
-    /*缁撴潫鏃堕棿*/
-    private String endTime;
-    private String equipmentId;
     /*璁惧鍚嶇О*/
     private String equipmentName;
     /*璁惧缁�*/
@@ -22,4 +17,5 @@
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date torqueDate;
     private float torqueValue;
+    private String notes;
 }

--
Gitblit v1.9.3