From 5d8858a61bc55a818d84658732d9bbb06aeede2e Mon Sep 17 00:00:00 2001 From: ruanqi Date: Mon, 27 Sep 2021 18:31:18 +0800 Subject: [PATCH] =?UTF-8?q?0927=20=E9=98=AE=E7=90=A6=20=E6=97=A5=E5=8E=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gaotao/common/utils/DateUtil.java | 446 +++++++++++++ .../base/controller/BaseController.java | 366 +++++++++++ .../gaotao/modules/base/dao/BaseMapper.java | 270 ++++++++ .../modules/base/entity/BatchCDListVO.java | 33 + .../gaotao/modules/base/entity/BatchCDVO.java | 153 +++++ .../modules/base/entity/CalendarData.java | 204 ++++++ .../base/entity/CalendarDatetypeData.java | 396 ++++++++++++ .../base/entity/CalendarDatetypeOutData.java | 319 +++++++++ .../entity/CalendarDatetypeShiftData.java | 178 ++++++ .../entity/CalendarDatetypeShiftOutData.java | 158 +++++ .../base/entity/CalendarExceptionData.java | 238 +++++++ .../entity/CalendarExceptionShiftData.java | 153 +++++ .../entity/CalendarExceptionShiftInData.java | 164 +++++ .../modules/base/service/BaseService.java | 133 ++++ .../base/service/Impl/BaseServiceImpl.java | 605 ++++++++++++++++++ src/main/resources/mapper/base/BaseMapper.xml | 280 ++++++++ 16 files changed, 4096 insertions(+) create mode 100644 src/main/java/com/gaotao/common/utils/DateUtil.java create mode 100644 src/main/java/com/gaotao/modules/base/controller/BaseController.java create mode 100644 src/main/java/com/gaotao/modules/base/dao/BaseMapper.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/BatchCDListVO.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/BatchCDVO.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeOutData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftOutData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarExceptionData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftData.java create mode 100644 src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftInData.java create mode 100644 src/main/java/com/gaotao/modules/base/service/BaseService.java create mode 100644 src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java create mode 100644 src/main/resources/mapper/base/BaseMapper.xml diff --git a/src/main/java/com/gaotao/common/utils/DateUtil.java b/src/main/java/com/gaotao/common/utils/DateUtil.java new file mode 100644 index 0000000..a7602ab --- /dev/null +++ b/src/main/java/com/gaotao/common/utils/DateUtil.java @@ -0,0 +1,446 @@ +package com.gaotao.common.utils; + +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.temporal.ChronoUnit; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class DateUtil { + /** + * 将时间转为小数 + * + * @param date + * @return + */ + public static double getTimeforDoule(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); + String start = sdf.format(date); + String[] strs = start.split(":"); + int a = Integer.parseInt(strs[0]); + int b = Integer.parseInt(strs[1]); + DecimalFormat df = new DecimalFormat("0.00"); + String num = df.format((float) b / 60); + double c = Double.valueOf(num).doubleValue(); + double d = a + c; + return d; + } + + + /** + * @author LR + * @Description: 获取当前时间的年月日时分秒 + * @UpdateUser LR + * @UpdateRemark [说明本次修改内容] + */ + public static String getStringNow() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return sdf.format(new Date()); + } + + /** + * @param @param date + * @param @return 设定文件 + * @return String 返回类型 + * @throws + * @Title: getStringDate + * @author LR + * @Description: 返回String类型的yyyy-MM-dd的日期 + */ + public static String getStringDate(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + return sdf.format(date); + } + + /** + * 获取日期戳 + * + * @param date + * @return + */ + public static String getSDate(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + return sdf.format(date); + } + + /** + * 获取时间戳 + * + * @param date + * @return + */ + public static String getSTime(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("HHmmss"); + return sdf.format(date); + } + + /** + * @param @param date + * @param @param parten + * @param @return 设定文件 + * @return String 返回类型 + * @throws + * @Title: getStringDate + * @author LR + * @Description: 根据模版获取相应时间的格式 + */ + public static String getStringDate(Date date, String parten) { + SimpleDateFormat sdf = new SimpleDateFormat(parten); + return sdf.format(date); + } + + /** + * @param @return 设定文件 + * @return String 返回类型 + * @throws + * @Title: getYesterday + * @author LR + * @Description: 获取昨日的String类型的yyyy-MM-dd的日期 + */ + public static String getStringYesterday() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_MONTH, -1); + return sdf.format(cal.getTime()); + } + + /** + * @param @return 设定文件 + * @return String 返回类型 + * @throws + * @Title: getYesterday + * @author LR + * @Description: 获取明天的String类型的yyyy-MM-dd的日期 + */ + public static String getStringTomorrow() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_MONTH, +1); + return sdf.format(cal.getTime()); + } + + /** + * @throws ParseException + * @author LR + * @Description: String转换date + * @UpdateUser LR + * @UpdateRemark [说明本次修改内容] + */ + public static Date getDate(String time) throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + return sdf.parse(time); + + } + + /** + * @throws + * @author RQ + * @Description: String转换date + * @UpdateUser rq + * @UpdateRemark [说明本次修改内容] + */ + public static Date getDate2(String time) throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return sdf.parse(time); + + } + + /** + * @param @param date + * @param @return 设定文件 + * @return String 返回类型 + * @throws + * @Title: getLastMonth + * @author LR + * @Description: 获取上一个月的YYYY-MM + */ + public static String getLastMonth(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.add(Calendar.MONTH, -1); + Date lastDate = cal.getTime(); + return sdf.format(lastDate); + } + + public static Date getDateByParten(String date, String parten) + throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat(parten); + return sdf.parse(date); + } + + + /** + * 获取两个日期之间的日期 + * + * @param start 开始日期 + * @param end 结束日期 + * @return 日期集合 + */ + public static List getBetweenDates(Date start, Date end) { + List result = new ArrayList(); + Calendar tempStart = Calendar.getInstance(); + tempStart.setTime(start); + tempStart.add(Calendar.DAY_OF_YEAR, 1); + + Calendar tempEnd = Calendar.getInstance(); + tempEnd.setTime(end); + while (tempStart.before(tempEnd)) { + result.add(tempStart.getTime()); + tempStart.add(Calendar.DAY_OF_YEAR, 1); + } + return result; + } + + /** + * 获取两个日期之间的日期(包含) + * + * @param start 开始日期 + * @param end 结束日期 + * @return 日期集合 + */ + public static List collectLocalDates(LocalDate start, LocalDate end) { + // 用起始时间作为流的源头,按照每次加一天的方式创建一个无限流 + return Stream.iterate(start, localDate -> localDate.plusDays(1)) + // 截断无限流,长度为起始时间和结束时间的差+1个 + .limit(ChronoUnit.DAYS.between(start, end) + 1) + // 由于最后要的是字符串,所以map转换一下 + .map(LocalDate::toString) + // 把流收集为List + .collect(Collectors.toList()); + } + + /** + * 判断当前时间是否在[startTime, endTime]区间,注意时间格式要一致 + * + * @param nowTime 当前时间 + * @param startTime 开始时间 + * @param endTime 结束时间 + */ + public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) { + if (nowTime.getTime() == startTime.getTime() + || nowTime.getTime() == endTime.getTime()) { + return true; + } + + Calendar date = Calendar.getInstance(); + date.setTime(nowTime); + + Calendar begin = Calendar.getInstance(); + begin.setTime(startTime); + + Calendar end = Calendar.getInstance(); + end.setTime(endTime); + + if (date.after(begin) && date.before(end)) { + return true; + } else { + return false; + } + } + + /** + * 判断当前时间有没有超过有效期 + * + * @param nowTime + * @param termOfValidity + * @return + */ + public static boolean termOfValidity(Date nowTime, Date termOfValidity) { + + if (nowTime.getTime() == termOfValidity.getTime()) { + return true; + } + + Calendar date = Calendar.getInstance(); + date.setTime(nowTime); + ; + + Calendar end = Calendar.getInstance(); + end.setTime(termOfValidity); + + if (date.before(end)) { + return true; + } else { + return false; + } + + } + + /** + * 判断时间 + * + * @param startTime + * @param endTime + * @return + */ + public static boolean compareDate(Date startTime, Date endTime) { + if (startTime.getTime() > endTime.getTime()) { + return true; + } else { + return false; + } + } + + /** + * String 转 date + * + * @param time + * @return + * @throws ParseException + */ + public static Date getDateTime(String time) throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return sdf.parse(time); + + } + + /** + * @param date1 + * @param date2 + * @return double + * @throws + * @Method getHour + * @Description: 根据开始时间,结束时间获取相差小时数 + * @author zuowenwen + * @Version 1.0 + * @date 2020/7/21 + */ + public static double getHour(Date date1, Date date2) throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + long startTime = date1.getTime(); + long endTime = date2.getTime(); + Long Intervals = endTime - startTime; + Double hour = (double) Intervals / 1000 / 3600; + DecimalFormat decimalFormat = new DecimalFormat(".0"); + String p = decimalFormat.format(hour); + hour = Double.parseDouble(p); + return hour; + } + + /** + * @param date + * @return java.lang.String + * @throws + * @Method getWeek + * @Description: 根据时间获取星期几 + * @author zuowenwen + * @Version 1.0 + * @date 2020/7/21 + */ + public static String getWeek(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("EEEE"); + String week = sdf.format(date); + return week; + } + + /** + * @param date + * @return java.lang.Integer + * @throws + * @Method getWeekDay + * @Description: 根据时间获取一周的第几天 + * @author zuowenwen + * @Version 1.0 + * @date 2020/7/21 + */ + public static Integer getWeekDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + int weekDay = calendar.get(Calendar.DAY_OF_WEEK); + if (weekDay == 1) { + weekDay = 7; + } else { + weekDay--; + } + return weekDay; + } + + /** + * @param date + * @param num + * @return java.util.Date + * @throws + * @Method getAddDate + * @Description: 根据时间 获取num之前的时间 + * @author zuowenwen + * @Version 1.0 + * @date 2020/7/23 + */ + public static Date getAddDate(Date date, Integer num) { + Calendar calendar = new GregorianCalendar(); + calendar.setTime(date); + calendar.add(calendar.DATE, num); //把日期往后增加一天,整数 往后推,负数往前移动 + date = calendar.getTime(); //这个时间就是日期往后推一天的结果 + return date; + } + + public static Date getDateTime(String time, String parten) throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat(parten); + return sdf.parse(time); + + } + + public String DateToStringBeginOrEnd(Date date, Boolean flag) { + String time = null; + SimpleDateFormat dateformat1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + Calendar calendar1 = Calendar.getInstance(); + //获取某一天的0点0分0秒 或者 23点59分59秒 + if (flag) { + calendar1.setTime(date); + calendar1.set(calendar1.get(Calendar.YEAR), calendar1.get(Calendar.MONTH), calendar1.get(Calendar.DAY_OF_MONTH), + 0, 0, 0); + Date beginOfDate = calendar1.getTime(); + time = dateformat1.format(beginOfDate); + System.out.println(time); + } else { + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(date); + calendar1.set(calendar2.get(Calendar.YEAR), calendar2.get(Calendar.MONTH), calendar2.get(Calendar.DAY_OF_MONTH), + 23, 59, 59); + Date endOfDate = calendar1.getTime(); + time = dateformat1.format(endOfDate); + System.out.println(time); + } + return time; + } + + /** + * 得到某年某周的第一天 + * + * @param year + * @param week + * @return + */ + public static Date getFirstDayOfWeek(int year, int week) { + Calendar c = new GregorianCalendar(); + c.set(Calendar.YEAR, year); + c.set(Calendar.MONTH, Calendar.JANUARY); + c.set(Calendar.DATE, 1); + + Calendar cal = (GregorianCalendar) c.clone(); + cal.add(Calendar.DATE, week * 7); + + return getFirstDayOfWeek(cal.getTime()); + } + + /** + * 取得当前日期所在周的第一天 + * + * @param date + * @return + */ + public static Date getFirstDayOfWeek(Date date) { + Calendar c = new GregorianCalendar(); + c.setFirstDayOfWeek(Calendar.MONDAY); + c.setTime(date); + c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek()); // Monday + return c.getTime (); + } + + + +} diff --git a/src/main/java/com/gaotao/modules/base/controller/BaseController.java b/src/main/java/com/gaotao/modules/base/controller/BaseController.java new file mode 100644 index 0000000..93686c0 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/controller/BaseController.java @@ -0,0 +1,366 @@ +package com.gaotao.modules.base.controller; + +import com.gaotao.modules.base.entity.*; +import com.gaotao.modules.base.service.BaseService; +import com.gaotao.modules.pda.utils.ResponseData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.TransactionSystemException; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import sun.util.calendar.CalendarDate; + +import javax.servlet.http.HttpSession; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * + * @ClassName: BaseController + * @Description: 基础功能controller + * @author rq + * @date 2021年9月25日 + * + */ +@Controller +@RequestMapping(value="/base") +public class BaseController { + @Autowired + private BaseService baseService; + + /** + * 获取工厂日历 + * @param + * @return + */ + @PostMapping(value="/getCalendarData") + @ResponseBody + public Object getCalendarData(@RequestBody CalendarData indata){ + Map map = new HashMap<>(); + try { + List result = baseService.getCalendarData(indata); + map.put("success", true); + map.put("rows", result); + map.put("total", result.size()); + } catch (Exception e) { + map.put("success", false); + map.put("msg", e.getMessage()); + } + return map; + } + + /** + * 查询工作类型 + * @param + * @return + */ + @PostMapping("/calendarDatetypeInfo") + @ResponseBody + public Object shiftInfoJson(@RequestBody CalendarData calendarData){ + Map map = new HashMap<>(); + try { + List list = baseService.getCalendarDatetypeData(calendarData.getSite()); + map.put("rows", list); + map.put("total", list.size()); + } catch (Exception e) { + map.put("msg", e.getMessage()); + map.put("code", "500"); + } + return map; + } + /** + * 保存工厂日历 + * @param inData + * @param + * @return + */ + @PostMapping(value="/saveCalendar") + @ResponseBody + public Object saveCalendar(@RequestBody CalendarData inData){ + ResponseData responseData = new ResponseData(); + // UserOutData userOutData = (UserOutData) session.getAttribute("user"); + try { + // responseData = baseService.maintainCalendar(inData, userOutData.getSite(), userOutData.getUsername()); + responseData = baseService.maintainCalendar(inData); + } catch (Exception e) { + if (e instanceof TransactionSystemException) { + responseData.setCode("300"); + responseData.setMsg("数据已被修改,请更新数据!"); + }else{ + responseData.setCode("400"); + responseData.setMsg(e.getMessage()); + } + } + return responseData; + } + /** + * 删除工厂日历 + * @param + * @author rq + * @return + */ + @PostMapping("/delCalendar") + @ResponseBody + public Object delCalendar(@RequestBody CalendarData inData){ + ResponseData responseData = new ResponseData(); + try { + responseData = baseService.delCalendar(inData); + } catch (Exception e) { + responseData.setMsg(e.getMessage()); + responseData.setCode("500"); + } + return responseData; + } + /** + * 获取已经安排的工作日历 + * @param + * @param + */ + @PostMapping(value="/getCalendarExceptionData") + @ResponseBody + public Object getCalendarExceptionData(@RequestBody CalendarData inData){ + Map map = new HashMap<>(); + try { + List result = baseService.getCalendarExceptionData(inData); + map.put("success", true); + map.put("rows", result); + map.put("total", result.size()); + } catch (Exception e) { + map.put("success", false); + map.put("msg", e.getMessage()); + } + return map; + } + + /** + * 维护班次信息 + * @param inData + * @param + * @return + */ + @PostMapping(value="/saveShift") + @ResponseBody + public Object saveShift(@RequestBody CalendarDatetypeShiftData inData){ + ResponseData responseData = new ResponseData(); + // UserOutData userOutData = (UserOutData) session.getAttribute("user"); + try { + responseData = baseService.maintainShift(inData); + } catch (Exception e) { + if (e instanceof TransactionSystemException) { + responseData.setCode("300"); + responseData.setMsg("数据已被修改,请更新数据!"); + }else{ + responseData.setCode("400"); + responseData.setMsg(e.getMessage()); + } + } + return responseData; + } + /** + * 编辑班次信息 + * @param inData + * @param + * @return + */ + @PostMapping(value="/updateShift") + @ResponseBody + public Object updateShift(@RequestBody CalendarDatetypeShiftData inData){ + ResponseData responseData = new ResponseData(); + // UserOutData userOutData = (UserOutData) session.getAttribute("user"); + try { + responseData = baseService.updateShift(inData); + } catch (Exception e) { + if (e instanceof TransactionSystemException) { + responseData.setCode("300"); + responseData.setMsg("数据已被修改,请更新数据!"); + }else{ + responseData.setCode("400"); + responseData.setMsg(e.getMessage()); + } + } + return responseData; + } + + /** + * 获取班次信息 + * @param + * @param + * @return + */ + @PostMapping(value="/getShiftData") + @ResponseBody + public Object getCDatatypeShiftData(@RequestBody CalendarDatetypeData indata){ + Map map = new HashMap<>(); + try { + List result = baseService.getShiftData(indata); + map.put("success", true); + map.put("rows", result); + map.put("total", result.size()); + } catch (Exception e) { + map.put("success", false); + map.put("msg", e.getMessage()); + } + return map; + } + /** + * 维护工作类型 + * @param indata + * @param + * @return + */ + @PostMapping("/saveCalendarDatetypeData") + @ResponseBody + public Object saveCalendarDatetypeData(@RequestBody CalendarDatetypeData indata){ + ResponseData responseData = new ResponseData(); + try { + responseData = baseService.saveCalendarDatetypeData(indata); + } catch (Exception e) { + if ( e instanceof TransactionSystemException) { + responseData.setCode("300"); + responseData.setMsg("数据已被修改,请更新数据!"); + }else{ + responseData.setCode("400"); + responseData.setMsg(e.getMessage()); + } + } + return responseData; + } + /** + * 删除工厂日历类型 + * @param + * @return + */ + @PostMapping("/delCalendarType") + @ResponseBody + public Object delCalendarType(@RequestBody CalendarDatetypeData indata){ + ResponseData responseData = new ResponseData(); + try { + responseData = baseService.delCalendarType(indata); + } catch (Exception e) { + responseData.setMsg(e.getMessage()); + responseData.setCode("500"); + } + return responseData; + } + /** + * 维护日历班次信息 + * @param indata + * @param + * @return + */ + @PostMapping("/batchSaveCDData") + @ResponseBody + public Object batchSaveCDData(@RequestBody BatchCDListVO indata){ + ResponseData responseData = new ResponseData(); + // UserOutData userOutData = (UserOutData) session.getAttribute("user"); + try { + responseData = baseService.batchSaveCDData(indata); + } catch (Exception e) { + responseData.setCode("400"); + responseData.setMsg(e.getMessage()); + } + return responseData; + } + + /** + * 单个维护已安排的日历 + * @param site + * @param calendarId + * @param scheduledate + * @param dataType + * @param + * @return + */ + @PostMapping("/saveCDData") + @ResponseBody + public Object saveCDData(String site,String calendarId,String scheduledate,String dataType,String userName){ + ResponseData responseData = new ResponseData(); + // UserOutData userOutData = (UserOutData) session.getAttribute("user"); + try { + responseData = baseService.saveCDData(site,calendarId,scheduledate,dataType,userName); + } catch (Exception e) { + if (e instanceof TransactionSystemException) { + responseData.setCode("300"); + responseData.setMsg("数据已被修改,请更新数据!"); + }else{ + responseData.setCode("400"); + responseData.setMsg(e.getMessage()); + } + } + return responseData; + } + /** + * @Description 获取下拉框排班 + * @Title getCDatatypeShiftData + * @param site + * @author rq + * @date 2021/3/16 17:32 + * @return + * @throw + */ + + @PostMapping(value="/getAllShiftData") + @ResponseBody + public Object getCDatatypeShiftData(String site){ + Map map = new HashMap<>(); + try { + List result = baseService.getAllShiftData(site); + map.put("success", true); + map.put("rows", result); + map.put("total", result.size()); + } catch (Exception e) { + map.put("success", false); + map.put("msg", e.getMessage()); + } + return map; + } + + /** + * @Title delShift + * @Description 删除班次 + * @author rq + * @date 2021/4/16 11:56 + * @return {@link Object} + */ + + @PostMapping("/delShift") + @ResponseBody + public Object delShift(@RequestBody CalendarDatetypeShiftData inData){ + ResponseData responseData = new ResponseData(); + try { + responseData = baseService.delShift(inData); + } catch (Exception e) { + responseData.setMsg(e.getMessage()); + responseData.setCode("500"); + } + return responseData; + } + + /** + * @Title getShiftNo + * @Description 获取班次编码 + * @author rq + * @date 2021/4/16 14:55 + * @return {@link Object} + */ + + @PostMapping(value="/getShiftNo") + @ResponseBody + public Object getShiftNo(String site){ + Map map = new HashMap<>(); + try { + String result = baseService.getShiftNo(); + map.put("success", true); + map.put("rows", result); + } catch (Exception e) { + map.put("success", false); + map.put("msg", e.getMessage()); + } + return map; + } + + +} diff --git a/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java b/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java new file mode 100644 index 0000000..bb5615f --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/dao/BaseMapper.java @@ -0,0 +1,270 @@ +package com.gaotao.modules.base.dao; + +import com.gaotao.modules.base.entity.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author rq + * @ClassName: BaseMapper + * @Description: 工艺的dao + * @date 2021年9月25日 + */ +@Mapper +public interface BaseMapper { + /** + * 查询工厂日历 + * + * @return + * @author rq + */ + List getCalendarData(CalendarData indata); + + /** + * 查询工作日类型 + * + * @return + * @author rq + */ + List findBySite(@Param("site")String site); + + /** + * 编辑工厂日历 + * + * @param inData + * @author rq + */ + int editCalendar(CalendarData inData); + + /** + * 查找工厂编号 + * + * @return + * @author rq + */ + CalendarData findByCalendarId(@Param("calendarId")String CalendarId); + + /** + * 保存新增日历 + * + * @return + * @author rq + */ + void save(CalendarData indata); + + /** + * 删除工厂日历 + * + * @param id + * @author rq + */ + void delCalendar(@Param("calendarId")String calendarId); + + /** + * 获取工作日类型 + * + * @param + * @author rq + */ + CalendarDatetypeOutData findByDatetypeAndSite(@Param("dataType")String dataType,@Param("site") String site); + + /** + * 查询已经维护的日历信息 + * + * @param site + * @param calendarId + * @param scheduledate + * @return + */ + List getCalendarEByCIdAndSDate(@Param("site")String site, @Param("calendarId")String calendarId, @Param("scheduledate")String scheduledate); + + /** + * 根据日历编码获取日历信息 + * + * @return + */ + List findBySiteAndCalendarId(CalendarData inData); + + /** + * 编辑班次 + * + * @param inData + * @return + */ + int editShift(CalendarDatetypeShiftData inData); + + /** + * 根据编码查询班次 + * + * @param id + * @return + */ + CalendarDatetypeShiftOutData findShiftById(@Param("id")int id); + + /** + * 根据班次编码查询班次 + * + * @param + * @return + */ + CalendarDatetypeShiftOutData findByShiftno(CalendarDatetypeShiftData inData); + + /** + * 保存班次 + * + * @param + * @return + */ + void saveCDS(CalendarDatetypeShiftData inData); + + /** + * 查询班次信息 + * + * @return + * @author rq + */ + List findBySiteAndDatetype(CalendarDatetypeData indata); + /** + * 查询其他班次信息 + * + * @return + * @author rq + */ + List findBySiteAndDatetype2(CalendarDatetypeShiftData inData); + + /** + * 根据工作类型查询数据 + * + * @param datetype + * @return + */ + CalendarDatetypeData findCDDByDatetypeAndSite(@Param("datetype")String datetype, @Param("site")String site); + + /** + * 根据ID查询数据 + * + * @param id + * @return + */ + CalendarDatetypeData findCDDById(@Param("id")int id); + + /** + * 保存工作日数据 + * + * @param + * @return + */ + void saveCDD(CalendarDatetypeData indata); + + /** + * 删除工作类型 + * + * @param id + * @return + */ + void deleteById(CalendarDatetypeData indata); + + /** + * 查询已经维护的日历班次信息 + * + * @param site + * @param calendarId + * @param scheduledate + * @return + */ + List getCalendarESByCIdAndSDate(@Param("site")String site, @Param("calendarId")String calendarId, @Param("scheduledate")String scheduledate); + + /** + * 删除已经维护的日历班次安排 + * + * @param id + * @return + */ + void deleteCESById(CalendarExceptionShiftData calendarExceptionShiftData); + + /** + * 保存日历班次信息 + * + * @param + * @return + */ + void saveCED(CalendarExceptionData cesd); + + /** + * 保存日历班次安排 + * + * @param + * @return + */ + void saveCESD(CalendarExceptionShiftData cesd); + + /** + * 删除日历班次安排 + * + * @param + * @return + */ + void deleteCEDById(CalendarExceptionData calendarExceptionData); + + /** + * 编辑工作日数据 + * + * @param + * @return + */ + + void updateCDD(CalendarDatetypeData indata); + + /** + * @Description 获取下拉框排班 + * @Title getAllShiftData + * @param site + * @author rq + * @date 2021/3/16 17:36 + * @return {@link List< CalendarDatetypeShiftData>} + * @throw + */ + + List getAllShiftData(@Param("site")String site); + + /** + * @Title findDataType + * @Description 查找工作日类型是否被引用 + * @author rq + * @date 2021/4/13 13:31 + * @return {@link List< CalendarExceptionData>} + */ + + List findDateType(CalendarDatetypeData indata); + /** + * @Title delShift + * @Description 删除班次 + * @author rq + * @date 2021/4/16 11:57 + * @return + */ + void deleteShift(@RequestBody CalendarDatetypeShiftData inData); + + /** + * @Title getShiftNo + * @Description 获取班次最后几位 + * @author rq + * @date 2021/4/16 14:56 + * @return {@link String} + */ + int getShiftNo(); + + /** + * @Title getSiteAccessFlag + * @Description 日历校验 + * @author rq + * @date 2021/5/21 11:14 + * @return {@link String} + */ + String getSiteAccessFlag(@Param("userId") String userId,@Param("site") String site); + + +} diff --git a/src/main/java/com/gaotao/modules/base/entity/BatchCDListVO.java b/src/main/java/com/gaotao/modules/base/entity/BatchCDListVO.java new file mode 100644 index 0000000..c350f05 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/BatchCDListVO.java @@ -0,0 +1,33 @@ +package com.gaotao.modules.base.entity; + +import java.util.List; + +public class BatchCDListVO { + private List timeList; + private List batchCDVoList; + private String user; + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public List getTimeList() { + return timeList; + } + + public void setTimeList(List timeList) { + this.timeList = timeList; + } + + public List getBatchCDVoList() { + return batchCDVoList; + } + + public void setBatchCDVoList(List batchCDVoList) { + this.batchCDVoList = batchCDVoList; + } +} diff --git a/src/main/java/com/gaotao/modules/base/entity/BatchCDVO.java b/src/main/java/com/gaotao/modules/base/entity/BatchCDVO.java new file mode 100644 index 0000000..246edba --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/BatchCDVO.java @@ -0,0 +1,153 @@ +package com.gaotao.modules.base.entity; + +import java.util.Date; + +public class BatchCDVO { + private int id; + private String site; + private String calendarId; + private String calendarDesc; + private String status; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + private String val0; + private String val1; + private String val2; + private String val3; + private String val4; + private String val5; + private String val6; + private String val7; + private String val8; + private String val9; + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getSite() { + return site; + } + public void setSite(String site) { + this.site = site; + } + public String getCalendarId() { + return calendarId; + } + public void setCalendarId(String calendarId) { + this.calendarId = calendarId; + } + public String getCalendarDesc() { + return calendarDesc; + } + public void setCalendarDesc(String calendarDesc) { + this.calendarDesc = calendarDesc; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public Date getCreatedDate() { + return createdDate; + } + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + public String getCreatedBy() { + return createdBy; + } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + public Date getUpdateDate() { + return updateDate; + } + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + public String getUpdateBy() { + return updateBy; + } + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + public String getDelflag() { + return delflag; + } + public void setDelflag(String delflag) { + this.delflag = delflag; + } + public int getVersion() { + return version; + } + public void setVersion(int version) { + this.version = version; + } + public String getVal0() { + return val0; + } + public void setVal0(String val0) { + this.val0 = val0; + } + public String getVal1() { + return val1; + } + public void setVal1(String val1) { + this.val1 = val1; + } + public String getVal2() { + return val2; + } + public void setVal2(String val2) { + this.val2 = val2; + } + public String getVal3() { + return val3; + } + public void setVal3(String val3) { + this.val3 = val3; + } + public String getVal4() { + return val4; + } + public void setVal4(String val4) { + this.val4 = val4; + } + public String getVal5() { + return val5; + } + public void setVal5(String val5) { + this.val5 = val5; + } + public String getVal6() { + return val6; + } + public void setVal6(String val6) { + this.val6 = val6; + } + public String getVal7() { + return val7; + } + public void setVal7(String val7) { + this.val7 = val7; + } + public String getVal8() { + return val8; + } + public void setVal8(String val8) { + this.val8 = val8; + } + public String getVal9() { + return val9; + } + public void setVal9(String val9) { + this.val9 = val9; + } +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarData.java new file mode 100644 index 0000000..1fcba50 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarData.java @@ -0,0 +1,204 @@ +package com.gaotao.modules.base.entity; + +import java.util.Date; + +public class CalendarData { + + private int id; + private String site; + private String calendarId; + private String calendarDesc; + private String status; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + + private int version; + private String calendarSite; + private String user; + private String val1; + private String val2; + private String val3; + private String val4; + private String val5; + private String val6; + private String val7; + private String val8; + private String val9; + private String val0; + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public String getCalendarSite() { + return calendarSite; + } + + public void setCalendarSite(String calendarSite) { + this.calendarSite = calendarSite; + } + + public int getVersion2() { + return version2; + } + + public void setVersion2(int version2) { + this.version2 = version2; + } + + private int version2; + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getSite() { + return site; + } + public void setSite(String site) { + this.site = site; + } + public String getCalendarId() { + return calendarId; + } + public void setCalendarId(String calendarId) { + this.calendarId = calendarId; + } + public String getCalendarDesc() { + return calendarDesc; + } + public void setCalendarDesc(String calendarDesc) { + this.calendarDesc = calendarDesc; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + + public Date getCreatedDate() { + return createdDate; + } + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + public String getCreatedBy() { + return createdBy; + } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + public Date getUpdateDate() { + return updateDate; + } + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + public String getUpdateBy() { + return updateBy; + } + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + public String getDelflag() { + return delflag; + } + public void setDelflag(String delflag) { + this.delflag = delflag; + } + public int getVersion() { + return version; + } + public void setVersion(int version) { + this.version = version; + } + + public String getVal1() { + return val1; + } + + public void setVal1(String val1) { + this.val1 = val1; + } + + public String getVal2() { + return val2; + } + + public void setVal2(String val2) { + this.val2 = val2; + } + + public String getVal3() { + return val3; + } + + public void setVal3(String val3) { + this.val3 = val3; + } + + public String getVal4() { + return val4; + } + + public void setVal4(String val4) { + this.val4 = val4; + } + + public String getVal5() { + return val5; + } + + public void setVal5(String val5) { + this.val5 = val5; + } + + public String getVal6() { + return val6; + } + + public void setVal6(String val6) { + this.val6 = val6; + } + + public String getVal7() { + return val7; + } + + public void setVal7(String val7) { + this.val7 = val7; + } + + public String getVal8() { + return val8; + } + + public void setVal8(String val8) { + this.val8 = val8; + } + + public String getVal9() { + return val9; + } + + public void setVal9(String val9) { + this.val9 = val9; + } + + public String getVal0() { + return val0; + } + + public void setVal0(String val0) { + this.val0 = val0; + } +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeData.java new file mode 100644 index 0000000..75c3aa1 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeData.java @@ -0,0 +1,396 @@ +package com.gaotao.modules.base.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gaotao.common.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.Date; + +public class CalendarDatetypeData { + private int id; + private String site; + private String datetype; + private BigDecimal excepttime1; + private BigDecimal exceptduration1; + private BigDecimal excepttime2; + private BigDecimal exceptduration2; + private BigDecimal excepttime3; + private BigDecimal exceptduration3; + private BigDecimal excepttime4; + private BigDecimal exceptduration4; + private BigDecimal excepttime5; + private BigDecimal exceptduration5; + private BigDecimal excepttime6; + private BigDecimal exceptduration6; + private BigDecimal worktime; + private String remark; + // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date exceptexacttime1; + // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date exceptexacttime2; + // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date exceptexacttime3; + // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date exceptexacttime4; + // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date exceptexacttime5; + // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date exceptexacttime6; + private BigDecimal starttime; + private BigDecimal endtime; + + private Date startexacttime; + + private Date endexacttime; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + private int version2; + private String userId; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public int getVersion2() { + return version2; + } + + public void setVersion2(int version2) { + this.version2 = version2; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getDatetype() { + return datetype; + } + + public void setDatetype(String datetype) { + this.datetype = datetype; + } + + public BigDecimal getExcepttime1() { + return excepttime1; + } + + public void setExcepttime1(BigDecimal excepttime1) { + this.excepttime1 = excepttime1; + } + + public BigDecimal getExceptduration1() { + return exceptduration1; + } + + public void setExceptduration1(BigDecimal exceptduration1) { + if (exceptduration1 == null || "".equals(exceptduration1)) { + this.exceptduration1 = new BigDecimal(0); + } else { + this.exceptduration1 = exceptduration1; + } + } + + public BigDecimal getExcepttime2() { + return excepttime2; + } + + public void setExcepttime2(BigDecimal excepttime2) { + this.excepttime2 = excepttime2; + } + + public BigDecimal getExceptduration2() { + return exceptduration2; + } + + public void setExceptduration2(BigDecimal exceptduration2) { + if (exceptduration2 == null || "".equals(exceptduration2)) { + this.exceptduration2 = new BigDecimal(0); + } else { + this.exceptduration2 = exceptduration2; + } + } + + public BigDecimal getExcepttime3() { + return excepttime3; + } + + public void setExcepttime3(BigDecimal excepttime3) { + this.excepttime3 = excepttime3; + } + + public BigDecimal getExceptduration3() { + return exceptduration3; + } + + public void setExceptduration3(BigDecimal exceptduration3) { + if (exceptduration3 == null || "".equals(exceptduration3)) { + this.exceptduration3 = new BigDecimal(0); + } else { + this.exceptduration3 = exceptduration3; + } + } + + public BigDecimal getExcepttime4() { + return excepttime4; + } + + public void setExcepttime4(BigDecimal excepttime4) { + this.excepttime4 = excepttime4; + } + + public BigDecimal getExceptduration4() { + return exceptduration4; + } + + public void setExceptduration4(BigDecimal exceptduration4) { + if (exceptduration4 == null || "".equals(exceptduration4)) { + this.exceptduration4 = new BigDecimal(0); + } else { + this.exceptduration4 = exceptduration4; + } + } + + public BigDecimal getExcepttime5() { + return excepttime5; + } + + public void setExcepttime5(BigDecimal excepttime5) { + this.excepttime5 = excepttime5; + } + + public BigDecimal getExceptduration5() { + return exceptduration5; + } + + public void setExceptduration5(BigDecimal exceptduration5) { + if (exceptduration5 == null || "".equals(exceptduration5)) { + this.exceptduration5 = new BigDecimal(0); + } else { + this.exceptduration5 = exceptduration5; + } + } + + public BigDecimal getExcepttime6() { + return excepttime6; + } + + public void setExcepttime6(BigDecimal excepttime6) { + this.excepttime6 = excepttime6; + } + + public BigDecimal getExceptduration6() { + return exceptduration6; + } + + public void setExceptduration6(BigDecimal exceptduration6) { + if (exceptduration6 == null || "".equals(exceptduration6)) { + this.exceptduration6 = new BigDecimal(0); + } else { + this.exceptduration6 = exceptduration6; + } + } + + public BigDecimal getWorktime() { + return worktime; + } + + public void setWorktime(BigDecimal worktime) { + this.worktime = worktime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Date getExceptexacttime1() { + return exceptexacttime1; + } + + + public void setExceptexacttime1(String exceptexacttime1) throws ParseException { + if (exceptexacttime1 == null || "".equals(exceptexacttime1)) { + this.exceptexacttime1 = null; + } else { + this.exceptexacttime1 = DateUtil.getDateByParten(exceptexacttime1, "HH:mm"); + } + } + + public Date getExceptexacttime2() { + return exceptexacttime2; + } + + + public void setExceptexacttime2(String exceptexacttime2) throws ParseException { + if (exceptexacttime2 == null || "".equals(exceptexacttime2)) { + this.exceptexacttime2 = null; + } else { + this.exceptexacttime2 = DateUtil.getDateByParten(exceptexacttime2, "HH:mm"); + } + } + + public Date getExceptexacttime3() { + return exceptexacttime3; + } + + public void setExceptexacttime3(String exceptexacttime3) throws ParseException { + if (exceptexacttime3 == null || "".equals(exceptexacttime3)) { + this.exceptexacttime3 = null; + } else { + this.exceptexacttime3 = DateUtil.getDateByParten(exceptexacttime3, "HH:mm"); + } + } + + public Date getExceptexacttime4() { + return exceptexacttime4; + } + + + public void setExceptexacttime4(String exceptexacttime4) throws ParseException { + if (exceptexacttime4 == null || "".equals(exceptexacttime4)) { + this.exceptexacttime4 = null; + } else { + this.exceptexacttime4 = DateUtil.getDateByParten(exceptexacttime4, "HH:mm"); + } + } + + public Date getExceptexacttime5() { + return exceptexacttime5; + } + + + public void setExceptexacttime5(String exceptexacttime5) throws ParseException { + if (exceptexacttime5 == null || "".equals(exceptexacttime5)) { + this.exceptexacttime5 = null; + } else { + this.exceptexacttime5 = DateUtil.getDateByParten(exceptexacttime5, "HH:mm"); + } + } + + public Date getExceptexacttime6() { + return exceptexacttime6; + } + + + public void setExceptexacttime6(String exceptexacttime6) throws ParseException { + if (exceptexacttime6 == null || "".equals(exceptexacttime6)) { + this.exceptexacttime6 = null; + } else { + this.exceptexacttime6 = DateUtil.getDateByParten(exceptexacttime6, "HH:mm"); + } + } + + public BigDecimal getStarttime() { + return starttime; + } + + public void setStarttime(BigDecimal starttime) { + this.starttime = starttime; + } + + public BigDecimal getEndtime() { + return endtime; + } + + public void setEndtime(BigDecimal endtime) { + this.endtime = endtime; + } + + public Date getStartexacttime() { + return startexacttime; + } + + public void setStartexacttime(Date startexacttime) { + this.startexacttime = startexacttime; + } + + public Date getEndexacttime() { + return endexacttime; + } + + public void setEndexacttime(Date endexacttime) { + this.endexacttime = endexacttime; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } + +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeOutData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeOutData.java new file mode 100644 index 0000000..cc61579 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeOutData.java @@ -0,0 +1,319 @@ +package com.gaotao.modules.base.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +public class CalendarDatetypeOutData { + private int id; + private String site; + private String datetype; + private BigDecimal excepttime1; + private BigDecimal exceptduration1; + private BigDecimal excepttime2; + private BigDecimal exceptduration2; + private BigDecimal excepttime3; + private BigDecimal exceptduration3; + private BigDecimal excepttime4; + private BigDecimal exceptduration4; + private BigDecimal excepttime5; + private BigDecimal exceptduration5; + private BigDecimal excepttime6; + private BigDecimal exceptduration6; + private BigDecimal worktime; + private String remark; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime1; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime2; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime3; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime4; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime5; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime6; + private BigDecimal starttime; + private BigDecimal endtime; + private Date startexacttime; + private Date endexacttime; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getDatetype() { + return datetype; + } + + public void setDatetype(String datetype) { + this.datetype = datetype; + } + + public BigDecimal getExcepttime1() { + return excepttime1; + } + + public void setExcepttime1(BigDecimal excepttime1) { + this.excepttime1 = excepttime1; + } + + public BigDecimal getExceptduration1() { + return exceptduration1; + } + + public void setExceptduration1(BigDecimal exceptduration1) { + this.exceptduration1 = exceptduration1; + } + + public BigDecimal getExcepttime2() { + return excepttime2; + } + + public void setExcepttime2(BigDecimal excepttime2) { + this.excepttime2 = excepttime2; + } + + public BigDecimal getExceptduration2() { + return exceptduration2; + } + + public void setExceptduration2(BigDecimal exceptduration2) { + this.exceptduration2 = exceptduration2; + } + + public BigDecimal getExcepttime3() { + return excepttime3; + } + + public void setExcepttime3(BigDecimal excepttime3) { + this.excepttime3 = excepttime3; + } + + public BigDecimal getExceptduration3() { + return exceptduration3; + } + + public void setExceptduration3(BigDecimal exceptduration3) { + this.exceptduration3 = exceptduration3; + } + + public BigDecimal getExcepttime4() { + return excepttime4; + } + + public void setExcepttime4(BigDecimal excepttime4) { + this.excepttime4 = excepttime4; + } + + public BigDecimal getExceptduration4() { + return exceptduration4; + } + + public void setExceptduration4(BigDecimal exceptduration4) { + this.exceptduration4 = exceptduration4; + } + + public BigDecimal getExcepttime5() { + return excepttime5; + } + + public void setExcepttime5(BigDecimal excepttime5) { + this.excepttime5 = excepttime5; + } + + public BigDecimal getExceptduration5() { + return exceptduration5; + } + + public void setExceptduration5(BigDecimal exceptduration5) { + this.exceptduration5 = exceptduration5; + } + + public BigDecimal getExcepttime6() { + return excepttime6; + } + + public void setExcepttime6(BigDecimal excepttime6) { + this.excepttime6 = excepttime6; + } + + public BigDecimal getExceptduration6() { + return exceptduration6; + } + + public void setExceptduration6(BigDecimal exceptduration6) { + this.exceptduration6 = exceptduration6; + } + + public BigDecimal getWorktime() { + return worktime; + } + + public void setWorktime(BigDecimal worktime) { + this.worktime = worktime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Date getExceptexacttime1() { + return exceptexacttime1; + } + + public void setExceptexacttime1(Date exceptexacttime1) { + this.exceptexacttime1 = exceptexacttime1; + } + + public Date getExceptexacttime2() { + return exceptexacttime2; + } + + public void setExceptexacttime2(Date exceptexacttime2) { + this.exceptexacttime2 = exceptexacttime2; + } + + public Date getExceptexacttime3() { + return exceptexacttime3; + } + + public void setExceptexacttime3(Date exceptexacttime3) { + this.exceptexacttime3 = exceptexacttime3; + } + + public Date getExceptexacttime4() { + return exceptexacttime4; + } + + public void setExceptexacttime4(Date exceptexacttime4) { + this.exceptexacttime4 = exceptexacttime4; + } + + public Date getExceptexacttime5() { + return exceptexacttime5; + } + + public void setExceptexacttime5(Date exceptexacttime5) { + this.exceptexacttime5 = exceptexacttime5; + } + + public Date getExceptexacttime6() { + return exceptexacttime6; + } + + public void setExceptexacttime6(Date exceptexacttime6) { + this.exceptexacttime6 = exceptexacttime6; + } + + public BigDecimal getStarttime() { + return starttime; + } + + public void setStarttime(BigDecimal starttime) { + this.starttime = starttime; + } + + public BigDecimal getEndtime() { + return endtime; + } + + public void setEndtime(BigDecimal endtime) { + this.endtime = endtime; + } + + public Date getStartexacttime() { + return startexacttime; + } + + public void setStartexacttime(Date startexacttime) { + this.startexacttime = startexacttime; + } + + public Date getEndexacttime() { + return endexacttime; + } + + public void setEndexacttime(Date endexacttime) { + this.endexacttime = endexacttime; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftData.java new file mode 100644 index 0000000..c4fb093 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftData.java @@ -0,0 +1,178 @@ +package com.gaotao.modules.base.entity; + + + + + + +import com.gaotao.common.utils.DateUtil; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.Date; + +public class CalendarDatetypeShiftData { + private int id; + private String site; + private String datetype; + private String shiftno; + private String shiftdesc; + private Date startexacttime; + private Date endexacttime; + private BigDecimal starttime; + private BigDecimal endtime; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + private int version2; + private String user; + public int getVersion2() { + return version2; + } + + public void setVersion2(int version2) { + this.version2 = version2; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getDatetype() { + return datetype; + } + + public void setDatetype(String datetype) { + this.datetype = datetype; + } + + public String getShiftno() { + return shiftno; + } + + public void setShiftno(String shiftno) { + this.shiftno = shiftno; + } + + public String getShiftdesc() { + return shiftdesc; + } + + public void setShiftdesc(String shiftdesc) { + this.shiftdesc = shiftdesc; + } + + public Date getStartexacttime() { + return startexacttime; + } + + + public void setStartexacttime(String startexacttime) throws ParseException { + if(startexacttime==null || "".equals(startexacttime)){ + this.startexacttime = null; + }else{ + this.startexacttime = DateUtil.getDateByParten(startexacttime,"HH:mm"); + } + } + + public Date getEndexacttime() { + return endexacttime; + } + + + + public void setEndexacttime(String endexacttime) throws ParseException { + if(endexacttime==null || "".equals(endexacttime)){ + this.endexacttime = null; + }else{ + this.endexacttime = DateUtil.getDateByParten(endexacttime,"HH:mm"); + } + } + + public BigDecimal getStarttime() { + return starttime; + } + + public void setStarttime(BigDecimal starttime) { + this.starttime = starttime; + } + + public BigDecimal getEndtime() { + return endtime; + } + + public void setEndtime(BigDecimal endtime) { + this.endtime = endtime; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftOutData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftOutData.java new file mode 100644 index 0000000..a91dcf2 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarDatetypeShiftOutData.java @@ -0,0 +1,158 @@ +package com.gaotao.modules.base.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +public class CalendarDatetypeShiftOutData { + private int id; + private String site; + private String datetype; + private String shiftno; + private String shiftdesc; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date startexacttime; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date endexacttime; + private BigDecimal starttime; + private BigDecimal endtime; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + private int version2; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getDatetype() { + return datetype; + } + + public void setDatetype(String datetype) { + this.datetype = datetype; + } + + public String getShiftno() { + return shiftno; + } + + public void setShiftno(String shiftno) { + this.shiftno = shiftno; + } + + public String getShiftdesc() { + return shiftdesc; + } + + public void setShiftdesc(String shiftdesc) { + this.shiftdesc = shiftdesc; + } + + public Date getStartexacttime() { + return startexacttime; + } + + public void setStartexacttime(Date startexacttime) { + this.startexacttime = startexacttime; + } + + public Date getEndexacttime() { + return endexacttime; + } + + public void setEndexacttime(Date endexacttime) { + this.endexacttime = endexacttime; + } + + public BigDecimal getStarttime() { + return starttime; + } + + public void setStarttime(BigDecimal starttime) { + this.starttime = starttime; + } + + public BigDecimal getEndtime() { + return endtime; + } + + public void setEndtime(BigDecimal endtime) { + this.endtime = endtime; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } + + public int getVersion2() { + return version2; + } + + public void setVersion2(int version2) { + this.version2 = version2; + } +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionData.java new file mode 100644 index 0000000..424cde3 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionData.java @@ -0,0 +1,238 @@ +package com.gaotao.modules.base.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +public class CalendarExceptionData { + private int id; + private String site; + private String calendarId; + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date scheduledate; + private BigDecimal excepttime1; + private BigDecimal exceptduration1; + private BigDecimal excepttime2; + private BigDecimal exceptduration2; + private BigDecimal excepttime3; + private BigDecimal exceptduration3; + private BigDecimal excepttime4; + private BigDecimal exceptduration4; + private BigDecimal excepttime5; + private BigDecimal exceptduration5; + private BigDecimal excepttime6; + private BigDecimal exceptduration6; + private BigDecimal worktime; + private String datetype; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime1; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime2; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime3; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime4; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime5; + @DateTimeFormat(pattern = "HH:mm") + @JsonFormat(pattern = "HH:mm", timezone = "GMT+8") + private Date exceptexacttime6; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getSite() { + return site; + } + public void setSite(String site) { + this.site = site; + } + public String getCalendarId() { + return calendarId; + } + public void setCalendarId(String calendarId) { + this.calendarId = calendarId; + } + public Date getScheduledate() { + return scheduledate; + } + public void setScheduledate(Date scheduledate) { + this.scheduledate = scheduledate; + } + public BigDecimal getExcepttime1() { + return excepttime1; + } + public void setExcepttime1(BigDecimal excepttime1) { + this.excepttime1 = excepttime1; + } + public BigDecimal getExceptduration1() { + return exceptduration1; + } + public void setExceptduration1(BigDecimal exceptduration1) { + this.exceptduration1 = exceptduration1; + } + public BigDecimal getExcepttime2() { + return excepttime2; + } + public void setExcepttime2(BigDecimal excepttime2) { + this.excepttime2 = excepttime2; + } + public BigDecimal getExceptduration2() { + return exceptduration2; + } + public void setExceptduration2(BigDecimal exceptduration2) { + this.exceptduration2 = exceptduration2; + } + public BigDecimal getExcepttime3() { + return excepttime3; + } + public void setExcepttime3(BigDecimal excepttime3) { + this.excepttime3 = excepttime3; + } + public BigDecimal getExceptduration3() { + return exceptduration3; + } + public void setExceptduration3(BigDecimal exceptduration3) { + this.exceptduration3 = exceptduration3; + } + public BigDecimal getExcepttime4() { + return excepttime4; + } + public void setExcepttime4(BigDecimal excepttime4) { + this.excepttime4 = excepttime4; + } + public BigDecimal getExceptduration4() { + return exceptduration4; + } + public void setExceptduration4(BigDecimal exceptduration4) { + this.exceptduration4 = exceptduration4; + } + public BigDecimal getExcepttime5() { + return excepttime5; + } + public void setExcepttime5(BigDecimal excepttime5) { + this.excepttime5 = excepttime5; + } + public BigDecimal getExceptduration5() { + return exceptduration5; + } + public void setExceptduration5(BigDecimal exceptduration5) { + this.exceptduration5 = exceptduration5; + } + public BigDecimal getExcepttime6() { + return excepttime6; + } + public void setExcepttime6(BigDecimal excepttime6) { + this.excepttime6 = excepttime6; + } + public BigDecimal getExceptduration6() { + return exceptduration6; + } + public void setExceptduration6(BigDecimal exceptduration6) { + this.exceptduration6 = exceptduration6; + } + public BigDecimal getWorktime() { + return worktime; + } + public void setWorktime(BigDecimal worktime) { + this.worktime = worktime; + } + public String getDatetype() { + return datetype; + } + public void setDatetype(String datetype) { + this.datetype = datetype; + } + public Date getExceptexacttime1() { + return exceptexacttime1; + } + public void setExceptexacttime1(Date exceptexacttime1) { + this.exceptexacttime1 = exceptexacttime1; + } + public Date getExceptexacttime2() { + return exceptexacttime2; + } + public void setExceptexacttime2(Date exceptexacttime2) { + this.exceptexacttime2 = exceptexacttime2; + } + public Date getExceptexacttime3() { + return exceptexacttime3; + } + public void setExceptexacttime3(Date exceptexacttime3) { + this.exceptexacttime3 = exceptexacttime3; + } + public Date getExceptexacttime4() { + return exceptexacttime4; + } + public void setExceptexacttime4(Date exceptexacttime4) { + this.exceptexacttime4 = exceptexacttime4; + } + public Date getExceptexacttime5() { + return exceptexacttime5; + } + public void setExceptexacttime5(Date exceptexacttime5) { + this.exceptexacttime5 = exceptexacttime5; + } + public Date getExceptexacttime6() { + return exceptexacttime6; + } + public void setExceptexacttime6(Date exceptexacttime6) { + this.exceptexacttime6 = exceptexacttime6; + } + public Date getCreatedDate() { + return createdDate; + } + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + public String getCreatedBy() { + return createdBy; + } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + public Date getUpdateDate() { + return updateDate; + } + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + public String getUpdateBy() { + return updateBy; + } + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + public String getDelflag() { + return delflag; + } + public void setDelflag(String delflag) { + this.delflag = delflag; + } + public int getVersion() { + return version; + } + public void setVersion(int version) { + this.version = version; + } + + +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftData.java new file mode 100644 index 0000000..29821af --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftData.java @@ -0,0 +1,153 @@ +package com.gaotao.modules.base.entity; + +import java.math.BigDecimal; +import java.util.Date; + +public class CalendarExceptionShiftData { + private int id; + private String site; + private String calendarId; + private String shiftno; + private Date scheduledate; + private String shiftdesc; + private Date startexacttime; + private Date endexacttime; + private BigDecimal starttime; + private BigDecimal endtime; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getCalendarId() { + return calendarId; + } + + public void setCalendarId(String calendarId) { + this.calendarId = calendarId; + } + + public String getShiftno() { + return shiftno; + } + + public void setShiftno(String shiftno) { + this.shiftno = shiftno; + } + + public Date getScheduledate() { + return scheduledate; + } + + public void setScheduledate(Date scheduledate) { + this.scheduledate = scheduledate; + } + + public String getShiftdesc() { + return shiftdesc; + } + + public void setShiftdesc(String shiftdesc) { + this.shiftdesc = shiftdesc; + } + + public Date getStartexacttime() { + return startexacttime; + } + + public void setStartexacttime(Date startexacttime) { + this.startexacttime = startexacttime; + } + + public Date getEndexacttime() { + return endexacttime; + } + + public void setEndexacttime(Date endexacttime) { + this.endexacttime = endexacttime; + } + + public BigDecimal getStarttime() { + return starttime; + } + + public void setStarttime(BigDecimal starttime) { + this.starttime = starttime; + } + + public BigDecimal getEndtime() { + return endtime; + } + + public void setEndtime(BigDecimal endtime) { + this.endtime = endtime; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } + + +} diff --git a/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftInData.java b/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftInData.java new file mode 100644 index 0000000..845f967 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/entity/CalendarExceptionShiftInData.java @@ -0,0 +1,164 @@ +package com.gaotao.modules.base.entity; + + + +import com.gaotao.common.utils.DateUtil; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.Date; + +public class CalendarExceptionShiftInData { + private int id; + private String site; + private String calendarId; + private String shiftno; + private Date scheduledate; + private String shiftdesc; + private Date startexacttime; + private Date endexacttime; + private BigDecimal starttime; + private BigDecimal endtime; + private Date createdDate; + private String createdBy; + private Date updateDate; + private String updateBy; + private String delflag; + private int version; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getCalendarId() { + return calendarId; + } + + public void setCalendarId(String calendarId) { + this.calendarId = calendarId; + } + + public String getShiftno() { + return shiftno; + } + + public void setShiftno(String shiftno) { + this.shiftno = shiftno; + } + + public Date getScheduledate() { + return scheduledate; + } + + public void setScheduledate(Date scheduledate) { + this.scheduledate = scheduledate; + } + + public String getShiftdesc() { + return shiftdesc; + } + + public void setShiftdesc(String shiftdesc) { + this.shiftdesc = shiftdesc; + } + + public Date getStartexacttime() { + return startexacttime; + } + + public void setStartexacttime(String startexacttime) throws ParseException { + if(startexacttime==null || "".equals(startexacttime)){ + this.startexacttime = null; + }else{ + this.startexacttime = DateUtil.getDateByParten(startexacttime,"HH:mm"); + } + } + + public Date getEndexacttime() { + return endexacttime; + } + + public void setEndexacttime(String endexacttime) throws ParseException { + if(endexacttime==null || "".equals(endexacttime)){ + this.endexacttime = null; + }else{ + this.endexacttime = DateUtil.getDateByParten(endexacttime,"HH:mm"); + } + } + + public BigDecimal getStarttime() { + return starttime; + } + + public void setStarttime(BigDecimal starttime) { + this.starttime = starttime; + } + + public BigDecimal getEndtime() { + return endtime; + } + + public void setEndtime(BigDecimal endtime) { + this.endtime = endtime; + } + + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } +} diff --git a/src/main/java/com/gaotao/modules/base/service/BaseService.java b/src/main/java/com/gaotao/modules/base/service/BaseService.java new file mode 100644 index 0000000..5b0dc3e --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/service/BaseService.java @@ -0,0 +1,133 @@ +package com.gaotao.modules.base.service; + +import com.gaotao.modules.base.entity.*; +import com.gaotao.modules.pda.utils.ResponseData; +import org.springframework.web.bind.annotation.RequestBody; + +import javax.servlet.http.HttpSession; +import java.text.ParseException; +import java.util.List; + +public interface BaseService { + /** + * 查询工厂日历 + * @author rq + * @return + */ + List getCalendarData(CalendarData indata); + + /** + * 查询工作类型 rq + * @return + */ + List getCalendarDatetypeData(String site); + + /** + * 维护工厂日历数据 + * @author rq + * @param + * @return + */ + ResponseData maintainCalendar(CalendarData query); + /** + * 删除工厂日历 + * @author rq + * @param + * @return + */ + ResponseData delCalendar(CalendarData inData); + /** + * 获取已安排的工作日历 + * @author rq + * @param site + * @param calendarId + * @return + */ + List getCalendarExceptionData(CalendarData inData); + + /** + * 维护班次数据 + * @param inData + * @param + * @param user + * @return + */ + ResponseData maintainShift(CalendarDatetypeShiftData inData); + + /** + * 编辑班次数据 + * @param inData + * @param + * @param user + * @return + */ + ResponseData updateShift(CalendarDatetypeShiftData inData); + /** + * 查询班次信息 + * @param + * @return + */ + List getShiftData(CalendarDatetypeData indata); + + /** + * 保存工作类型 + * @param indata + * @return + */ + ResponseData saveCalendarDatetypeData(CalendarDatetypeData indata) throws ParseException; + /** + * 删除工作类型 + * @param + * @return + */ + ResponseData delCalendarType(CalendarDatetypeData indata); + + /** + * 维护日历班次信息(批量) + * @param inData + * @param + * @return + */ + ResponseData batchSaveCDData(BatchCDListVO inData); + + /** + * 维护日历班次信息(单条) + * @param + * @param user + * @return + */ + ResponseData saveCDData(String site,String calendarId,String scheduledate,String dataType,String user); + + /** + * @Description 获取下拉框排班 + * @Title getAllShiftData + * @param site + * @author rq + * @date 2021/3/16 17:36 + * @return {@link List< CalendarDatetypeShiftData>} + * @throw + */ + + List getAllShiftData(String site); + + /** + * @Title delShift + * @Description 删除班次 + * @author rq + * @date 2021/4/16 11:57 + * @return + */ + ResponseData delShift(@RequestBody CalendarDatetypeShiftData inData); + + /** + * @Title getShiftNo + * @Description 获取班次编码 + * @author rq + * @date 2021/4/16 14:56 + * @return {@link String} + */ + + String getShiftNo(); + + +} diff --git a/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java b/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java new file mode 100644 index 0000000..774ac26 --- /dev/null +++ b/src/main/java/com/gaotao/modules/base/service/Impl/BaseServiceImpl.java @@ -0,0 +1,605 @@ +package com.gaotao.modules.base.service.Impl; + + +import com.gaotao.common.utils.DateUtil; +import com.gaotao.modules.base.dao.BaseMapper; +import com.gaotao.modules.base.entity.*; +import com.gaotao.modules.base.service.BaseService; +import com.gaotao.modules.pda.utils.ResponseData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; + +import javax.servlet.http.HttpSession; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +@Service +public class BaseServiceImpl implements BaseService { + @Autowired + private BaseMapper baseMapper; + + @Override + public List getCalendarData(CalendarData indata) { + return baseMapper.getCalendarData(indata); + } + + @Override + public List getCalendarDatetypeData(String site) { + return baseMapper.findBySite(site); + } + + @Override + public ResponseData maintainCalendar(CalendarData indata) { + ResponseData responseData = new ResponseData(); + // indata.setSite(indata.getCalendarSite()); + // String flag=baseMapper.getSiteAccessFlag(indata.getUser(),indata.getSite()); + // if(!flag.equals("Y")){ + // throw new RuntimeException("该工厂未授权,无法保存!"); + // } + //判断是新增还是修改数据 + // indata.setVersion2(indata.getVersion()+1); + int id = indata.getId(); + if(id > 0){ + //修工厂日历 + // indata.setUpdateDate(new Date()); + // indata.setUpdateBy(user); +// calendarRepo.save(indata); + int index = baseMapper.editCalendar(indata); + if(index>0){ + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("工厂日历修改成功!"); + }else{ + responseData.setMsg("修改失败,数据可能已被修改,请刷新页面!"); + return responseData; + } + }else{ + String CalendarId=indata.getCalendarId(); + CalendarData checkData = baseMapper.findByCalendarId(CalendarId); + if(checkData!=null){ + responseData.setMsg("该日历编号已存在!"); + return responseData; + } + indata.setDelflag("N"); + indata.setCreatedDate(new Date()); + // indata.setCreatedBy(user); + baseMapper.save(indata); + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("工厂日历新增成功!"); + } + return responseData; + } + + @Override + public ResponseData delCalendar(CalendarData inData) { + ResponseData responseData = new ResponseData(); + List list=baseMapper.findBySiteAndCalendarId(inData); + if(list.size()>0){ + responseData.setMsg("该日历存在工作日历例外!"); + responseData.setCode("500"); + return responseData; + } + baseMapper.delCalendar(inData.getCalendarId()); + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("删除成功!"); + return responseData; + } + @Override + public List getCalendarExceptionData(CalendarData inData) { + return baseMapper.findBySiteAndCalendarId(inData); + } + + @Override + public ResponseData maintainShift(CalendarDatetypeShiftData inData) { + ResponseData responseData = new ResponseData(); + //转换日期时间 + if(inData.getStartexacttime()!=null&&!"".equals(inData.getStartexacttime())){ + inData.setStarttime(BigDecimal.valueOf(DateUtil.getTimeforDoule(inData.getStartexacttime()))); + }else{ + inData.setStarttime(new BigDecimal(0)); + } + if(inData.getEndexacttime()!=null&&!"".equals(inData.getEndexacttime())){ + inData.setEndtime(BigDecimal.valueOf(DateUtil.getTimeforDoule(inData.getEndexacttime()))); + }else{ + inData.setEndtime(new BigDecimal(0)); + } + //判断是新增还是修改数据 + int id = inData.getId(); + if(id > 0){ + //修班次 + inData.setUpdateDate(new Date()); + inData.setUpdateBy(inData.getUser()); + inData.setVersion2(inData.getVersion()+1); + int index = baseMapper.editShift(inData); + if(index>0){ + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("班次修改成功!"); + }else{ + responseData.setMsg("修改失败,数据可能已被修改,请刷新页面!"); + return responseData; + } + }else{ + CalendarDatetypeShiftOutData checkData = baseMapper.findByShiftno(inData); + if(checkData!=null){ + responseData.setMsg("该班次已存在!"); + return responseData; + } + CalendarDatetypeData newInData=new CalendarDatetypeData(); + newInData.setSite(inData.getSite()); + newInData.setDatetype(inData.getDatetype()); + List LC = baseMapper.findBySiteAndDatetype(newInData); + if(LC.size()>0){ + for (int x=0;x LC = baseMapper.findBySiteAndDatetype2(inData); + if(LC.size()>0){ + for (int x=0;x0){ + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("班次修改成功!"); + }else{ + responseData.setMsg("修改失败,数据可能已被修改,请刷新页面!"); + + } + return responseData; + + } + + @Override + public ResponseData saveCDData(String site, String calendarId, String scheduledate,String dataType,String user) { + ResponseData responseData = new ResponseData(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + CalendarExceptionData ced = null;//工作日历工作日 + CalendarExceptionShiftData cesd = null;//工作日历班次 + CalendarDatetypeOutData cdd = null;//工作日类型 + List cdsdList = null;//工作班次类型 + try { + ced = new CalendarExceptionData();//实例化工作日历工作日 + cdd = baseMapper.findByDatetypeAndSite(dataType,site);//获取工作日类型 + ced.setSite(site); + ced.setScheduledate(sdf.parse(scheduledate)); + ced.setCalendarId(calendarId); + ced.setDatetype(dataType); + ced.setWorktime(cdd.getWorktime()); + ced.setExcepttime1(cdd.getExcepttime1()); + ced.setExcepttime2(cdd.getExcepttime2()); + ced.setExcepttime3(cdd.getExcepttime3()); + ced.setExcepttime4(cdd.getExcepttime4()); + ced.setExcepttime5(cdd.getExcepttime5()); + ced.setExcepttime6(cdd.getExcepttime6()); + ced.setExceptduration1(cdd.getExceptduration1()); + ced.setExceptduration2(cdd.getExceptduration2()); + ced.setExceptduration3(cdd.getExceptduration3()); + ced.setExceptduration4(cdd.getExceptduration4()); + ced.setExceptduration5(cdd.getExceptduration5()); + ced.setExceptduration6(cdd.getExceptduration6()); + ced.setExceptexacttime1(cdd.getExceptexacttime1()); + ced.setExceptexacttime2(cdd.getExceptexacttime2()); + ced.setExceptexacttime3(cdd.getExceptexacttime3()); + ced.setExceptexacttime4(cdd.getExceptexacttime4()); + ced.setExceptexacttime5(cdd.getExceptexacttime5()); + ced.setExceptexacttime6(cdd.getExceptexacttime6()); + ced.setDelflag("N"); + ced.setCreatedBy(user); + ced.setCreatedDate(new Date()); + //删除已经维护的日历安排 + List calendarExceptionList = baseMapper.getCalendarEByCIdAndSDate(site, calendarId, scheduledate); + + for (CalendarExceptionData calData: calendarExceptionList) { + baseMapper.deleteCEDById(calData); + } + //删除已经维护的日历班次安排 + List cesData = baseMapper.getCalendarESByCIdAndSDate(site, calendarId, scheduledate); + for(int i=0;i0){ + for(int j = 0;j getShiftData(CalendarDatetypeData indata) { + return baseMapper.findBySiteAndDatetype(indata); + } + + @Override + @Transactional + public ResponseData saveCalendarDatetypeData(CalendarDatetypeData indata) throws ParseException { + ResponseData responseData = new ResponseData(); + // String flag=baseMapper.getSiteAccessFlag(indata.getUserId(),indata.getSite()); + // if(!flag.equals("Y")){ + // throw new RuntimeException("该工厂未授权,无法保存!"); + // } + // UserOutData userOutData = (UserOutData) session.getAttribute("user"); + // indata.setSite(userOutData.getSite()); + if(indata.getExceptexacttime1()!=null&&!"".equals(indata.getExceptexacttime1())){ + indata.setExcepttime1(BigDecimal.valueOf(DateUtil.getTimeforDoule(indata.getExceptexacttime1()))); + }else{ + indata.setExcepttime1(new BigDecimal(0)); + } + if(indata.getExceptexacttime2()!=null&&!"".equals(indata.getExceptexacttime2())){ + indata.setExcepttime2(BigDecimal.valueOf(DateUtil.getTimeforDoule(indata.getExceptexacttime2()))); + }else{ + indata.setExcepttime2(new BigDecimal(0)); + } + if(indata.getExceptexacttime3()!=null&&!"".equals(indata.getExceptexacttime3())){ + indata.setExcepttime3(BigDecimal.valueOf(DateUtil.getTimeforDoule(indata.getExceptexacttime3()))); + }else{ + indata.setExcepttime3(new BigDecimal(0)); + } + if(indata.getExceptexacttime4()!=null&&!"".equals(indata.getExceptexacttime4())){ + indata.setExcepttime4(BigDecimal.valueOf(DateUtil.getTimeforDoule(indata.getExceptexacttime4()))); + }else{ + indata.setExcepttime4(new BigDecimal(0)); + } + if(indata.getExceptexacttime5()!=null&&!"".equals(indata.getExceptexacttime5())){ + indata.setExcepttime5(BigDecimal.valueOf(DateUtil.getTimeforDoule(indata.getExceptexacttime5()))); + }else{ + indata.setExcepttime5(new BigDecimal(0)); + } + if(indata.getExceptexacttime6()!=null&&!"".equals(indata.getExceptexacttime6())){ + indata.setExcepttime6(BigDecimal.valueOf(DateUtil.getTimeforDoule(indata.getExceptexacttime6()))); + }else{ + indata.setExcepttime6(new BigDecimal(0)); + } + //计算工作时长 + BigDecimal dayTime = new BigDecimal(24); + BigDecimal worktime = indata.getExceptduration1() + .add(indata.getExceptduration2() + .add(indata.getExceptduration3() + .add(indata.getExceptduration4() + .add(indata.getExceptduration5() + .add(indata.getExceptduration6()))))); + int i = worktime.compareTo(BigDecimal.ZERO); + if(i==-1){//判断工作时间是否小于0 + responseData.setMsg("工作时间不可以小于0!"); + responseData.setCode("500"); + return responseData; + } + //24小时减去休息时间 + indata.setWorktime(dayTime.subtract(worktime)); + //判断休息时间 + if(indata.getExceptexacttime1()!=null&&!"".equals(indata.getExceptexacttime1()) + &&indata.getExceptexacttime2()!=null&&!"".equals(indata.getExceptexacttime2())){ + if(!((indata.getExceptduration1().add(indata.getExcepttime1())).compareTo(indata.getExcepttime2())==-1)){ + responseData.setMsg("休息时间点2小于休息时间点1"); + responseData.setCode("500"); + return responseData; + } + } + if(indata.getExceptexacttime2()!=null&&!"".equals(indata.getExceptexacttime2()) + &&indata.getExceptexacttime3()!=null&&!"".equals(indata.getExceptexacttime3())){ + if(!((indata.getExceptduration2().add(indata.getExcepttime2())).compareTo(indata.getExcepttime3())==-1)){ + responseData.setMsg("休息时间点3小于休息时间点2"); + responseData.setCode("500"); + return responseData; + } + } + if(indata.getExceptexacttime3()!=null&&!"".equals(indata.getExceptexacttime3()) + &&indata.getExceptexacttime4()!=null&&!"".equals(indata.getExceptexacttime4())){ + if(!((indata.getExceptduration3().add(indata.getExcepttime3())).compareTo(indata.getExcepttime4())==-1)){ + responseData.setMsg("休息时间点4小于休息时间点3"); + responseData.setCode("500"); + return responseData; + } + } + if(indata.getExceptexacttime4()!=null&&!"".equals(indata.getExceptexacttime4()) + &&indata.getExceptexacttime5()!=null&&!"".equals(indata.getExceptexacttime5())){ + if(!((indata.getExceptduration4().add(indata.getExcepttime4())).compareTo(indata.getExcepttime5())==-1)){ + responseData.setMsg("休息时间点5小于休息时间点4"); + responseData.setCode("500"); + return responseData; + } + } + if(indata.getExceptexacttime5()!=null&&!"".equals(indata.getExceptexacttime5()) + &&indata.getExceptexacttime6()!=null&&!"".equals(indata.getExceptexacttime6())){ + if(!((indata.getExceptduration5().add(indata.getExcepttime5())).compareTo(indata.getExcepttime6())==-1)){ + responseData.setMsg("休息时间点6小于休息时间点5"); + responseData.setCode("500"); + return responseData; + } + } + if(indata.getExceptexacttime2()==null){ + indata.setExceptexacttime2("00:00"); + } + if(indata.getExceptexacttime3()==null){ + indata.setExceptexacttime3("00:00"); + } + if(indata.getExceptexacttime4()==null){ + indata.setExceptexacttime4("00:00"); + } + if(indata.getExceptexacttime5()==null){ + indata.setExceptexacttime5("00:00"); + } + if(indata.getExceptexacttime6()==null){ + indata.setExceptexacttime6("00:00"); + } + //根据班次编号及厂商编号查询该条数据是否存在 + CalendarDatetypeData outdata = baseMapper.findCDDByDatetypeAndSite(indata.getDatetype(),indata.getSite()); + if(outdata!=null && indata.getId()==0){ + responseData.setMsg("该工作类型已经存在!"); + responseData.setCode("500"); + return responseData; + } + if(indata.getId()==0){ + indata.setDelflag("N"); + // indata.setCreatedBy(userOutData.getUsername()); + indata.setCreatedDate(new Date()); + //保存 + baseMapper.saveCDD(indata); + responseData.setMsg("保存成功!"); + responseData.setSuccess(true); + responseData.setCode("200"); + return responseData; + }else{ + // CalendarDatetypeData OriginalData = baseMapper.findCDDById(indata.getId()); + // indata.setUpdateBy(userOutData.getUsername()); + indata.setUpdateDate(new Date()); + // indata.setCreatedBy(OriginalData.getCreatedBy()); + // indata.setCreatedDate(OriginalData.getCreatedDate()); + // indata.setDelflag(OriginalData.getDelflag()); + // indata.setVersion2(indata.getVersion()+1); + //更改 + baseMapper.updateCDD(indata); + responseData.setMsg("编辑成功!"); + responseData.setSuccess(true); + responseData.setCode("200"); + return responseData; + } + + + } + + @Override + public ResponseData delCalendarType(CalendarDatetypeData indata) { + ResponseData responseData = new ResponseData(); + //查找工作日类型下是否有班次 + List lcc=baseMapper.findBySiteAndDatetype(indata); + //查找工作日类型是否被引用 + List lc= baseMapper.findDateType(indata); + if(lcc.size()!=0){ + responseData.setMsg("该工作日类型存在班次!"); + responseData.setCode("500"); + return responseData; + } + if(lc.size()!=0){ + responseData.setMsg("该工作日类型已被引用!"); + responseData.setCode("500"); + return responseData; + } + baseMapper.deleteById(indata); + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("删除成功!"); + return responseData; + } + @Override + @Transactional + public ResponseData batchSaveCDData(BatchCDListVO inData) { + ResponseData responseData = new ResponseData(); + List listData = inData.getBatchCDVoList(); + List timeList = inData.getTimeList(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + CalendarExceptionData ced = null;//工作日历工作日 + CalendarExceptionShiftData cesd = null;//工作日历班次 + CalendarDatetypeOutData cdd = null;//工作日类型 + List cdsdList = null;//工作班次类型 + try { + if(listData.size()==0){ + responseData.setMsg("请选择数据!"); + return responseData; + }else{ + for(int i = 0;i ceData = baseMapper.getCalendarEByCIdAndSDate(listData.get(i).getSite(), listData.get(i).getCalendarId(), timeList.get(k)); + if(ceData.size()>0){ + deleteAllCE(ceData); + } + //删除已经维护的日历班次安排 + List cesData = baseMapper.getCalendarESByCIdAndSDate(listData.get(i).getSite(), listData.get(i).getCalendarId(), timeList.get(k)); + if(cesData.size()>0){ + deleteAllCES(cesData); + } + baseMapper.saveCED(ced); + CalendarDatetypeData newInData=new CalendarDatetypeData(); + newInData.setSite(listData.get(i).getSite()); + newInData.setDatetype(valArr[k]); + cdsdList = baseMapper.findBySiteAndDatetype(newInData); + if(cdsdList.size()>0){ + for(int j = 0;j ceData){ + for(int i=0;i cesData){ + for(int i=0;i getAllShiftData(String site){ + return baseMapper.getAllShiftData(site); + } + + @Override + public ResponseData delShift(@RequestBody CalendarDatetypeShiftData inData) { + ResponseData responseData = new ResponseData(); + + baseMapper.deleteShift(inData); + responseData.setCode("200"); + responseData.setSuccess(true); + responseData.setMsg("删除成功!"); + return responseData; + } + + @Override + public String getShiftNo() { + int number = baseMapper.getShiftNo(); + int no=number+1; + String shiftNo="BC"+String.format("%06d", no); + return shiftNo; + } + + + +} diff --git a/src/main/resources/mapper/base/BaseMapper.xml b/src/main/resources/mapper/base/BaseMapper.xml new file mode 100644 index 0000000..ff181f3 --- /dev/null +++ b/src/main/resources/mapper/base/BaseMapper.xml @@ -0,0 +1,280 @@ + + + + + + + + + + UPDATE calendar set CalendarDesc=#{calendarDesc},status=#{status} + + WHERE CalendarID = #{calendarId} + + + + + + + + + + + INSERT INTO calendar(site,calendarID,calendarDesc,status) + VALUES (#{site},#{calendarId},#{calendarDesc},#{status}) + + + + DELETE FROM calendar WHERE CalendarID = #{calendarId} + + + + + + + + + + + UPDATE calendar_datetype_shift set shiftdesc=#{shiftdesc},startexacttime=#{startexacttime} + ,endexacttime=#{endexacttime},starttime=#{starttime},endtime=#{endtime} + + + AND site = #{site} + + AND DateType = #{datetype} + and ShiftNo =#{shiftno} + + + + + + + + + INSERT INTO calendar_datetype_shift (shiftno,datetype,site,shiftdesc,startexacttime,endexacttime,starttime,endtime) + VALUES (#{shiftno},#{datetype},#{site},#{shiftdesc},#{startexacttime},#{endexacttime},#{starttime},#{endtime}) + + + + + + + + + + + + INSERT INTO calendar_datetype (site,datetype,excepttime1,exceptduration1,excepttime2,exceptduration2,excepttime3,exceptduration3,excepttime4,exceptduration4, + excepttime5,exceptduration5,excepttime6,exceptduration6,worktime,remark,exceptexacttime1,exceptexacttime2,exceptexacttime3,exceptexacttime4,exceptexacttime5,exceptexacttime6) + VALUES(#{site},#{datetype},#{excepttime1},#{exceptduration1},#{excepttime2},#{exceptduration2},#{excepttime3},#{exceptduration3},#{excepttime4},#{exceptduration4}, + #{excepttime5},#{exceptduration5},#{excepttime6},#{exceptduration6},#{worktime},#{remark},#{exceptexacttime1},#{exceptexacttime2},#{exceptexacttime3},#{exceptexacttime4},#{exceptexacttime5},#{exceptexacttime6}) + + + + DELETE FROM calendar_datetype WHERE site= #{site} and datetype=#{datetype} + + + + + + DELETE FROM calendar_exception_shift WHERE site = #{site} AND CalendarId = #{calendarId} AND ScheduleDate = #{scheduledate} + + + + INSERT INTO calendar_exception (site,CalendarID,scheduledate,excepttime1,exceptduration1,excepttime2,exceptduration2,excepttime3 + ,exceptduration3,excepttime4,exceptduration4,excepttime5,exceptduration5,excepttime6,exceptduration6,worktime,datetype,exceptexacttime1 + ,exceptexacttime2,exceptexacttime3,exceptexacttime4,exceptexacttime5,exceptexacttime6) + VALUES (#{site},#{calendarId},#{scheduledate},#{excepttime1},#{exceptduration1},#{excepttime2},#{exceptduration2},#{excepttime3}, + #{exceptduration3},#{excepttime4},#{exceptduration4},#{excepttime5},#{exceptduration5},#{excepttime6},#{exceptduration6},#{worktime},#{datetype},#{exceptexacttime1} + ,#{exceptexacttime2},#{exceptexacttime3},#{exceptexacttime4},#{exceptexacttime5},#{exceptexacttime6}) + + + + INSERT INTO calendar_exception_shift (site,calendarID,shiftno,scheduledate,shiftdesc,startexacttime,endexacttime, + starttime,endtime) + VALUES (#{site},#{calendarId},#{shiftno},#{scheduledate},#{shiftdesc},#{startexacttime},#{endexacttime}, + #{starttime},#{endtime}) + + + + DELETE FROM calendar_exception WHERE site = #{site} and CalendarId = #{calendarId} AND scheduledate = #{scheduledate} + + + + UPDATE calendar_datetype set excepttime1=#{excepttime1},exceptduration1=#{exceptduration1}, + excepttime2=#{excepttime2},exceptduration2=#{exceptduration2},excepttime3=#{excepttime3},exceptduration3=#{exceptduration3},excepttime4=#{excepttime4},exceptduration4=#{exceptduration4}, + excepttime5=#{excepttime5},exceptduration5=#{exceptduration5},excepttime6=#{excepttime6},exceptduration6=#{exceptduration6},worktime=#{worktime},remark=#{remark},exceptexacttime1=#{exceptexacttime1}, + exceptexacttime2=#{exceptexacttime2},exceptexacttime3=#{exceptexacttime3},exceptexacttime4=#{exceptexacttime4},exceptexacttime5=#{exceptexacttime5},exceptexacttime6=#{exceptexacttime6} + + + AND site = #{site} + + + AND datetype = #{datetype} + + + + + + + + + DELETE FROM calendar_datetype_shift WHERE shiftno=#{shiftno} AND site=#{site} AND DateType=#{datetype} + + + + + + + + \ No newline at end of file