first commit
This commit is contained in:
57
ktg-mes/pom.xml
Normal file
57
ktg-mes/pom.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ktg</artifactId>
|
||||
<groupId>com.ktg</groupId>
|
||||
<version>3.8.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ktg-mes</artifactId>
|
||||
|
||||
<description>
|
||||
MES 系统
|
||||
</description>
|
||||
<dependencies>
|
||||
<!--jasperreport组件-->
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports</artifactId>
|
||||
<version>6.18.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports-fonts</artifactId>
|
||||
<version>6.18.1</version>
|
||||
</dependency>
|
||||
<!--PDF生成组件-->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext-pdfa</artifactId>
|
||||
<version>5.5.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itext-asian</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ktg</groupId>
|
||||
<artifactId>ktg-framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
14
ktg-mes/src/main/java/com/ktg/mes/aspect/BarcodeGen.java
Normal file
14
ktg-mes/src/main/java/com/ktg/mes/aspect/BarcodeGen.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.ktg.mes.aspect;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface BarcodeGen {
|
||||
/**
|
||||
* 业务类型
|
||||
* @return
|
||||
*/
|
||||
String barcodeType();
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.ktg.mes.aspect;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.mes.wm.domain.WmBarcodeConfig;
|
||||
import com.ktg.mes.wm.service.IWmBarcodeConfigService;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
public class BarcodeGenAspect {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BarcodeGenAspect.class);
|
||||
|
||||
@Autowired
|
||||
private IWmBarcodeConfigService wmBarcodeConfigService;
|
||||
|
||||
/**
|
||||
* 根据业务controller的类型和返回值生成对应的条码
|
||||
* @param joinPoint
|
||||
* @param gen
|
||||
* @param returnResult
|
||||
*/
|
||||
@AfterReturning(pointcut = "@annotation(gen)",returning = "returnResult")
|
||||
public void doAfter(JoinPoint joinPoint, BarcodeGen gen, AjaxResult returnResult){
|
||||
//先判断当前类型的业务是否配置了需要自动生成条码
|
||||
if(!wmBarcodeConfigService.isAutoGen(gen.barcodeType())){
|
||||
//无需自动生成条码
|
||||
return ;
|
||||
}
|
||||
WmBarcodeConfig param = new WmBarcodeConfig();
|
||||
param.setBarcodeType(gen.barcodeType());
|
||||
List<WmBarcodeConfig> confgs = wmBarcodeConfigService.selectWmBarcodeConfigList(param);
|
||||
if(CollectionUtils.isEmpty(confgs)){
|
||||
log.warn("当前类型的业务未配置对应的条码生成规则!{}",gen.barcodeType());
|
||||
}
|
||||
|
||||
Long businessId = (Long)returnResult.get("data"); //获取业务ID
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.cal.domain.CalCalendar;
|
||||
import com.ktg.mes.cal.domain.CalHoliday;
|
||||
import com.ktg.mes.cal.service.ICalCalendarService;
|
||||
import com.ktg.mes.cal.service.ICalHolidayService;
|
||||
import com.ktg.mes.cal.utils.CalendarUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 排班日历
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/calendar")
|
||||
public class CalCalendarController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ICalCalendarService calCalendarService;
|
||||
|
||||
@Autowired
|
||||
private ICalHolidayService calHolidayService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calendar:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult getCalendars(CalCalendar calCalendar){
|
||||
|
||||
Date day = calCalendar.getDate();
|
||||
List<CalCalendar> days = null;
|
||||
if(StringUtils.isNull(day)){
|
||||
day = new Date();
|
||||
}
|
||||
|
||||
if(UserConstants.CAL_QUERY_BY_TYPE.equals(calCalendar.getQueryType())){
|
||||
days=calCalendarService.getCalendarByType(day,calCalendar.getCalendarType());
|
||||
}else if(UserConstants.CAL_QUERY_BY_TEAM.equals(calCalendar.getQueryType())){
|
||||
days=calCalendarService.getCalendarByTeam(day,calCalendar.getTeamId());
|
||||
}else {
|
||||
days=calCalendarService.getCalendarByUser(day,calCalendar.getUserId());
|
||||
}
|
||||
return AjaxResult.success(getCalendarsWithoutHoliday(days));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过滤掉节假日
|
||||
* @param days
|
||||
* @return
|
||||
*/
|
||||
private List<CalCalendar> getCalendarsWithoutHoliday(List<CalCalendar> days){
|
||||
CalHoliday param = new CalHoliday();
|
||||
List<CalHoliday> holidays = calHolidayService.selectCalHolidayList(param);
|
||||
if(CollUtil.isNotEmpty(holidays)){
|
||||
List<CalCalendar> results = days.stream().filter(
|
||||
calCalendar -> holidays.stream().filter(calHoliday -> calCalendar.getTheDay().equals(CalendarUtil.getDateStr(calHoliday.getTheDay()))).collect(Collectors.toList()).size()==0
|
||||
).collect(Collectors.toList());
|
||||
return results;
|
||||
}
|
||||
return days;
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.cal.domain.CalHoliday;
|
||||
import com.ktg.mes.cal.service.ICalHolidayService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 节假日设置Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/calholiday")
|
||||
public class CalHolidayController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICalHolidayService calHolidayService;
|
||||
|
||||
/**
|
||||
* 查询节假日设置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calholiday:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(CalHoliday calHoliday)
|
||||
{
|
||||
List<CalHoliday> list = calHolidayService.selectCalHolidayList(calHoliday);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出节假日设置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calholiday:export')")
|
||||
@Log(title = "节假日设置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CalHoliday calHoliday)
|
||||
{
|
||||
List<CalHoliday> list = calHolidayService.selectCalHolidayList(calHoliday);
|
||||
ExcelUtil<CalHoliday> util = new ExcelUtil<CalHoliday>(CalHoliday.class);
|
||||
util.exportExcel(response, list, "节假日设置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节假日设置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calholiday:query')")
|
||||
@GetMapping(value = "/{holidayId}")
|
||||
public AjaxResult getInfo(@PathVariable("holidayId") Long holidayId)
|
||||
{
|
||||
return AjaxResult.success(calHolidayService.selectCalHolidayByHolidayId(holidayId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增节假日设置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calholiday:add')")
|
||||
@Log(title = "节假日设置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CalHoliday calHoliday)
|
||||
{
|
||||
CalHoliday param = new CalHoliday();
|
||||
param.setTheDay(calHoliday.getTheDay());
|
||||
List<CalHoliday> days = calHolidayService.selectCalHolidayList(param);
|
||||
if(CollUtil.isNotEmpty(days)){
|
||||
calHoliday.setHolidayId(days.get(0).getHolidayId());
|
||||
return toAjax(calHolidayService.updateCalHoliday(calHoliday));
|
||||
}else{
|
||||
return toAjax(calHolidayService.insertCalHoliday(calHoliday));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改节假日设置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calholiday:edit')")
|
||||
@Log(title = "节假日设置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CalHoliday calHoliday)
|
||||
{
|
||||
return toAjax(calHolidayService.updateCalHoliday(calHoliday));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除节假日设置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calholiday:remove')")
|
||||
@Log(title = "节假日设置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{holidayIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] holidayIds)
|
||||
{
|
||||
return toAjax(calHolidayService.deleteCalHolidayByHolidayIds(holidayIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||
import com.ktg.mes.cal.service.ICalPlanTeamService;
|
||||
import com.ktg.mes.cal.service.ICalShiftService;
|
||||
import com.ktg.mes.cal.service.ICalTeamshiftService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.cal.domain.CalPlan;
|
||||
import com.ktg.mes.cal.service.ICalPlanService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排班计划Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/calplan")
|
||||
public class CalPlanController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICalPlanService calPlanService;
|
||||
|
||||
@Autowired
|
||||
private ICalShiftService calShiftService;
|
||||
|
||||
@Autowired
|
||||
private ICalPlanTeamService calPlanTeamService;
|
||||
|
||||
@Autowired
|
||||
private ICalTeamshiftService calTeamshiftService;
|
||||
|
||||
/**
|
||||
* 查询排班计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CalPlan calPlan)
|
||||
{
|
||||
startPage();
|
||||
List<CalPlan> list = calPlanService.selectCalPlanList(calPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排班计划列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:export')")
|
||||
@Log(title = "排班计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CalPlan calPlan)
|
||||
{
|
||||
List<CalPlan> list = calPlanService.selectCalPlanList(calPlan);
|
||||
ExcelUtil<CalPlan> util = new ExcelUtil<CalPlan>(CalPlan.class);
|
||||
util.exportExcel(response, list, "排班计划数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排班计划详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:query')")
|
||||
@GetMapping(value = "/{planId}")
|
||||
public AjaxResult getInfo(@PathVariable("planId") Long planId)
|
||||
{
|
||||
return AjaxResult.success(calPlanService.selectCalPlanByPlanId(planId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排班计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:add')")
|
||||
@Log(title = "排班计划", businessType = BusinessType.INSERT)
|
||||
@Transactional
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CalPlan calPlan)
|
||||
{
|
||||
int ret = calPlanService.insertCalPlan(calPlan);
|
||||
//根据选择的轮班方式生成默认的班次
|
||||
calShiftService.addDefaultShift(calPlan.getPlanId(),calPlan.getShiftType());
|
||||
return toAjax(ret);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改排班计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:edit')")
|
||||
@Log(title = "排班计划", businessType = BusinessType.UPDATE)
|
||||
@Transactional
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CalPlan calPlan)
|
||||
{
|
||||
if(UserConstants.ORDER_STATUS_CONFIRMED.equals(calPlan.getStatus())){
|
||||
|
||||
//检查班组配置
|
||||
List<CalPlanTeam> teams = calPlanTeamService.selectCalPlanTeamListByPlanId(calPlan.getPlanId());
|
||||
if(CollectionUtil.isEmpty(teams)){
|
||||
return AjaxResult.error("请配置班组!");
|
||||
} else if(teams.size() != 2 && UserConstants.CAL_SHIFT_TYPE_TWO.equals(calPlan.getShiftType())){
|
||||
return AjaxResult.error("两班倒请配置两个班组!");
|
||||
} else if(teams.size() !=3 && UserConstants.CAL_SHIFT_TYPE_THREE.equals(calPlan.getShiftType())){
|
||||
return AjaxResult.error("三倒请配置三个班组!");
|
||||
}
|
||||
|
||||
calTeamshiftService.genRecords(calPlan.getPlanId());
|
||||
}
|
||||
return toAjax(calPlanService.updateCalPlan(calPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排班计划
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:remove')")
|
||||
@Log(title = "排班计划", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{planIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] planIds)
|
||||
{
|
||||
for (Long planId:planIds
|
||||
) {
|
||||
//状态判断
|
||||
CalPlan plan = calPlanService.selectCalPlanByPlanId(planId);
|
||||
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
|
||||
return AjaxResult.error("只能删除草稿状态单据!");
|
||||
}
|
||||
calShiftService.deleteByPlanId(planId);
|
||||
calPlanTeamService.deleteByPlanId(planId);
|
||||
}
|
||||
return toAjax(calPlanService.deleteCalPlanByPlanIds(planIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||
import com.ktg.mes.cal.service.ICalPlanTeamService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计划班组Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/planteam")
|
||||
public class CalPlanTeamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICalPlanTeamService calPlanTeamService;
|
||||
|
||||
/**
|
||||
* 查询计划班组列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CalPlanTeam calPlanTeam)
|
||||
{
|
||||
startPage();
|
||||
List<CalPlanTeam> list = calPlanTeamService.selectCalPlanTeamList(calPlanTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划班组列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:export')")
|
||||
@Log(title = "计划班组", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CalPlanTeam calPlanTeam)
|
||||
{
|
||||
List<CalPlanTeam> list = calPlanTeamService.selectCalPlanTeamList(calPlanTeam);
|
||||
ExcelUtil<CalPlanTeam> util = new ExcelUtil<CalPlanTeam>(CalPlanTeam.class);
|
||||
util.exportExcel(response, list, "计划班组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划班组详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(calPlanTeamService.selectCalPlanTeamByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划班组
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:add')")
|
||||
@Log(title = "计划班组", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CalPlanTeam calPlanTeam)
|
||||
{
|
||||
if (UserConstants.NOT_UNIQUE.equals(calPlanTeamService.checkPlanTeamUnique(calPlanTeam))) {
|
||||
return AjaxResult.error("班组已添加,不能重复添加!");
|
||||
}
|
||||
return toAjax(calPlanTeamService.insertCalPlanTeam(calPlanTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划班组
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:edit')")
|
||||
@Log(title = "计划班组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CalPlanTeam calPlanTeam)
|
||||
{
|
||||
return toAjax(calPlanTeamService.updateCalPlanTeam(calPlanTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划班组
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:remove')")
|
||||
@Log(title = "计划班组", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(calPlanTeamService.deleteCalPlanTeamByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.cal.domain.CalPlan;
|
||||
import com.ktg.mes.cal.service.ICalPlanService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.cal.domain.CalShift;
|
||||
import com.ktg.mes.cal.service.ICalShiftService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计划班次Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/shift")
|
||||
public class CalShiftController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICalShiftService calShiftService;
|
||||
|
||||
@Autowired
|
||||
private ICalPlanService calPlanService;
|
||||
|
||||
/**
|
||||
* 查询计划班次列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CalShift calShift)
|
||||
{
|
||||
startPage();
|
||||
List<CalShift> list = calShiftService.selectCalShiftList(calShift);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划班次列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:export')")
|
||||
@Log(title = "计划班次", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CalShift calShift)
|
||||
{
|
||||
List<CalShift> list = calShiftService.selectCalShiftList(calShift);
|
||||
ExcelUtil<CalShift> util = new ExcelUtil<CalShift>(CalShift.class);
|
||||
util.exportExcel(response, list, "计划班次数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划班次详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:query')")
|
||||
@GetMapping(value = "/{shiftId}")
|
||||
public AjaxResult getInfo(@PathVariable("shiftId") Long shiftId)
|
||||
{
|
||||
return AjaxResult.success(calShiftService.selectCalShiftByShiftId(shiftId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划班次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:add')")
|
||||
@Log(title = "计划班次", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CalShift calShift)
|
||||
{
|
||||
int count = calShiftService.checkShiftCount(calShift.getPlanId());
|
||||
CalPlan plan = calPlanService.selectCalPlanByPlanId(calShift.getPlanId());
|
||||
if(UserConstants.CAL_SHIFT_TYPE_SINGLE.equals(plan.getShiftType())&&count>0){
|
||||
return AjaxResult.error("轮班方式为 白班 时只能有一个班次!");
|
||||
}
|
||||
if(UserConstants.CAL_SHIFT_TYPE_TWO.equals(plan.getShiftType())&&count>1){
|
||||
return AjaxResult.error("轮班方式为 两班倒 时只能有两个班次!");
|
||||
}
|
||||
if(UserConstants.CAL_SHIFT_TYPE_THREE.equals(plan.getShiftType())&&count>2){
|
||||
return AjaxResult.error("轮班方式为 三班倒 时只能有三个班次!");
|
||||
}
|
||||
|
||||
return toAjax(calShiftService.insertCalShift(calShift));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划班次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:edit')")
|
||||
@Log(title = "计划班次", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CalShift calShift)
|
||||
{
|
||||
return toAjax(calShiftService.updateCalShift(calShift));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划班次
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:calplan:remove')")
|
||||
@Log(title = "计划班次", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{shiftIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] shiftIds)
|
||||
{
|
||||
return toAjax(calShiftService.deleteCalShiftByShiftIds(shiftIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.mes.cal.service.ICalTeamMemberService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.cal.domain.CalTeam;
|
||||
import com.ktg.mes.cal.service.ICalTeamService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 班组Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/team")
|
||||
public class CalTeamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICalTeamService calTeamService;
|
||||
|
||||
@Autowired
|
||||
private ICalTeamMemberService calTeamMemberService;
|
||||
|
||||
/**
|
||||
* 查询班组列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CalTeam calTeam)
|
||||
{
|
||||
startPage();
|
||||
List<CalTeam> list = calTeamService.selectCalTeamList(calTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有班组列表
|
||||
*/
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll(){
|
||||
CalTeam calTeam= new CalTeam();
|
||||
List<CalTeam> list = calTeamService.selectCalTeamList(calTeam);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班组列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:export')")
|
||||
@Log(title = "班组", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CalTeam calTeam)
|
||||
{
|
||||
List<CalTeam> list = calTeamService.selectCalTeamList(calTeam);
|
||||
ExcelUtil<CalTeam> util = new ExcelUtil<CalTeam>(CalTeam.class);
|
||||
util.exportExcel(response, list, "班组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班组详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:query')")
|
||||
@GetMapping(value = "/{teamId}")
|
||||
public AjaxResult getInfo(@PathVariable("teamId") Long teamId)
|
||||
{
|
||||
return AjaxResult.success(calTeamService.selectCalTeamByTeamId(teamId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:add')")
|
||||
@Log(title = "班组", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CalTeam calTeam)
|
||||
{
|
||||
return toAjax(calTeamService.insertCalTeam(calTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:edit')")
|
||||
@Log(title = "班组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CalTeam calTeam)
|
||||
{
|
||||
return toAjax(calTeamService.updateCalTeam(calTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:remove')")
|
||||
@Log(title = "班组", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{teamIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] teamIds)
|
||||
{
|
||||
for (Long teamId:teamIds
|
||||
) {
|
||||
calTeamMemberService.deleteByTeamId(teamId);
|
||||
}
|
||||
return toAjax(calTeamService.deleteCalTeamByTeamIds(teamIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.ktg.mes.cal.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.cal.domain.CalTeamMember;
|
||||
import com.ktg.mes.cal.service.ICalTeamMemberService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 班组成员Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/cal/teammember")
|
||||
public class CalTeamMemberController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICalTeamMemberService calTeamMemberService;
|
||||
|
||||
/**
|
||||
* 查询班组成员列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CalTeamMember calTeamMember)
|
||||
{
|
||||
startPage();
|
||||
List<CalTeamMember> list = calTeamMemberService.selectCalTeamMemberList(calTeamMember);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班组成员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:export')")
|
||||
@Log(title = "班组成员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CalTeamMember calTeamMember)
|
||||
{
|
||||
List<CalTeamMember> list = calTeamMemberService.selectCalTeamMemberList(calTeamMember);
|
||||
ExcelUtil<CalTeamMember> util = new ExcelUtil<CalTeamMember>(CalTeamMember.class);
|
||||
util.exportExcel(response, list, "班组成员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班组成员详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:query')")
|
||||
@GetMapping(value = "/{memberId}")
|
||||
public AjaxResult getInfo(@PathVariable("memberId") Long memberId)
|
||||
{
|
||||
return AjaxResult.success(calTeamMemberService.selectCalTeamMemberByMemberId(memberId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:add')")
|
||||
@Log(title = "班组成员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CalTeamMember calTeamMember)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(calTeamMemberService.checkUserUnique(calTeamMember))){
|
||||
return AjaxResult.error("用户"+calTeamMember.getNickName()+"已分配过班组!");
|
||||
}
|
||||
|
||||
return toAjax(calTeamMemberService.insertCalTeamMember(calTeamMember));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组成员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:cal:team:remove')")
|
||||
@Log(title = "班组成员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{memberIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] memberIds)
|
||||
{
|
||||
return toAjax(calTeamMemberService.deleteCalTeamMemberByMemberIds(memberIds));
|
||||
}
|
||||
}
|
113
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalCalendar.java
Normal file
113
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalCalendar.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class CalCalendar extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 查询参数部分
|
||||
*/
|
||||
private String queryType;
|
||||
|
||||
private Date date;
|
||||
|
||||
private String calendarType;
|
||||
|
||||
private Long teamId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
|
||||
/**
|
||||
* 返回值部分
|
||||
*/
|
||||
private String theDay;
|
||||
|
||||
private String shiftType;
|
||||
|
||||
private List<CalTeamshift> teamShifts;
|
||||
|
||||
|
||||
public String getQueryType() {
|
||||
return queryType;
|
||||
}
|
||||
|
||||
public void setQueryType(String queryType) {
|
||||
this.queryType = queryType;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getCalendarType() {
|
||||
return calendarType;
|
||||
}
|
||||
|
||||
public void setCalendarType(String calendarType) {
|
||||
this.calendarType = calendarType;
|
||||
}
|
||||
|
||||
public Long getTeamId() {
|
||||
return teamId;
|
||||
}
|
||||
|
||||
public void setTeamId(Long teamId) {
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getTheDay() {
|
||||
return theDay;
|
||||
}
|
||||
|
||||
public void setTheDay(String theDay) {
|
||||
this.theDay = theDay;
|
||||
}
|
||||
|
||||
public String getShiftType() {
|
||||
return shiftType;
|
||||
}
|
||||
|
||||
public void setShiftType(String shiftType) {
|
||||
this.shiftType = shiftType;
|
||||
}
|
||||
|
||||
public List<CalTeamshift> getTeamShifts() {
|
||||
return teamShifts;
|
||||
}
|
||||
|
||||
public void setTeamShifts(List<CalTeamshift> teamShifts) {
|
||||
this.teamShifts = teamShifts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CalCalendar{" +
|
||||
"queryType='" + queryType + '\'' +
|
||||
", date='" + date + '\'' +
|
||||
", calendarType='" + calendarType + '\'' +
|
||||
", teamId=" + teamId +
|
||||
", userId=" + userId +
|
||||
", theDay=" + theDay +
|
||||
", shiftType='" + shiftType + '\'' +
|
||||
", teamShifts=" + teamShifts +
|
||||
'}';
|
||||
}
|
||||
}
|
155
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalHoliday.java
Normal file
155
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalHoliday.java
Normal file
@ -0,0 +1,155 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 节假日设置对象 cal_holiday
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-08
|
||||
*/
|
||||
public class CalHoliday extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long holidayId;
|
||||
|
||||
/** 日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date theDay;
|
||||
|
||||
/** 日期类型 */
|
||||
@Excel(name = "日期类型")
|
||||
private String holidayType;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setHolidayId(Long holidayId)
|
||||
{
|
||||
this.holidayId = holidayId;
|
||||
}
|
||||
|
||||
public Long getHolidayId()
|
||||
{
|
||||
return holidayId;
|
||||
}
|
||||
public void setTheDay(Date theDay)
|
||||
{
|
||||
this.theDay = theDay;
|
||||
}
|
||||
|
||||
public Date getTheDay()
|
||||
{
|
||||
return theDay;
|
||||
}
|
||||
public void setHolidayType(String holidayType)
|
||||
{
|
||||
this.holidayType = holidayType;
|
||||
}
|
||||
|
||||
public String getHolidayType()
|
||||
{
|
||||
return holidayType;
|
||||
}
|
||||
public void setStartTime(Date startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
public void setEndTime(Date endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Date getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("holidayId", getHolidayId())
|
||||
.append("theDay", getTheDay())
|
||||
.append("holidayType", getHolidayType())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
213
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalPlan.java
Normal file
213
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalPlan.java
Normal file
@ -0,0 +1,213 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 排班计划对象 cal_plan
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
public class CalPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 计划编号 */
|
||||
@Excel(name = "计划编号")
|
||||
private String planCode;
|
||||
|
||||
/** 计划名称 */
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
private String calendarType;
|
||||
|
||||
/** 开始日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/** 结束日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/** 轮班方式 */
|
||||
@Excel(name = "轮班方式")
|
||||
private String shiftType;
|
||||
|
||||
/** 倒班方式 */
|
||||
@Excel(name = "倒班方式")
|
||||
private String shiftMethod;
|
||||
|
||||
/** 数 */
|
||||
@Excel(name = "数")
|
||||
private Long shiftCount;
|
||||
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setPlanId(Long planId)
|
||||
{
|
||||
this.planId = planId;
|
||||
}
|
||||
|
||||
public Long getPlanId()
|
||||
{
|
||||
return planId;
|
||||
}
|
||||
public void setPlanCode(String planCode)
|
||||
{
|
||||
this.planCode = planCode;
|
||||
}
|
||||
|
||||
public String getPlanCode()
|
||||
{
|
||||
return planCode;
|
||||
}
|
||||
public void setPlanName(String planName)
|
||||
{
|
||||
this.planName = planName;
|
||||
}
|
||||
|
||||
public String getPlanName()
|
||||
{
|
||||
return planName;
|
||||
}
|
||||
public void setStartDate(Date startDate)
|
||||
{
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getCalendarType() {
|
||||
return calendarType;
|
||||
}
|
||||
|
||||
public void setCalendarType(String calendarType) {
|
||||
this.calendarType = calendarType;
|
||||
}
|
||||
|
||||
public Date getStartDate()
|
||||
{
|
||||
return startDate;
|
||||
}
|
||||
public void setEndDate(Date endDate)
|
||||
{
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public Date getEndDate()
|
||||
{
|
||||
return endDate;
|
||||
}
|
||||
public void setShiftType(String shiftType)
|
||||
{
|
||||
this.shiftType = shiftType;
|
||||
}
|
||||
|
||||
public String getShiftType()
|
||||
{
|
||||
return shiftType;
|
||||
}
|
||||
public void setShiftMethod(String shiftMethod)
|
||||
{
|
||||
this.shiftMethod = shiftMethod;
|
||||
}
|
||||
|
||||
public String getShiftMethod()
|
||||
{
|
||||
return shiftMethod;
|
||||
}
|
||||
public void setShiftCount(Long shiftCount)
|
||||
{
|
||||
this.shiftCount = shiftCount;
|
||||
}
|
||||
|
||||
public Long getShiftCount()
|
||||
{
|
||||
return shiftCount;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CalPlan{" +
|
||||
"planId=" + planId +
|
||||
", planCode='" + planCode + '\'' +
|
||||
", planName='" + planName + '\'' +
|
||||
", calendarType='" + calendarType + '\'' +
|
||||
", startDate=" + startDate +
|
||||
", endDate=" + endDate +
|
||||
", shiftType='" + shiftType + '\'' +
|
||||
", shiftMethod='" + shiftMethod + '\'' +
|
||||
", shiftCount=" + shiftCount +
|
||||
", status='" + status + '\'' +
|
||||
", attr1='" + attr1 + '\'' +
|
||||
", attr2='" + attr2 + '\'' +
|
||||
", attr3=" + attr3 +
|
||||
", attr4=" + attr4 +
|
||||
'}';
|
||||
}
|
||||
}
|
150
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalPlanTeam.java
Normal file
150
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalPlanTeam.java
Normal file
@ -0,0 +1,150 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 计划班组对象 cal_plan_team
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-07
|
||||
*/
|
||||
public class CalPlanTeam extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long recordId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 班组ID */
|
||||
@Excel(name = "班组ID")
|
||||
private Long teamId;
|
||||
|
||||
/** 班组编号 */
|
||||
@Excel(name = "班组编号")
|
||||
private String teamCode;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setPlanId(Long planId)
|
||||
{
|
||||
this.planId = planId;
|
||||
}
|
||||
|
||||
public Long getPlanId()
|
||||
{
|
||||
return planId;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamCode(String teamCode)
|
||||
{
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamCode()
|
||||
{
|
||||
return teamCode;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("planId", getPlanId())
|
||||
.append("teamId", getTeamId())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("teamName", getTeamName())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
public enum CalQueryType {
|
||||
|
||||
BY_CALTYPE,BY_TEAM,BY_USER
|
||||
}
|
167
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalShift.java
Normal file
167
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalShift.java
Normal file
@ -0,0 +1,167 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 计划班次对象 cal_shift
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
public class CalShift extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 班次ID */
|
||||
private Long shiftId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 序号 */
|
||||
@Excel(name = "序号")
|
||||
private Integer orderNum;
|
||||
|
||||
/** 班次名称 */
|
||||
@Excel(name = "班次名称")
|
||||
private String shiftName;
|
||||
|
||||
/** 开始时间 */
|
||||
@Excel(name = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
|
||||
@Excel(name = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setShiftId(Long shiftId)
|
||||
{
|
||||
this.shiftId = shiftId;
|
||||
}
|
||||
|
||||
public Long getShiftId()
|
||||
{
|
||||
return shiftId;
|
||||
}
|
||||
public void setPlanId(Long planId)
|
||||
{
|
||||
this.planId = planId;
|
||||
}
|
||||
|
||||
public Long getPlanId()
|
||||
{
|
||||
return planId;
|
||||
}
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
public void setShiftName(String shiftName)
|
||||
{
|
||||
this.shiftName = shiftName;
|
||||
}
|
||||
|
||||
public String getShiftName()
|
||||
{
|
||||
return shiftName;
|
||||
}
|
||||
public void setStartTime(String startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
public void setEndTime(String endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("shiftId", getShiftId())
|
||||
.append("planId", getPlanId())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("shiftName", getShiftName())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
128
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeam.java
Normal file
128
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeam.java
Normal file
@ -0,0 +1,128 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 班组对象 cal_team
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
public class CalTeam extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 班组ID */
|
||||
private Long teamId;
|
||||
|
||||
/** 班组编号 */
|
||||
@Excel(name = "班组编号")
|
||||
private String teamCode;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
private String calendarType;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamCode(String teamCode)
|
||||
{
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamCode()
|
||||
{
|
||||
return teamCode;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getCalendarType() {
|
||||
return calendarType;
|
||||
}
|
||||
|
||||
public void setCalendarType(String calendarType) {
|
||||
this.calendarType = calendarType;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CalTeam{" +
|
||||
"teamId=" + teamId +
|
||||
", teamCode='" + teamCode + '\'' +
|
||||
", teamName='" + teamName + '\'' +
|
||||
", calendarType='" + calendarType + '\'' +
|
||||
", attr1='" + attr1 + '\'' +
|
||||
", attr2='" + attr2 + '\'' +
|
||||
", attr3=" + attr3 +
|
||||
", attr4=" + attr4 +
|
||||
'}';
|
||||
}
|
||||
}
|
164
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeamMember.java
Normal file
164
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeamMember.java
Normal file
@ -0,0 +1,164 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 班组成员对象 cal_team_member
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
public class CalTeamMember extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 班组成员ID */
|
||||
private Long memberId;
|
||||
|
||||
/** 班组ID */
|
||||
@Excel(name = "班组ID")
|
||||
private Long teamId;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 电话 */
|
||||
@Excel(name = "电话")
|
||||
private String tel;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setMemberId(Long memberId)
|
||||
{
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId()
|
||||
{
|
||||
return memberId;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setTel(String tel)
|
||||
{
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
public String getTel()
|
||||
{
|
||||
return tel;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("memberId", getMemberId())
|
||||
.append("teamId", getTeamId())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("tel", getTel())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
213
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeamshift.java
Normal file
213
ktg-mes/src/main/java/com/ktg/mes/cal/domain/CalTeamshift.java
Normal file
@ -0,0 +1,213 @@
|
||||
package com.ktg.mes.cal.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 班组排班对象 cal_teamshift
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-11
|
||||
*/
|
||||
public class CalTeamshift extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long recordId;
|
||||
|
||||
/** 日期 */
|
||||
private String theDay;
|
||||
|
||||
/** 班组ID */
|
||||
@Excel(name = "班组ID")
|
||||
private Long teamId;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
/** 班次ID */
|
||||
@Excel(name = "班次ID")
|
||||
private Long shiftId;
|
||||
|
||||
/** 班次名称 */
|
||||
@Excel(name = "班次名称")
|
||||
private String shiftName;
|
||||
|
||||
/** 序号 */
|
||||
@Excel(name = "序号")
|
||||
private Long orderNum;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
private String calendarType;
|
||||
|
||||
/** 轮班方式 */
|
||||
@Excel(name = "轮班方式")
|
||||
private String shiftType;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setTheDay(String theDay)
|
||||
{
|
||||
this.theDay = theDay;
|
||||
}
|
||||
|
||||
public String getTheDay()
|
||||
{
|
||||
return theDay;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setShiftId(Long shiftId)
|
||||
{
|
||||
this.shiftId = shiftId;
|
||||
}
|
||||
|
||||
public Long getShiftId()
|
||||
{
|
||||
return shiftId;
|
||||
}
|
||||
public void setShiftName(String shiftName)
|
||||
{
|
||||
this.shiftName = shiftName;
|
||||
}
|
||||
|
||||
public String getShiftName()
|
||||
{
|
||||
return shiftName;
|
||||
}
|
||||
public void setOrderNum(Long orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public Long getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
public void setPlanId(Long planId)
|
||||
{
|
||||
this.planId = planId;
|
||||
}
|
||||
|
||||
public Long getPlanId()
|
||||
{
|
||||
return planId;
|
||||
}
|
||||
public void setShiftType(String shiftType)
|
||||
{
|
||||
this.shiftType = shiftType;
|
||||
}
|
||||
|
||||
public String getCalendarType() {
|
||||
return calendarType;
|
||||
}
|
||||
|
||||
public void setCalendarType(String calendarType) {
|
||||
this.calendarType = calendarType;
|
||||
}
|
||||
|
||||
public String getShiftType()
|
||||
{
|
||||
return shiftType;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CalTeamshift{" +
|
||||
"recordId=" + recordId +
|
||||
", theDay=" + theDay +
|
||||
", teamId=" + teamId +
|
||||
", teamName='" + teamName + '\'' +
|
||||
", shiftId=" + shiftId +
|
||||
", shiftName='" + shiftName + '\'' +
|
||||
", orderNum=" + orderNum +
|
||||
", planId=" + planId +
|
||||
", calendarType='" + calendarType + '\'' +
|
||||
", shiftType='" + shiftType + '\'' +
|
||||
", attr1='" + attr1 + '\'' +
|
||||
", attr2='" + attr2 + '\'' +
|
||||
", attr3=" + attr3 +
|
||||
", attr4=" + attr4 +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalHoliday;
|
||||
|
||||
/**
|
||||
* 节假日设置Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-08
|
||||
*/
|
||||
public interface CalHolidayMapper
|
||||
{
|
||||
/**
|
||||
* 查询节假日设置
|
||||
*
|
||||
* @param holidayId 节假日设置主键
|
||||
* @return 节假日设置
|
||||
*/
|
||||
public CalHoliday selectCalHolidayByHolidayId(Long holidayId);
|
||||
|
||||
/**
|
||||
* 查询节假日设置列表
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 节假日设置集合
|
||||
*/
|
||||
public List<CalHoliday> selectCalHolidayList(CalHoliday calHoliday);
|
||||
|
||||
/**
|
||||
* 新增节假日设置
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalHoliday(CalHoliday calHoliday);
|
||||
|
||||
/**
|
||||
* 修改节假日设置
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalHoliday(CalHoliday calHoliday);
|
||||
|
||||
/**
|
||||
* 删除节假日设置
|
||||
*
|
||||
* @param holidayId 节假日设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalHolidayByHolidayId(Long holidayId);
|
||||
|
||||
/**
|
||||
* 批量删除节假日设置
|
||||
*
|
||||
* @param holidayIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalHolidayByHolidayIds(Long[] holidayIds);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalPlan;
|
||||
|
||||
/**
|
||||
* 排班计划Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
public interface CalPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询排班计划
|
||||
*
|
||||
* @param planId 排班计划主键
|
||||
* @return 排班计划
|
||||
*/
|
||||
public CalPlan selectCalPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询排班计划列表
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 排班计划集合
|
||||
*/
|
||||
public List<CalPlan> selectCalPlanList(CalPlan calPlan);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增排班计划
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalPlan(CalPlan calPlan);
|
||||
|
||||
/**
|
||||
* 修改排班计划
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalPlan(CalPlan calPlan);
|
||||
|
||||
/**
|
||||
* 删除排班计划
|
||||
*
|
||||
* @param planId 排班计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 批量删除排班计划
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanByPlanIds(Long[] planIds);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||
|
||||
/**
|
||||
* 计划班组Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-07
|
||||
*/
|
||||
public interface CalPlanTeamMapper
|
||||
{
|
||||
/**
|
||||
* 查询计划班组
|
||||
*
|
||||
* @param recordId 计划班组主键
|
||||
* @return 计划班组
|
||||
*/
|
||||
public CalPlanTeam selectCalPlanTeamByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询计划班组列表
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 计划班组集合
|
||||
*/
|
||||
public List<CalPlanTeam> selectCalPlanTeamList(CalPlanTeam calPlanTeam);
|
||||
|
||||
public CalPlanTeam checkPlanTeamUnique(CalPlanTeam calPlanTeam);
|
||||
|
||||
/**
|
||||
* 新增计划班组
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalPlanTeam(CalPlanTeam calPlanTeam);
|
||||
|
||||
/**
|
||||
* 修改计划班组
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalPlanTeam(CalPlanTeam calPlanTeam);
|
||||
|
||||
/**
|
||||
* 删除计划班组
|
||||
*
|
||||
* @param recordId 计划班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanTeamByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除计划班组
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanTeamByRecordIds(Long[] recordIds);
|
||||
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalShift;
|
||||
|
||||
/**
|
||||
* 计划班次Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
public interface CalShiftMapper
|
||||
{
|
||||
/**
|
||||
* 查询计划班次
|
||||
*
|
||||
* @param shiftId 计划班次主键
|
||||
* @return 计划班次
|
||||
*/
|
||||
public CalShift selectCalShiftByShiftId(Long shiftId);
|
||||
|
||||
/**
|
||||
* 查询计划班次列表
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 计划班次集合
|
||||
*/
|
||||
public List<CalShift> selectCalShiftList(CalShift calShift);
|
||||
|
||||
|
||||
|
||||
|
||||
public int checkShiftCount(Long planId);
|
||||
|
||||
/**
|
||||
* 新增计划班次
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalShift(CalShift calShift);
|
||||
|
||||
/**
|
||||
* 修改计划班次
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalShift(CalShift calShift);
|
||||
|
||||
/**
|
||||
* 删除计划班次
|
||||
*
|
||||
* @param shiftId 计划班次主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalShiftByShiftId(Long shiftId);
|
||||
|
||||
/**
|
||||
* 批量删除计划班次
|
||||
*
|
||||
* @param shiftIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalShiftByShiftIds(Long[] shiftIds);
|
||||
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalTeam;
|
||||
|
||||
/**
|
||||
* 班组Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
public interface CalTeamMapper
|
||||
{
|
||||
/**
|
||||
* 查询班组
|
||||
*
|
||||
* @param teamId 班组主键
|
||||
* @return 班组
|
||||
*/
|
||||
public CalTeam selectCalTeamByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 查询班组列表
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 班组集合
|
||||
*/
|
||||
public List<CalTeam> selectCalTeamList(CalTeam calTeam);
|
||||
|
||||
/**
|
||||
* 新增班组
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalTeam(CalTeam calTeam);
|
||||
|
||||
/**
|
||||
* 修改班组
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalTeam(CalTeam calTeam);
|
||||
|
||||
/**
|
||||
* 删除班组
|
||||
*
|
||||
* @param teamId 班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 批量删除班组
|
||||
*
|
||||
* @param teamIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamByTeamIds(Long[] teamIds);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalTeamMember;
|
||||
|
||||
/**
|
||||
* 班组成员Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
public interface CalTeamMemberMapper
|
||||
{
|
||||
/**
|
||||
* 查询班组成员
|
||||
*
|
||||
* @param memberId 班组成员主键
|
||||
* @return 班组成员
|
||||
*/
|
||||
public CalTeamMember selectCalTeamMemberByMemberId(Long memberId);
|
||||
|
||||
/**
|
||||
* 查询班组成员列表
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 班组成员集合
|
||||
*/
|
||||
public List<CalTeamMember> selectCalTeamMemberList(CalTeamMember calTeamMember);
|
||||
|
||||
public CalTeamMember checkUserUnique(CalTeamMember calTeamMember);
|
||||
|
||||
/**
|
||||
* 新增班组成员
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalTeamMember(CalTeamMember calTeamMember);
|
||||
|
||||
/**
|
||||
* 修改班组成员
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalTeamMember(CalTeamMember calTeamMember);
|
||||
|
||||
/**
|
||||
* 删除班组成员
|
||||
*
|
||||
* @param memberId 班组成员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamMemberByMemberId(Long memberId);
|
||||
|
||||
public int deleteByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 批量删除班组成员
|
||||
*
|
||||
* @param memberIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamMemberByMemberIds(Long[] memberIds);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.ktg.mes.cal.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalTeamshift;
|
||||
|
||||
/**
|
||||
* 班组排班Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-11
|
||||
*/
|
||||
public interface CalTeamshiftMapper
|
||||
{
|
||||
/**
|
||||
* 查询班组排班
|
||||
*
|
||||
* @param recordId 班组排班主键
|
||||
* @return 班组排班
|
||||
*/
|
||||
public CalTeamshift selectCalTeamshiftByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询班组排班列表
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 班组排班集合
|
||||
*/
|
||||
public List<CalTeamshift> selectCalTeamshiftList(CalTeamshift calTeamshift);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增班组排班
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalTeamshift(CalTeamshift calTeamshift);
|
||||
|
||||
/**
|
||||
* 修改班组排班
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalTeamshift(CalTeamshift calTeamshift);
|
||||
|
||||
/**
|
||||
* 删除班组排班
|
||||
*
|
||||
* @param recordId 班组排班主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamshiftByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除班组排班
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamshiftByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import com.ktg.mes.cal.domain.CalCalendar;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface ICalCalendarService {
|
||||
|
||||
/**
|
||||
* 查询某个班组类型在某月的排班日历
|
||||
* @param day
|
||||
* @param calenderType
|
||||
* @return
|
||||
*/
|
||||
List<CalCalendar> getCalendarByType(Date day, String calenderType);
|
||||
|
||||
/**
|
||||
* 查询某个班组在某个月的排班日历
|
||||
* @param day
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
List<CalCalendar> getCalendarByTeam(Date day,Long teamId);
|
||||
|
||||
/**
|
||||
* 查询某个人在某月的排班日历
|
||||
* @param day
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<CalCalendar> getCalendarByUser(Date day,Long userId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalHoliday;
|
||||
|
||||
/**
|
||||
* 节假日设置Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-08
|
||||
*/
|
||||
public interface ICalHolidayService
|
||||
{
|
||||
/**
|
||||
* 查询节假日设置
|
||||
*
|
||||
* @param holidayId 节假日设置主键
|
||||
* @return 节假日设置
|
||||
*/
|
||||
public CalHoliday selectCalHolidayByHolidayId(Long holidayId);
|
||||
|
||||
/**
|
||||
* 查询节假日设置列表
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 节假日设置集合
|
||||
*/
|
||||
public List<CalHoliday> selectCalHolidayList(CalHoliday calHoliday);
|
||||
|
||||
/**
|
||||
* 新增节假日设置
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalHoliday(CalHoliday calHoliday);
|
||||
|
||||
/**
|
||||
* 修改节假日设置
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalHoliday(CalHoliday calHoliday);
|
||||
|
||||
/**
|
||||
* 批量删除节假日设置
|
||||
*
|
||||
* @param holidayIds 需要删除的节假日设置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalHolidayByHolidayIds(Long[] holidayIds);
|
||||
|
||||
/**
|
||||
* 删除节假日设置信息
|
||||
*
|
||||
* @param holidayId 节假日设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalHolidayByHolidayId(Long holidayId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalPlan;
|
||||
|
||||
/**
|
||||
* 排班计划Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
public interface ICalPlanService
|
||||
{
|
||||
/**
|
||||
* 查询排班计划
|
||||
*
|
||||
* @param planId 排班计划主键
|
||||
* @return 排班计划
|
||||
*/
|
||||
public CalPlan selectCalPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询排班计划列表
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 排班计划集合
|
||||
*/
|
||||
public List<CalPlan> selectCalPlanList(CalPlan calPlan);
|
||||
|
||||
/**
|
||||
* 新增排班计划
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalPlan(CalPlan calPlan);
|
||||
|
||||
/**
|
||||
* 修改排班计划
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalPlan(CalPlan calPlan);
|
||||
|
||||
/**
|
||||
* 批量删除排班计划
|
||||
*
|
||||
* @param planIds 需要删除的排班计划主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 删除排班计划信息
|
||||
*
|
||||
* @param planId 排班计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||
|
||||
/**
|
||||
* 计划班组Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-07
|
||||
*/
|
||||
public interface ICalPlanTeamService
|
||||
{
|
||||
/**
|
||||
* 查询计划班组
|
||||
*
|
||||
* @param recordId 计划班组主键
|
||||
* @return 计划班组
|
||||
*/
|
||||
public CalPlanTeam selectCalPlanTeamByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询计划班组列表
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 计划班组集合
|
||||
*/
|
||||
public List<CalPlanTeam> selectCalPlanTeamList(CalPlanTeam calPlanTeam);
|
||||
|
||||
public List<CalPlanTeam> selectCalPlanTeamListByPlanId(Long plandId);
|
||||
|
||||
|
||||
public String checkPlanTeamUnique(CalPlanTeam calPlanTeam);
|
||||
|
||||
/**
|
||||
* 新增计划班组
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalPlanTeam(CalPlanTeam calPlanTeam);
|
||||
|
||||
/**
|
||||
* 修改计划班组
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalPlanTeam(CalPlanTeam calPlanTeam);
|
||||
|
||||
/**
|
||||
* 批量删除计划班组
|
||||
*
|
||||
* @param recordIds 需要删除的计划班组主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanTeamByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除计划班组信息
|
||||
*
|
||||
* @param recordId 计划班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalPlanTeamByRecordId(Long recordId);
|
||||
|
||||
public int deleteByPlanId(Long plandId);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalShift;
|
||||
|
||||
/**
|
||||
* 计划班次Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
public interface ICalShiftService
|
||||
{
|
||||
/**
|
||||
* 查询计划班次
|
||||
*
|
||||
* @param shiftId 计划班次主键
|
||||
* @return 计划班次
|
||||
*/
|
||||
public CalShift selectCalShiftByShiftId(Long shiftId);
|
||||
|
||||
/**
|
||||
* 查询计划班次列表
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 计划班次集合
|
||||
*/
|
||||
public List<CalShift> selectCalShiftList(CalShift calShift);
|
||||
|
||||
/**
|
||||
* 根据计划ID查询班次
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public List<CalShift> selectCalShiftListByPlanId(Long planId);
|
||||
|
||||
|
||||
public int checkShiftCount(Long planId);
|
||||
|
||||
|
||||
public void addDefaultShift(Long plandId,String shiftType);
|
||||
|
||||
/**
|
||||
* 新增计划班次
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalShift(CalShift calShift);
|
||||
|
||||
/**
|
||||
* 修改计划班次
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalShift(CalShift calShift);
|
||||
|
||||
/**
|
||||
* 批量删除计划班次
|
||||
*
|
||||
* @param shiftIds 需要删除的计划班次主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalShiftByShiftIds(Long[] shiftIds);
|
||||
|
||||
/**
|
||||
* 删除计划班次信息
|
||||
*
|
||||
* @param shiftId 计划班次主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalShiftByShiftId(Long shiftId);
|
||||
|
||||
public int deleteByPlanId(Long planId);
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalTeamMember;
|
||||
|
||||
/**
|
||||
* 班组成员Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
public interface ICalTeamMemberService
|
||||
{
|
||||
/**
|
||||
* 查询班组成员
|
||||
*
|
||||
* @param memberId 班组成员主键
|
||||
* @return 班组成员
|
||||
*/
|
||||
public CalTeamMember selectCalTeamMemberByMemberId(Long memberId);
|
||||
|
||||
/**
|
||||
* 查询班组成员列表
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 班组成员集合
|
||||
*/
|
||||
public List<CalTeamMember> selectCalTeamMemberList(CalTeamMember calTeamMember);
|
||||
|
||||
|
||||
public String checkUserUnique(CalTeamMember calTeamMember);
|
||||
|
||||
/**
|
||||
* 新增班组成员
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalTeamMember(CalTeamMember calTeamMember);
|
||||
|
||||
/**
|
||||
* 修改班组成员
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalTeamMember(CalTeamMember calTeamMember);
|
||||
|
||||
/**
|
||||
* 批量删除班组成员
|
||||
*
|
||||
* @param memberIds 需要删除的班组成员主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamMemberByMemberIds(Long[] memberIds);
|
||||
|
||||
public int deleteByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 删除班组成员信息
|
||||
*
|
||||
* @param memberId 班组成员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamMemberByMemberId(Long memberId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalTeam;
|
||||
|
||||
/**
|
||||
* 班组Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
public interface ICalTeamService
|
||||
{
|
||||
/**
|
||||
* 查询班组
|
||||
*
|
||||
* @param teamId 班组主键
|
||||
* @return 班组
|
||||
*/
|
||||
public CalTeam selectCalTeamByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 查询班组列表
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 班组集合
|
||||
*/
|
||||
public List<CalTeam> selectCalTeamList(CalTeam calTeam);
|
||||
|
||||
/**
|
||||
* 新增班组
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalTeam(CalTeam calTeam);
|
||||
|
||||
/**
|
||||
* 修改班组
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalTeam(CalTeam calTeam);
|
||||
|
||||
/**
|
||||
* 批量删除班组
|
||||
*
|
||||
* @param teamIds 需要删除的班组主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamByTeamIds(Long[] teamIds);
|
||||
|
||||
/**
|
||||
* 删除班组信息
|
||||
*
|
||||
* @param teamId 班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamByTeamId(Long teamId);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.ktg.mes.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.cal.domain.CalTeamshift;
|
||||
|
||||
/**
|
||||
* 班组排班Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-11
|
||||
*/
|
||||
public interface ICalTeamshiftService
|
||||
{
|
||||
/**
|
||||
* 查询班组排班
|
||||
*
|
||||
* @param recordId 班组排班主键
|
||||
* @return 班组排班
|
||||
*/
|
||||
public CalTeamshift selectCalTeamshiftByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询班组排班列表
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 班组排班集合
|
||||
*/
|
||||
public List<CalTeamshift> selectCalTeamshiftList(CalTeamshift calTeamshift);
|
||||
|
||||
/**
|
||||
* 新增班组排班
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCalTeamshift(CalTeamshift calTeamshift);
|
||||
|
||||
/**
|
||||
* 修改班组排班
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCalTeamshift(CalTeamshift calTeamshift);
|
||||
|
||||
/**
|
||||
* 批量删除班组排班
|
||||
*
|
||||
* @param recordIds 需要删除的班组排班主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamshiftByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除班组排班信息
|
||||
*
|
||||
* @param recordId 班组排班主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCalTeamshiftByRecordId(Long recordId);
|
||||
|
||||
|
||||
public void genRecords(Long plandId);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.mes.cal.domain.CalCalendar;
|
||||
import com.ktg.mes.cal.domain.CalHoliday;
|
||||
import com.ktg.mes.cal.domain.CalTeamMember;
|
||||
import com.ktg.mes.cal.domain.CalTeamshift;
|
||||
import com.ktg.mes.cal.mapper.CalPlanMapper;
|
||||
import com.ktg.mes.cal.mapper.CalTeamMemberMapper;
|
||||
import com.ktg.mes.cal.mapper.CalTeamshiftMapper;
|
||||
import com.ktg.mes.cal.service.ICalCalendarService;
|
||||
import com.ktg.mes.cal.service.ICalHolidayService;
|
||||
import com.ktg.mes.cal.service.ICalTeamMemberService;
|
||||
import com.ktg.mes.cal.utils.CalendarUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class CalCalendarServiceImpl implements ICalCalendarService {
|
||||
|
||||
@Autowired
|
||||
private CalPlanMapper calPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private CalTeamshiftMapper calTeamshiftMapper;
|
||||
|
||||
@Autowired
|
||||
private CalTeamMemberMapper calTeamMemberMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 1.循环生成当前月份每一天的CalCalendar
|
||||
* 2.根据月份和班组类型查询合适的plan
|
||||
* 3.根据plan上的Shift_type和shift_method计算每个班组的班次
|
||||
* 4.设置CalShiftTeamBean
|
||||
* @param day
|
||||
* @param calenderType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CalCalendar> getCalendarByType(Date day, String calenderType) {
|
||||
List<CalCalendar> calendars = null;
|
||||
calendars = CalendarUtil.getDays(day);
|
||||
for (CalCalendar cal:calendars
|
||||
) {
|
||||
CalTeamshift param2 = new CalTeamshift();
|
||||
param2.setTheDay(cal.getTheDay());
|
||||
param2.setCalendarType(calenderType);
|
||||
List<CalTeamshift> teamshifts = calTeamshiftMapper.selectCalTeamshiftList(param2);
|
||||
cal.setTeamShifts(teamshifts);
|
||||
if(CollUtil.isNotEmpty(teamshifts)){
|
||||
cal.setShiftType(teamshifts.get(0).getShiftType());
|
||||
}
|
||||
}
|
||||
return calendars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CalCalendar> getCalendarByTeam(Date day, Long teamId) {
|
||||
List<CalCalendar> calendars = null;
|
||||
calendars = CalendarUtil.getDays(day);
|
||||
for (CalCalendar cal:calendars
|
||||
) {
|
||||
CalTeamshift param2 = new CalTeamshift();
|
||||
param2.setTheDay(cal.getTheDay());
|
||||
param2.setTeamId(teamId);
|
||||
List<CalTeamshift> teamshifts = calTeamshiftMapper.selectCalTeamshiftList(param2);
|
||||
cal.setTeamShifts(teamshifts);
|
||||
if(CollUtil.isNotEmpty(teamshifts)){
|
||||
cal.setShiftType(teamshifts.get(0).getShiftType());
|
||||
}
|
||||
}
|
||||
return calendars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CalCalendar> getCalendarByUser(Date day, Long userId) {
|
||||
List<CalCalendar> calendars = null;
|
||||
|
||||
CalTeamMember param = new CalTeamMember();
|
||||
param.setUserId(userId);
|
||||
List<CalTeamMember> members = calTeamMemberMapper.selectCalTeamMemberList(param);
|
||||
if(CollUtil.isNotEmpty(members)){
|
||||
Long teamId = members.get(0).getTeamId();
|
||||
calendars = CalendarUtil.getDays(day);
|
||||
for (CalCalendar cal:calendars
|
||||
) {
|
||||
CalTeamshift param2 = new CalTeamshift();
|
||||
param2.setTheDay(cal.getTheDay());
|
||||
param2.setTeamId(teamId);
|
||||
List<CalTeamshift> teamshifts = calTeamshiftMapper.selectCalTeamshiftList(param2);
|
||||
cal.setTeamShifts(teamshifts);
|
||||
if(CollUtil.isNotEmpty(teamshifts)){
|
||||
cal.setShiftType(teamshifts.get(0).getShiftType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return calendars;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalHolidayMapper;
|
||||
import com.ktg.mes.cal.domain.CalHoliday;
|
||||
import com.ktg.mes.cal.service.ICalHolidayService;
|
||||
|
||||
/**
|
||||
* 节假日设置Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-08
|
||||
*/
|
||||
@Service
|
||||
public class CalHolidayServiceImpl implements ICalHolidayService
|
||||
{
|
||||
@Autowired
|
||||
private CalHolidayMapper calHolidayMapper;
|
||||
|
||||
/**
|
||||
* 查询节假日设置
|
||||
*
|
||||
* @param holidayId 节假日设置主键
|
||||
* @return 节假日设置
|
||||
*/
|
||||
@Override
|
||||
public CalHoliday selectCalHolidayByHolidayId(Long holidayId)
|
||||
{
|
||||
return calHolidayMapper.selectCalHolidayByHolidayId(holidayId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询节假日设置列表
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 节假日设置
|
||||
*/
|
||||
@Override
|
||||
public List<CalHoliday> selectCalHolidayList(CalHoliday calHoliday)
|
||||
{
|
||||
return calHolidayMapper.selectCalHolidayList(calHoliday);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增节假日设置
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalHoliday(CalHoliday calHoliday)
|
||||
{
|
||||
calHoliday.setCreateTime(DateUtils.getNowDate());
|
||||
return calHolidayMapper.insertCalHoliday(calHoliday);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改节假日设置
|
||||
*
|
||||
* @param calHoliday 节假日设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalHoliday(CalHoliday calHoliday)
|
||||
{
|
||||
calHoliday.setUpdateTime(DateUtils.getNowDate());
|
||||
return calHolidayMapper.updateCalHoliday(calHoliday);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除节假日设置
|
||||
*
|
||||
* @param holidayIds 需要删除的节假日设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalHolidayByHolidayIds(Long[] holidayIds)
|
||||
{
|
||||
return calHolidayMapper.deleteCalHolidayByHolidayIds(holidayIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除节假日设置信息
|
||||
*
|
||||
* @param holidayId 节假日设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalHolidayByHolidayId(Long holidayId)
|
||||
{
|
||||
return calHolidayMapper.deleteCalHolidayByHolidayId(holidayId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalPlanMapper;
|
||||
import com.ktg.mes.cal.domain.CalPlan;
|
||||
import com.ktg.mes.cal.service.ICalPlanService;
|
||||
|
||||
/**
|
||||
* 排班计划Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
@Service
|
||||
public class CalPlanServiceImpl implements ICalPlanService
|
||||
{
|
||||
@Autowired
|
||||
private CalPlanMapper calPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询排班计划
|
||||
*
|
||||
* @param planId 排班计划主键
|
||||
* @return 排班计划
|
||||
*/
|
||||
@Override
|
||||
public CalPlan selectCalPlanByPlanId(Long planId)
|
||||
{
|
||||
return calPlanMapper.selectCalPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排班计划列表
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 排班计划
|
||||
*/
|
||||
@Override
|
||||
public List<CalPlan> selectCalPlanList(CalPlan calPlan)
|
||||
{
|
||||
return calPlanMapper.selectCalPlanList(calPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排班计划
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalPlan(CalPlan calPlan)
|
||||
{
|
||||
calPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return calPlanMapper.insertCalPlan(calPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排班计划
|
||||
*
|
||||
* @param calPlan 排班计划
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalPlan(CalPlan calPlan)
|
||||
{
|
||||
calPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return calPlanMapper.updateCalPlan(calPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除排班计划
|
||||
*
|
||||
* @param planIds 需要删除的排班计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalPlanByPlanIds(Long[] planIds)
|
||||
{
|
||||
return calPlanMapper.deleteCalPlanByPlanIds(planIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排班计划信息
|
||||
*
|
||||
* @param planId 排班计划主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalPlanByPlanId(Long planId)
|
||||
{
|
||||
return calPlanMapper.deleteCalPlanByPlanId(planId);
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalPlanTeamMapper;
|
||||
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||
import com.ktg.mes.cal.service.ICalPlanTeamService;
|
||||
|
||||
/**
|
||||
* 计划班组Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-07
|
||||
*/
|
||||
@Service
|
||||
public class CalPlanTeamServiceImpl implements ICalPlanTeamService
|
||||
{
|
||||
@Autowired
|
||||
private CalPlanTeamMapper calPlanTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询计划班组
|
||||
*
|
||||
* @param recordId 计划班组主键
|
||||
* @return 计划班组
|
||||
*/
|
||||
@Override
|
||||
public CalPlanTeam selectCalPlanTeamByRecordId(Long recordId)
|
||||
{
|
||||
return calPlanTeamMapper.selectCalPlanTeamByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划班组列表
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 计划班组
|
||||
*/
|
||||
@Override
|
||||
public List<CalPlanTeam> selectCalPlanTeamList(CalPlanTeam calPlanTeam)
|
||||
{
|
||||
return calPlanTeamMapper.selectCalPlanTeamList(calPlanTeam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CalPlanTeam> selectCalPlanTeamListByPlanId(Long plandId) {
|
||||
CalPlanTeam param = new CalPlanTeam();
|
||||
param.setPlanId(plandId);
|
||||
return calPlanTeamMapper.selectCalPlanTeamList(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkPlanTeamUnique(CalPlanTeam calPlanTeam) {
|
||||
CalPlanTeam team = calPlanTeamMapper.checkPlanTeamUnique(calPlanTeam);
|
||||
Long recodeId = calPlanTeam.getRecordId()==null?-1L:calPlanTeam.getRecordId();
|
||||
if(StringUtils.isNotNull(team) && team.getRecordId().longValue() != recodeId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划班组
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalPlanTeam(CalPlanTeam calPlanTeam)
|
||||
{
|
||||
calPlanTeam.setCreateTime(DateUtils.getNowDate());
|
||||
return calPlanTeamMapper.insertCalPlanTeam(calPlanTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划班组
|
||||
*
|
||||
* @param calPlanTeam 计划班组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalPlanTeam(CalPlanTeam calPlanTeam)
|
||||
{
|
||||
calPlanTeam.setUpdateTime(DateUtils.getNowDate());
|
||||
return calPlanTeamMapper.updateCalPlanTeam(calPlanTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划班组
|
||||
*
|
||||
* @param recordIds 需要删除的计划班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalPlanTeamByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return calPlanTeamMapper.deleteCalPlanTeamByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划班组信息
|
||||
*
|
||||
* @param recordId 计划班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalPlanTeamByRecordId(Long recordId)
|
||||
{
|
||||
return calPlanTeamMapper.deleteCalPlanTeamByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanId(Long plandId) {
|
||||
return calPlanTeamMapper.deleteByPlanId(plandId);
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalShiftMapper;
|
||||
import com.ktg.mes.cal.domain.CalShift;
|
||||
import com.ktg.mes.cal.service.ICalShiftService;
|
||||
|
||||
/**
|
||||
* 计划班次Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-06
|
||||
*/
|
||||
@Service
|
||||
public class CalShiftServiceImpl implements ICalShiftService
|
||||
{
|
||||
@Autowired
|
||||
private CalShiftMapper calShiftMapper;
|
||||
|
||||
/**
|
||||
* 查询计划班次
|
||||
*
|
||||
* @param shiftId 计划班次主键
|
||||
* @return 计划班次
|
||||
*/
|
||||
@Override
|
||||
public CalShift selectCalShiftByShiftId(Long shiftId)
|
||||
{
|
||||
return calShiftMapper.selectCalShiftByShiftId(shiftId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划班次列表
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 计划班次
|
||||
*/
|
||||
@Override
|
||||
public List<CalShift> selectCalShiftList(CalShift calShift)
|
||||
{
|
||||
return calShiftMapper.selectCalShiftList(calShift);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CalShift> selectCalShiftListByPlanId(Long planId) {
|
||||
CalShift param = new CalShift();
|
||||
param.setPlanId(planId);
|
||||
return calShiftMapper.selectCalShiftList(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkShiftCount(Long planId) {
|
||||
return calShiftMapper.checkShiftCount(planId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDefaultShift(Long plandId,String shiftType) {
|
||||
if(UserConstants.CAL_SHIFT_TYPE_SINGLE.equals(shiftType)){
|
||||
CalShift shift = new CalShift();
|
||||
shift.setPlanId(plandId);
|
||||
shift.setShiftName(UserConstants.CAL_SHIFT_NAME_DAY);
|
||||
shift.setOrderNum(1);
|
||||
shift.setStartTime("8:00");
|
||||
shift.setEndTime("18:00");
|
||||
calShiftMapper.insertCalShift(shift);
|
||||
}else if(UserConstants.CAL_SHIFT_TYPE_TWO.equals(shiftType)){
|
||||
CalShift shiftDay = new CalShift();
|
||||
shiftDay.setPlanId(plandId);
|
||||
shiftDay.setShiftName(UserConstants.CAL_SHIFT_NAME_DAY);
|
||||
shiftDay.setOrderNum(1);
|
||||
shiftDay.setStartTime("8:00");
|
||||
shiftDay.setEndTime("20:00");
|
||||
CalShift shiftNight = new CalShift();
|
||||
shiftNight.setPlanId(plandId);
|
||||
shiftNight.setShiftName(UserConstants.CAL_SHIFT_NAME_NIGHT);
|
||||
shiftNight.setOrderNum(2);
|
||||
shiftNight.setStartTime("20:00");
|
||||
shiftNight.setEndTime("8:00");
|
||||
calShiftMapper.insertCalShift(shiftDay);
|
||||
calShiftMapper.insertCalShift(shiftNight);
|
||||
}else {
|
||||
CalShift shiftDay = new CalShift();
|
||||
shiftDay.setPlanId(plandId);
|
||||
shiftDay.setShiftName(UserConstants.CAL_SHIFT_NAME_DAY);
|
||||
shiftDay.setOrderNum(1);
|
||||
shiftDay.setStartTime("8:00");
|
||||
shiftDay.setEndTime("16:00");
|
||||
CalShift shiftMid = new CalShift();
|
||||
shiftMid.setPlanId(plandId);
|
||||
shiftMid.setShiftName(UserConstants.CAL_SHIFT_NAME_MID);
|
||||
shiftMid.setOrderNum(2);
|
||||
shiftMid.setStartTime("16:00");
|
||||
shiftMid.setEndTime("24:00");
|
||||
CalShift shiftNight = new CalShift();
|
||||
shiftNight.setPlanId(plandId);
|
||||
shiftNight.setShiftName(UserConstants.CAL_SHIFT_NAME_NIGHT);
|
||||
shiftNight.setOrderNum(3);
|
||||
shiftNight.setStartTime("00:00");
|
||||
shiftNight.setEndTime("8:00");
|
||||
calShiftMapper.insertCalShift(shiftDay);
|
||||
calShiftMapper.insertCalShift(shiftMid);
|
||||
calShiftMapper.insertCalShift(shiftNight);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划班次
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalShift(CalShift calShift)
|
||||
{
|
||||
calShift.setCreateTime(DateUtils.getNowDate());
|
||||
return calShiftMapper.insertCalShift(calShift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划班次
|
||||
*
|
||||
* @param calShift 计划班次
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalShift(CalShift calShift)
|
||||
{
|
||||
calShift.setUpdateTime(DateUtils.getNowDate());
|
||||
return calShiftMapper.updateCalShift(calShift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划班次
|
||||
*
|
||||
* @param shiftIds 需要删除的计划班次主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalShiftByShiftIds(Long[] shiftIds)
|
||||
{
|
||||
return calShiftMapper.deleteCalShiftByShiftIds(shiftIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划班次信息
|
||||
*
|
||||
* @param shiftId 计划班次主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalShiftByShiftId(Long shiftId)
|
||||
{
|
||||
return calShiftMapper.deleteCalShiftByShiftId(shiftId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanId(Long planId) {
|
||||
return calShiftMapper.deleteByPlanId(planId);
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalTeamMemberMapper;
|
||||
import com.ktg.mes.cal.domain.CalTeamMember;
|
||||
import com.ktg.mes.cal.service.ICalTeamMemberService;
|
||||
|
||||
/**
|
||||
* 班组成员Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
@Service
|
||||
public class CalTeamMemberServiceImpl implements ICalTeamMemberService
|
||||
{
|
||||
@Autowired
|
||||
private CalTeamMemberMapper calTeamMemberMapper;
|
||||
|
||||
/**
|
||||
* 查询班组成员
|
||||
*
|
||||
* @param memberId 班组成员主键
|
||||
* @return 班组成员
|
||||
*/
|
||||
@Override
|
||||
public CalTeamMember selectCalTeamMemberByMemberId(Long memberId)
|
||||
{
|
||||
return calTeamMemberMapper.selectCalTeamMemberByMemberId(memberId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组成员列表
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 班组成员
|
||||
*/
|
||||
@Override
|
||||
public List<CalTeamMember> selectCalTeamMemberList(CalTeamMember calTeamMember)
|
||||
{
|
||||
return calTeamMemberMapper.selectCalTeamMemberList(calTeamMember);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkUserUnique(CalTeamMember calTeamMember) {
|
||||
CalTeamMember member = calTeamMemberMapper.checkUserUnique(calTeamMember);
|
||||
Long memberId = calTeamMember.getMemberId()==null?-1L:calTeamMember.getMemberId();
|
||||
if(StringUtils.isNotNull(member) && memberId !=member.getMemberId()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组成员
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalTeamMember(CalTeamMember calTeamMember)
|
||||
{
|
||||
calTeamMember.setCreateTime(DateUtils.getNowDate());
|
||||
return calTeamMemberMapper.insertCalTeamMember(calTeamMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组成员
|
||||
*
|
||||
* @param calTeamMember 班组成员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalTeamMember(CalTeamMember calTeamMember)
|
||||
{
|
||||
calTeamMember.setUpdateTime(DateUtils.getNowDate());
|
||||
return calTeamMemberMapper.updateCalTeamMember(calTeamMember);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除班组成员
|
||||
*
|
||||
* @param memberIds 需要删除的班组成员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalTeamMemberByMemberIds(Long[] memberIds)
|
||||
{
|
||||
return calTeamMemberMapper.deleteCalTeamMemberByMemberIds(memberIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByTeamId(Long teamId) {
|
||||
return calTeamMemberMapper.deleteByTeamId(teamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组成员信息
|
||||
*
|
||||
* @param memberId 班组成员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalTeamMemberByMemberId(Long memberId)
|
||||
{
|
||||
return calTeamMemberMapper.deleteCalTeamMemberByMemberId(memberId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalTeamMapper;
|
||||
import com.ktg.mes.cal.domain.CalTeam;
|
||||
import com.ktg.mes.cal.service.ICalTeamService;
|
||||
|
||||
/**
|
||||
* 班组Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-05
|
||||
*/
|
||||
@Service
|
||||
public class CalTeamServiceImpl implements ICalTeamService
|
||||
{
|
||||
@Autowired
|
||||
private CalTeamMapper calTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询班组
|
||||
*
|
||||
* @param teamId 班组主键
|
||||
* @return 班组
|
||||
*/
|
||||
@Override
|
||||
public CalTeam selectCalTeamByTeamId(Long teamId)
|
||||
{
|
||||
return calTeamMapper.selectCalTeamByTeamId(teamId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组列表
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 班组
|
||||
*/
|
||||
@Override
|
||||
public List<CalTeam> selectCalTeamList(CalTeam calTeam)
|
||||
{
|
||||
return calTeamMapper.selectCalTeamList(calTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalTeam(CalTeam calTeam)
|
||||
{
|
||||
calTeam.setCreateTime(DateUtils.getNowDate());
|
||||
return calTeamMapper.insertCalTeam(calTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组
|
||||
*
|
||||
* @param calTeam 班组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalTeam(CalTeam calTeam)
|
||||
{
|
||||
calTeam.setUpdateTime(DateUtils.getNowDate());
|
||||
return calTeamMapper.updateCalTeam(calTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除班组
|
||||
*
|
||||
* @param teamIds 需要删除的班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalTeamByTeamIds(Long[] teamIds)
|
||||
{
|
||||
return calTeamMapper.deleteCalTeamByTeamIds(teamIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组信息
|
||||
*
|
||||
* @param teamId 班组主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalTeamByTeamId(Long teamId)
|
||||
{
|
||||
return calTeamMapper.deleteCalTeamByTeamId(teamId);
|
||||
}
|
||||
}
|
@ -0,0 +1,383 @@
|
||||
package com.ktg.mes.cal.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.mes.cal.domain.CalPlan;
|
||||
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||
import com.ktg.mes.cal.domain.CalShift;
|
||||
import com.ktg.mes.cal.mapper.CalPlanMapper;
|
||||
import com.ktg.mes.cal.mapper.CalPlanTeamMapper;
|
||||
import com.ktg.mes.cal.mapper.CalShiftMapper;
|
||||
import com.ktg.mes.cal.utils.CalendarUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.cal.mapper.CalTeamshiftMapper;
|
||||
import com.ktg.mes.cal.domain.CalTeamshift;
|
||||
import com.ktg.mes.cal.service.ICalTeamshiftService;
|
||||
|
||||
/**
|
||||
* 班组排班Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-11
|
||||
*/
|
||||
@Service
|
||||
public class CalTeamshiftServiceImpl implements ICalTeamshiftService
|
||||
{
|
||||
@Autowired
|
||||
private CalTeamshiftMapper calTeamshiftMapper;
|
||||
|
||||
@Autowired
|
||||
private CalPlanMapper calPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private CalShiftMapper calShiftMapper;
|
||||
|
||||
@Autowired
|
||||
private CalPlanTeamMapper calPlanTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询班组排班
|
||||
*
|
||||
* @param recordId 班组排班主键
|
||||
* @return 班组排班
|
||||
*/
|
||||
@Override
|
||||
public CalTeamshift selectCalTeamshiftByRecordId(Long recordId)
|
||||
{
|
||||
return calTeamshiftMapper.selectCalTeamshiftByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组排班列表
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 班组排班
|
||||
*/
|
||||
@Override
|
||||
public List<CalTeamshift> selectCalTeamshiftList(CalTeamshift calTeamshift)
|
||||
{
|
||||
return calTeamshiftMapper.selectCalTeamshiftList(calTeamshift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组排班
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCalTeamshift(CalTeamshift calTeamshift)
|
||||
{
|
||||
calTeamshift.setCreateTime(DateUtils.getNowDate());
|
||||
return calTeamshiftMapper.insertCalTeamshift(calTeamshift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组排班
|
||||
*
|
||||
* @param calTeamshift 班组排班
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCalTeamshift(CalTeamshift calTeamshift)
|
||||
{
|
||||
calTeamshift.setUpdateTime(DateUtils.getNowDate());
|
||||
return calTeamshiftMapper.updateCalTeamshift(calTeamshift);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除班组排班
|
||||
*
|
||||
* @param recordIds 需要删除的班组排班主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalTeamshiftByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return calTeamshiftMapper.deleteCalTeamshiftByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组排班信息
|
||||
*
|
||||
* @param recordId 班组排班主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCalTeamshiftByRecordId(Long recordId)
|
||||
{
|
||||
return calTeamshiftMapper.deleteCalTeamshiftByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据排班计划生成每个班组的明细排班记录
|
||||
* 1.查询计划头
|
||||
* 2.查询计划中的班组
|
||||
* 3.查询计划中的班次
|
||||
* 4.计算计划的开始日期和结束日期的差值
|
||||
* 5.遍历每一天,设置每一天的班组与班次的对应关系(要结合轮班方式)
|
||||
* @param plandId
|
||||
*/
|
||||
@Async
|
||||
@Override
|
||||
public void genRecords(Long plandId) {
|
||||
CalPlan plan =calPlanMapper.selectCalPlanByPlanId(plandId);
|
||||
CalShift p1 = new CalShift();
|
||||
p1.setPlanId(plandId);
|
||||
List<CalShift> shifts = calShiftMapper.selectCalShiftList(p1);
|
||||
CalPlanTeam p2 = new CalPlanTeam();
|
||||
p2.setPlanId(plandId);
|
||||
List<CalPlanTeam> teams = calPlanTeamMapper.selectCalPlanTeamList(p2);
|
||||
Long days = CalendarUtil.getDateDiff(plan.getStartDate(),plan.getEndDate());
|
||||
|
||||
int shiftIndex =0;
|
||||
Date nowDate =null;
|
||||
for(int i =0;i<days;i++){
|
||||
//当前遍历到的日期
|
||||
nowDate = CalendarUtil.addDays(plan.getStartDate(),i);
|
||||
|
||||
//按季度轮班
|
||||
if(UserConstants.CAL_SHIFT_METHOD_QUARTER.equals(plan.getShiftMethod())){
|
||||
//获取季度第一天
|
||||
String quarterStart = CalendarUtil.getQuarterStartStr(nowDate);
|
||||
|
||||
//如果到了季度第一天,并且不是排班计划的开始季度
|
||||
if(quarterStart.equals(CalendarUtil.getDateStr(nowDate)) && !quarterStart.equals(CalendarUtil.getQuarterStartStr(plan.getStartDate()))){
|
||||
shiftIndex ++; //轮班一次
|
||||
}
|
||||
}
|
||||
//按月轮班
|
||||
else if(UserConstants.CAL_SHIFT_METHOD_MONTH.equals(plan.getShiftMethod())){
|
||||
//获取月份第一天
|
||||
String monthStart = CalendarUtil.getMonthStartStr(nowDate);
|
||||
|
||||
//如果到了月初,并且不是排班计划开始月份
|
||||
if(monthStart.equals(CalendarUtil.getDateStr(nowDate)) && !monthStart.equals(CalendarUtil.getMonthStartStr(plan.getStartDate()))){
|
||||
shiftIndex ++; //轮班一次
|
||||
}
|
||||
}
|
||||
//按周轮班
|
||||
else if(UserConstants.CAL_SHIFT_METHOD_WEEK.equals(plan.getShiftMethod())){
|
||||
//获取周的第一天
|
||||
String weekStart = CalendarUtil.getWeekStartTimeStr(nowDate);
|
||||
|
||||
//如果是每周一,并且不是排班计划开始周
|
||||
if(weekStart.equals(CalendarUtil.getDateStr(nowDate)) && !weekStart.equals(CalendarUtil.getWeekStartTimeStr(plan.getStartDate()))){
|
||||
shiftIndex ++;
|
||||
}
|
||||
}
|
||||
//按天
|
||||
else{
|
||||
//如果到了指定的轮班天数,并且不是刚开始
|
||||
if(i%(plan.getShiftCount())==0 && i!=0){
|
||||
shiftIndex ++;
|
||||
}
|
||||
}
|
||||
|
||||
//如果是单白班,不需要倒班
|
||||
if(UserConstants.CAL_SHIFT_TYPE_SINGLE.equals(plan.getShiftType())){
|
||||
CalTeamshift bean = new CalTeamshift();
|
||||
bean.setPlanId(plandId);
|
||||
bean.setCalendarType(plan.getCalendarType());
|
||||
bean.setShiftType(plan.getShiftType());
|
||||
bean.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
bean.setTeamId(teams.get(0).getTeamId());
|
||||
bean.setTeamName(teams.get(0).getTeamName());
|
||||
bean.setShiftId(shifts.get(0).getShiftId());
|
||||
bean.setShiftName(shifts.get(0).getShiftName());
|
||||
saveTeamShift(bean);
|
||||
}
|
||||
|
||||
//如果是两班倒
|
||||
if(UserConstants.CAL_SHIFT_TYPE_TWO.equals(plan.getShiftType())){
|
||||
if(shiftIndex%2 == 0){
|
||||
//A组上白班
|
||||
CalTeamshift beanA = new CalTeamshift();
|
||||
beanA.setPlanId(plandId);
|
||||
beanA.setCalendarType(plan.getCalendarType());
|
||||
beanA.setShiftType(plan.getShiftType());
|
||||
beanA.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanA.setTeamId(teams.get(0).getTeamId());
|
||||
beanA.setTeamName(teams.get(0).getTeamName());
|
||||
beanA.setShiftId(shifts.get(0).getShiftId());
|
||||
beanA.setShiftName(shifts.get(0).getShiftName());
|
||||
beanA.setOrderNum(1L);
|
||||
saveTeamShift(beanA);
|
||||
//B组上夜班
|
||||
CalTeamshift beanB = new CalTeamshift();
|
||||
beanB.setPlanId(plandId);
|
||||
beanB.setCalendarType(plan.getCalendarType());
|
||||
beanB.setShiftType(plan.getShiftType());
|
||||
beanB.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanB.setTeamId(teams.get(1).getTeamId());
|
||||
beanB.setTeamName(teams.get(1).getTeamName());
|
||||
beanB.setShiftId(shifts.get(1).getShiftId());
|
||||
beanB.setShiftName(shifts.get(1).getShiftName());
|
||||
beanB.setOrderNum(2L);
|
||||
saveTeamShift(beanB);
|
||||
}else{
|
||||
//A组上夜班
|
||||
CalTeamshift beanA = new CalTeamshift();
|
||||
beanA.setPlanId(plandId);
|
||||
beanA.setCalendarType(plan.getCalendarType());
|
||||
beanA.setShiftType(plan.getShiftType());
|
||||
beanA.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanA.setTeamId(teams.get(0).getTeamId());
|
||||
beanA.setTeamName(teams.get(0).getTeamName());
|
||||
beanA.setShiftId(shifts.get(1).getShiftId());
|
||||
beanA.setShiftName(shifts.get(1).getShiftName());
|
||||
beanA.setOrderNum(2L);
|
||||
saveTeamShift(beanA);
|
||||
//B组上白班
|
||||
CalTeamshift beanB = new CalTeamshift();
|
||||
beanB.setPlanId(plandId);
|
||||
beanB.setCalendarType(plan.getCalendarType());
|
||||
beanB.setShiftType(plan.getShiftType());
|
||||
beanB.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanB.setTeamId(teams.get(1).getTeamId());
|
||||
beanB.setTeamName(teams.get(1).getTeamName());
|
||||
beanB.setShiftId(shifts.get(0).getShiftId());
|
||||
beanB.setShiftName(shifts.get(0).getShiftName());
|
||||
beanB.setOrderNum(1L);
|
||||
saveTeamShift(beanB);
|
||||
}
|
||||
}
|
||||
|
||||
//如果是三班倒
|
||||
if(UserConstants.CAL_SHIFT_TYPE_THREE.equals(plan.getShiftType())){
|
||||
if(shiftIndex%2 == 0){
|
||||
//A组上白班
|
||||
CalTeamshift beanA = new CalTeamshift();
|
||||
beanA.setPlanId(plandId);
|
||||
beanA.setCalendarType(plan.getCalendarType());
|
||||
beanA.setShiftType(plan.getShiftType());
|
||||
beanA.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanA.setTeamId(teams.get(0).getTeamId());
|
||||
beanA.setTeamName(teams.get(0).getTeamName());
|
||||
beanA.setShiftId(shifts.get(0).getShiftId());
|
||||
beanA.setShiftName(shifts.get(0).getShiftName());
|
||||
beanA.setOrderNum(1L);
|
||||
saveTeamShift(beanA);
|
||||
//B组上中班
|
||||
CalTeamshift beanB = new CalTeamshift();
|
||||
beanB.setPlanId(plandId);
|
||||
beanB.setCalendarType(plan.getCalendarType());
|
||||
beanB.setShiftType(plan.getShiftType());
|
||||
beanB.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanB.setTeamId(teams.get(1).getTeamId());
|
||||
beanB.setTeamName(teams.get(1).getTeamName());
|
||||
beanB.setShiftId(shifts.get(1).getShiftId());
|
||||
beanB.setShiftName(shifts.get(1).getShiftName());
|
||||
beanB.setOrderNum(2L);
|
||||
saveTeamShift(beanB);
|
||||
//C组上夜班
|
||||
CalTeamshift beanC = new CalTeamshift();
|
||||
beanC.setPlanId(plandId);
|
||||
beanC.setCalendarType(plan.getCalendarType());
|
||||
beanC.setShiftType(plan.getShiftType());
|
||||
beanC.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanC.setTeamId(teams.get(2).getTeamId());
|
||||
beanC.setTeamName(teams.get(2).getTeamName());
|
||||
beanC.setShiftId(shifts.get(2).getShiftId());
|
||||
beanC.setShiftName(shifts.get(2).getShiftName());
|
||||
beanC.setOrderNum(3L);
|
||||
saveTeamShift(beanC);
|
||||
}else if(shiftIndex%2 == 1){
|
||||
//A组上中班
|
||||
CalTeamshift beanA = new CalTeamshift();
|
||||
beanA.setPlanId(plandId);
|
||||
beanA.setCalendarType(plan.getCalendarType());
|
||||
beanA.setShiftType(plan.getShiftType());
|
||||
beanA.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanA.setTeamId(teams.get(0).getTeamId());
|
||||
beanA.setTeamName(teams.get(0).getTeamName());
|
||||
beanA.setShiftId(shifts.get(1).getShiftId());
|
||||
beanA.setShiftName(shifts.get(1).getShiftName());
|
||||
beanA.setOrderNum(2L);
|
||||
saveTeamShift(beanA);
|
||||
//B组上夜班
|
||||
CalTeamshift beanB = new CalTeamshift();
|
||||
beanB.setPlanId(plandId);
|
||||
beanB.setCalendarType(plan.getCalendarType());
|
||||
beanB.setShiftType(plan.getShiftType());
|
||||
beanB.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanB.setTeamId(teams.get(1).getTeamId());
|
||||
beanB.setTeamName(teams.get(1).getTeamName());
|
||||
beanB.setShiftId(shifts.get(2).getShiftId());
|
||||
beanB.setShiftName(shifts.get(2).getShiftName());
|
||||
beanB.setOrderNum(3L);
|
||||
saveTeamShift(beanB);
|
||||
//C组上白班
|
||||
CalTeamshift beanC = new CalTeamshift();
|
||||
beanC.setPlanId(plandId);
|
||||
beanC.setCalendarType(plan.getCalendarType());
|
||||
beanC.setShiftType(plan.getShiftType());
|
||||
beanC.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanC.setTeamId(teams.get(2).getTeamId());
|
||||
beanC.setTeamName(teams.get(2).getTeamName());
|
||||
beanC.setShiftId(shifts.get(0).getShiftId());
|
||||
beanC.setShiftName(shifts.get(0).getShiftName());
|
||||
beanC.setOrderNum(1L);
|
||||
saveTeamShift(beanC);
|
||||
}else{
|
||||
//A组上夜班
|
||||
CalTeamshift beanA = new CalTeamshift();
|
||||
beanA.setPlanId(plandId);
|
||||
beanA.setCalendarType(plan.getCalendarType());
|
||||
beanA.setShiftType(plan.getShiftType());
|
||||
beanA.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanA.setTeamId(teams.get(0).getTeamId());
|
||||
beanA.setTeamName(teams.get(0).getTeamName());
|
||||
beanA.setShiftId(shifts.get(2).getShiftId());
|
||||
beanA.setShiftName(shifts.get(2).getShiftName());
|
||||
beanA.setOrderNum(3L);
|
||||
saveTeamShift(beanA);
|
||||
//B组上白班
|
||||
CalTeamshift beanB = new CalTeamshift();
|
||||
beanB.setPlanId(plandId);
|
||||
beanB.setCalendarType(plan.getCalendarType());
|
||||
beanB.setShiftType(plan.getShiftType());
|
||||
beanB.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanB.setTeamId(teams.get(1).getTeamId());
|
||||
beanB.setTeamName(teams.get(1).getTeamName());
|
||||
beanB.setShiftId(shifts.get(0).getShiftId());
|
||||
beanB.setShiftName(shifts.get(0).getShiftName());
|
||||
beanB.setOrderNum(1L);
|
||||
saveTeamShift(beanB);
|
||||
//C组上中班
|
||||
CalTeamshift beanC = new CalTeamshift();
|
||||
beanC.setPlanId(plandId);
|
||||
beanC.setCalendarType(plan.getCalendarType());
|
||||
beanC.setShiftType(plan.getShiftType());
|
||||
beanC.setTheDay(CalendarUtil.getDateStr(nowDate));
|
||||
beanC.setTeamId(teams.get(2).getTeamId());
|
||||
beanC.setTeamName(teams.get(2).getTeamName());
|
||||
beanC.setShiftId(shifts.get(1).getShiftId());
|
||||
beanC.setShiftName(shifts.get(1).getShiftName());
|
||||
beanC.setOrderNum(2L);
|
||||
saveTeamShift(beanC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveTeamShift(CalTeamshift calTeamshift){
|
||||
CalTeamshift param = new CalTeamshift();
|
||||
param.setTheDay(calTeamshift.getTheDay());
|
||||
param.setTeamId(calTeamshift.getTeamId());
|
||||
List<CalTeamshift> teamshifts = calTeamshiftMapper.selectCalTeamshiftList(param);
|
||||
if(CollUtil.isNotEmpty(teamshifts)){
|
||||
calTeamshift.setRecordId(teamshifts.get(0).getRecordId());
|
||||
calTeamshiftMapper.updateCalTeamshift(calTeamshift);
|
||||
}else{
|
||||
calTeamshiftMapper.insertCalTeamshift(calTeamshift);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
522
ktg-mes/src/main/java/com/ktg/mes/cal/utils/CalendarUtil.java
Normal file
522
ktg-mes/src/main/java/com/ktg/mes/cal/utils/CalendarUtil.java
Normal file
@ -0,0 +1,522 @@
|
||||
package com.ktg.mes.cal.utils;
|
||||
|
||||
import com.ktg.mes.cal.domain.CalCalendar;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Month;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
|
||||
public class CalendarUtil {
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
/**
|
||||
* 星期日;
|
||||
*/
|
||||
public static final String SUNDAY = "星期日";
|
||||
|
||||
/**
|
||||
* 星期一;
|
||||
*/
|
||||
public static final String MONDAY = "星期一";
|
||||
|
||||
/**
|
||||
* 星期二;
|
||||
*/
|
||||
public static final String TUESDAY = "星期二";
|
||||
|
||||
/**
|
||||
* 星期三;
|
||||
*/
|
||||
public static final String WEDNESDAY = "星期三";
|
||||
|
||||
/**
|
||||
* 星期四;
|
||||
*/
|
||||
public static final String THURSDAY = "星期四";
|
||||
|
||||
/**
|
||||
* 星期五;
|
||||
*/
|
||||
public static final String FRIDAY = "星期五";
|
||||
|
||||
/**
|
||||
* 星期六;
|
||||
*/
|
||||
public static final String SATURDAY = "星期六";
|
||||
|
||||
/**
|
||||
* 显示年月日时分秒,例如 2015-08-11 09:51:53.
|
||||
*/
|
||||
public static final String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
||||
/**
|
||||
* 显示年月日时分,例如 2015-08-11 09:51.
|
||||
*/
|
||||
public static final String NO_SECOND_DATETIME_PATTERN = "yyyy-MM-dd HH:mm";
|
||||
/**
|
||||
* 仅显示年月日,例如 2015-08-11.
|
||||
*/
|
||||
public static final String DATE_PATTERN = "yyyy-MM-dd";
|
||||
/**
|
||||
* 仅显示时分秒,例如 09:51:53.
|
||||
*/
|
||||
public static final String TIME_PATTERN = "HH:mm:ss";
|
||||
/**
|
||||
* 显示年月日时分秒(由/分割),例如 2015/08/11 09:51:53.
|
||||
*/
|
||||
public static final String DATETIME_PATTERN_WITH_SLASH = "yyyy/MM/dd HH:mm:ss";
|
||||
/**
|
||||
* 显示年月日(由/分割),例如 2015/08/11.
|
||||
*/
|
||||
public static final String DATE_PATTERN_WITH_SLASH = "yyyy/MM/dd";
|
||||
/**
|
||||
* 仅显示年(无符号),例如 2015.
|
||||
*/
|
||||
private static final String YEAR_PATTERN = "yyyy";
|
||||
/**
|
||||
* 仅显示年月,例如 2015-08.
|
||||
*/
|
||||
private static final String MONTH_PATTERN = "yyyy-MM";
|
||||
|
||||
/**
|
||||
* 获取当前日期和时间字符串.
|
||||
*
|
||||
* @return String 日期时间字符串,例如 2015-08-11 09:51:53
|
||||
*/
|
||||
public static String getDateTimeStr() {
|
||||
return format(new Date(), DATETIME_PATTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳转换为日期时间字符串
|
||||
*
|
||||
* @param timestamp 时间戳
|
||||
* @param pattern 日期格式 例如DATETIME_PATTERN
|
||||
* @return String 日期时间字符串,例如 2015-08-11 09:51:53
|
||||
*/
|
||||
public static String getDateTimeStr(long timestamp, String pattern) {
|
||||
return new SimpleDateFormat(pattern).format(timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期字符串.
|
||||
*
|
||||
* @return String 日期字符串,例如2015-08-11
|
||||
*/
|
||||
public static String getDateStr() {
|
||||
return format(new Date(), DATE_PATTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期字符串.
|
||||
*
|
||||
* @return String 日期字符串,例如2015-08-11
|
||||
*/
|
||||
public static String getDateStr(Date theday) {
|
||||
return format(theday, DATE_PATTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间字符串.
|
||||
*
|
||||
* @return String 时间字符串,例如 09:51:53
|
||||
*/
|
||||
public static String getTimeStr() {
|
||||
return format(new Date(), TIME_PATTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前年份字符串.
|
||||
*
|
||||
* @return String 当前年份字符串,例如 2015
|
||||
*/
|
||||
public static String getYearStr() {
|
||||
return format(new Date(), YEAR_PATTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前月份字符串.
|
||||
*
|
||||
* @return String 当前月份字符串,例如 08
|
||||
*/
|
||||
public static String getMonthStr() {
|
||||
return format(new Date(), "MM");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前天数字符串.
|
||||
*
|
||||
* @return String 当前天数字符串,例如 11
|
||||
*/
|
||||
public static String getDayStr() {
|
||||
return format(new Date(), "dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前星期字符串.
|
||||
*
|
||||
* @return String 当前星期字符串,例如 星期二
|
||||
*/
|
||||
public static String getDayOfWeekStr() {
|
||||
return format(new Date(), "E");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期是星期几
|
||||
*
|
||||
* @param date 日期
|
||||
* @return String 星期几
|
||||
*/
|
||||
public static String getDayOfWeekStr(Date date) {
|
||||
String[] weekOfDays = {SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY};
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
int num = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
return weekOfDays[num];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取日期时间字符串
|
||||
*
|
||||
* @param date 需要转化的日期时间
|
||||
* @param pattern 时间格式
|
||||
* @return String 日期时间字符串,例如 2015-08-11 09:51:53
|
||||
*/
|
||||
public static String format(Date date, String pattern) {
|
||||
return new SimpleDateFormat(pattern).format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num年数之后的日期.
|
||||
*
|
||||
* @param num 间隔年数(负数表示之前)
|
||||
* @return Date 日期
|
||||
*/
|
||||
public static Date addYears(Date date, int num) {
|
||||
return add(date, num, Calendar.YEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num月数之后的日期.
|
||||
*
|
||||
* @param num 间隔月数(负数表示之前)
|
||||
* @return Date 日期
|
||||
*/
|
||||
public static Date addMonths(Date date, int num) {
|
||||
return add(date, num, Calendar.MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num周数之后的日期.
|
||||
*
|
||||
* @param date 日期
|
||||
* @param num 周数(负数表示之前)
|
||||
* @return Date 新的日期
|
||||
*/
|
||||
public static Date addWeeks(Date date, int num) {
|
||||
return add(date, num, Calendar.WEEK_OF_YEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num天数之后的日期.
|
||||
*
|
||||
* @param date 日期
|
||||
* @param num 天数(负数表示之前)
|
||||
* @return Date 新的日期
|
||||
*/
|
||||
public static Date addDays(Date date, int num) {
|
||||
return add(date, num, Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num小时之后的日期.
|
||||
*
|
||||
* @param date 日期
|
||||
* @param num 小时数(负数表示之前)
|
||||
* @return Date 新的日期
|
||||
*/
|
||||
public static Date addHours(Date date, int num) {
|
||||
return add(date, num, Calendar.HOUR_OF_DAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num分钟之后的日期.
|
||||
*
|
||||
* @param date 日期
|
||||
* @param num 分钟数(负数表示之前)
|
||||
* @return Date 新的日期
|
||||
*/
|
||||
public static Date addMinutes(Date date, int num) {
|
||||
return add(date, num, Calendar.MINUTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期num秒钟之后的日期.
|
||||
*
|
||||
* @param date 日期
|
||||
* @param num 秒钟数(负数表示之前)
|
||||
* @return Date 新的日期
|
||||
*/
|
||||
public static Date addSeconds(Date date, int num) {
|
||||
return add(date, num, Calendar.SECOND);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期指定数量日期时间单位之后的日期.
|
||||
*
|
||||
* @param date 日期
|
||||
* @param num 数量
|
||||
* @param unit 日期时间单位
|
||||
* @return Date 新的日期
|
||||
*/
|
||||
public static Date add(Date date, int num, int unit) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(unit, num);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本周的第一天,一个星期的第一天是星期一,最后一天是星期天
|
||||
*
|
||||
* @return Calendar 日历
|
||||
*/
|
||||
public static Date getStartDayOfWeek(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
|
||||
calendar.setFirstDayOfWeek(Calendar.MONDAY);
|
||||
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
||||
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本周的最后一天,一个星期的第一天是星期一,最后一天是星期天
|
||||
*
|
||||
* @return Calendar 日历
|
||||
*/
|
||||
public static Date getEndDayOfWeek(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
|
||||
calendar.setFirstDayOfWeek(Calendar.MONDAY);
|
||||
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
|
||||
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||
calendar.set(Calendar.MINUTE, 59);
|
||||
calendar.set(Calendar.SECOND, 59);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期当周第一天的日期字符串
|
||||
*
|
||||
* @param date 指定日期
|
||||
* @return String 格式:yyyy-MM-dd
|
||||
*/
|
||||
public static String getWeekStartTimeStr(Date date) {
|
||||
return getDateStr(getStartDayOfWeek(date));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本周最后一天的日期字符串
|
||||
*
|
||||
* @return String 格式:yyyy-MM-dd
|
||||
*/
|
||||
public static String getWeekEndTimeStr() {
|
||||
return getDateStr(getEndDayOfWeek(new Date()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定日期所在月份的开始日期
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Date getMonthStart(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
int index = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
calendar.add(Calendar.DATE, (1 - index));
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期所在月份的最后一天
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Date getMonthEnd(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.MONTH, 1);
|
||||
int index = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
calendar.add(Calendar.DATE, (-index));
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期对应月份第一天
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String getMonthStartStr(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
int index = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
calendar.add(Calendar.DATE, (1 - index));
|
||||
return sdf.format(calendar.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期对应月份最后一天
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String getMonthEndStr(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.MONTH, 1);
|
||||
int index = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
calendar.add(Calendar.DATE, (-index));
|
||||
return sdf.format(calendar.getTime());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定日期对应季度的第一天
|
||||
* @param theDay
|
||||
* @return
|
||||
*/
|
||||
public static String getQuarterStartStr(Date theDay){
|
||||
LocalDate resDate = null;
|
||||
if (theDay == null) {
|
||||
resDate = LocalDate.now();
|
||||
}else{
|
||||
resDate = LocalDate.parse(sdf.format(theDay),formatter);
|
||||
}
|
||||
Month month = resDate.getMonth();
|
||||
Month firstMonthOfQuarter = month.firstMonthOfQuarter();
|
||||
|
||||
resDate = LocalDate.of(resDate.getYear(), firstMonthOfQuarter, 1);
|
||||
|
||||
return resDate.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期对应季度的最后一天
|
||||
* @param theDay
|
||||
* @return
|
||||
*/
|
||||
public static String getQuarterEandStr(Date theDay){
|
||||
LocalDate resDate = LocalDate.now();
|
||||
if (theDay == null) {
|
||||
resDate = LocalDate.now();
|
||||
}else {
|
||||
resDate = LocalDate.parse(sdf.format(theDay),formatter);
|
||||
}
|
||||
Month month = resDate.getMonth();
|
||||
Month firstMonthOfQuarter = month.firstMonthOfQuarter();
|
||||
Month endMonthOfQuarter = Month.of(firstMonthOfQuarter.getValue() + 2);
|
||||
resDate = LocalDate.of(resDate.getYear(), endMonthOfQuarter, endMonthOfQuarter.length(resDate.isLeapYear()));
|
||||
return resDate.toString();
|
||||
}
|
||||
|
||||
|
||||
public static Date getNext(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Long getDateDiff(Date start,Date end){
|
||||
LocalDate sdate = LocalDate.parse(sdf.format(start),formatter);
|
||||
LocalDate edate = LocalDate.parse(sdf.format(end),formatter);
|
||||
return sdate.until(edate,ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
public static Long getDateDiff(String start,Date end){
|
||||
LocalDate sdate = LocalDate.parse(start,formatter);
|
||||
LocalDate edate = LocalDate.parse(sdf.format(end),formatter);
|
||||
return edate.until(sdate,ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
public static Long getDateDiff(Date start,String end){
|
||||
LocalDate sdate = LocalDate.parse(sdf.format(start),formatter);
|
||||
LocalDate edate = LocalDate.parse(sdf.format(end),formatter);
|
||||
return edate.until(sdate,ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个日期之间的天数差值
|
||||
* @param start
|
||||
* @param end
|
||||
* @return
|
||||
*/
|
||||
public static Long getDateDiff(String start,String end){
|
||||
LocalDate sdate = LocalDate.parse(start,formatter);
|
||||
LocalDate edate = LocalDate.parse(end,formatter);
|
||||
return edate.until(sdate,ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
public static Date getDatePlus(Date theDay,Integer count){
|
||||
LocalDate sdate = LocalDate.parse(sdf.format(theDay),formatter);
|
||||
sdate.plusDays(count);
|
||||
return Date.from(sdate.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定月份的所有日期
|
||||
* @param d
|
||||
* @return
|
||||
*/
|
||||
public static List<CalCalendar> getDays(Date d){
|
||||
List<CalCalendar> lst=new ArrayList();
|
||||
Date date = getMonthStart(d);
|
||||
Date monthEnd = getMonthEnd(d);
|
||||
while (!date.after(monthEnd)) {
|
||||
CalCalendar cal = new CalCalendar();
|
||||
cal.setTheDay(sdf.format(date));
|
||||
lst.add(cal);
|
||||
date = getNext(date);
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期前后N天的所有日期
|
||||
* @param date
|
||||
* @param num
|
||||
* @param pattern
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getDateStrList(Date date, int num, String pattern) {
|
||||
List<String> result = new ArrayList<>();
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(date);
|
||||
boolean flag = false;
|
||||
if (num < 0) {
|
||||
num = Math.abs(num);
|
||||
flag = true;
|
||||
}
|
||||
for (int i = 0; i < num; i++) {
|
||||
result.add(new SimpleDateFormat(pattern).format(c.getTimeInMillis()));
|
||||
c.add(Calendar.DATE, flag ? -1 : 1);
|
||||
}
|
||||
if (flag) {
|
||||
Collections.reverse(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.ktg.mes.dashboard.controller;
|
||||
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.mes.dashboard.service.DashboardService;
|
||||
import com.ktg.mes.dashboard.vo.res.CheckPlanResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MachineryResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MaterialStockResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.QualityCheckRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.RepairRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.WarehouseResponse;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页大屏Controller
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dashboard")
|
||||
public class DashboardController extends BaseController {
|
||||
@Autowired
|
||||
private DashboardService dashboardService;
|
||||
|
||||
/**
|
||||
* 首页大屏-获取设备(状态及生产工单进度)列表
|
||||
*/
|
||||
@GetMapping("/getMachineryList")
|
||||
public AjaxResult getMachineryList() {
|
||||
List<MachineryResponse> list = dashboardService.getMachineryList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页大屏-设备点检计划列表
|
||||
* 只有两个除尘设备
|
||||
* 一个设备对应一个点检计划 一个保养计划
|
||||
*/
|
||||
@GetMapping("/getCheckPlanList")
|
||||
public AjaxResult getCheckPlanList() {
|
||||
List<CheckPlanResponse> list = dashboardService.getCheckPlanList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 首页大屏-获取库存现有量-查询仓库设置列表
|
||||
*/
|
||||
@GetMapping("/getWarehouseList")
|
||||
public AjaxResult getWarehouseList() {
|
||||
List<WarehouseResponse> list = dashboardService.getWarehouseList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 首页大屏-获取库存现有量列表
|
||||
*/
|
||||
@GetMapping("/getMaterialStockList")
|
||||
public AjaxResult getMaterialStockList(Long warehouseId) {
|
||||
List<MaterialStockResponse> list = dashboardService.getMaterialStockList(warehouseId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页大屏-获取维修记录列表
|
||||
*/
|
||||
@GetMapping("/getRepairList")
|
||||
public AjaxResult getRepairList(Integer type) {
|
||||
if (type == 1) {
|
||||
List<DvCheckMaintenRecord> list = dashboardService.getCheckList();
|
||||
return AjaxResult.success(list);
|
||||
} else if (type == 2) {
|
||||
List<DvCheckMaintenRecord> list = dashboardService.getMaintenList();
|
||||
return AjaxResult.success(list);
|
||||
} else if (type == 3) {
|
||||
List<RepairRecordResponse> list = dashboardService.getRepairList();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页大屏-获取质检记录列表 1来料检验 2过程检验 3出货检验
|
||||
*/
|
||||
@GetMapping("/getQualityCheckList")
|
||||
public AjaxResult getQualityCheckList(Integer type) {
|
||||
List<QualityCheckRecordResponse> list = dashboardService.getQualityCheckList(type);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ktg.mes.dashboard.mapper;
|
||||
|
||||
import com.ktg.mes.dashboard.vo.CheckVo;
|
||||
import com.ktg.mes.dashboard.vo.MaintenVo;
|
||||
import com.ktg.mes.dashboard.vo.RepairVo;
|
||||
import com.ktg.mes.dashboard.vo.res.CheckPlanResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MachineryResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MaterialStockResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.QualityCheckRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.RepairRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.WarehouseResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页大屏Mapper接口
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
public interface DashboardMapper {
|
||||
|
||||
List<MachineryResponse> getMachineryList();
|
||||
|
||||
List<CheckPlanResponse> getCheckPlanList();
|
||||
|
||||
List<WarehouseResponse> getWarehouseList();
|
||||
|
||||
List<MaterialStockResponse> getMaterialStockList(Long warehouseId);
|
||||
|
||||
List<RepairRecordResponse> getRepairList();
|
||||
|
||||
CheckVo getCheckVo(@Param("machineryId") Long machineryId, @Param("planType") String planType);
|
||||
|
||||
MaintenVo getMaintenVo(@Param("machineryId") Long machineryId, @Param("planType") String planType);
|
||||
|
||||
List<RepairVo> getRepairVoList(@Param("machineryId") Long machineryId);
|
||||
|
||||
List<QualityCheckRecordResponse> getQcIqcList();
|
||||
|
||||
List<QualityCheckRecordResponse> getQcIpqcList();
|
||||
|
||||
List<QualityCheckRecordResponse> getQcOqcList();
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.ktg.mes.dashboard.service;
|
||||
|
||||
import com.ktg.mes.dashboard.vo.res.CheckPlanResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MachineryResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MaterialStockResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.QualityCheckRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.RepairRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.WarehouseResponse;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页大屏Service接口
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
public interface DashboardService {
|
||||
|
||||
List<MachineryResponse> getMachineryList();
|
||||
|
||||
List<CheckPlanResponse> getCheckPlanList();
|
||||
|
||||
List<WarehouseResponse> getWarehouseList();
|
||||
|
||||
List<MaterialStockResponse> getMaterialStockList(Long warehouseId);
|
||||
|
||||
List<DvCheckMaintenRecord> getCheckList();
|
||||
|
||||
List<DvCheckMaintenRecord> getMaintenList();
|
||||
|
||||
List<RepairRecordResponse> getRepairList();
|
||||
|
||||
List<QualityCheckRecordResponse> getQualityCheckList(Integer type);
|
||||
|
||||
}
|
@ -0,0 +1,200 @@
|
||||
package com.ktg.mes.dashboard.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ktg.mes.dashboard.mapper.DashboardMapper;
|
||||
import com.ktg.mes.dashboard.service.DashboardService;
|
||||
import com.ktg.mes.dashboard.vo.CheckVo;
|
||||
import com.ktg.mes.dashboard.vo.MaintenVo;
|
||||
import com.ktg.mes.dashboard.vo.RepairVo;
|
||||
import com.ktg.mes.dashboard.vo.res.CheckPlanResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MachineryProgressResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MachineryResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.MaterialStockResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.QualityCheckRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.RepairRecordResponse;
|
||||
import com.ktg.mes.dashboard.vo.res.WarehouseResponse;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
import com.ktg.mes.dv.mapper.DvCheckMaintenRecordMapper;
|
||||
import com.ktg.mes.pro.constant.JobProgressEnum;
|
||||
import com.ktg.mes.pro.domain.ProMachineryJobProgress;
|
||||
import com.ktg.mes.pro.mapper.ProMachineryJobMapper;
|
||||
import com.ktg.mes.pro.mapper.ProMachineryJobProgressMapper;
|
||||
import com.ktg.system.service.ISysDictDataService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页大屏Service业务层处理
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Service
|
||||
public class DashboardServiceImpl implements DashboardService {
|
||||
@Autowired
|
||||
private DashboardMapper dashboardMapper;
|
||||
@Autowired
|
||||
private ISysDictDataService dictDataService;
|
||||
@Autowired
|
||||
private ProMachineryJobMapper machineryJobMapper;
|
||||
@Autowired
|
||||
private ProMachineryJobProgressMapper machineryJobProgressMapper;
|
||||
@Autowired
|
||||
private DvCheckMaintenRecordMapper checkMaintenRecordMapper;
|
||||
|
||||
@Override
|
||||
public List<MachineryResponse> getMachineryList() {
|
||||
List<MachineryResponse> responseList = dashboardMapper.getMachineryList();
|
||||
for (MachineryResponse response : responseList) {
|
||||
ArrayList<MachineryProgressResponse> progressList = new ArrayList<>();
|
||||
LambdaQueryWrapper<ProMachineryJobProgress> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(ProMachineryJobProgress::getJobId, response.getJobId());
|
||||
queryWrapper1.eq(ProMachineryJobProgress::getProgressCode, JobProgressEnum.JB.getCode());
|
||||
queryWrapper1.ne(ProMachineryJobProgress::getStartTime, null);
|
||||
ProMachineryJobProgress jbProgress = machineryJobProgressMapper.selectOne(queryWrapper1);
|
||||
if (jbProgress != null) {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(jbProgress.getProgressName())
|
||||
.startTime(jbProgress.getStartTime())
|
||||
.endTime(jbProgress.getEndTime())
|
||||
.progressStatus(1).build();
|
||||
progressList.add(progressResponse);
|
||||
} else {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(JobProgressEnum.JB.getName()).startTime(null).endTime(null).progressStatus(2).build();
|
||||
progressList.add(progressResponse);
|
||||
}
|
||||
// 扒渣
|
||||
LambdaQueryWrapper<ProMachineryJobProgress> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.eq(ProMachineryJobProgress::getJobId, response.getJobId());
|
||||
queryWrapper2.eq(ProMachineryJobProgress::getProgressCode, JobProgressEnum.BZ.getCode());
|
||||
ProMachineryJobProgress bzProgress = machineryJobProgressMapper.selectOne(queryWrapper2);
|
||||
if (bzProgress != null) {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(bzProgress.getProgressName())
|
||||
.startTime(bzProgress.getStartTime())
|
||||
.endTime(bzProgress.getEndTime())
|
||||
.progressStatus(1).build();
|
||||
progressList.add(progressResponse);
|
||||
} else {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(JobProgressEnum.BZ.getName()).startTime(null).endTime(null).progressStatus(2).build();
|
||||
progressList.add(progressResponse);
|
||||
}
|
||||
// 搅拌取样
|
||||
LambdaQueryWrapper<ProMachineryJobProgress> queryWrapper3 = new LambdaQueryWrapper<>();
|
||||
queryWrapper3.eq(ProMachineryJobProgress::getJobId, response.getJobId());
|
||||
queryWrapper3.eq(ProMachineryJobProgress::getProgressCode, JobProgressEnum.JBQY.getCode());
|
||||
ProMachineryJobProgress jbqyProgress = machineryJobProgressMapper.selectOne(queryWrapper3);
|
||||
if (jbqyProgress != null) {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(jbqyProgress.getProgressName())
|
||||
.startTime(jbqyProgress.getStartTime())
|
||||
.endTime(jbqyProgress.getEndTime())
|
||||
.progressStatus(1).build();
|
||||
progressList.add(progressResponse);
|
||||
} else {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(JobProgressEnum.JBQY.getName()).startTime(null).endTime(null).progressStatus(2).build();
|
||||
progressList.add(progressResponse);
|
||||
}
|
||||
// 精炼除气
|
||||
LambdaQueryWrapper<ProMachineryJobProgress> queryWrapper4 = new LambdaQueryWrapper<>();
|
||||
queryWrapper4.eq(ProMachineryJobProgress::getJobId, response.getJobId());
|
||||
queryWrapper4.eq(ProMachineryJobProgress::getProgressCode, JobProgressEnum.JLCQ.getCode());
|
||||
ProMachineryJobProgress jlcqProgress = machineryJobProgressMapper.selectOne(queryWrapper4);
|
||||
if (jlcqProgress != null) {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(jlcqProgress.getProgressName())
|
||||
.startTime(jlcqProgress.getStartTime())
|
||||
.endTime(jlcqProgress.getEndTime())
|
||||
.progressStatus(1).build();
|
||||
progressList.add(progressResponse);
|
||||
} else {
|
||||
MachineryProgressResponse progressResponse = MachineryProgressResponse.builder().progressName(JobProgressEnum.JLCQ.getName()).startTime(null).endTime(null).progressStatus(2).build();
|
||||
progressList.add(progressResponse);
|
||||
}
|
||||
response.setProcesses(progressList);
|
||||
}
|
||||
return responseList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckPlanResponse> getCheckPlanList() {
|
||||
List<CheckPlanResponse> responseList = dashboardMapper.getCheckPlanList();
|
||||
for (CheckPlanResponse response : responseList) {
|
||||
// 设备点检计划 CHECK
|
||||
CheckVo checkVo = dashboardMapper.getCheckVo(response.getMachineryId(), "CHECK");
|
||||
if (checkVo != null) {
|
||||
String dictLabel = dictDataService.selectDictLabel("mes_cycle_type", checkVo.getCycleType());
|
||||
response.setPlanCode(checkVo.getPlanCode());
|
||||
response.setPlanRate(checkVo.getCycleCount() + dictLabel + "1次");
|
||||
response.setPlanUpdateTime(checkVo.getUpdateTime());
|
||||
}
|
||||
// 设备保养计划 MAINTEN
|
||||
MaintenVo maintenVo = dashboardMapper.getMaintenVo(response.getMachineryId(), "MAINTEN");
|
||||
if (maintenVo != null) {
|
||||
String dictLabel = dictDataService.selectDictLabel("mes_cycle_type", maintenVo.getCycleType());
|
||||
response.setMaintenCode(maintenVo.getPlanCode());
|
||||
response.setMaintenRate(maintenVo.getCycleCount() + dictLabel + "1次");
|
||||
response.setMaintenUpdateTime(maintenVo.getUpdateTime());
|
||||
}
|
||||
// 该设备最近一次维修记录
|
||||
List<RepairVo> repairVos = dashboardMapper.getRepairVoList(response.getMachineryId());
|
||||
if (CollectionUtils.isNotEmpty(repairVos)) {
|
||||
RepairVo repairVo = repairVos.get(0);
|
||||
response.setRepairCode(repairVo.getRepairCode());
|
||||
response.setRepairStatus(repairVo.getStatus());
|
||||
response.setAcceptedBy(repairVo.getAcceptedBy());
|
||||
response.setRepairUpdateTime(repairVo.getUpdateTime());
|
||||
}
|
||||
}
|
||||
return responseList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseResponse> getWarehouseList() {
|
||||
return dashboardMapper.getWarehouseList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaterialStockResponse> getMaterialStockList(Long warehouseId) {
|
||||
List<MaterialStockResponse> responseList = dashboardMapper.getMaterialStockList(warehouseId);
|
||||
return responseList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DvCheckMaintenRecord> getCheckList() {
|
||||
LambdaQueryWrapper<DvCheckMaintenRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DvCheckMaintenRecord::getPlanType, "CHECK");
|
||||
queryWrapper.orderByDesc(DvCheckMaintenRecord::getCreateTime);
|
||||
queryWrapper.last("limit 6");
|
||||
return checkMaintenRecordMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DvCheckMaintenRecord> getMaintenList() {
|
||||
LambdaQueryWrapper<DvCheckMaintenRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DvCheckMaintenRecord::getPlanType, "MAINTEN");
|
||||
queryWrapper.orderByDesc(DvCheckMaintenRecord::getCreateTime);
|
||||
queryWrapper.last("limit 6");
|
||||
return checkMaintenRecordMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairRecordResponse> getRepairList() {
|
||||
List<RepairRecordResponse> responseList = dashboardMapper.getRepairList();
|
||||
return responseList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QualityCheckRecordResponse> getQualityCheckList(Integer type) {
|
||||
List<QualityCheckRecordResponse> responseList = new ArrayList<>();
|
||||
if (type == 1) {
|
||||
responseList = dashboardMapper.getQcIqcList();
|
||||
} else if (type == 2) {
|
||||
responseList = dashboardMapper.getQcIpqcList();
|
||||
} else if (type == 3) {
|
||||
responseList = dashboardMapper.getQcOqcList();
|
||||
}
|
||||
return responseList;
|
||||
}
|
||||
|
||||
}
|
45
ktg-mes/src/main/java/com/ktg/mes/dashboard/vo/CheckVo.java
Normal file
45
ktg-mes/src/main/java/com/ktg/mes/dashboard/vo/CheckVo.java
Normal file
@ -0,0 +1,45 @@
|
||||
package com.ktg.mes.dashboard.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-设备检测计划-点检计划
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class CheckVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 点检计划编码
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 点检计划名称
|
||||
*/
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 次数
|
||||
*/
|
||||
private Long cycleCount;
|
||||
|
||||
/**
|
||||
* 频率
|
||||
*/
|
||||
private String cycleType;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.ktg.mes.dashboard.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-设备检测计划-保养计划
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class MaintenVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 保养计划编码
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 保养计划名称
|
||||
*/
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 次数
|
||||
*/
|
||||
private Long cycleCount;
|
||||
|
||||
/**
|
||||
* 频率
|
||||
*/
|
||||
private String cycleType;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
40
ktg-mes/src/main/java/com/ktg/mes/dashboard/vo/RepairVo.java
Normal file
40
ktg-mes/src/main/java/com/ktg/mes/dashboard/vo/RepairVo.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.ktg.mes.dashboard.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-设备检测计划-设备维修
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class RepairVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 维修单编号
|
||||
*/
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
private String acceptedBy;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-设备检测计划
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class CheckPlanResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long machineryId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String machineryCode;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 设备状态 STOP-停机、WORKING-生产中、REPAIR-维修中
|
||||
*/
|
||||
private String machineryStatus;
|
||||
|
||||
// =====点检计划=======
|
||||
/**
|
||||
* 点检计划编码
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 频率
|
||||
*/
|
||||
private String planRate;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date planUpdateTime;
|
||||
|
||||
// =====保养计划=====
|
||||
/**
|
||||
* 保养计划编码
|
||||
*/
|
||||
private String maintenCode;
|
||||
|
||||
/**
|
||||
* 频率
|
||||
*/
|
||||
private String maintenRate;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date maintenUpdateTime;
|
||||
|
||||
// =====设备维修=====
|
||||
/**
|
||||
* 维修单编号
|
||||
*/
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
private String acceptedBy;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String repairStatus;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date repairUpdateTime;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-设备(状态及生产工单进度)
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class MachineryProgressResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 进度名称
|
||||
*/
|
||||
private String progressName;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 进度状态 0已完成 1进行中 2未进行
|
||||
*/
|
||||
private Integer progressStatus;
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页大屏-设备(状态及生产工单进度)
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class MachineryResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 设备状态 STOP-停机、WORKING-生产中、REPAIR-维修中
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 生产作业id
|
||||
*/
|
||||
private Long jobId;
|
||||
|
||||
/**
|
||||
* 设备当前生产工单进度
|
||||
*/
|
||||
private String jobProgressCode;
|
||||
|
||||
/**
|
||||
* 天然气用量
|
||||
*/
|
||||
private BigDecimal gasCost;
|
||||
|
||||
/**
|
||||
* 生产工单编码
|
||||
*/
|
||||
private String workorderCode;
|
||||
|
||||
/**
|
||||
* 设备当前生产产品
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 总步数
|
||||
*/
|
||||
private Integer totalStep;
|
||||
|
||||
/**
|
||||
* 当前步骤
|
||||
*/
|
||||
private Integer currentStep;
|
||||
|
||||
/**
|
||||
* 生产工单进度
|
||||
*/
|
||||
private List<MachineryProgressResponse> processes;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-库存现有量
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class MaterialStockResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品物料编码
|
||||
*/
|
||||
private String itemCode;
|
||||
|
||||
/**
|
||||
* 产品物料名称
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 在库数量
|
||||
*/
|
||||
private BigDecimal quantityOnhand;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitOfMeasure;
|
||||
|
||||
/**
|
||||
* 库存有效期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expireDate;
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-质检记录
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class QualityCheckRecordResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 检验单号
|
||||
*/
|
||||
private String checkCode;
|
||||
|
||||
/**
|
||||
* 检验名称
|
||||
*/
|
||||
private String checkName;
|
||||
|
||||
/**
|
||||
* 产品物料编码
|
||||
*/
|
||||
private String itemCode;
|
||||
|
||||
/**
|
||||
* 产品物料名称
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/**
|
||||
* 检测结果
|
||||
*/
|
||||
private String checkResult;
|
||||
|
||||
/**
|
||||
* 检测人员
|
||||
*/
|
||||
private String inspector;
|
||||
|
||||
/**
|
||||
* 检测日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inspectDate;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 首页大屏-维修记录
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class RepairRecordResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 维修单编号
|
||||
*/
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 维修单名称
|
||||
*/
|
||||
private String repairName;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String machineryCode;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
private String acceptedBy;
|
||||
|
||||
/**
|
||||
* 维修完成日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date finishDate;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ktg.mes.dashboard.vo.res;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 首页大屏-库存现有量-仓库设置
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
public class WarehouseResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 仓库ID
|
||||
*/
|
||||
private Long warehouseId;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String warehouseName;
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkmachinery")
|
||||
public class DvCheckMachineryController extends BaseController {
|
||||
@Autowired
|
||||
private IDvCheckMachineryService dvCheckMachineryService;
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckMachinery dvCheckMachinery) {
|
||||
startPage();
|
||||
List<DvCheckMachinery> list = dvCheckMachineryService.selectDvCheckMachineryList(dvCheckMachinery);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点检设备列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:export')")
|
||||
@Log(title = "点检设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckMachinery dvCheckMachinery) {
|
||||
List<DvCheckMachinery> list = dvCheckMachineryService.selectDvCheckMachineryList(dvCheckMachinery);
|
||||
ExcelUtil<DvCheckMachinery> util = new ExcelUtil<DvCheckMachinery>(DvCheckMachinery.class);
|
||||
util.exportExcel(response, list, "点检设备数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点检设备详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId) {
|
||||
return AjaxResult.success(dvCheckMachineryService.selectDvCheckMachineryByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:add')")
|
||||
@Log(title = "点检设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvCheckMachinery dvCheckMachinery) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(dvCheckMachineryService.checkMachineryUnique(dvCheckMachinery))) {
|
||||
return AjaxResult.error("设备已设置过点检计划!");
|
||||
}
|
||||
return toAjax(dvCheckMachineryService.insertDvCheckMachinery(dvCheckMachinery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:edit')")
|
||||
@Log(title = "点检设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvCheckMachinery dvCheckMachinery) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(dvCheckMachineryService.checkMachineryUnique(dvCheckMachinery))) {
|
||||
return AjaxResult.error("设备已设置过点检计划!");
|
||||
}
|
||||
return toAjax(dvCheckMachineryService.updateDvCheckMachinery(dvCheckMachinery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:remove')")
|
||||
@Log(title = "点检设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds) {
|
||||
return toAjax(dvCheckMachineryService.deleteDvCheckMachineryByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
import com.ktg.mes.dv.service.IDvCheckMaintenRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检/保养记录Controller
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkMaintenRecord")
|
||||
public class DvCheckMaintenRecordController extends BaseController {
|
||||
@Autowired
|
||||
private IDvCheckMaintenRecordService checkMaintenRecordService;
|
||||
|
||||
/**
|
||||
* 查询设备点检/保养记录列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckMaintenRecord record) {
|
||||
startPage();
|
||||
List<DvCheckMaintenRecord> list = checkMaintenRecordService.getList(record);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检/保养记录
|
||||
*/
|
||||
@Log(title = "导出设备点检/保养记录excel", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportExcel")
|
||||
public void exportExcel(HttpServletResponse response, DvCheckMaintenRecord record) {
|
||||
List<DvCheckMaintenRecord> list = checkMaintenRecordService.getList(record);
|
||||
ExcelUtil<DvCheckMaintenRecord> util = new ExcelUtil<>(DvCheckMaintenRecord.class);
|
||||
util.exportExcel(response, list, "点检保养记录");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检/保养记录
|
||||
*/
|
||||
@GetMapping(value = "/getInfo/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId) {
|
||||
if (recordId == null) {
|
||||
return AjaxResult.error("参数异常");
|
||||
}
|
||||
DvCheckMaintenRecord dto = checkMaintenRecordService.getInfo(recordId);
|
||||
return AjaxResult.success(dto);
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
import com.ktg.mes.dv.domain.DvCheckPlan;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
||||
import com.ktg.mes.dv.service.IDvCheckPlanService;
|
||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkplan")
|
||||
public class DvCheckPlanController extends BaseController {
|
||||
@Autowired
|
||||
private IDvCheckPlanService dvCheckPlanService;
|
||||
|
||||
@Autowired
|
||||
IDvCheckMachineryService dvCheckMachineryService;
|
||||
|
||||
@Autowired
|
||||
IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckPlan dvCheckPlan) {
|
||||
startPage();
|
||||
List<DvCheckPlan> list = dvCheckPlanService.selectDvCheckPlanList(dvCheckPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检计划头列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:export')")
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckPlan dvCheckPlan) {
|
||||
List<DvCheckPlan> list = dvCheckPlanService.selectDvCheckPlanList(dvCheckPlan);
|
||||
ExcelUtil<DvCheckPlan> util = new ExcelUtil<DvCheckPlan>(DvCheckPlan.class);
|
||||
util.exportExcel(response, list, "设备点检保养计划数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检计划头详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:query')")
|
||||
@GetMapping(value = "/{planId}")
|
||||
public AjaxResult getInfo(@PathVariable("planId") Long planId) {
|
||||
return AjaxResult.success(dvCheckPlanService.selectDvCheckPlanByPlanId(planId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:add')")
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvCheckPlan dvCheckPlan) {
|
||||
return toAjax(dvCheckPlanService.insertDvCheckPlan(dvCheckPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:edit')")
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvCheckPlan dvCheckPlan) {
|
||||
if (UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckPlan.getStatus())) {
|
||||
DvCheckMachinery para1 = new DvCheckMachinery();
|
||||
para1.setPlanId(dvCheckPlan.getPlanId());
|
||||
List<DvCheckMachinery> machinerys = dvCheckMachineryService.selectDvCheckMachineryList(para1);
|
||||
if (!CollUtil.isNotEmpty(machinerys)) {
|
||||
return AjaxResult.error("请指定设备!");
|
||||
}
|
||||
|
||||
DvCheckSubject para2 = new DvCheckSubject();
|
||||
para2.setPlanId(dvCheckPlan.getPlanId());
|
||||
List<DvCheckSubject> subjects = dvCheckSubjectService.selectDvCheckSubjectList(para2);
|
||||
if (!CollUtil.isNotEmpty(subjects)) {
|
||||
return AjaxResult.error("请指定项目!");
|
||||
}
|
||||
}
|
||||
return toAjax(dvCheckPlanService.updateDvCheckPlan(dvCheckPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:remove')")
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{planIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] planIds) {
|
||||
try {
|
||||
dvCheckPlanService.deleteDvCheckPlanByPlanIds(planIds);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checksubject")
|
||||
public class DvCheckSubjectController extends BaseController {
|
||||
@Autowired
|
||||
private IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckSubject dvCheckSubject) {
|
||||
startPage();
|
||||
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点检项目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:export')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckSubject dvCheckSubject) {
|
||||
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
|
||||
ExcelUtil<DvCheckSubject> util = new ExcelUtil<DvCheckSubject>(DvCheckSubject.class);
|
||||
util.exportExcel(response, list, "点检项目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点检项目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId) {
|
||||
return AjaxResult.success(dvCheckSubjectService.selectDvCheckSubjectByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:add')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvCheckSubject dvCheckSubject) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))) {
|
||||
return AjaxResult.error("点检项目已经添加过!");
|
||||
}
|
||||
|
||||
return toAjax(dvCheckSubjectService.insertDvCheckSubject(dvCheckSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:edit')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvCheckSubject dvCheckSubject) {
|
||||
if (UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))) {
|
||||
return AjaxResult.error("点检项目已经添加过!");
|
||||
}
|
||||
return toAjax(dvCheckSubjectService.updateDvCheckSubject(dvCheckSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:remove')")
|
||||
@Log(title = "点检项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds) {
|
||||
return toAjax(dvCheckSubjectService.deleteDvCheckSubjectByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.SecurityUtils;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.mes.dv.domain.DvMachinery;
|
||||
import com.ktg.mes.dv.service.IDvMachineryService;
|
||||
import com.ktg.mes.wm.utils.WmBarCodeUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/machinery")
|
||||
public class DvMachineryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvMachineryService dvMachineryService;
|
||||
|
||||
@Autowired
|
||||
private WmBarCodeUtil wmBarCodeUtil;
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvMachinery dvMachinery)
|
||||
{
|
||||
startPage();
|
||||
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll()
|
||||
{
|
||||
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(new DvMachinery());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinery:export')")
|
||||
@Log(title = "设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvMachinery dvMachinery)
|
||||
{
|
||||
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
|
||||
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
|
||||
util.exportExcel(response, list, "设备数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinery:query')")
|
||||
@GetMapping(value = "/{machineryId}")
|
||||
public AjaxResult getInfo(@PathVariable("machineryId") Long machineryId)
|
||||
{
|
||||
return AjaxResult.success(dvMachineryService.selectDvMachineryByMachineryId(machineryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinery:add')")
|
||||
@Log(title = "设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvMachinery dvMachinery)
|
||||
{
|
||||
dvMachineryService.insertDvMachinery(dvMachinery);
|
||||
wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_MACHINERY,dvMachinery.getMachineryId(),dvMachinery.getMachineryCode(),dvMachinery.getMachineryName());
|
||||
return AjaxResult.success(dvMachinery.getMachineryId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinery:edit')")
|
||||
@Log(title = "设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvMachinery dvMachinery)
|
||||
{
|
||||
return toAjax(dvMachineryService.updateDvMachinery(dvMachinery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinery:remove')")
|
||||
@Log(title = "设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{machineryIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] machineryIds)
|
||||
{
|
||||
return toAjax(dvMachineryService.deleteDvMachineryByMachineryIds(machineryIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 依据上传的文件批量更新或新增设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinery:import')")
|
||||
@Log(title = "设备", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file,
|
||||
@RequestParam(name = "updateSupport", defaultValue = "false") boolean updateSupport) throws Exception {
|
||||
ExcelUtil<DvMachinery> util = new ExcelUtil<>(DvMachinery.class);
|
||||
List<DvMachinery> dvMachineryList = util.importExcel(file.getInputStream());
|
||||
String operName = SecurityUtils.getUsername();
|
||||
String message = dvMachineryService.importMachinery(dvMachineryList, updateSupport, operName);
|
||||
return AjaxResult.success("导入成功,共导入 " + message + " 条数据");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.dv.domain.DvMachinery;
|
||||
import com.ktg.mes.dv.service.IDvMachineryService;
|
||||
import com.ktg.system.strategy.AutoCodeUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.dv.domain.DvMachineryType;
|
||||
import com.ktg.mes.dv.service.IDvMachineryTypeService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 设备类型Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/machinerytype")
|
||||
public class DvMachineryTypeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvMachineryTypeService dvMachineryTypeService;
|
||||
|
||||
@Autowired
|
||||
private IDvMachineryService dvMachineryService;
|
||||
|
||||
@Autowired
|
||||
private AutoCodeUtil autoCodeUtil;
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(DvMachineryType dvMachineryType)
|
||||
{
|
||||
List<DvMachineryType> list = dvMachineryTypeService.selectDvMachineryTypeList(dvMachineryType);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备类型列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinerytype:export')")
|
||||
@Log(title = "设备类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvMachineryType dvMachineryType)
|
||||
{
|
||||
List<DvMachineryType> list = dvMachineryTypeService.selectDvMachineryTypeList(dvMachineryType);
|
||||
ExcelUtil<DvMachineryType> util = new ExcelUtil<DvMachineryType>(DvMachineryType.class);
|
||||
util.exportExcel(response, list, "设备类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备类型详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinerytype:query')")
|
||||
@GetMapping(value = "/{machineryTypeId}")
|
||||
public AjaxResult getInfo(@PathVariable("machineryTypeId") Long machineryTypeId)
|
||||
{
|
||||
return AjaxResult.success(dvMachineryTypeService.selectDvMachineryTypeByMachineryTypeId(machineryTypeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinerytype:add')")
|
||||
@Log(title = "设备类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvMachineryType dvMachineryType)
|
||||
{
|
||||
dvMachineryType.setMachineryTypeCode(autoCodeUtil.genSerialCode(UserConstants.MACHINERY_TYPE_CODE,null));
|
||||
return toAjax(dvMachineryTypeService.insertDvMachineryType(dvMachineryType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinerytype:edit')")
|
||||
@Log(title = "设备类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvMachineryType dvMachineryType)
|
||||
{
|
||||
return toAjax(dvMachineryTypeService.updateDvMachineryType(dvMachineryType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:machinerytype:remove')")
|
||||
@Log(title = "设备类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{machineryTypeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] machineryTypeIds)
|
||||
{
|
||||
for (Long typeId:machineryTypeIds
|
||||
) {
|
||||
DvMachinery param = new DvMachinery();
|
||||
param.setMachineryTypeId(typeId);
|
||||
List<DvMachinery> machinerys = dvMachineryService.selectDvMachineryList(param);
|
||||
if(CollUtil.isNotEmpty(machinerys)){
|
||||
return AjaxResult.error("设备类型下已配置了设备,不能删除!");
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(dvMachineryTypeService.deleteDvMachineryTypeByMachineryTypeIds(machineryTypeIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
import com.ktg.mes.dv.service.IDvRepairService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备维修单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/repair")
|
||||
public class DvRepairController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvRepairService dvRepairService;
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvRepair dvRepair)
|
||||
{
|
||||
startPage();
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备维修单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:export')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvRepair dvRepair)
|
||||
{
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
ExcelUtil<DvRepair> util = new ExcelUtil<DvRepair>(DvRepair.class);
|
||||
util.exportExcel(response, list, "设备维修单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备维修单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:query')")
|
||||
@GetMapping(value = "/{repairId}")
|
||||
public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairService.selectDvRepairByRepairId(repairId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dv:repair:add')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return AjaxResult.error("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.insertDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:edit')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return AjaxResult.error("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.updateDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:remove')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{repairIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] repairIds)
|
||||
{
|
||||
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.dv.domain.DvRepairLine;
|
||||
import com.ktg.mes.dv.service.IDvRepairLineService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备维修单行Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/repairline")
|
||||
public class DvRepairLineController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvRepairLineService dvRepairLineService;
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvRepairLine dvRepairLine)
|
||||
{
|
||||
startPage();
|
||||
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备维修单行列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:export')")
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvRepairLine dvRepairLine)
|
||||
{
|
||||
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
|
||||
ExcelUtil<DvRepairLine> util = new ExcelUtil<DvRepairLine>(DvRepairLine.class);
|
||||
util.exportExcel(response, list, "设备维修单行数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备维修单行详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:query')")
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairLineService.selectDvRepairLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:add')")
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvRepairLine dvRepairLine)
|
||||
{
|
||||
return toAjax(dvRepairLineService.insertDvRepairLine(dvRepairLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:edit')")
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvRepairLine dvRepairLine)
|
||||
{
|
||||
return toAjax(dvRepairLineService.updateDvRepairLine(dvRepairLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单行
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:remove')")
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] lineIds)
|
||||
{
|
||||
return toAjax(dvRepairLineService.deleteDvRepairLineByLineIds(lineIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.dv.domain.DvSubject;
|
||||
import com.ktg.mes.dv.service.IDvSubjectService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/dvsubject")
|
||||
public class DvSubjectController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvSubjectService dvSubjectService;
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvSubject dvSubject)
|
||||
{
|
||||
startPage();
|
||||
List<DvSubject> list = dvSubjectService.selectDvSubjectList(dvSubject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检保养项目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:dvsubject:export')")
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvSubject dvSubject)
|
||||
{
|
||||
List<DvSubject> list = dvSubjectService.selectDvSubjectList(dvSubject);
|
||||
ExcelUtil<DvSubject> util = new ExcelUtil<DvSubject>(DvSubject.class);
|
||||
util.exportExcel(response, list, "设备点检保养项目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检保养项目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:dvsubject:query')")
|
||||
@GetMapping(value = "/{subjectId}")
|
||||
public AjaxResult getInfo(@PathVariable("subjectId") Long subjectId)
|
||||
{
|
||||
return AjaxResult.success(dvSubjectService.selectDvSubjectBySubjectId(subjectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:dvsubject:add')")
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvSubject dvSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvSubjectService.checkSubjectCodeUnique(dvSubject))){
|
||||
return AjaxResult.error("项目编码已存在!");
|
||||
}
|
||||
return toAjax(dvSubjectService.insertDvSubject(dvSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:dvsubject:edit')")
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvSubject dvSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvSubjectService.checkSubjectCodeUnique(dvSubject))){
|
||||
return AjaxResult.error("项目编码已存在!");
|
||||
}
|
||||
return toAjax(dvSubjectService.updateDvSubject(dvSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:dvsubject:remove')")
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{subjectIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] subjectIds)
|
||||
{
|
||||
return toAjax(dvSubjectService.deleteDvSubjectBySubjectIds(subjectIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 点检设备对象 dv_check_machinery
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("dv_check_machinery")
|
||||
public class DvCheckMachinery extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
@TableId(value = "record_id", type = IdType.AUTO)
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 计划ID
|
||||
*/
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
private Long attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
private Long attr4;
|
||||
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检/保养记录对象 dv_check_mainten_record
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("dv_check_mainten_record")
|
||||
public class DvCheckMaintenRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "record_id", type = IdType.AUTO)
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 计划ID
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 点检/保养单号
|
||||
*/
|
||||
@Excel(name = "点检/保养单号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 计划编码
|
||||
*/
|
||||
@Excel(name = "计划编码")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 计划名称
|
||||
*/
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 频率
|
||||
*/
|
||||
private String cycleType;
|
||||
|
||||
/**
|
||||
* 次数
|
||||
*/
|
||||
private Long cycleCount;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long machineryId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 计划类型(取字典dv_plan_type CHECK点检 MAINTEN保养)
|
||||
*/
|
||||
@Excel(name = "计划类型", dictType = "dv_plan_type")
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String machineryBrand;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String machinerySpec;
|
||||
|
||||
/**
|
||||
* 状态(1未处理 2已处理 3已过期)
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "1=未处理,2=已处理,3=已过期")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 点检/保养时间
|
||||
*/
|
||||
@Excel(name = "点检/保养时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date checkTime;
|
||||
|
||||
/**
|
||||
* 点检人
|
||||
*/
|
||||
private String checkBy;
|
||||
|
||||
/**
|
||||
* 点检结果(是否正常)
|
||||
*/
|
||||
@Excel(name = "是否正常", readConverterExp = "Y=通过,N=不通过")
|
||||
private String checkStatus;
|
||||
|
||||
/**
|
||||
* 异常描述
|
||||
*/
|
||||
private String checkResult;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
private Long attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
private Long attr4;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 有效开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 有效截止时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<DvCheckMaintenRecordLine> lines;
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备点检/保养项目对象 dv_check_mainten_record_line
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("dv_check_mainten_record_line")
|
||||
public class DvCheckMaintenRecordLine implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "line_id", type = IdType.AUTO)
|
||||
private Long lineId;
|
||||
|
||||
/**
|
||||
* 点检保养记录ID
|
||||
*/
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long subjectId;
|
||||
|
||||
/**
|
||||
* 项目编码
|
||||
*/
|
||||
private String subjectCode;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String subjectName;
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
private String subjectType;
|
||||
|
||||
/**
|
||||
* 项目内容
|
||||
*/
|
||||
private String subjectContent;
|
||||
|
||||
/**
|
||||
* 标准
|
||||
*/
|
||||
private String subjectStandard;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
private Long attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
private Long attr4;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
102
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvCheckPlan.java
Normal file
102
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvCheckPlan.java
Normal file
@ -0,0 +1,102 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备点检计划头对象 dv_check_plan
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("dv_check_plan")
|
||||
public class DvCheckPlan extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 计划ID
|
||||
*/
|
||||
@TableId(value = "plan_id", type = IdType.AUTO)
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 计划编码
|
||||
*/
|
||||
@Excel(name = "计划编码")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 计划名称
|
||||
*/
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 频率
|
||||
*/
|
||||
@Excel(name = "频率")
|
||||
private String cycleType;
|
||||
|
||||
/**
|
||||
* 次数
|
||||
*/
|
||||
@Excel(name = "次数")
|
||||
private Long cycleCount;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
private Long attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
private Long attr4;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 点检项目对象 dv_check_subject
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("dv_check_subject")
|
||||
public class DvCheckSubject extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
@TableId(value = "record_id", type = IdType.AUTO)
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 计划ID
|
||||
*/
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@Excel(name = "设备ID")
|
||||
private Long subjectId;
|
||||
|
||||
/**
|
||||
* 项目编码
|
||||
*/
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/**
|
||||
* 项目内容
|
||||
*/
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/**
|
||||
* 标准
|
||||
*/
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
private Long attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
private Long attr4;
|
||||
|
||||
}
|
312
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvMachinery.java
Normal file
312
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvMachinery.java
Normal file
@ -0,0 +1,312 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备对象 dv_machinery
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public class DvMachinery extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备类型ID */
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备类型编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备类型名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 设备类型ID */
|
||||
@Excel(name = "设备类型ID")
|
||||
private Long machineryTypeId;
|
||||
|
||||
/** 设备类型编码 */
|
||||
@Excel(name = "设备类型编码")
|
||||
private String machineryTypeCode;
|
||||
|
||||
/** 设备类型名称 */
|
||||
@Excel(name = "设备类型名称")
|
||||
private String machineryTypeName;
|
||||
|
||||
/** 所属车间ID */
|
||||
@Excel(name = "所属车间ID")
|
||||
private Long workshopId;
|
||||
|
||||
/** 所属车间编码 */
|
||||
@Excel(name = "所属车间编码")
|
||||
private String workshopCode;
|
||||
|
||||
/** 所属车间名称 */
|
||||
@Excel(name = "所属车间名称")
|
||||
private String workshopName;
|
||||
|
||||
/** 设备状态 */
|
||||
@Excel(name = "设备状态")
|
||||
private String status;
|
||||
|
||||
/** 出厂编号 */
|
||||
@Excel(name = "出厂编号")
|
||||
private String factoryNo;
|
||||
|
||||
/** 启用时间 */
|
||||
@Excel(name = "启用时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
/** 当前设备生产记录ID pro_machinery_job.id */
|
||||
private Long machineryJobId;
|
||||
|
||||
/** 设备分类 取字典mes_machinery_type(1生产炉子 2除尘设备) */
|
||||
private String machineryType;
|
||||
|
||||
/** 天然气度数 */
|
||||
private BigDecimal gas;
|
||||
|
||||
public void setMachineryId(Long machineryId)
|
||||
{
|
||||
this.machineryId = machineryId;
|
||||
}
|
||||
|
||||
public Long getMachineryId()
|
||||
{
|
||||
return machineryId;
|
||||
}
|
||||
public void setMachineryCode(String machineryCode)
|
||||
{
|
||||
this.machineryCode = machineryCode;
|
||||
}
|
||||
|
||||
public String getMachineryCode()
|
||||
{
|
||||
return machineryCode;
|
||||
}
|
||||
public void setMachineryName(String machineryName)
|
||||
{
|
||||
this.machineryName = machineryName;
|
||||
}
|
||||
|
||||
public String getMachineryName()
|
||||
{
|
||||
return machineryName;
|
||||
}
|
||||
public void setMachineryBrand(String machineryBrand)
|
||||
{
|
||||
this.machineryBrand = machineryBrand;
|
||||
}
|
||||
|
||||
public String getMachineryBrand()
|
||||
{
|
||||
return machineryBrand;
|
||||
}
|
||||
public void setMachinerySpec(String machinerySpec)
|
||||
{
|
||||
this.machinerySpec = machinerySpec;
|
||||
}
|
||||
|
||||
public String getMachinerySpec()
|
||||
{
|
||||
return machinerySpec;
|
||||
}
|
||||
public void setMachineryTypeId(Long machineryTypeId)
|
||||
{
|
||||
this.machineryTypeId = machineryTypeId;
|
||||
}
|
||||
|
||||
public Long getMachineryTypeId()
|
||||
{
|
||||
return machineryTypeId;
|
||||
}
|
||||
public void setMachineryTypeCode(String machineryTypeCode)
|
||||
{
|
||||
this.machineryTypeCode = machineryTypeCode;
|
||||
}
|
||||
|
||||
public String getMachineryTypeCode()
|
||||
{
|
||||
return machineryTypeCode;
|
||||
}
|
||||
public void setMachineryTypeName(String machineryTypeName)
|
||||
{
|
||||
this.machineryTypeName = machineryTypeName;
|
||||
}
|
||||
|
||||
public String getMachineryTypeName()
|
||||
{
|
||||
return machineryTypeName;
|
||||
}
|
||||
public void setWorkshopId(Long workshopId)
|
||||
{
|
||||
this.workshopId = workshopId;
|
||||
}
|
||||
|
||||
public Long getWorkshopId()
|
||||
{
|
||||
return workshopId;
|
||||
}
|
||||
public void setWorkshopCode(String workshopCode)
|
||||
{
|
||||
this.workshopCode = workshopCode;
|
||||
}
|
||||
|
||||
public String getWorkshopCode()
|
||||
{
|
||||
return workshopCode;
|
||||
}
|
||||
public void setWorkshopName(String workshopName)
|
||||
{
|
||||
this.workshopName = workshopName;
|
||||
}
|
||||
|
||||
public String getWorkshopName()
|
||||
{
|
||||
return workshopName;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
public String getFactoryNo() {
|
||||
return factoryNo;
|
||||
}
|
||||
|
||||
public void setFactoryNo(String factoryNo) {
|
||||
this.factoryNo = factoryNo;
|
||||
}
|
||||
|
||||
public LocalDateTime getActivationTime() {
|
||||
return activationTime;
|
||||
}
|
||||
|
||||
public void setActivationTime(LocalDateTime activationTime) {
|
||||
this.activationTime = activationTime;
|
||||
}
|
||||
|
||||
public Long getMachineryJobId() {
|
||||
return machineryJobId;
|
||||
}
|
||||
|
||||
public void setMachineryJobId(Long machineryJobId) {
|
||||
this.machineryJobId = machineryJobId;
|
||||
}
|
||||
|
||||
public String getMachineryType() {
|
||||
return machineryType;
|
||||
}
|
||||
|
||||
public void setMachineryType(String machineryType) {
|
||||
this.machineryType = machineryType;
|
||||
}
|
||||
|
||||
public BigDecimal getGas() {
|
||||
return gas;
|
||||
}
|
||||
|
||||
public void setGas(BigDecimal gas) {
|
||||
this.gas = gas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("machineryId", getMachineryId())
|
||||
.append("machineryCode", getMachineryCode())
|
||||
.append("machineryName", getMachineryName())
|
||||
.append("machineryBrand", getMachineryBrand())
|
||||
.append("machinerySpec", getMachinerySpec())
|
||||
.append("machineryTypeId", getMachineryTypeId())
|
||||
.append("machineryTypeCode", getMachineryTypeCode())
|
||||
.append("machineryTypeName", getMachineryTypeName())
|
||||
.append("workshopId", getWorkshopId())
|
||||
.append("workshopCode", getWorkshopCode())
|
||||
.append("workshopName", getWorkshopName())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
151
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvMachineryType.java
Normal file
151
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvMachineryType.java
Normal file
@ -0,0 +1,151 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.TreeEntity;
|
||||
|
||||
/**
|
||||
* 设备类型对象 dv_machinery_type
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public class DvMachineryType extends TreeEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备类型ID */
|
||||
private Long machineryTypeId;
|
||||
|
||||
/** 设备类型编码 */
|
||||
@Excel(name = "设备类型编码")
|
||||
private String machineryTypeCode;
|
||||
|
||||
/** 设备类型名称 */
|
||||
@Excel(name = "设备类型名称")
|
||||
private String machineryTypeName;
|
||||
|
||||
/** 父类型ID */
|
||||
@Excel(name = "父类型ID")
|
||||
private Long parentTypeId;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setMachineryTypeId(Long machineryTypeId)
|
||||
{
|
||||
this.machineryTypeId = machineryTypeId;
|
||||
}
|
||||
|
||||
public Long getMachineryTypeId()
|
||||
{
|
||||
return machineryTypeId;
|
||||
}
|
||||
public void setMachineryTypeCode(String machineryTypeCode)
|
||||
{
|
||||
this.machineryTypeCode = machineryTypeCode;
|
||||
}
|
||||
|
||||
public String getMachineryTypeCode()
|
||||
{
|
||||
return machineryTypeCode;
|
||||
}
|
||||
public void setMachineryTypeName(String machineryTypeName)
|
||||
{
|
||||
this.machineryTypeName = machineryTypeName;
|
||||
}
|
||||
|
||||
public String getMachineryTypeName()
|
||||
{
|
||||
return machineryTypeName;
|
||||
}
|
||||
public void setParentTypeId(Long parentTypeId)
|
||||
{
|
||||
this.parentTypeId = parentTypeId;
|
||||
}
|
||||
|
||||
public Long getParentTypeId()
|
||||
{
|
||||
return parentTypeId;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("machineryTypeId", getMachineryTypeId())
|
||||
.append("machineryTypeCode", getMachineryTypeCode())
|
||||
.append("machineryTypeName", getMachineryTypeName())
|
||||
.append("parentTypeId", getParentTypeId())
|
||||
.append("ancestors", getAncestors())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
147
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvRepair.java
Normal file
147
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvRepair.java
Normal file
@ -0,0 +1,147 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 设备维修单对象 dv_repair
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@Data
|
||||
public class DvRepair extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 维修单ID
|
||||
*/
|
||||
private Long repairId;
|
||||
|
||||
/**
|
||||
* 维修单编号
|
||||
*/
|
||||
@Excel(name = "维修单编号")
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 维修单名称
|
||||
*/
|
||||
@Excel(name = "维修单名称")
|
||||
private String repairName;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/**
|
||||
* 设备类型ID
|
||||
*/
|
||||
@Excel(name = "设备类型ID")
|
||||
private Long machineryTypeId;
|
||||
|
||||
/**
|
||||
* 报修日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "报修日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date requireDate;
|
||||
|
||||
/**
|
||||
* 维修完成日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "维修完成日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date finishDate;
|
||||
|
||||
/**
|
||||
* 验收日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "验收日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date confirmDate;
|
||||
|
||||
/**
|
||||
* 维修结果
|
||||
*/
|
||||
@Excel(name = "维修结果")
|
||||
private String repairResult;
|
||||
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
@Excel(name = "维修人员")
|
||||
private String acceptedBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String acceptName;
|
||||
|
||||
/**
|
||||
* 验收人员
|
||||
*/
|
||||
@Excel(name = "验收人员")
|
||||
private String confirmBy;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String confirmName;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
private Long attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
private Long attr4;
|
||||
|
||||
}
|
234
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvRepairLine.java
Normal file
234
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvRepairLine.java
Normal file
@ -0,0 +1,234 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 设备维修单行对象 dv_repair_line
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
public class DvRepairLine extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 行ID */
|
||||
private Long lineId;
|
||||
|
||||
/** 维修单ID */
|
||||
@Excel(name = "维修单ID")
|
||||
private Long repairId;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 故障描述 */
|
||||
@Excel(name = "故障描述")
|
||||
private String malfunction;
|
||||
|
||||
/** 故障描述资源 */
|
||||
@Excel(name = "故障描述资源")
|
||||
private String malfunctionUrl;
|
||||
|
||||
/** 维修情况 */
|
||||
@Excel(name = "维修情况")
|
||||
private String repairDes;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
public void setRepairId(Long repairId)
|
||||
{
|
||||
this.repairId = repairId;
|
||||
}
|
||||
|
||||
public Long getRepairId()
|
||||
{
|
||||
return repairId;
|
||||
}
|
||||
public void setSubjectId(Long subjectId)
|
||||
{
|
||||
this.subjectId = subjectId;
|
||||
}
|
||||
|
||||
public Long getSubjectId()
|
||||
{
|
||||
return subjectId;
|
||||
}
|
||||
public void setSubjectCode(String subjectCode)
|
||||
{
|
||||
this.subjectCode = subjectCode;
|
||||
}
|
||||
|
||||
public String getSubjectCode()
|
||||
{
|
||||
return subjectCode;
|
||||
}
|
||||
public void setSubjectName(String subjectName)
|
||||
{
|
||||
this.subjectName = subjectName;
|
||||
}
|
||||
|
||||
public String getSubjectName()
|
||||
{
|
||||
return subjectName;
|
||||
}
|
||||
public void setSubjectType(String subjectType)
|
||||
{
|
||||
this.subjectType = subjectType;
|
||||
}
|
||||
|
||||
public String getSubjectType()
|
||||
{
|
||||
return subjectType;
|
||||
}
|
||||
public void setSubjectContent(String subjectContent)
|
||||
{
|
||||
this.subjectContent = subjectContent;
|
||||
}
|
||||
|
||||
public String getSubjectContent()
|
||||
{
|
||||
return subjectContent;
|
||||
}
|
||||
public void setSubjectStandard(String subjectStandard)
|
||||
{
|
||||
this.subjectStandard = subjectStandard;
|
||||
}
|
||||
|
||||
public String getSubjectStandard()
|
||||
{
|
||||
return subjectStandard;
|
||||
}
|
||||
public void setMalfunction(String malfunction)
|
||||
{
|
||||
this.malfunction = malfunction;
|
||||
}
|
||||
|
||||
public String getMalfunction()
|
||||
{
|
||||
return malfunction;
|
||||
}
|
||||
public void setMalfunctionUrl(String malfunctionUrl)
|
||||
{
|
||||
this.malfunctionUrl = malfunctionUrl;
|
||||
}
|
||||
|
||||
public String getMalfunctionUrl()
|
||||
{
|
||||
return malfunctionUrl;
|
||||
}
|
||||
public void setRepairDes(String repairDes)
|
||||
{
|
||||
this.repairDes = repairDes;
|
||||
}
|
||||
|
||||
public String getRepairDes()
|
||||
{
|
||||
return repairDes;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("lineId", getLineId())
|
||||
.append("repairId", getRepairId())
|
||||
.append("subjectId", getSubjectId())
|
||||
.append("subjectCode", getSubjectCode())
|
||||
.append("subjectName", getSubjectName())
|
||||
.append("subjectType", getSubjectType())
|
||||
.append("subjectContent", getSubjectContent())
|
||||
.append("subjectStandard", getSubjectStandard())
|
||||
.append("malfunction", getMalfunction())
|
||||
.append("malfunctionUrl", getMalfunctionUrl())
|
||||
.append("repairDes", getRepairDes())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
178
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvSubject.java
Normal file
178
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvSubject.java
Normal file
@ -0,0 +1,178 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目对象 dv_subject
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public class DvSubject extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 项目ID */
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setSubjectId(Long subjectId)
|
||||
{
|
||||
this.subjectId = subjectId;
|
||||
}
|
||||
|
||||
public Long getSubjectId()
|
||||
{
|
||||
return subjectId;
|
||||
}
|
||||
public void setSubjectCode(String subjectCode)
|
||||
{
|
||||
this.subjectCode = subjectCode;
|
||||
}
|
||||
|
||||
public String getSubjectCode()
|
||||
{
|
||||
return subjectCode;
|
||||
}
|
||||
public void setSubjectName(String subjectName)
|
||||
{
|
||||
this.subjectName = subjectName;
|
||||
}
|
||||
|
||||
public String getSubjectName()
|
||||
{
|
||||
return subjectName;
|
||||
}
|
||||
public void setSubjectType(String subjectType)
|
||||
{
|
||||
this.subjectType = subjectType;
|
||||
}
|
||||
|
||||
public String getSubjectType()
|
||||
{
|
||||
return subjectType;
|
||||
}
|
||||
public void setSubjectContent(String subjectContent)
|
||||
{
|
||||
this.subjectContent = subjectContent;
|
||||
}
|
||||
|
||||
public String getSubjectContent()
|
||||
{
|
||||
return subjectContent;
|
||||
}
|
||||
public void setSubjectStandard(String subjectStandard)
|
||||
{
|
||||
this.subjectStandard = subjectStandard;
|
||||
}
|
||||
|
||||
public String getSubjectStandard()
|
||||
{
|
||||
return subjectStandard;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("subjectId", getSubjectId())
|
||||
.append("subjectCode", getSubjectCode())
|
||||
.append("subjectName", getSubjectName())
|
||||
.append("subjectType", getSubjectType())
|
||||
.append("subjectContent", getSubjectContent())
|
||||
.append("subjectStandard", getSubjectStandard())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
public interface DvCheckMachineryMapper extends BaseMapper<DvCheckMachinery> {
|
||||
/**
|
||||
* 查询点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 点检设备
|
||||
*/
|
||||
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 点检设备集合
|
||||
*/
|
||||
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
public DvCheckMachinery checkMachineryUnique(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 删除点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除点检设备
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 根据计划头ID删除对应的设备列表
|
||||
*
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecordLine;
|
||||
|
||||
/**
|
||||
* 设备点检/保养项目Mapper接口
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
public interface DvCheckMaintenRecordLineMapper extends BaseMapper<DvCheckMaintenRecordLine> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
|
||||
/**
|
||||
* 设备点检/保养记录Mapper接口
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
public interface DvCheckMaintenRecordMapper extends BaseMapper<DvCheckMaintenRecord> {
|
||||
|
||||
void updateExpireRecord();
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ktg.mes.dv.domain.DvCheckPlan;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface DvCheckPlanMapper extends BaseMapper<DvCheckPlan> {
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 设备点检计划头集合
|
||||
*/
|
||||
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan);
|
||||
|
||||
public DvCheckPlan checkPlanCodeUnique(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检计划头
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanIds(Long[] planIds);
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public interface DvCheckSubjectMapper extends BaseMapper<DvCheckSubject> {
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目集合
|
||||
*/
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
|
||||
|
||||
|
||||
public DvCheckSubject checkSubjectUnique(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 删除点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 根据计划ID删除对应的计划项目
|
||||
*
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import com.ktg.mes.dv.domain.DvMachinery;
|
||||
import com.ktg.mes.dv.vo.res.DvMachineryResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface DvMachineryMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 设备
|
||||
*/
|
||||
public DvMachinery selectDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 依据设备编码查询设备
|
||||
*
|
||||
* @param machineryCode 设备编码
|
||||
* @return 设备
|
||||
*/
|
||||
public DvMachinery selectByMachineryCode( String machineryCode);
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 设备集合
|
||||
*/
|
||||
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*
|
||||
* @param machineryIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryIds(Long[] machineryIds);
|
||||
|
||||
/**
|
||||
* 获取设备(状态及生产工单进度)列表
|
||||
* @return
|
||||
*/
|
||||
List<DvMachineryResponse> getMachineryJobProgressList();
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvMachineryType;
|
||||
|
||||
/**
|
||||
* 设备类型Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface DvMachineryTypeMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 设备类型
|
||||
*/
|
||||
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 设备类型集合
|
||||
*/
|
||||
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 删除设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
|
||||
/**
|
||||
* 批量删除设备类型
|
||||
*
|
||||
* @param machineryTypeIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvRepairLine;
|
||||
|
||||
/**
|
||||
* 设备维修单行Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
public interface DvRepairLineMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 设备维修单行
|
||||
*/
|
||||
public DvRepairLine selectDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 设备维修单行集合
|
||||
*/
|
||||
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 删除设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单行
|
||||
*
|
||||
* @param lineIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineIds(Long[] lineIds);
|
||||
|
||||
public int deleteByRepairId(Long repairId);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
|
||||
/**
|
||||
* 设备维修单Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public interface DvRepairMapper extends BaseMapper<DvRepair>
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单集合
|
||||
*/
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
|
||||
|
||||
public DvRepair checkCodeUnique(DvRepair dvRepair);
|
||||
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvSubject;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface DvSubjectMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
public DvSubject selectDvSubjectBySubjectId(Long subjectId);
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 设备点检保养项目集合
|
||||
*/
|
||||
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject);
|
||||
|
||||
|
||||
public DvSubject checkSubjectCodeUnique(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectId(Long subjectId);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检保养项目
|
||||
*
|
||||
* @param subjectIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectIds(Long[] subjectIds);
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
public interface IDvCheckMachineryService extends IService<DvCheckMachinery> {
|
||||
/**
|
||||
* 查询点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 点检设备
|
||||
*/
|
||||
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 点检设备集合
|
||||
*/
|
||||
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
public String checkMachineryUnique(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 批量删除点检设备
|
||||
*
|
||||
* @param recordIds 需要删除的点检设备主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除点检设备信息
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 根据计划头ID删除对应的设备列表
|
||||
*
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecordLine;
|
||||
|
||||
/**
|
||||
* 设备点检/保养项目Service接口
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
public interface IDvCheckMaintenRecordLineService extends IService<DvCheckMaintenRecordLine> {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检/保养记录Service接口
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
public interface IDvCheckMaintenRecordService extends IService<DvCheckMaintenRecord> {
|
||||
|
||||
List<DvCheckMaintenRecord> getList(DvCheckMaintenRecord record);
|
||||
|
||||
DvCheckMaintenRecord getInfo(Long recordId);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ktg.mes.dv.domain.DvCheckPlan;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface IDvCheckPlanService extends IService<DvCheckPlan> {
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 设备点检计划头集合
|
||||
*/
|
||||
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 检查计划编码是否唯一
|
||||
*
|
||||
* @param dvCheckPlan
|
||||
* @return
|
||||
*/
|
||||
public String checkPlanCodeUnique(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检计划头
|
||||
*
|
||||
* @param planIds 需要删除的设备点检计划头主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public void deleteDvCheckPlanByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头信息
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public interface IDvCheckSubjectService extends IService<DvCheckSubject> {
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目集合
|
||||
*/
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
|
||||
|
||||
|
||||
/**
|
||||
* 检查当前计划下,点检项目是否唯一
|
||||
*
|
||||
* @param dvCheckSubject
|
||||
* @return
|
||||
*/
|
||||
public String checkSubjectUnique(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的点检项目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除点检项目信息
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 根据计划ID删除对应的计划项目
|
||||
*
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import com.ktg.mes.dv.domain.DvMachinery;
|
||||
import com.ktg.mes.dv.vo.res.DvMachineryResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface IDvMachineryService
|
||||
{
|
||||
/**
|
||||
* 查询设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 设备
|
||||
*/
|
||||
public DvMachinery selectDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 设备集合
|
||||
*/
|
||||
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*
|
||||
* @param machineryIds 需要删除的设备主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryIds(Long[] machineryIds);
|
||||
|
||||
/**
|
||||
* 删除设备信息
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 依据上传的文件,批量导入或更新设备信息
|
||||
*
|
||||
* @param machineryList 设备信息列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
public String importMachinery(List<DvMachinery> machineryList, Boolean isUpdateSupport, String operName);
|
||||
|
||||
/**
|
||||
* 获取设备(状态及生产工单进度)列表
|
||||
* @return
|
||||
*/
|
||||
List<DvMachineryResponse> getMachineryJobProgressList();
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvMachineryType;
|
||||
|
||||
/**
|
||||
* 设备类型Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface IDvMachineryTypeService
|
||||
{
|
||||
/**
|
||||
* 查询设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 设备类型
|
||||
*/
|
||||
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 设备类型集合
|
||||
*/
|
||||
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 批量删除设备类型
|
||||
*
|
||||
* @param machineryTypeIds 需要删除的设备类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds);
|
||||
|
||||
/**
|
||||
* 删除设备类型信息
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvRepairLine;
|
||||
|
||||
/**
|
||||
* 设备维修单行Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
public interface IDvRepairLineService
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 设备维修单行
|
||||
*/
|
||||
public DvRepairLine selectDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 设备维修单行集合
|
||||
*/
|
||||
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单行
|
||||
*
|
||||
* @param lineIds 需要删除的设备维修单行主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 删除设备维修单行信息
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 根据维修单头删除所有行信息
|
||||
* @param repairId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByRepairId(Long repairId);
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
|
||||
/**
|
||||
* 设备维修单Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public interface IDvRepairService
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单集合
|
||||
*/
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 检测维修单编号是否唯一
|
||||
* @param dvRepair
|
||||
* @return
|
||||
*/
|
||||
public String checkCodeUnique(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的设备维修单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
|
||||
/**
|
||||
* 删除设备维修单信息
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 小程序获取维修单列表
|
||||
* @return
|
||||
*/
|
||||
List<DvRepair> selectWxRepairList();
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvSubject;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface IDvSubjectService
|
||||
{
|
||||
/**
|
||||
* 查询设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
public DvSubject selectDvSubjectBySubjectId(Long subjectId);
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 设备点检保养项目集合
|
||||
*/
|
||||
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 检查项目编码是否重复
|
||||
* @param dvSubject
|
||||
* @return
|
||||
*/
|
||||
public String checkSubjectCodeUnique(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检保养项目
|
||||
*
|
||||
* @param subjectIds 需要删除的设备点检保养项目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectIds(Long[] subjectIds);
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目信息
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectId(Long subjectId);
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.ktg.mes.dv.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
import com.ktg.mes.dv.mapper.DvCheckMachineryMapper;
|
||||
import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckMachineryServiceImpl extends ServiceImpl<DvCheckMachineryMapper, DvCheckMachinery> implements IDvCheckMachineryService {
|
||||
@Autowired
|
||||
private DvCheckMachineryMapper dvCheckMachineryMapper;
|
||||
|
||||
/**
|
||||
* 查询点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 点检设备
|
||||
*/
|
||||
@Override
|
||||
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId) {
|
||||
return dvCheckMachineryMapper.selectDvCheckMachineryByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 点检设备
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery) {
|
||||
return dvCheckMachineryMapper.selectDvCheckMachineryList(dvCheckMachinery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkMachineryUnique(DvCheckMachinery dvCheckMachinery) {
|
||||
DvCheckMachinery machinery = dvCheckMachineryMapper.checkMachineryUnique(dvCheckMachinery);
|
||||
Long recordId = dvCheckMachinery.getRecordId() == null ? -1L : dvCheckMachinery.getRecordId();
|
||||
if (StringUtils.isNotNull(machinery) && machinery.getRecordId().longValue() != recordId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery) {
|
||||
dvCheckMachinery.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckMachineryMapper.insertDvCheckMachinery(dvCheckMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery) {
|
||||
dvCheckMachinery.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckMachineryMapper.updateDvCheckMachinery(dvCheckMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除点检设备
|
||||
*
|
||||
* @param recordIds 需要删除的点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds) {
|
||||
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检设备信息
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId) {
|
||||
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanId(Long planId) {
|
||||
return dvCheckMachineryMapper.deleteByPlanId(planId);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ktg.mes.dv.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecordLine;
|
||||
import com.ktg.mes.dv.mapper.DvCheckMaintenRecordLineMapper;
|
||||
import com.ktg.mes.dv.service.IDvCheckMaintenRecordLineService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 设备点检/保养项目Service业务层处理
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckMaintenRecordLineServiceImpl extends ServiceImpl<DvCheckMaintenRecordLineMapper, DvCheckMaintenRecordLine> implements IDvCheckMaintenRecordLineService {
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.ktg.mes.dv.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ktg.common.exception.ServiceException;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecordLine;
|
||||
import com.ktg.mes.dv.mapper.DvCheckMaintenRecordLineMapper;
|
||||
import com.ktg.mes.dv.mapper.DvCheckMaintenRecordMapper;
|
||||
import com.ktg.mes.dv.service.IDvCheckMaintenRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检/保养记录Service业务层处理
|
||||
*
|
||||
* @author lishitian
|
||||
* @date 2024-10-23
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckMaintenRecordServiceImpl extends ServiceImpl<DvCheckMaintenRecordMapper, DvCheckMaintenRecord> implements IDvCheckMaintenRecordService {
|
||||
@Autowired
|
||||
private DvCheckMaintenRecordLineMapper dvCheckMaintenRecordLineMapper;
|
||||
|
||||
@Override
|
||||
public List<DvCheckMaintenRecord> getList(DvCheckMaintenRecord record) {
|
||||
LambdaQueryWrapper<DvCheckMaintenRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(record.getOrderCode())) {
|
||||
queryWrapper.like(DvCheckMaintenRecord::getOrderCode, record.getOrderCode());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(record.getMachineryCode())) {
|
||||
queryWrapper.like(DvCheckMaintenRecord::getMachineryCode, record.getMachineryCode());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(record.getMachineryName())) {
|
||||
queryWrapper.like(DvCheckMaintenRecord::getMachineryName, record.getMachineryName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(record.getPlanType())) {
|
||||
queryWrapper.eq(DvCheckMaintenRecord::getPlanType, record.getPlanType());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(record.getStatus())) {
|
||||
queryWrapper.eq(DvCheckMaintenRecord::getStatus, record.getStatus());
|
||||
}
|
||||
queryWrapper.orderByDesc(DvCheckMaintenRecord::getCreateTime);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DvCheckMaintenRecord getInfo(Long recordId) {
|
||||
DvCheckMaintenRecord record = this.getById(recordId);
|
||||
if (record == null) {
|
||||
throw new ServiceException("记录不存在");
|
||||
}
|
||||
LambdaQueryWrapper<DvCheckMaintenRecordLine> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DvCheckMaintenRecordLine::getRecordId, recordId);
|
||||
List<DvCheckMaintenRecordLine> lines = dvCheckMaintenRecordLineMapper.selectList(queryWrapper);
|
||||
record.setLines(lines);
|
||||
return record;
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.ktg.mes.dv.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.exception.BussinessException;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.dv.domain.DvCheckMaintenRecord;
|
||||
import com.ktg.mes.dv.domain.DvCheckPlan;
|
||||
import com.ktg.mes.dv.mapper.DvCheckMaintenRecordMapper;
|
||||
import com.ktg.mes.dv.mapper.DvCheckPlanMapper;
|
||||
import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
||||
import com.ktg.mes.dv.service.IDvCheckMaintenRecordService;
|
||||
import com.ktg.mes.dv.service.IDvCheckPlanService;
|
||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckPlanServiceImpl extends ServiceImpl<DvCheckPlanMapper, DvCheckPlan> implements IDvCheckPlanService {
|
||||
@Autowired
|
||||
private DvCheckPlanMapper dvCheckPlanMapper;
|
||||
@Autowired
|
||||
IDvCheckMachineryService dvCheckMachineryService;
|
||||
@Autowired
|
||||
IDvCheckSubjectService dvCheckSubjectService;
|
||||
@Autowired
|
||||
private DvCheckMaintenRecordMapper dvCheckMaintenRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
@Override
|
||||
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId) {
|
||||
return dvCheckPlanMapper.selectDvCheckPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan) {
|
||||
return dvCheckPlanMapper.selectDvCheckPlanList(dvCheckPlan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkPlanCodeUnique(DvCheckPlan dvCheckPlan) {
|
||||
DvCheckPlan plan = dvCheckPlanMapper.checkPlanCodeUnique(dvCheckPlan);
|
||||
Long planId = dvCheckPlan.getPlanId() == null ? -1L : dvCheckPlan.getPlanId();
|
||||
if (StringUtils.isNotNull(plan) && plan.getPlanId().longValue() == planId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan) {
|
||||
dvCheckPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckPlanMapper.insertDvCheckPlan(dvCheckPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan) {
|
||||
dvCheckPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
// todo 生成点检保养记录
|
||||
if (UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckPlan.getStatus())) {
|
||||
}
|
||||
return dvCheckPlanMapper.updateDvCheckPlan(dvCheckPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备点检计划头
|
||||
*
|
||||
* @param planIds 需要删除的设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDvCheckPlanByPlanIds(Long[] planIds) {
|
||||
for (Long planId : planIds) {
|
||||
DvCheckPlan plan = this.selectDvCheckPlanByPlanId(planId);
|
||||
if (!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())) {
|
||||
throw new BussinessException("只能删除草稿状态单据!");
|
||||
}
|
||||
dvCheckMachineryService.deleteByPlanId(planId);
|
||||
dvCheckSubjectService.deleteByPlanId(planId);
|
||||
// 将该计划生成的未处理的任务删除
|
||||
LambdaQueryWrapper<DvCheckMaintenRecord> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(DvCheckMaintenRecord::getPlanId, planId);
|
||||
lqw.eq(DvCheckMaintenRecord::getStatus, "1");
|
||||
dvCheckMaintenRecordMapper.delete(lqw);
|
||||
}
|
||||
dvCheckPlanMapper.deleteDvCheckPlanByPlanIds(planIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头信息
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckPlanByPlanId(Long planId) {
|
||||
return dvCheckPlanMapper.deleteDvCheckPlanByPlanId(planId);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user