feat(production): 新增安灯模块

- 新增安灯看板配置实体类、控制器、服务层和数据访问层
- 新增安灯事件实体类,支持多种事件状态与处理流程
- 新增安灯派工记录实体类及相关接口实现
- 实现基础的增删改查、导出Excel等功能
- 配置MyBatis映射文件支持数据库操作
- 提供RESTful API用于前后端交互
master
zangch@mesnac.com 3 months ago
parent a7cfea450a
commit 2584433878

@ -0,0 +1,108 @@
package com.aucma.production.controller;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.production.domain.AndonBoardConfig;
import com.aucma.production.service.IAndonBoardConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-10-28
*/
@RestController
@RequestMapping("/production/andonBoardConfig" )
public class AndonBoardConfigController extends BaseController {
@Autowired
private IAndonBoardConfigService andonBoardConfigService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:list')" )
@GetMapping("/list" )
public TableDataInfo list(AndonBoardConfig andonBoardConfig) {
startPage();
List<AndonBoardConfig> list = andonBoardConfigService.selectAndonBoardConfigList(andonBoardConfig);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:export')" )
@Log(title = "安灯看板配置" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, AndonBoardConfig andonBoardConfig) {
List<AndonBoardConfig> list = andonBoardConfigService.selectAndonBoardConfigList(andonBoardConfig);
ExcelUtil<AndonBoardConfig> util = new ExcelUtil<AndonBoardConfig>(AndonBoardConfig. class);
util.exportExcel(response, list, "安灯看板配置数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:query')" )
@GetMapping(value = "/{boardId}" )
public AjaxResult getInfo(@PathVariable("boardId" ) Long boardId) {
return success(andonBoardConfigService.selectAndonBoardConfigByBoardId(boardId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:add')" )
@Log(title = "安灯看板配置" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AndonBoardConfig andonBoardConfig) {
andonBoardConfig.setCreateBy(getUsername());
andonBoardConfig.setCreateTime(DateUtils.getNowDate());
return toAjax(andonBoardConfigService.insertAndonBoardConfig(andonBoardConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:edit')" )
@Log(title = "安灯看板配置" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AndonBoardConfig andonBoardConfig) {
andonBoardConfig.setUpdateBy(getUsername());
andonBoardConfig.setUpdateTime(DateUtils.getNowDate());
return toAjax(andonBoardConfigService.updateAndonBoardConfig(andonBoardConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:remove')" )
@Log(title = "安灯看板配置" , businessType = BusinessType.DELETE)
@DeleteMapping("/{boardIds}" )
public AjaxResult remove(@PathVariable Long[] boardIds) {
return toAjax(andonBoardConfigService.deleteAndonBoardConfigByBoardIds(boardIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonBoardConfig:list')" )
@GetMapping("/getAndonBoardConfigList" )
public AjaxResult getAndonBoardConfigList(AndonBoardConfig andonBoardConfig) {
List<AndonBoardConfig> list = andonBoardConfigService.selectAndonBoardConfigList(andonBoardConfig);
return success(list);
}
}

@ -0,0 +1,108 @@
package com.aucma.production.controller;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.production.domain.AndonEventAssignment;
import com.aucma.production.service.IAndonEventAssignmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* /Controller
*
* @author Yinq
* @date 2025-10-28
*/
@RestController
@RequestMapping("/production/andonEventAssignment" )
public class AndonEventAssignmentController extends BaseController {
@Autowired
private IAndonEventAssignmentService andonEventAssignmentService;
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:list')" )
@GetMapping("/list" )
public TableDataInfo list(AndonEventAssignment andonEventAssignment) {
startPage();
List<AndonEventAssignment> list = andonEventAssignmentService.selectAndonEventAssignmentList(andonEventAssignment);
return getDataTable(list);
}
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:export')" )
@Log(title = "安灯派工记录(派工即通知/待办)" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, AndonEventAssignment andonEventAssignment) {
List<AndonEventAssignment> list = andonEventAssignmentService.selectAndonEventAssignmentList(andonEventAssignment);
ExcelUtil<AndonEventAssignment> util = new ExcelUtil<AndonEventAssignment>(AndonEventAssignment. class);
util.exportExcel(response, list, "安灯派工记录(派工即通知/待办)数据" );
}
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:query')" )
@GetMapping(value = "/{assignmentId}" )
public AjaxResult getInfo(@PathVariable("assignmentId" ) Long assignmentId) {
return success(andonEventAssignmentService.selectAndonEventAssignmentByAssignmentId(assignmentId));
}
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:add')" )
@Log(title = "安灯派工记录(派工即通知/待办)" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AndonEventAssignment andonEventAssignment) {
andonEventAssignment.setCreateBy(getUsername());
andonEventAssignment.setCreateTime(DateUtils.getNowDate());
return toAjax(andonEventAssignmentService.insertAndonEventAssignment(andonEventAssignment));
}
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:edit')" )
@Log(title = "安灯派工记录(派工即通知/待办)" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AndonEventAssignment andonEventAssignment) {
andonEventAssignment.setUpdateBy(getUsername());
andonEventAssignment.setUpdateTime(DateUtils.getNowDate());
return toAjax(andonEventAssignmentService.updateAndonEventAssignment(andonEventAssignment));
}
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:remove')" )
@Log(title = "安灯派工记录(派工即通知/待办)" , businessType = BusinessType.DELETE)
@DeleteMapping("/{assignmentIds}" )
public AjaxResult remove(@PathVariable Long[] assignmentIds) {
return toAjax(andonEventAssignmentService.deleteAndonEventAssignmentByAssignmentIds(assignmentIds));
}
/**
* /
*/
@PreAuthorize("@ss.hasPermi('production:andonEventAssignment:list')" )
@GetMapping("/getAndonEventAssignmentList" )
public AjaxResult getAndonEventAssignmentList(AndonEventAssignment andonEventAssignment) {
List<AndonEventAssignment> list = andonEventAssignmentService.selectAndonEventAssignmentList(andonEventAssignment);
return success(list);
}
}

@ -0,0 +1,148 @@
package com.aucma.production.controller;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.production.domain.AndonEvent;
import com.aucma.production.service.IAndonEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-10-28
*/
@RestController
@RequestMapping("/production/andonEvent" )
public class AndonEventController extends BaseController {
@Autowired
private IAndonEventService andonEventService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:list')" )
@GetMapping("/list" )
public TableDataInfo list(AndonEvent andonEvent) {
startPage();
List<AndonEvent> list = andonEventService.selectAndonEventList(andonEvent);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:export')" )
@Log(title = "安灯事件" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, AndonEvent andonEvent) {
List<AndonEvent> list = andonEventService.selectAndonEventList(andonEvent);
ExcelUtil<AndonEvent> util = new ExcelUtil<AndonEvent>(AndonEvent. class);
util.exportExcel(response, list, "安灯事件数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:query')" )
@GetMapping(value = "/{eventId}" )
public AjaxResult getInfo(@PathVariable("eventId" ) Long eventId) {
return success(andonEventService.selectAndonEventByEventId(eventId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:add')" )
@Log(title = "安灯事件" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AndonEvent andonEvent) {
andonEvent.setCreateBy(getUsername());
andonEvent.setCreateTime(DateUtils.getNowDate());
return toAjax(andonEventService.insertAndonEvent(andonEvent));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:edit')" )
@Log(title = "安灯事件" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AndonEvent andonEvent) {
andonEvent.setUpdateBy(getUsername());
andonEvent.setUpdateTime(DateUtils.getNowDate());
return toAjax(andonEventService.updateAndonEvent(andonEvent));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:remove')" )
@Log(title = "安灯事件" , businessType = BusinessType.DELETE)
@DeleteMapping("/{eventIds}" )
public AjaxResult remove(@PathVariable Long[] eventIds) {
return toAjax(andonEventService.deleteAndonEventByEventIds(eventIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:list')" )
@GetMapping("/getAndonEventList" )
public AjaxResult getAndonEventList(AndonEvent andonEvent) {
List<AndonEvent> list = andonEventService.selectAndonEventList(andonEvent);
return success(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:edit')" )
@Log(title = "安灯事件确认" , businessType = BusinessType.UPDATE)
@PostMapping("/acknowledge/{eventId}" )
public AjaxResult acknowledge(@PathVariable Long eventId) {
return toAjax(andonEventService.acknowledgeEvent(eventId, getUsername()));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:edit')" )
@Log(title = "安灯事件开始处理" , businessType = BusinessType.UPDATE)
@PostMapping("/startProcess/{eventId}" )
public AjaxResult startProcess(@PathVariable Long eventId) {
return toAjax(andonEventService.startProcessEvent(eventId, getUsername()));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:edit')" )
@Log(title = "安灯事件完成" , businessType = BusinessType.UPDATE)
@PostMapping("/complete/{eventId}" )
public AjaxResult complete(@PathVariable Long eventId, @RequestParam(required = false) String resolution) {
return toAjax(andonEventService.completeEvent(eventId, resolution, getUsername()));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEvent:edit')" )
@Log(title = "安灯事件取消" , businessType = BusinessType.UPDATE)
@PostMapping("/cancel/{eventId}" )
public AjaxResult cancel(@PathVariable Long eventId, @RequestParam(required = false) String cancelReason) {
return toAjax(andonEventService.cancelEvent(eventId, cancelReason, getUsername()));
}
}

@ -0,0 +1,108 @@
package com.aucma.production.controller;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.production.domain.AndonEventLog;
import com.aucma.production.service.IAndonEventLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-10-28
*/
@RestController
@RequestMapping("/production/andonEventLog" )
public class AndonEventLogController extends BaseController {
@Autowired
private IAndonEventLogService andonEventLogService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:list')" )
@GetMapping("/list" )
public TableDataInfo list(AndonEventLog andonEventLog) {
startPage();
List<AndonEventLog> list = andonEventLogService.selectAndonEventLogList(andonEventLog);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:export')" )
@Log(title = "安灯事件操作日志(审计与追踪)" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, AndonEventLog andonEventLog) {
List<AndonEventLog> list = andonEventLogService.selectAndonEventLogList(andonEventLog);
ExcelUtil<AndonEventLog> util = new ExcelUtil<AndonEventLog>(AndonEventLog. class);
util.exportExcel(response, list, "安灯事件操作日志(审计与追踪)数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:query')" )
@GetMapping(value = "/{logId}" )
public AjaxResult getInfo(@PathVariable("logId" ) Long logId) {
return success(andonEventLogService.selectAndonEventLogByLogId(logId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:add')" )
@Log(title = "安灯事件操作日志(审计与追踪)" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AndonEventLog andonEventLog) {
andonEventLog.setCreateBy(getUsername());
andonEventLog.setCreateTime(DateUtils.getNowDate());
return toAjax(andonEventLogService.insertAndonEventLog(andonEventLog));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:edit')" )
@Log(title = "安灯事件操作日志(审计与追踪)" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AndonEventLog andonEventLog) {
andonEventLog.setUpdateBy(getUsername());
andonEventLog.setUpdateTime(DateUtils.getNowDate());
return toAjax(andonEventLogService.updateAndonEventLog(andonEventLog));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:remove')" )
@Log(title = "安灯事件操作日志(审计与追踪)" , businessType = BusinessType.DELETE)
@DeleteMapping("/{logIds}" )
public AjaxResult remove(@PathVariable Long[] logIds) {
return toAjax(andonEventLogService.deleteAndonEventLogByLogIds(logIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonEventLog:list')" )
@GetMapping("/getAndonEventLogList" )
public AjaxResult getAndonEventLogList(AndonEventLog andonEventLog) {
List<AndonEventLog> list = andonEventLogService.selectAndonEventLogList(andonEventLog);
return success(list);
}
}

@ -0,0 +1,108 @@
package com.aucma.production.controller;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.production.domain.AndonRule;
import com.aucma.production.service.IAndonRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-10-28
*/
@RestController
@RequestMapping("/production/andonRule" )
public class AndonRuleController extends BaseController {
@Autowired
private IAndonRuleService andonRuleService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:list')" )
@GetMapping("/list" )
public TableDataInfo list(AndonRule andonRule) {
startPage();
List<AndonRule> list = andonRuleService.selectAndonRuleList(andonRule);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:export')" )
@Log(title = "安灯规则配置" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, AndonRule andonRule) {
List<AndonRule> list = andonRuleService.selectAndonRuleList(andonRule);
ExcelUtil<AndonRule> util = new ExcelUtil<AndonRule>(AndonRule. class);
util.exportExcel(response, list, "安灯规则配置数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:query')" )
@GetMapping(value = "/{ruleId}" )
public AjaxResult getInfo(@PathVariable("ruleId" ) Long ruleId) {
return success(andonRuleService.selectAndonRuleByRuleId(ruleId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:add')" )
@Log(title = "安灯规则配置" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AndonRule andonRule) {
andonRule.setCreateBy(getUsername());
andonRule.setCreateTime(DateUtils.getNowDate());
return toAjax(andonRuleService.insertAndonRule(andonRule));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:edit')" )
@Log(title = "安灯规则配置" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AndonRule andonRule) {
andonRule.setUpdateBy(getUsername());
andonRule.setUpdateTime(DateUtils.getNowDate());
return toAjax(andonRuleService.updateAndonRule(andonRule));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:remove')" )
@Log(title = "安灯规则配置" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ruleIds}" )
public AjaxResult remove(@PathVariable Long[] ruleIds) {
return toAjax(andonRuleService.deleteAndonRuleByRuleIds(ruleIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('production:andonRule:list')" )
@GetMapping("/getAndonRuleList" )
public AjaxResult getAndonRuleList(AndonRule andonRule) {
List<AndonRule> list = andonRuleService.selectAndonRuleList(andonRule);
return success(list);
}
}

@ -0,0 +1,140 @@
package com.aucma.production.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* andon_board_config
*
* @author Yinq
* @date 2025-10-28
*/
public class AndonBoardConfig extends BaseEntity
{
private static final long serialVersionUID=1L;
/** 主键ID */
private Long boardId;
/** 看板编码 */
@Excel(name = "看板编码")
private String boardCode;
/** 看板名称 */
@Excel(name = "看板名称")
private String boardName;
/** 产品线编码 */
@Excel(name = "产品线编码")
private String productLineCode;
/** 工位/工序编码(作用域) */
@Excel(name = "工位/工序编码", readConverterExp = "作=用域")
private String stationCode;
/** 看板展示字段配置JSON */
@Excel(name = "看板展示字段配置", readConverterExp = "J=SON")
private String displayFields;
/** 刷新间隔(秒) */
@Excel(name = "刷新间隔", readConverterExp = "秒=")
private Long refreshIntervalSec;
/** 是否有效1有效/0无效 */
@Excel(name = "是否有效", readConverterExp = "1=有效/0无效")
private String isFlag;
public void setBoardId(Long boardId)
{
this.boardId = boardId;
}
public Long getBoardId()
{
return boardId;
}
public void setBoardCode(String boardCode)
{
this.boardCode = boardCode;
}
public String getBoardCode()
{
return boardCode;
}
public void setBoardName(String boardName)
{
this.boardName = boardName;
}
public String getBoardName()
{
return boardName;
}
public void setProductLineCode(String productLineCode)
{
this.productLineCode = productLineCode;
}
public String getProductLineCode()
{
return productLineCode;
}
public void setStationCode(String stationCode)
{
this.stationCode = stationCode;
}
public String getStationCode()
{
return stationCode;
}
public void setDisplayFields(String displayFields)
{
this.displayFields = displayFields;
}
public String getDisplayFields()
{
return displayFields;
}
public void setRefreshIntervalSec(Long refreshIntervalSec)
{
this.refreshIntervalSec = refreshIntervalSec;
}
public Long getRefreshIntervalSec()
{
return refreshIntervalSec;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("boardId",getBoardId())
.append("boardCode",getBoardCode())
.append("boardName",getBoardName())
.append("productLineCode",getProductLineCode())
.append("stationCode",getStationCode())
.append("displayFields",getDisplayFields())
.append("refreshIntervalSec",getRefreshIntervalSec())
.append("isFlag",getIsFlag())
.append("remark",getRemark())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.toString();
}
}

@ -0,0 +1,401 @@
package com.aucma.production.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* andon_event
*
* @author Yinq
* @date 2025-10-28
*/
public class AndonEvent extends BaseEntity
{
private static final long serialVersionUID=1L;
/** 主键ID */
private Long eventId;
/** 安灯呼叫单号 */
@Excel(name = "安灯呼叫单号")
private String callCode;
/** 呼叫类型编码(如质量/设备/物料/安全等) */
@Excel(name = "呼叫类型编码", readConverterExp = "如=质量/设备/物料/安全等")
private String callTypeCode;
/** 触发源类型:工位/设备/报警/手动 */
@Excel(name = "触发源类型:工位/设备/报警/手动")
private String sourceType;
/** 触发源引用ID设备/报警/其他) */
@Excel(name = "触发源引用ID", readConverterExp = "设=备/报警/其他")
private Long sourceRefId;
/** 产品线编码 */
@Excel(name = "产品线编码")
private String productLineCode;
/** 工位/工序编码 */
@Excel(name = "工位/工序编码")
private String stationCode;
/** 班组编码 */
@Excel(name = "班组编码")
private String teamCode;
/** 工单号 */
@Excel(name = "工单号")
private String orderCode;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 设备ID */
@Excel(name = "设备ID")
private Long deviceId;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 优先级1最高默认3 */
@Excel(name = "优先级", readConverterExp = "1=最高默认3")
private Long priority;
/** 事件状态(待处理/处理中/已解决/已取消) */
@Excel(name = "事件状态", readConverterExp = "待=处理/处理中/已解决/已取消")
private String eventStatus;
/** 呼叫描述 */
@Excel(name = "呼叫描述")
private String description;
/** 确认人 */
@Excel(name = "确认人")
private String ackBy;
/** 确认时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "确认时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date ackTime;
/** 开始处理时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始处理时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date responseStartTime;
/** 处理完成/解决时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "处理完成/解决时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date responseEndTime;
/** 处理/解决措施 */
@Excel(name = "处理/解决措施")
private String resolution;
/** 取消原因 */
@Excel(name = "取消原因")
private String cancelReason;
/** 升级级别 */
@Excel(name = "升级级别")
private Long escalateLevel;
/** 升级时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "升级时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date escalateTime;
/** 确认截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "确认截止时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date ackDeadline;
/** 解决截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "解决截止时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date resolveDeadline;
/** 是否有效1有效/0无效 */
@Excel(name = "是否有效", readConverterExp = "1=有效/0无效")
private String isFlag;
public void setEventId(Long eventId)
{
this.eventId = eventId;
}
public Long getEventId()
{
return eventId;
}
public void setCallCode(String callCode)
{
this.callCode = callCode;
}
public String getCallCode()
{
return callCode;
}
public void setCallTypeCode(String callTypeCode)
{
this.callTypeCode = callTypeCode;
}
public String getCallTypeCode()
{
return callTypeCode;
}
public void setSourceType(String sourceType)
{
this.sourceType = sourceType;
}
public String getSourceType()
{
return sourceType;
}
public void setSourceRefId(Long sourceRefId)
{
this.sourceRefId = sourceRefId;
}
public Long getSourceRefId()
{
return sourceRefId;
}
public void setProductLineCode(String productLineCode)
{
this.productLineCode = productLineCode;
}
public String getProductLineCode()
{
return productLineCode;
}
public void setStationCode(String stationCode)
{
this.stationCode = stationCode;
}
public String getStationCode()
{
return stationCode;
}
public void setTeamCode(String teamCode)
{
this.teamCode = teamCode;
}
public String getTeamCode()
{
return teamCode;
}
public void setOrderCode(String orderCode)
{
this.orderCode = orderCode;
}
public String getOrderCode()
{
return orderCode;
}
public void setMaterialCode(String materialCode)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setDeviceCode(String deviceCode)
{
this.deviceCode = deviceCode;
}
public String getDeviceCode()
{
return deviceCode;
}
public void setPriority(Long priority)
{
this.priority = priority;
}
public Long getPriority()
{
return priority;
}
public void setEventStatus(String eventStatus)
{
this.eventStatus = eventStatus;
}
public String getEventStatus()
{
return eventStatus;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setAckBy(String ackBy)
{
this.ackBy = ackBy;
}
public String getAckBy()
{
return ackBy;
}
public void setAckTime(Date ackTime)
{
this.ackTime = ackTime;
}
public Date getAckTime()
{
return ackTime;
}
public void setResponseStartTime(Date responseStartTime)
{
this.responseStartTime = responseStartTime;
}
public Date getResponseStartTime()
{
return responseStartTime;
}
public void setResponseEndTime(Date responseEndTime)
{
this.responseEndTime = responseEndTime;
}
public Date getResponseEndTime()
{
return responseEndTime;
}
public void setResolution(String resolution)
{
this.resolution = resolution;
}
public String getResolution()
{
return resolution;
}
public void setCancelReason(String cancelReason)
{
this.cancelReason = cancelReason;
}
public String getCancelReason()
{
return cancelReason;
}
public void setEscalateLevel(Long escalateLevel)
{
this.escalateLevel = escalateLevel;
}
public Long getEscalateLevel()
{
return escalateLevel;
}
public void setEscalateTime(Date escalateTime)
{
this.escalateTime = escalateTime;
}
public Date getEscalateTime()
{
return escalateTime;
}
public void setAckDeadline(Date ackDeadline)
{
this.ackDeadline = ackDeadline;
}
public Date getAckDeadline()
{
return ackDeadline;
}
public void setResolveDeadline(Date resolveDeadline)
{
this.resolveDeadline = resolveDeadline;
}
public Date getResolveDeadline()
{
return resolveDeadline;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("eventId",getEventId())
.append("callCode",getCallCode())
.append("callTypeCode",getCallTypeCode())
.append("sourceType",getSourceType())
.append("sourceRefId",getSourceRefId())
.append("productLineCode",getProductLineCode())
.append("stationCode",getStationCode())
.append("teamCode",getTeamCode())
.append("orderCode",getOrderCode())
.append("materialCode",getMaterialCode())
.append("deviceId",getDeviceId())
.append("deviceCode",getDeviceCode())
.append("priority",getPriority())
.append("eventStatus",getEventStatus())
.append("description",getDescription())
.append("ackBy",getAckBy())
.append("ackTime",getAckTime())
.append("responseStartTime",getResponseStartTime())
.append("responseEndTime",getResponseEndTime())
.append("resolution",getResolution())
.append("cancelReason",getCancelReason())
.append("escalateLevel",getEscalateLevel())
.append("escalateTime",getEscalateTime())
.append("ackDeadline",getAckDeadline())
.append("resolveDeadline",getResolveDeadline())
.append("isFlag",getIsFlag())
.append("remark",getRemark())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.toString();
}
}

@ -0,0 +1,188 @@
package com.aucma.production.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* / andon_event_assignment
*
* @author Yinq
* @date 2025-10-28
*/
public class AndonEventAssignment extends BaseEntity
{
private static final long serialVersionUID=1L;
/** 主键ID */
private Long assignmentId;
/** 事件ID */
@Excel(name = "事件ID")
private Long eventId;
/** 被分配用户ID */
@Excel(name = "被分配用户ID")
private Long assigneeUserId;
/** 被分配用户姓名 */
@Excel(name = "被分配用户姓名")
private String assigneeUserName;
/** 被分配角色编码 */
@Excel(name = "被分配角色编码")
private String assigneeRoleKey;
/** 被分配班组编码 */
@Excel(name = "被分配班组编码")
private String assigneeTeamCode;
/** 分配时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "分配时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date assignedTime;
/** 接单时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "接单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date acceptTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
/** 派工状态(分配/接受/拒绝/完成/已取消) */
@Excel(name = "派工状态", readConverterExp = "分=配/接受/拒绝/完成/已取消")
private String status;
/** 是否有效1有效/0无效 */
@Excel(name = "是否有效", readConverterExp = "1=有效/0无效")
private String isFlag;
public void setAssignmentId(Long assignmentId)
{
this.assignmentId = assignmentId;
}
public Long getAssignmentId()
{
return assignmentId;
}
public void setEventId(Long eventId)
{
this.eventId = eventId;
}
public Long getEventId()
{
return eventId;
}
public void setAssigneeUserId(Long assigneeUserId)
{
this.assigneeUserId = assigneeUserId;
}
public Long getAssigneeUserId()
{
return assigneeUserId;
}
public void setAssigneeUserName(String assigneeUserName)
{
this.assigneeUserName = assigneeUserName;
}
public String getAssigneeUserName()
{
return assigneeUserName;
}
public void setAssigneeRoleKey(String assigneeRoleKey)
{
this.assigneeRoleKey = assigneeRoleKey;
}
public String getAssigneeRoleKey()
{
return assigneeRoleKey;
}
public void setAssigneeTeamCode(String assigneeTeamCode)
{
this.assigneeTeamCode = assigneeTeamCode;
}
public String getAssigneeTeamCode()
{
return assigneeTeamCode;
}
public void setAssignedTime(Date assignedTime)
{
this.assignedTime = assignedTime;
}
public Date getAssignedTime()
{
return assignedTime;
}
public void setAcceptTime(Date acceptTime)
{
this.acceptTime = acceptTime;
}
public Date getAcceptTime()
{
return acceptTime;
}
public void setFinishTime(Date finishTime)
{
this.finishTime = finishTime;
}
public Date getFinishTime()
{
return finishTime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("assignmentId",getAssignmentId())
.append("eventId",getEventId())
.append("assigneeUserId",getAssigneeUserId())
.append("assigneeUserName",getAssigneeUserName())
.append("assigneeRoleKey",getAssigneeRoleKey())
.append("assigneeTeamCode",getAssigneeTeamCode())
.append("assignedTime",getAssignedTime())
.append("acceptTime",getAcceptTime())
.append("finishTime",getFinishTime())
.append("status",getStatus())
.append("isFlag",getIsFlag())
.append("remark",getRemark())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.toString();
}
}

@ -0,0 +1,130 @@
package com.aucma.production.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* andon_event_log
*
* @author Yinq
* @date 2025-10-28
*/
public class AndonEventLog extends BaseEntity
{
private static final long serialVersionUID=1L;
/** 主键ID */
private Long logId;
/** 事件ID */
@Excel(name = "事件ID")
private Long eventId;
/** 操作类型(创建/确认/分配/升级/解决/取消/评论) */
@Excel(name = "操作类型", readConverterExp = "创=建/确认/分配/升级/解决/取消/评论")
private String operation;
/** 操作内容 */
@Excel(name = "操作内容")
private String content;
/** 操作人ID */
@Excel(name = "操作人ID")
private Long operatorUserId;
/** 操作人姓名 */
@Excel(name = "操作人姓名")
private String operatorUserName;
/** 操作时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date operationTime;
public void setLogId(Long logId)
{
this.logId = logId;
}
public Long getLogId()
{
return logId;
}
public void setEventId(Long eventId)
{
this.eventId = eventId;
}
public Long getEventId()
{
return eventId;
}
public void setOperation(String operation)
{
this.operation = operation;
}
public String getOperation()
{
return operation;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setOperatorUserId(Long operatorUserId)
{
this.operatorUserId = operatorUserId;
}
public Long getOperatorUserId()
{
return operatorUserId;
}
public void setOperatorUserName(String operatorUserName)
{
this.operatorUserName = operatorUserName;
}
public String getOperatorUserName()
{
return operatorUserName;
}
public void setOperationTime(Date operationTime)
{
this.operationTime = operationTime;
}
public Date getOperationTime()
{
return operationTime;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("logId",getLogId())
.append("eventId",getEventId())
.append("operation",getOperation())
.append("content",getContent())
.append("operatorUserId",getOperatorUserId())
.append("operatorUserName",getOperatorUserName())
.append("operationTime",getOperationTime())
.append("remark",getRemark())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.toString();
}
}

@ -0,0 +1,62 @@
package com.aucma.production.mapper;
import com.aucma.production.domain.AndonBoardConfig;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-10-28
*/
public interface AndonBoardConfigMapper
{
/**
*
*
* @param boardId
* @return
*/
public AndonBoardConfig selectAndonBoardConfigByBoardId(Long boardId);
/**
*
*
* @param andonBoardConfig
* @return
*/
public List<AndonBoardConfig> selectAndonBoardConfigList(AndonBoardConfig andonBoardConfig);
/**
*
*
* @param andonBoardConfig
* @return
*/
public int insertAndonBoardConfig(AndonBoardConfig andonBoardConfig);
/**
*
*
* @param andonBoardConfig
* @return
*/
public int updateAndonBoardConfig(AndonBoardConfig andonBoardConfig);
/**
*
*
* @param boardId
* @return
*/
public int deleteAndonBoardConfigByBoardId(Long boardId);
/**
*
*
* @param boardIds
* @return
*/
public int deleteAndonBoardConfigByBoardIds(Long[] boardIds);
}

@ -0,0 +1,62 @@
package com.aucma.production.mapper;
import com.aucma.production.domain.AndonEventAssignment;
import java.util.List;
/**
* /Mapper
*
* @author Yinq
* @date 2025-10-28
*/
public interface AndonEventAssignmentMapper
{
/**
* /
*
* @param assignmentId /
* @return /
*/
public AndonEventAssignment selectAndonEventAssignmentByAssignmentId(Long assignmentId);
/**
* /
*
* @param andonEventAssignment /
* @return /
*/
public List<AndonEventAssignment> selectAndonEventAssignmentList(AndonEventAssignment andonEventAssignment);
/**
* /
*
* @param andonEventAssignment /
* @return
*/
public int insertAndonEventAssignment(AndonEventAssignment andonEventAssignment);
/**
* /
*
* @param andonEventAssignment /
* @return
*/
public int updateAndonEventAssignment(AndonEventAssignment andonEventAssignment);
/**
* /
*
* @param assignmentId /
* @return
*/
public int deleteAndonEventAssignmentByAssignmentId(Long assignmentId);
/**
* /
*
* @param assignmentIds
* @return
*/
public int deleteAndonEventAssignmentByAssignmentIds(Long[] assignmentIds);
}

@ -0,0 +1,62 @@
package com.aucma.production.mapper;
import com.aucma.production.domain.AndonEventLog;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-10-28
*/
public interface AndonEventLogMapper
{
/**
*
*
* @param logId
* @return
*/
public AndonEventLog selectAndonEventLogByLogId(Long logId);
/**
*
*
* @param andonEventLog
* @return
*/
public List<AndonEventLog> selectAndonEventLogList(AndonEventLog andonEventLog);
/**
*
*
* @param andonEventLog
* @return
*/
public int insertAndonEventLog(AndonEventLog andonEventLog);
/**
*
*
* @param andonEventLog
* @return
*/
public int updateAndonEventLog(AndonEventLog andonEventLog);
/**
*
*
* @param logId
* @return
*/
public int deleteAndonEventLogByLogId(Long logId);
/**
*
*
* @param logIds
* @return
*/
public int deleteAndonEventLogByLogIds(Long[] logIds);
}

@ -0,0 +1,62 @@
package com.aucma.production.mapper;
import com.aucma.production.domain.AndonEvent;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-10-28
*/
public interface AndonEventMapper
{
/**
*
*
* @param eventId
* @return
*/
public AndonEvent selectAndonEventByEventId(Long eventId);
/**
*
*
* @param andonEvent
* @return
*/
public List<AndonEvent> selectAndonEventList(AndonEvent andonEvent);
/**
*
*
* @param andonEvent
* @return
*/
public int insertAndonEvent(AndonEvent andonEvent);
/**
*
*
* @param andonEvent
* @return
*/
public int updateAndonEvent(AndonEvent andonEvent);
/**
*
*
* @param eventId
* @return
*/
public int deleteAndonEventByEventId(Long eventId);
/**
*
*
* @param eventIds
* @return
*/
public int deleteAndonEventByEventIds(Long[] eventIds);
}

@ -0,0 +1,62 @@
package com.aucma.production.mapper;
import com.aucma.production.domain.AndonRule;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-10-28
*/
public interface AndonRuleMapper
{
/**
*
*
* @param ruleId
* @return
*/
public AndonRule selectAndonRuleByRuleId(Long ruleId);
/**
*
*
* @param andonRule
* @return
*/
public List<AndonRule> selectAndonRuleList(AndonRule andonRule);
/**
*
*
* @param andonRule
* @return
*/
public int insertAndonRule(AndonRule andonRule);
/**
*
*
* @param andonRule
* @return
*/
public int updateAndonRule(AndonRule andonRule);
/**
*
*
* @param ruleId
* @return
*/
public int deleteAndonRuleByRuleId(Long ruleId);
/**
*
*
* @param ruleIds
* @return
*/
public int deleteAndonRuleByRuleIds(Long[] ruleIds);
}

@ -0,0 +1,62 @@
package com.aucma.production.service;
import com.aucma.production.domain.AndonBoardConfig;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
public interface IAndonBoardConfigService
{
/**
*
*
* @param boardId
* @return
*/
public AndonBoardConfig selectAndonBoardConfigByBoardId(Long boardId);
/**
*
*
* @param andonBoardConfig
* @return
*/
public List<AndonBoardConfig> selectAndonBoardConfigList(AndonBoardConfig andonBoardConfig);
/**
*
*
* @param andonBoardConfig
* @return
*/
public int insertAndonBoardConfig(AndonBoardConfig andonBoardConfig);
/**
*
*
* @param andonBoardConfig
* @return
*/
public int updateAndonBoardConfig(AndonBoardConfig andonBoardConfig);
/**
*
*
* @param boardIds
* @return
*/
public int deleteAndonBoardConfigByBoardIds(Long[] boardIds);
/**
*
*
* @param boardId
* @return
*/
public int deleteAndonBoardConfigByBoardId(Long boardId);
}

@ -0,0 +1,62 @@
package com.aucma.production.service;
import com.aucma.production.domain.AndonEventAssignment;
import java.util.List;
/**
* /Service
*
* @author Yinq
* @date 2025-10-28
*/
public interface IAndonEventAssignmentService
{
/**
* /
*
* @param assignmentId /
* @return /
*/
public AndonEventAssignment selectAndonEventAssignmentByAssignmentId(Long assignmentId);
/**
* /
*
* @param andonEventAssignment /
* @return /
*/
public List<AndonEventAssignment> selectAndonEventAssignmentList(AndonEventAssignment andonEventAssignment);
/**
* /
*
* @param andonEventAssignment /
* @return
*/
public int insertAndonEventAssignment(AndonEventAssignment andonEventAssignment);
/**
* /
*
* @param andonEventAssignment /
* @return
*/
public int updateAndonEventAssignment(AndonEventAssignment andonEventAssignment);
/**
* /
*
* @param assignmentIds /
* @return
*/
public int deleteAndonEventAssignmentByAssignmentIds(Long[] assignmentIds);
/**
* /
*
* @param assignmentId /
* @return
*/
public int deleteAndonEventAssignmentByAssignmentId(Long assignmentId);
}

@ -0,0 +1,62 @@
package com.aucma.production.service;
import com.aucma.production.domain.AndonEventLog;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
public interface IAndonEventLogService
{
/**
*
*
* @param logId
* @return
*/
public AndonEventLog selectAndonEventLogByLogId(Long logId);
/**
*
*
* @param andonEventLog
* @return
*/
public List<AndonEventLog> selectAndonEventLogList(AndonEventLog andonEventLog);
/**
*
*
* @param andonEventLog
* @return
*/
public int insertAndonEventLog(AndonEventLog andonEventLog);
/**
*
*
* @param andonEventLog
* @return
*/
public int updateAndonEventLog(AndonEventLog andonEventLog);
/**
*
*
* @param logIds
* @return
*/
public int deleteAndonEventLogByLogIds(Long[] logIds);
/**
*
*
* @param logId
* @return
*/
public int deleteAndonEventLogByLogId(Long logId);
}

@ -0,0 +1,100 @@
package com.aucma.production.service;
import com.aucma.production.domain.AndonEvent;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
public interface IAndonEventService
{
/**
*
*
* @param eventId
* @return
*/
public AndonEvent selectAndonEventByEventId(Long eventId);
/**
*
*
* @param andonEvent
* @return
*/
public List<AndonEvent> selectAndonEventList(AndonEvent andonEvent);
/**
*
*
* @param andonEvent
* @return
*/
public int insertAndonEvent(AndonEvent andonEvent);
/**
*
*
* @param andonEvent
* @return
*/
public int updateAndonEvent(AndonEvent andonEvent);
/**
*
*
* @param eventIds
* @return
*/
public int deleteAndonEventByEventIds(Long[] eventIds);
/**
*
*
* @param eventId
* @return
*/
public int deleteAndonEventByEventId(Long eventId);
/**
*
*
* @param eventId ID
* @param ackBy
* @return
*/
public int acknowledgeEvent(Long eventId, String ackBy);
/**
*
*
* @param eventId ID
* @param operator
* @return
*/
public int startProcessEvent(Long eventId, String operator);
/**
*
*
* @param eventId ID
* @param resolution
* @param operator
* @return
*/
public int completeEvent(Long eventId, String resolution, String operator);
/**
*
*
* @param eventId ID
* @param cancelReason
* @param operator
* @return
*/
public int cancelEvent(Long eventId, String cancelReason, String operator);
}

@ -0,0 +1,62 @@
package com.aucma.production.service;
import com.aucma.production.domain.AndonRule;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
public interface IAndonRuleService
{
/**
*
*
* @param ruleId
* @return
*/
public AndonRule selectAndonRuleByRuleId(Long ruleId);
/**
*
*
* @param andonRule
* @return
*/
public List<AndonRule> selectAndonRuleList(AndonRule andonRule);
/**
*
*
* @param andonRule
* @return
*/
public int insertAndonRule(AndonRule andonRule);
/**
*
*
* @param andonRule
* @return
*/
public int updateAndonRule(AndonRule andonRule);
/**
*
*
* @param ruleIds
* @return
*/
public int deleteAndonRuleByRuleIds(Long[] ruleIds);
/**
*
*
* @param ruleId
* @return
*/
public int deleteAndonRuleByRuleId(Long ruleId);
}

@ -0,0 +1,97 @@
package com.aucma.production.service.impl;
import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.AndonBoardConfig;
import com.aucma.production.mapper.AndonBoardConfigMapper;
import com.aucma.production.service.IAndonBoardConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
@Service
public class AndonBoardConfigServiceImpl implements IAndonBoardConfigService
{
@Autowired
private AndonBoardConfigMapper andonBoardConfigMapper;
/**
*
*
* @param boardId
* @return
*/
@Override
public AndonBoardConfig selectAndonBoardConfigByBoardId(Long boardId)
{
return andonBoardConfigMapper.selectAndonBoardConfigByBoardId(boardId);
}
/**
*
*
* @param andonBoardConfig
* @return
*/
@Override
public List<AndonBoardConfig> selectAndonBoardConfigList(AndonBoardConfig andonBoardConfig)
{
return andonBoardConfigMapper.selectAndonBoardConfigList(andonBoardConfig);
}
/**
*
*
* @param andonBoardConfig
* @return
*/
@Override
public int insertAndonBoardConfig(AndonBoardConfig andonBoardConfig)
{
andonBoardConfig.setCreateTime(DateUtils.getNowDate());
return andonBoardConfigMapper.insertAndonBoardConfig(andonBoardConfig);
}
/**
*
*
* @param andonBoardConfig
* @return
*/
@Override
public int updateAndonBoardConfig(AndonBoardConfig andonBoardConfig)
{
andonBoardConfig.setUpdateTime(DateUtils.getNowDate());
return andonBoardConfigMapper.updateAndonBoardConfig(andonBoardConfig);
}
/**
*
*
* @param boardIds
* @return
*/
@Override
public int deleteAndonBoardConfigByBoardIds(Long[] boardIds)
{
return andonBoardConfigMapper.deleteAndonBoardConfigByBoardIds(boardIds);
}
/**
*
*
* @param boardId
* @return
*/
@Override
public int deleteAndonBoardConfigByBoardId(Long boardId)
{
return andonBoardConfigMapper.deleteAndonBoardConfigByBoardId(boardId);
}
}

@ -0,0 +1,209 @@
package com.aucma.production.service.impl;
import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.AndonEvent;
import com.aucma.production.domain.AndonEventAssignment;
import com.aucma.production.domain.AndonEventLog;
import com.aucma.production.domain.AndonRule;
import com.aucma.production.mapper.AndonEventAssignmentMapper;
import com.aucma.production.mapper.AndonEventLogMapper;
import com.aucma.production.mapper.AndonEventMapper;
import com.aucma.production.mapper.AndonRuleMapper;
import com.aucma.production.service.IAndonEventAssignmentService;
import com.aucma.common.constant.AnDonConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* /Service
*
* @author Yinq
* @date 2025-10-28
*/
@Service
public class AndonEventAssignmentServiceImpl implements IAndonEventAssignmentService
{
@Autowired
private AndonEventAssignmentMapper andonEventAssignmentMapper;
@Autowired
private AndonEventMapper andonEventMapper;
@Autowired
private AndonEventLogMapper andonEventLogMapper;
@Autowired
private AndonRuleMapper andonRuleMapper;
/**
* /
*
* @param assignmentId /
* @return /
*/
@Override
public AndonEventAssignment selectAndonEventAssignmentByAssignmentId(Long assignmentId)
{
return andonEventAssignmentMapper.selectAndonEventAssignmentByAssignmentId(assignmentId);
}
/**
* /
*
* @param andonEventAssignment /
* @return /
*/
@Override
public List<AndonEventAssignment> selectAndonEventAssignmentList(AndonEventAssignment andonEventAssignment)
{
return andonEventAssignmentMapper.selectAndonEventAssignmentList(andonEventAssignment);
}
/**
* /
*
* @param andonEventAssignment /
* @return
*/
@Override
public int insertAndonEventAssignment(AndonEventAssignment andonEventAssignment)
{
andonEventAssignment.setCreateTime(DateUtils.getNowDate());
return andonEventAssignmentMapper.insertAndonEventAssignment(andonEventAssignment);
}
/**
* /
*
* @param andonEventAssignment /
* @return
*/
@Override
public int updateAndonEventAssignment(AndonEventAssignment andonEventAssignment)
{
andonEventAssignment.setUpdateTime(DateUtils.getNowDate());
// 根据状态补充派工自身的里程碑时间
if (andonEventAssignment.getStatus() != null) {
String status = andonEventAssignment.getStatus();
if (AnDonConstants.AssignmentStatus.ACCEPTED.equals(status) && andonEventAssignment.getAcceptTime() == null) {
andonEventAssignment.setAcceptTime(DateUtils.getNowDate());
} else if (AnDonConstants.AssignmentStatus.DONE.equals(status) && andonEventAssignment.getFinishTime() == null) {
andonEventAssignment.setFinishTime(DateUtils.getNowDate());
}
}
int ret = andonEventAssignmentMapper.updateAndonEventAssignment(andonEventAssignment);
// 派工状态联动事件状态与里程碑,并记录日志
try {
if (andonEventAssignment.getEventId() != null && andonEventAssignment.getStatus() != null) {
String status = andonEventAssignment.getStatus();
AndonEvent e = andonEventMapper.selectAndonEventByEventId(andonEventAssignment.getEventId());
if (e != null) {
if (AnDonConstants.AssignmentStatus.ACCEPTED.equals(status)) {
if (e.getResponseStartTime() == null) {
e.setResponseStartTime(DateUtils.getNowDate());
}
e.setEventStatus(AnDonConstants.EventStatus.PROCESSING);
andonEventMapper.updateAndonEvent(e);
logEvent(e.getEventId(), AnDonConstants.Operation.ACCEPT, "派工已接受,事件进入处理中");
} else if (AnDonConstants.AssignmentStatus.DONE.equals(status)) {
if (e.getResponseEndTime() == null) {
e.setResponseEndTime(DateUtils.getNowDate());
}
e.setEventStatus(AnDonConstants.EventStatus.RESOLVED);
andonEventMapper.updateAndonEvent(e);
logEvent(e.getEventId(), AnDonConstants.Operation.RESOLVE, "派工已完成,事件标记已解决");
// 完成时根据策略可取消其他派工
if (shouldCancelOthers(e)) {
cancelOtherAssignments(e.getEventId(), andonEventAssignment.getAssignmentId());
}
} else if (AnDonConstants.AssignmentStatus.CANCELLED.equals(status)) {
logEvent(e.getEventId(), AnDonConstants.Operation.CANCEL_ASSIGNMENT, "派工已取消");
} else if (AnDonConstants.AssignmentStatus.REJECTED.equals(status)) {
logEvent(e.getEventId(), AnDonConstants.Operation.REJECT, "派工被拒绝");
}
}
}
} catch (Exception ignore) { }
return ret;
}
/**
* /
*
* @param assignmentIds /
* @return
*/
@Override
public int deleteAndonEventAssignmentByAssignmentIds(Long[] assignmentIds)
{
return andonEventAssignmentMapper.deleteAndonEventAssignmentByAssignmentIds(assignmentIds);
}
/**
* /
*
* @param assignmentId /
* @return
*/
@Override
public int deleteAndonEventAssignmentByAssignmentId(Long assignmentId)
{
return andonEventAssignmentMapper.deleteAndonEventAssignmentByAssignmentId(assignmentId);
}
private void logEvent(Long eventId, String operation, String content) {
if (eventId == null || operation == null || operation.trim().isEmpty()) return;
AndonEventLog log = new AndonEventLog();
log.setEventId(eventId);
log.setOperation(operation);
log.setContent(content);
log.setOperationTime(DateUtils.getNowDate());
andonEventLogMapper.insertAndonEventLog(log);
}
/** 是否应取消其他派工:从规则 remark 读取 cancelOthers默认 true。 */
private boolean shouldCancelOthers(AndonEvent e) {
if (e == null) return false;
AndonRule q = new AndonRule();
q.setCallTypeCode(e.getCallTypeCode());
q.setIsFlag(AnDonConstants.FLAG_VALID);
List<AndonRule> rules = andonRuleMapper.selectAndonRuleList(q);
if (rules == null || rules.isEmpty()) return false;
String remark = rules.get(0).getRemark();
if (remark == null || remark.trim().isEmpty()) return true;
try {
com.fasterxml.jackson.databind.ObjectMapper mapper = new com.fasterxml.jackson.databind.ObjectMapper();
com.fasterxml.jackson.databind.JsonNode node = mapper.readTree(remark);
com.fasterxml.jackson.databind.JsonNode co = node.get("cancelOthers");
if (co == null) return true;
return co.asBoolean(true);
} catch (Exception ex) {
return true;
}
}
/** 取消同一事件下除当前派工外的其他派工。 */
private void cancelOtherAssignments(Long eventId, Long currentAssignmentId) {
if (eventId == null) return;
AndonEventAssignment filter = new AndonEventAssignment();
filter.setEventId(eventId);
List<AndonEventAssignment> list = andonEventAssignmentMapper.selectAndonEventAssignmentList(filter);
if (list == null) return;
Date now = DateUtils.getNowDate();
for (AndonEventAssignment a : list) {
if (a == null) continue;
if (currentAssignmentId != null && currentAssignmentId.equals(a.getAssignmentId())) continue;
// 仅取消未完成/未取消的派工
String st = a.getStatus();
if (st == null || AnDonConstants.AssignmentStatus.ASSIGNED.equals(st) || AnDonConstants.AssignmentStatus.ACCEPTED.equals(st)) {
a.setStatus(AnDonConstants.AssignmentStatus.CANCELLED);
a.setUpdateTime(now);
andonEventAssignmentMapper.updateAndonEventAssignment(a);
}
}
logEvent(eventId, AnDonConstants.Operation.CANCEL_OTHERS, "策略要求取消该事件的其他并行派工");
}
}

@ -0,0 +1,97 @@
package com.aucma.production.service.impl;
import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.AndonEventLog;
import com.aucma.production.mapper.AndonEventLogMapper;
import com.aucma.production.service.IAndonEventLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
@Service
public class AndonEventLogServiceImpl implements IAndonEventLogService
{
@Autowired
private AndonEventLogMapper andonEventLogMapper;
/**
*
*
* @param logId
* @return
*/
@Override
public AndonEventLog selectAndonEventLogByLogId(Long logId)
{
return andonEventLogMapper.selectAndonEventLogByLogId(logId);
}
/**
*
*
* @param andonEventLog
* @return
*/
@Override
public List<AndonEventLog> selectAndonEventLogList(AndonEventLog andonEventLog)
{
return andonEventLogMapper.selectAndonEventLogList(andonEventLog);
}
/**
*
*
* @param andonEventLog
* @return
*/
@Override
public int insertAndonEventLog(AndonEventLog andonEventLog)
{
andonEventLog.setCreateTime(DateUtils.getNowDate());
return andonEventLogMapper.insertAndonEventLog(andonEventLog);
}
/**
*
*
* @param andonEventLog
* @return
*/
@Override
public int updateAndonEventLog(AndonEventLog andonEventLog)
{
andonEventLog.setUpdateTime(DateUtils.getNowDate());
return andonEventLogMapper.updateAndonEventLog(andonEventLog);
}
/**
*
*
* @param logIds
* @return
*/
@Override
public int deleteAndonEventLogByLogIds(Long[] logIds)
{
return andonEventLogMapper.deleteAndonEventLogByLogIds(logIds);
}
/**
*
*
* @param logId
* @return
*/
@Override
public int deleteAndonEventLogByLogId(Long logId)
{
return andonEventLogMapper.deleteAndonEventLogByLogId(logId);
}
}

@ -0,0 +1,441 @@
package com.aucma.production.service.impl;
import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.AndonEvent;
import com.aucma.production.domain.AndonEventAssignment;
import com.aucma.production.domain.AndonEventLog;
import com.aucma.production.domain.AndonRule;
import com.aucma.production.mapper.AndonEventAssignmentMapper;
import com.aucma.production.mapper.AndonEventLogMapper;
import com.aucma.production.mapper.AndonEventMapper;
import com.aucma.production.mapper.AndonRuleMapper;
import com.aucma.production.service.IAndonEventService;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.aucma.common.constant.AnDonConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
@Service
public class AndonEventServiceImpl implements IAndonEventService
{
@Autowired
private AndonEventMapper andonEventMapper;
@Autowired
private AndonRuleMapper andonRuleMapper;
@Autowired
private AndonEventAssignmentMapper andonEventAssignmentMapper;
@Autowired
private AndonEventLogMapper andonEventLogMapper;
/**
*
*
* @param eventId
* @return
*/
@Override
public AndonEvent selectAndonEventByEventId(Long eventId)
{
return andonEventMapper.selectAndonEventByEventId(eventId);
}
/**
*
*
* @param andonEvent
* @return
*/
@Override
public List<AndonEvent> selectAndonEventList(AndonEvent andonEvent)
{
return andonEventMapper.selectAndonEventList(andonEvent);
}
/**
*
*
* @param andonEvent
* @return
*/
@Override
public int insertAndonEvent(AndonEvent andonEvent)
{
andonEvent.setCreateTime(DateUtils.getNowDate());
// 在新增时自动匹配规则并计算截止时间与优先级
applyRuleAndCompute(andonEvent, true);
int ret = andonEventMapper.insertAndonEvent(andonEvent);
// 基于规则执行派工(派工即通知)
autoCreateAssignments(andonEvent);
// 记录日志:创建事件
logEvent(andonEvent.getEventId(), AnDonConstants.Operation.CREATE, "事件创建并完成规则计算与派工初始化");
return ret;
}
/**
*
*
* @param andonEvent
* @return
*/
@Override
public int updateAndonEvent(AndonEvent andonEvent)
{
andonEvent.setUpdateTime(DateUtils.getNowDate());
// 在修改时根据最新里程碑时间(如开始处理/确认)补充或重算解决截止时间
applyRuleAndCompute(andonEvent, false);
int ret = andonEventMapper.updateAndonEvent(andonEvent);
// 若事件已取消,级联取消派工
if (AnDonConstants.EventStatus.CANCELLED.equals(andonEvent.getEventStatus())) {
cascadeCancelAssignments(andonEvent.getEventId());
logEvent(andonEvent.getEventId(), AnDonConstants.Operation.CANCEL, "事件取消,已级联取消派工");
} else {
logEvent(andonEvent.getEventId(), AnDonConstants.Operation.EDIT, "事件编辑并同步时间计算");
}
return ret;
}
/**
*
*
* @param eventIds
* @return
*/
@Override
public int deleteAndonEventByEventIds(Long[] eventIds)
{
return andonEventMapper.deleteAndonEventByEventIds(eventIds);
}
/**
*
*
* @param eventId
* @return
*/
@Override
public int deleteAndonEventByEventId(Long eventId)
{
return andonEventMapper.deleteAndonEventByEventId(eventId);
}
/**
* ANDON_RULE /
* - ACK_DEADLINE + ACK_TIMEOUT_MIN
* - RESOLVE_DEADLINEstartackcreate remark.resAnchor + RESOLVE_TIMEOUT_MIN
* - PRIORITY使 PRIORITY_DEFAULT
*/
private void applyRuleAndCompute(AndonEvent e, boolean isInsert) {
if (e == null) return;
// 仅按呼叫类型与有效标记拉取候选规则,然后在内存中按“特征匹配度”挑选最优
AndonRule query = new AndonRule();
query.setCallTypeCode(e.getCallTypeCode());
query.setIsFlag(AnDonConstants.FLAG_VALID);
List<AndonRule> rules = andonRuleMapper.selectAndonRuleList(query);
AndonRule bestRule = pickBestRule(rules, e);
if (bestRule == null) {
// 无规则命中:保留优先级与截止时间为空或默认
return;
}
Integer ackTimeout = longToInt(bestRule.getAckTimeoutMin());
Integer resolveTimeout = longToInt(bestRule.getResolveTimeoutMin());
String resAnchor = parseResAnchor(bestRule.getRemark());
// 优先级:事件未手动设置时采用默认
if (e.getPriority() == null && bestRule.getPriorityDefault() != null) {
e.setPriority(bestRule.getPriorityDefault());
}
// 确认截止时间:仅在新增或缺失时计算
if ((isInsert || e.getAckDeadline() == null) && ackTimeout != null && ackTimeout > 0) {
Date createTime = e.getCreateTime();
if (createTime != null) {
e.setAckDeadline(addMinutes(createTime, ackTimeout));
}
}
// 解决截止时间:依据锚点策略计算;在更新时允许重算以贴合最新里程碑
if (resolveTimeout != null && resolveTimeout > 0) {
Date anchorTime = resolveAnchorTime(e, resAnchor);
if (anchorTime != null) {
e.setResolveDeadline(addMinutes(anchorTime, resolveTimeout));
}
}
}
/**
* NOTIFY_USERS NOTIFY_ROLES
*/
private void autoCreateAssignments(AndonEvent e) {
if (e == null || e.getEventId() == null) return;
AndonRule query = new AndonRule();
query.setCallTypeCode(e.getCallTypeCode());
query.setIsFlag(AnDonConstants.FLAG_VALID);
AndonRule rule = pickBestRule(andonRuleMapper.selectAndonRuleList(query), e);
if (rule == null) return;
Date now = DateUtils.getNowDate();
boolean created = false;
String mode = parseMode(rule.getRemark()); // single | multi
String fallback = parseFallback(rule.getRemark()); // role | none
// 优先使用用户列表
if (notEmpty(rule.getNotifyUsers())) {
String[] ids = rule.getNotifyUsers().split(",");
for (int i = 0; i < ids.length; i++) {
String t = ids[i] == null ? null : ids[i].trim();
if (!notEmpty(t)) continue;
try {
Long uid = Long.valueOf(t);
AndonEventAssignment a = new AndonEventAssignment();
a.setEventId(e.getEventId());
a.setAssigneeUserId(uid);
a.setAssignedTime(now);
a.setStatus(AnDonConstants.AssignmentStatus.ASSIGNED);
a.setIsFlag(AnDonConstants.FLAG_VALID);
a.setCreateTime(now);
andonEventAssignmentMapper.insertAndonEventAssignment(a);
created = true;
if ("single".equals(mode)) break; // 单人模式:仅创建一个派工
} catch (Exception ignore) { }
}
}
// 若无用户或单人模式未创建且允许角色兜底
if ((!created) && "role".equals(fallback) && notEmpty(rule.getNotifyRoles())) {
String[] roles = rule.getNotifyRoles().split(",");
for (int i = 0; i < roles.length; i++) {
String rk = roles[i] == null ? null : roles[i].trim();
if (!notEmpty(rk)) continue;
AndonEventAssignment a = new AndonEventAssignment();
a.setEventId(e.getEventId());
a.setAssigneeRoleKey(rk);
a.setAssignedTime(now);
a.setStatus(AnDonConstants.AssignmentStatus.ASSIGNED);
a.setIsFlag(AnDonConstants.FLAG_VALID);
a.setCreateTime(now);
andonEventAssignmentMapper.insertAndonEventAssignment(a);
created = true;
if ("single".equals(mode)) break;
}
}
if (created) {
logEvent(e.getEventId(), AnDonConstants.Operation.ASSIGN, "根据规则创建派工记录");
}
}
/** 解析派工模式single|multi默认为 single兼容当前单人负责人。 */
private String parseMode(String remark) {
String def = "single";
if (!notEmpty(remark)) return def;
try {
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(remark);
JsonNode mode = node.get("mode");
if (mode != null && notEmpty(mode.asText())) {
String v = mode.asText();
if ("single".equalsIgnoreCase(v) || "multi".equalsIgnoreCase(v)) {
return v.toLowerCase();
}
}
} catch (Exception ignore) { }
return def;
}
/** 解析兜底策略role|none默认 role。 */
private String parseFallback(String remark) {
String def = "role";
if (!notEmpty(remark)) return def;
try {
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(remark);
JsonNode fb = node.get("fallback");
if (fb != null && notEmpty(fb.asText())) {
String v = fb.asText();
if ("role".equalsIgnoreCase(v) || "none".equalsIgnoreCase(v)) {
return v.toLowerCase();
}
}
} catch (Exception ignore) { }
return def;
}
/** 事件取消时级联取消派工。 */
private void cascadeCancelAssignments(Long eventId) {
if (eventId == null) return;
AndonEventAssignment filter = new AndonEventAssignment();
filter.setEventId(eventId);
List<AndonEventAssignment> list = andonEventAssignmentMapper.selectAndonEventAssignmentList(filter);
if (list == null) return;
Date now = DateUtils.getNowDate();
for (AndonEventAssignment a : list) {
if (a == null) continue;
a.setStatus(AnDonConstants.AssignmentStatus.CANCELLED);
a.setUpdateTime(now);
andonEventAssignmentMapper.updateAndonEventAssignment(a);
}
}
/** 写入事件日志。 */
private void logEvent(Long eventId, String operation, String content) {
if (eventId == null || !notEmpty(operation)) return;
AndonEventLog log = new AndonEventLog();
log.setEventId(eventId);
log.setOperation(operation);
log.setContent(content);
log.setOperationTime(DateUtils.getNowDate());
andonEventLogMapper.insertAndonEventLog(log);
}
/** 选择匹配度最高的规则:按产线/工位/班组/触发源类型的精确匹配数排序。 */
private AndonRule pickBestRule(List<AndonRule> rules, AndonEvent e) {
if (rules == null || rules.isEmpty() || e == null) return null;
AndonRule best = null;
int bestScore = -1;
for (AndonRule r : rules) {
int score = 0;
if (notEmpty(r.getProductLineCode()) && r.getProductLineCode().equals(e.getProductLineCode())) score++;
if (notEmpty(r.getStationCode()) && r.getStationCode().equals(e.getStationCode())) score++;
if (notEmpty(r.getTeamCode()) && r.getTeamCode().equals(e.getTeamCode())) score++;
if (notEmpty(r.getSourceType()) && r.getSourceType().equals(e.getSourceType())) score++;
if (score > bestScore) {
bestScore = score;
best = r;
}
}
return best;
}
/** 解析规则 remark 中的 resAnchorstart|ack|create默认 start。 */
private String parseResAnchor(String remark) {
String def = "start";
if (!notEmpty(remark)) return def;
try {
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(remark);
JsonNode anchor = node.get("resAnchor");
if (anchor != null && notEmpty(anchor.asText())) {
String v = anchor.asText();
if ("start".equalsIgnoreCase(v) || "ack".equalsIgnoreCase(v) || "create".equalsIgnoreCase(v)) {
return v.toLowerCase();
}
}
} catch (Exception ignore) { }
return def;
}
/** 根据策略选择解决时限的起算锚点时间。 */
private Date resolveAnchorTime(AndonEvent e, String resAnchor) {
if (e == null) return null;
String a = (notEmpty(resAnchor) ? resAnchor : "start");
if ("start".equals(a)) {
if (e.getResponseStartTime() != null) return e.getResponseStartTime();
if (e.getAckTime() != null) return e.getAckTime();
return e.getCreateTime();
} else if ("ack".equals(a)) {
if (e.getAckTime() != null) return e.getAckTime();
return e.getCreateTime();
} else { // create
return e.getCreateTime();
}
}
private boolean notEmpty(String s) { return s != null && !s.trim().isEmpty(); }
private Integer longToInt(Long v) { return v == null ? null : v.intValue(); }
private Date addMinutes(Date base, int minutes) { return base == null ? null : new Date(base.getTime() + minutes * 60L * 1000L); }
/**
* PENDING PROCESSING
*/
@Override
public int acknowledgeEvent(Long eventId, String ackBy) {
if (eventId == null) return 0;
AndonEvent event = andonEventMapper.selectAndonEventByEventId(eventId);
if (event == null) return 0;
Date now = DateUtils.getNowDate();
event.setAckBy(ackBy);
event.setAckTime(now);
event.setEventStatus(AnDonConstants.EventStatus.PROCESSING);
event.setUpdateTime(now);
int ret = andonEventMapper.updateAndonEvent(event);
logEvent(eventId, AnDonConstants.Operation.ACK, "事件已确认,确认人:" + ackBy);
return ret;
}
/**
* PROCESSING
*/
@Override
public int startProcessEvent(Long eventId, String operator) {
if (eventId == null) return 0;
AndonEvent event = andonEventMapper.selectAndonEventByEventId(eventId);
if (event == null) return 0;
Date now = DateUtils.getNowDate();
event.setResponseStartTime(now);
event.setEventStatus(AnDonConstants.EventStatus.PROCESSING);
event.setUpdateTime(now);
// 重算解决截止时间(以开始处理时间为锤点)
applyRuleAndCompute(event, false);
int ret = andonEventMapper.updateAndonEvent(event);
logEvent(eventId, AnDonConstants.Operation.EDIT, "开始处理,操作人:" + operator);
return ret;
}
/**
* RESOLVED
*/
@Override
public int completeEvent(Long eventId, String resolution, String operator) {
if (eventId == null) return 0;
AndonEvent event = andonEventMapper.selectAndonEventByEventId(eventId);
if (event == null) return 0;
Date now = DateUtils.getNowDate();
event.setResponseEndTime(now);
event.setResolution(resolution);
event.setEventStatus(AnDonConstants.EventStatus.RESOLVED);
event.setUpdateTime(now);
int ret = andonEventMapper.updateAndonEvent(event);
logEvent(eventId, AnDonConstants.Operation.RESOLVE, "事件已完成,操作人:" + operator);
return ret;
}
/**
* CANCELLED
*/
@Override
public int cancelEvent(Long eventId, String cancelReason, String operator) {
if (eventId == null) return 0;
AndonEvent event = andonEventMapper.selectAndonEventByEventId(eventId);
if (event == null) return 0;
Date now = DateUtils.getNowDate();
event.setCancelReason(cancelReason);
event.setEventStatus(AnDonConstants.EventStatus.CANCELLED);
event.setUpdateTime(now);
int ret = andonEventMapper.updateAndonEvent(event);
cascadeCancelAssignments(eventId);
logEvent(eventId, AnDonConstants.Operation.CANCEL, "事件已取消,操作人:" + operator + ",原因:" + (cancelReason != null ? cancelReason : "未填写"));
return ret;
}
}

@ -0,0 +1,97 @@
package com.aucma.production.service.impl;
import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.AndonRule;
import com.aucma.production.mapper.AndonRuleMapper;
import com.aucma.production.service.IAndonRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-10-28
*/
@Service
public class AndonRuleServiceImpl implements IAndonRuleService
{
@Autowired
private AndonRuleMapper andonRuleMapper;
/**
*
*
* @param ruleId
* @return
*/
@Override
public AndonRule selectAndonRuleByRuleId(Long ruleId)
{
return andonRuleMapper.selectAndonRuleByRuleId(ruleId);
}
/**
*
*
* @param andonRule
* @return
*/
@Override
public List<AndonRule> selectAndonRuleList(AndonRule andonRule)
{
return andonRuleMapper.selectAndonRuleList(andonRule);
}
/**
*
*
* @param andonRule
* @return
*/
@Override
public int insertAndonRule(AndonRule andonRule)
{
andonRule.setCreateTime(DateUtils.getNowDate());
return andonRuleMapper.insertAndonRule(andonRule);
}
/**
*
*
* @param andonRule
* @return
*/
@Override
public int updateAndonRule(AndonRule andonRule)
{
andonRule.setUpdateTime(DateUtils.getNowDate());
return andonRuleMapper.updateAndonRule(andonRule);
}
/**
*
*
* @param ruleIds
* @return
*/
@Override
public int deleteAndonRuleByRuleIds(Long[] ruleIds)
{
return andonRuleMapper.deleteAndonRuleByRuleIds(ruleIds);
}
/**
*
*
* @param ruleId
* @return
*/
@Override
public int deleteAndonRuleByRuleId(Long ruleId)
{
return andonRuleMapper.deleteAndonRuleByRuleId(ruleId);
}
}

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.production.mapper.AndonBoardConfigMapper">
<resultMap type="AndonBoardConfig" id="AndonBoardConfigResult">
<result property="boardId" column="board_id" />
<result property="boardCode" column="board_code" />
<result property="boardName" column="board_name" />
<result property="productLineCode" column="product_line_code" />
<result property="stationCode" column="station_code" />
<result property="displayFields" column="display_fields" />
<result property="refreshIntervalSec" column="refresh_interval_sec" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAndonBoardConfigVo">
select board_id, board_code, board_name, product_line_code, station_code, display_fields, refresh_interval_sec, is_flag, remark, create_by, create_time, update_by, update_time from andon_board_config
</sql>
<select id="selectAndonBoardConfigList" parameterType="AndonBoardConfig" resultMap="AndonBoardConfigResult">
<include refid="selectAndonBoardConfigVo"/>
<where>
<if test="boardCode != null and boardCode != ''"> and board_code = #{boardCode}</if>
<if test="boardName != null and boardName != ''"> and board_name like concat(concat('%', #{boardName}), '%')</if>
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
<if test="stationCode != null and stationCode != ''"> and station_code = #{stationCode}</if>
<if test="displayFields != null and displayFields != ''"> and display_fields = #{displayFields}</if>
<if test="refreshIntervalSec != null "> and refresh_interval_sec = #{refreshIntervalSec}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectAndonBoardConfigByBoardId" parameterType="Long" resultMap="AndonBoardConfigResult">
<include refid="selectAndonBoardConfigVo"/>
where board_id = #{boardId}
</select>
<insert id="insertAndonBoardConfig" parameterType="AndonBoardConfig">
<selectKey keyProperty="boardId" resultType="long" order="BEFORE">
SELECT ANDON_BOARD_CONFIG_SEQ.NEXTVAL as boardId FROM DUAL
</selectKey>
insert into andon_board_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="boardId != null">board_id,</if>
<if test="boardCode != null and boardCode != ''">board_code,</if>
<if test="boardName != null and boardName != ''">board_name,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="stationCode != null">station_code,</if>
<if test="displayFields != null">display_fields,</if>
<if test="refreshIntervalSec != null">refresh_interval_sec,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="boardId != null">#{boardId},</if>
<if test="boardCode != null and boardCode != ''">#{boardCode},</if>
<if test="boardName != null and boardName != ''">#{boardName},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="displayFields != null">#{displayFields},</if>
<if test="refreshIntervalSec != null">#{refreshIntervalSec},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAndonBoardConfig" parameterType="AndonBoardConfig">
update andon_board_config
<trim prefix="SET" suffixOverrides=",">
<if test="boardCode != null and boardCode != ''">board_code = #{boardCode},</if>
<if test="boardName != null and boardName != ''">board_name = #{boardName},</if>
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="stationCode != null">station_code = #{stationCode},</if>
<if test="displayFields != null">display_fields = #{displayFields},</if>
<if test="refreshIntervalSec != null">refresh_interval_sec = #{refreshIntervalSec},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where board_id = #{boardId}
</update>
<delete id="deleteAndonBoardConfigByBoardId" parameterType="Long">
delete from andon_board_config where board_id = #{boardId}
</delete>
<delete id="deleteAndonBoardConfigByBoardIds" parameterType="String">
delete from andon_board_config where board_id in
<foreach item="boardId" collection="array" open="(" separator="," close=")">
#{boardId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.production.mapper.AndonEventAssignmentMapper">
<resultMap type="AndonEventAssignment" id="AndonEventAssignmentResult">
<result property="assignmentId" column="assignment_id" />
<result property="eventId" column="event_id" />
<result property="assigneeUserId" column="assignee_user_id" />
<result property="assigneeUserName" column="assignee_user_name" />
<result property="assigneeRoleKey" column="assignee_role_key" />
<result property="assigneeTeamCode" column="assignee_team_code" />
<result property="assignedTime" column="assigned_time" />
<result property="acceptTime" column="accept_time" />
<result property="finishTime" column="finish_time" />
<result property="status" column="status" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAndonEventAssignmentVo">
select assignment_id, event_id, assignee_user_id, assignee_user_name, assignee_role_key, assignee_team_code, assigned_time, accept_time, finish_time, status, is_flag, remark, create_by, create_time, update_by, update_time from andon_event_assignment
</sql>
<select id="selectAndonEventAssignmentList" parameterType="AndonEventAssignment" resultMap="AndonEventAssignmentResult">
<include refid="selectAndonEventAssignmentVo"/>
<where>
<if test="eventId != null "> and event_id = #{eventId}</if>
<if test="assigneeUserId != null "> and assignee_user_id = #{assigneeUserId}</if>
<if test="assigneeUserName != null and assigneeUserName != ''"> and assignee_user_name like concat(concat('%', #{assigneeUserName}), '%')</if>
<if test="assigneeRoleKey != null and assigneeRoleKey != ''"> and assignee_role_key = #{assigneeRoleKey}</if>
<if test="assigneeTeamCode != null and assigneeTeamCode != ''"> and assignee_team_code = #{assigneeTeamCode}</if>
<if test="assignedTime != null "> and assigned_time = #{assignedTime}</if>
<if test="acceptTime != null "> and accept_time = #{acceptTime}</if>
<if test="finishTime != null "> and finish_time = #{finishTime}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectAndonEventAssignmentByAssignmentId" parameterType="Long" resultMap="AndonEventAssignmentResult">
<include refid="selectAndonEventAssignmentVo"/>
where assignment_id = #{assignmentId}
</select>
<insert id="insertAndonEventAssignment" parameterType="AndonEventAssignment">
<selectKey keyProperty="assignmentId" resultType="long" order="BEFORE">
SELECT ANDON_EVENT_ASSIGNMENT_SEQ.NEXTVAL as assignmentId FROM DUAL
</selectKey>
insert into andon_event_assignment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="assignmentId != null">assignment_id,</if>
<if test="eventId != null">event_id,</if>
<if test="assigneeUserId != null">assignee_user_id,</if>
<if test="assigneeUserName != null">assignee_user_name,</if>
<if test="assigneeRoleKey != null">assignee_role_key,</if>
<if test="assigneeTeamCode != null">assignee_team_code,</if>
<if test="assignedTime != null">assigned_time,</if>
<if test="acceptTime != null">accept_time,</if>
<if test="finishTime != null">finish_time,</if>
<if test="status != null">status,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="assignmentId != null">#{assignmentId},</if>
<if test="eventId != null">#{eventId},</if>
<if test="assigneeUserId != null">#{assigneeUserId},</if>
<if test="assigneeUserName != null">#{assigneeUserName},</if>
<if test="assigneeRoleKey != null">#{assigneeRoleKey},</if>
<if test="assigneeTeamCode != null">#{assigneeTeamCode},</if>
<if test="assignedTime != null">#{assignedTime},</if>
<if test="acceptTime != null">#{acceptTime},</if>
<if test="finishTime != null">#{finishTime},</if>
<if test="status != null">#{status},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAndonEventAssignment" parameterType="AndonEventAssignment">
update andon_event_assignment
<trim prefix="SET" suffixOverrides=",">
<if test="eventId != null">event_id = #{eventId},</if>
<if test="assigneeUserId != null">assignee_user_id = #{assigneeUserId},</if>
<if test="assigneeUserName != null">assignee_user_name = #{assigneeUserName},</if>
<if test="assigneeRoleKey != null">assignee_role_key = #{assigneeRoleKey},</if>
<if test="assigneeTeamCode != null">assignee_team_code = #{assigneeTeamCode},</if>
<if test="assignedTime != null">assigned_time = #{assignedTime},</if>
<if test="acceptTime != null">accept_time = #{acceptTime},</if>
<if test="finishTime != null">finish_time = #{finishTime},</if>
<if test="status != null">status = #{status},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where assignment_id = #{assignmentId}
</update>
<delete id="deleteAndonEventAssignmentByAssignmentId" parameterType="Long">
delete from andon_event_assignment where assignment_id = #{assignmentId}
</delete>
<delete id="deleteAndonEventAssignmentByAssignmentIds" parameterType="String">
delete from andon_event_assignment where assignment_id in
<foreach item="assignmentId" collection="array" open="(" separator="," close=")">
#{assignmentId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.production.mapper.AndonEventLogMapper">
<resultMap type="AndonEventLog" id="AndonEventLogResult">
<result property="logId" column="log_id" />
<result property="eventId" column="event_id" />
<result property="operation" column="operation" />
<result property="content" column="content" />
<result property="operatorUserId" column="operator_user_id" />
<result property="operatorUserName" column="operator_user_name" />
<result property="operationTime" column="operation_time" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAndonEventLogVo">
select log_id, event_id, operation, content, operator_user_id, operator_user_name, operation_time, remark, create_by, create_time, update_by, update_time from andon_event_log
</sql>
<select id="selectAndonEventLogList" parameterType="AndonEventLog" resultMap="AndonEventLogResult">
<include refid="selectAndonEventLogVo"/>
<where>
<if test="eventId != null "> and event_id = #{eventId}</if>
<if test="operation != null and operation != ''"> and operation = #{operation}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="operatorUserId != null "> and operator_user_id = #{operatorUserId}</if>
<if test="operatorUserName != null and operatorUserName != ''"> and operator_user_name like concat(concat('%', #{operatorUserName}), '%')</if>
<if test="operationTime != null "> and operation_time = #{operationTime}</if>
</where>
</select>
<select id="selectAndonEventLogByLogId" parameterType="Long" resultMap="AndonEventLogResult">
<include refid="selectAndonEventLogVo"/>
where log_id = #{logId}
</select>
<insert id="insertAndonEventLog" parameterType="AndonEventLog">
<selectKey keyProperty="logId" resultType="long" order="BEFORE">
SELECT ANDON_EVENT_LOG_SEQ.NEXTVAL as logId FROM DUAL
</selectKey>
insert into andon_event_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="logId != null">log_id,</if>
<if test="eventId != null">event_id,</if>
<if test="operation != null and operation != ''">operation,</if>
<if test="content != null">content,</if>
<if test="operatorUserId != null">operator_user_id,</if>
<if test="operatorUserName != null">operator_user_name,</if>
<if test="operationTime != null">operation_time,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="logId != null">#{logId},</if>
<if test="eventId != null">#{eventId},</if>
<if test="operation != null and operation != ''">#{operation},</if>
<if test="content != null">#{content},</if>
<if test="operatorUserId != null">#{operatorUserId},</if>
<if test="operatorUserName != null">#{operatorUserName},</if>
<if test="operationTime != null">#{operationTime},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAndonEventLog" parameterType="AndonEventLog">
update andon_event_log
<trim prefix="SET" suffixOverrides=",">
<if test="eventId != null">event_id = #{eventId},</if>
<if test="operation != null and operation != ''">operation = #{operation},</if>
<if test="content != null">content = #{content},</if>
<if test="operatorUserId != null">operator_user_id = #{operatorUserId},</if>
<if test="operatorUserName != null">operator_user_name = #{operatorUserName},</if>
<if test="operationTime != null">operation_time = #{operationTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where log_id = #{logId}
</update>
<delete id="deleteAndonEventLogByLogId" parameterType="Long">
delete from andon_event_log where log_id = #{logId}
</delete>
<delete id="deleteAndonEventLogByLogIds" parameterType="String">
delete from andon_event_log where log_id in
<foreach item="logId" collection="array" open="(" separator="," close=")">
#{logId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.production.mapper.AndonEventMapper">
<resultMap type="AndonEvent" id="AndonEventResult">
<result property="eventId" column="event_id" />
<result property="callCode" column="call_code" />
<result property="callTypeCode" column="call_type_code" />
<result property="sourceType" column="source_type" />
<result property="sourceRefId" column="source_ref_id" />
<result property="productLineCode" column="product_line_code" />
<result property="stationCode" column="station_code" />
<result property="teamCode" column="team_code" />
<result property="orderCode" column="order_code" />
<result property="materialCode" column="material_code" />
<result property="deviceId" column="device_id" />
<result property="deviceCode" column="device_code" />
<result property="priority" column="priority" />
<result property="eventStatus" column="event_status" />
<result property="description" column="description" />
<result property="ackBy" column="ack_by" />
<result property="ackTime" column="ack_time" />
<result property="responseStartTime" column="response_start_time" />
<result property="responseEndTime" column="response_end_time" />
<result property="resolution" column="resolution" />
<result property="cancelReason" column="cancel_reason" />
<result property="escalateLevel" column="escalate_level" />
<result property="escalateTime" column="escalate_time" />
<result property="ackDeadline" column="ack_deadline" />
<result property="resolveDeadline" column="resolve_deadline" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAndonEventVo">
select event_id, call_code, call_type_code, source_type, source_ref_id, product_line_code, station_code, team_code, order_code, material_code, device_id, device_code, priority, event_status, description, ack_by, ack_time, response_start_time, response_end_time, resolution, cancel_reason, escalate_level, escalate_time, ack_deadline, resolve_deadline, is_flag, remark, create_by, create_time, update_by, update_time from andon_event
</sql>
<select id="selectAndonEventList" parameterType="AndonEvent" resultMap="AndonEventResult">
<include refid="selectAndonEventVo"/>
<where>
<if test="callCode != null and callCode != ''"> and call_code = #{callCode}</if>
<if test="callTypeCode != null and callTypeCode != ''"> and call_type_code = #{callTypeCode}</if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType}</if>
<if test="sourceRefId != null "> and source_ref_id = #{sourceRefId}</if>
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
<if test="stationCode != null and stationCode != ''"> and station_code = #{stationCode}</if>
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="priority != null "> and priority = #{priority}</if>
<if test="eventStatus != null and eventStatus != ''"> and event_status = #{eventStatus}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="ackBy != null and ackBy != ''"> and ack_by = #{ackBy}</if>
<if test="ackTime != null "> and ack_time = #{ackTime}</if>
<if test="responseStartTime != null "> and response_start_time = #{responseStartTime}</if>
<if test="responseEndTime != null "> and response_end_time = #{responseEndTime}</if>
<if test="resolution != null and resolution != ''"> and resolution = #{resolution}</if>
<if test="cancelReason != null and cancelReason != ''"> and cancel_reason = #{cancelReason}</if>
<if test="escalateLevel != null "> and escalate_level = #{escalateLevel}</if>
<if test="escalateTime != null "> and escalate_time = #{escalateTime}</if>
<if test="ackDeadline != null "> and ack_deadline = #{ackDeadline}</if>
<if test="resolveDeadline != null "> and resolve_deadline = #{resolveDeadline}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectAndonEventByEventId" parameterType="Long" resultMap="AndonEventResult">
<include refid="selectAndonEventVo"/>
where event_id = #{eventId}
</select>
<insert id="insertAndonEvent" parameterType="AndonEvent">
<selectKey keyProperty="eventId" resultType="long" order="BEFORE">
SELECT ANDON_EVENT_SEQ.NEXTVAL as eventId FROM DUAL
</selectKey>
insert into andon_event
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventId != null">event_id,</if>
<if test="callCode != null and callCode != ''">call_code,</if>
<if test="callTypeCode != null and callTypeCode != ''">call_type_code,</if>
<if test="sourceType != null and sourceType != ''">source_type,</if>
<if test="sourceRefId != null">source_ref_id,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="stationCode != null">station_code,</if>
<if test="teamCode != null">team_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="deviceId != null">device_id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="priority != null">priority,</if>
<if test="eventStatus != null and eventStatus != ''">event_status,</if>
<if test="description != null">description,</if>
<if test="ackBy != null">ack_by,</if>
<if test="ackTime != null">ack_time,</if>
<if test="responseStartTime != null">response_start_time,</if>
<if test="responseEndTime != null">response_end_time,</if>
<if test="resolution != null">resolution,</if>
<if test="cancelReason != null">cancel_reason,</if>
<if test="escalateLevel != null">escalate_level,</if>
<if test="escalateTime != null">escalate_time,</if>
<if test="ackDeadline != null">ack_deadline,</if>
<if test="resolveDeadline != null">resolve_deadline,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventId != null">#{eventId},</if>
<if test="callCode != null and callCode != ''">#{callCode},</if>
<if test="callTypeCode != null and callTypeCode != ''">#{callTypeCode},</if>
<if test="sourceType != null and sourceType != ''">#{sourceType},</if>
<if test="sourceRefId != null">#{sourceRefId},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="teamCode != null">#{teamCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="priority != null">#{priority},</if>
<if test="eventStatus != null and eventStatus != ''">#{eventStatus},</if>
<if test="description != null">#{description},</if>
<if test="ackBy != null">#{ackBy},</if>
<if test="ackTime != null">#{ackTime},</if>
<if test="responseStartTime != null">#{responseStartTime},</if>
<if test="responseEndTime != null">#{responseEndTime},</if>
<if test="resolution != null">#{resolution},</if>
<if test="cancelReason != null">#{cancelReason},</if>
<if test="escalateLevel != null">#{escalateLevel},</if>
<if test="escalateTime != null">#{escalateTime},</if>
<if test="ackDeadline != null">#{ackDeadline},</if>
<if test="resolveDeadline != null">#{resolveDeadline},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAndonEvent" parameterType="AndonEvent">
update andon_event
<trim prefix="SET" suffixOverrides=",">
<if test="callCode != null and callCode != ''">call_code = #{callCode},</if>
<if test="callTypeCode != null and callTypeCode != ''">call_type_code = #{callTypeCode},</if>
<if test="sourceType != null and sourceType != ''">source_type = #{sourceType},</if>
<if test="sourceRefId != null">source_ref_id = #{sourceRefId},</if>
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="stationCode != null">station_code = #{stationCode},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="priority != null">priority = #{priority},</if>
<if test="eventStatus != null and eventStatus != ''">event_status = #{eventStatus},</if>
<if test="description != null">description = #{description},</if>
<if test="ackBy != null">ack_by = #{ackBy},</if>
<if test="ackTime != null">ack_time = #{ackTime},</if>
<if test="responseStartTime != null">response_start_time = #{responseStartTime},</if>
<if test="responseEndTime != null">response_end_time = #{responseEndTime},</if>
<if test="resolution != null">resolution = #{resolution},</if>
<if test="cancelReason != null">cancel_reason = #{cancelReason},</if>
<if test="escalateLevel != null">escalate_level = #{escalateLevel},</if>
<if test="escalateTime != null">escalate_time = #{escalateTime},</if>
<if test="ackDeadline != null">ack_deadline = #{ackDeadline},</if>
<if test="resolveDeadline != null">resolve_deadline = #{resolveDeadline},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where event_id = #{eventId}
</update>
<delete id="deleteAndonEventByEventId" parameterType="Long">
delete from andon_event where event_id = #{eventId}
</delete>
<delete id="deleteAndonEventByEventIds" parameterType="String">
delete from andon_event where event_id in
<foreach item="eventId" collection="array" open="(" separator="," close=")">
#{eventId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.production.mapper.AndonRuleMapper">
<resultMap type="AndonRule" id="AndonRuleResult">
<result property="ruleId" column="rule_id" />
<result property="ruleName" column="rule_name" />
<result property="callTypeCode" column="call_type_code" />
<result property="productLineCode" column="product_line_code" />
<result property="stationCode" column="station_code" />
<result property="teamCode" column="team_code" />
<result property="sourceType" column="source_type" />
<result property="ackTimeoutMin" column="ack_timeout_min" />
<result property="resolveTimeoutMin" column="resolve_timeout_min" />
<result property="priorityDefault" column="priority_default" />
<result property="notifyRoles" column="notify_roles" />
<result property="notifyUsers" column="notify_users" />
<result property="escalateLevels" column="escalate_levels" />
<result property="effectiveBeginTime" column="effective_begin_time" />
<result property="effectiveEndTime" column="effective_end_time" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectAndonRuleVo">
select rule_id, rule_name, call_type_code, product_line_code, station_code, team_code, source_type, ack_timeout_min, resolve_timeout_min, priority_default, notify_roles, notify_users, escalate_levels, effective_begin_time, effective_end_time, is_flag, remark, create_by, create_time, update_by, update_time from andon_rule
</sql>
<select id="selectAndonRuleList" parameterType="AndonRule" resultMap="AndonRuleResult">
<include refid="selectAndonRuleVo"/>
<where>
<if test="ruleName != null and ruleName != ''"> and rule_name like concat(concat('%', #{ruleName}), '%')</if>
<if test="callTypeCode != null and callTypeCode != ''"> and call_type_code = #{callTypeCode}</if>
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
<if test="stationCode != null and stationCode != ''"> and station_code = #{stationCode}</if>
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType}</if>
<if test="ackTimeoutMin != null "> and ack_timeout_min = #{ackTimeoutMin}</if>
<if test="resolveTimeoutMin != null "> and resolve_timeout_min = #{resolveTimeoutMin}</if>
<if test="priorityDefault != null "> and priority_default = #{priorityDefault}</if>
<if test="notifyRoles != null and notifyRoles != ''"> and notify_roles = #{notifyRoles}</if>
<if test="notifyUsers != null and notifyUsers != ''"> and notify_users = #{notifyUsers}</if>
<if test="escalateLevels != null and escalateLevels != ''"> and escalate_levels = #{escalateLevels}</if>
<if test="effectiveBeginTime != null "> and effective_begin_time = #{effectiveBeginTime}</if>
<if test="effectiveEndTime != null "> and effective_end_time = #{effectiveEndTime}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectAndonRuleByRuleId" parameterType="Long" resultMap="AndonRuleResult">
<include refid="selectAndonRuleVo"/>
where rule_id = #{ruleId}
</select>
<insert id="insertAndonRule" parameterType="AndonRule">
<selectKey keyProperty="ruleId" resultType="long" order="BEFORE">
SELECT ANDON_RULE_SEQ.NEXTVAL as ruleId FROM DUAL
</selectKey>
insert into andon_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ruleId != null">rule_id,</if>
<if test="ruleName != null and ruleName != ''">rule_name,</if>
<if test="callTypeCode != null and callTypeCode != ''">call_type_code,</if>
<if test="productLineCode != null">product_line_code,</if>
<if test="stationCode != null">station_code,</if>
<if test="teamCode != null">team_code,</if>
<if test="sourceType != null">source_type,</if>
<if test="ackTimeoutMin != null">ack_timeout_min,</if>
<if test="resolveTimeoutMin != null">resolve_timeout_min,</if>
<if test="priorityDefault != null">priority_default,</if>
<if test="notifyRoles != null">notify_roles,</if>
<if test="notifyUsers != null">notify_users,</if>
<if test="escalateLevels != null">escalate_levels,</if>
<if test="effectiveBeginTime != null">effective_begin_time,</if>
<if test="effectiveEndTime != null">effective_end_time,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ruleId != null">#{ruleId},</if>
<if test="ruleName != null and ruleName != ''">#{ruleName},</if>
<if test="callTypeCode != null and callTypeCode != ''">#{callTypeCode},</if>
<if test="productLineCode != null">#{productLineCode},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="teamCode != null">#{teamCode},</if>
<if test="sourceType != null">#{sourceType},</if>
<if test="ackTimeoutMin != null">#{ackTimeoutMin},</if>
<if test="resolveTimeoutMin != null">#{resolveTimeoutMin},</if>
<if test="priorityDefault != null">#{priorityDefault},</if>
<if test="notifyRoles != null">#{notifyRoles},</if>
<if test="notifyUsers != null">#{notifyUsers},</if>
<if test="escalateLevels != null">#{escalateLevels},</if>
<if test="effectiveBeginTime != null">#{effectiveBeginTime},</if>
<if test="effectiveEndTime != null">#{effectiveEndTime},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateAndonRule" parameterType="AndonRule">
update andon_rule
<trim prefix="SET" suffixOverrides=",">
<if test="ruleName != null and ruleName != ''">rule_name = #{ruleName},</if>
<if test="callTypeCode != null and callTypeCode != ''">call_type_code = #{callTypeCode},</if>
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
<if test="stationCode != null">station_code = #{stationCode},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="sourceType != null">source_type = #{sourceType},</if>
<if test="ackTimeoutMin != null">ack_timeout_min = #{ackTimeoutMin},</if>
<if test="resolveTimeoutMin != null">resolve_timeout_min = #{resolveTimeoutMin},</if>
<if test="priorityDefault != null">priority_default = #{priorityDefault},</if>
<if test="notifyRoles != null">notify_roles = #{notifyRoles},</if>
<if test="notifyUsers != null">notify_users = #{notifyUsers},</if>
<if test="escalateLevels != null">escalate_levels = #{escalateLevels},</if>
<if test="effectiveBeginTime != null">effective_begin_time = #{effectiveBeginTime},</if>
<if test="effectiveEndTime != null">effective_end_time = #{effectiveEndTime},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where rule_id = #{ruleId}
</update>
<delete id="deleteAndonRuleByRuleId" parameterType="Long">
delete from andon_rule where rule_id = #{ruleId}
</delete>
<delete id="deleteAndonRuleByRuleIds" parameterType="String">
delete from andon_rule where rule_id in
<foreach item="ruleId" collection="array" open="(" separator="," close=")">
#{ruleId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save