From 1f2724fdef6f02370a0606e19041385867f76a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Thu, 15 Jan 2026 13:12:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(sys):=20=E6=96=B0=E5=A2=9ESOP=E6=A0=87?= =?UTF-8?q?=E5=87=86=E6=93=8D=E4=BD=9C=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建SopController提供URL配置和错误详情的CRUD接口 - 实现SopService接口定义标准操作流程相关业务方法 - 添加SopUrlConfig和SopErrorDetail实体类及数据访问层 - 配置MyBatis映射文件支持URL配置和错误详情的数据库操作 - 实现SopServiceImpl完成URL配置、错误详情的增删改查逻辑 - 在WmsMessageServiceImpl中禁用不准确的立库回传任务状态更新 --- .../service/impl/WmsMessageServiceImpl.java | 2 +- .../modules/sys/controller/SopController.java | 132 ++++++++++++++ .../modules/sys/dao/SopErrorDetailDao.java | 55 ++++++ .../modules/sys/dao/SopUrlConfigDao.java | 38 ++++ .../modules/sys/entity/SopErrorDetail.java | 105 +++++++++++ .../sys/entity/SopErrorDetailData.java | 65 +++++++ .../modules/sys/entity/SopUrlConfig.java | 52 ++++++ .../modules/sys/entity/SopUrlConfigData.java | 55 ++++++ .../modules/sys/service/SopService.java | 48 +++++ .../sys/service/impl/SopServiceImpl.java | 169 ++++++++++++++++++ .../mapper/sys/SopErrorDetailDao.xml | 117 ++++++++++++ .../resources/mapper/sys/SopUrlConfigDao.xml | 76 ++++++++ 12 files changed, 913 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/gaotao/modules/sys/controller/SopController.java create mode 100644 src/main/java/com/gaotao/modules/sys/dao/SopErrorDetailDao.java create mode 100644 src/main/java/com/gaotao/modules/sys/dao/SopUrlConfigDao.java create mode 100644 src/main/java/com/gaotao/modules/sys/entity/SopErrorDetail.java create mode 100644 src/main/java/com/gaotao/modules/sys/entity/SopErrorDetailData.java create mode 100644 src/main/java/com/gaotao/modules/sys/entity/SopUrlConfig.java create mode 100644 src/main/java/com/gaotao/modules/sys/entity/SopUrlConfigData.java create mode 100644 src/main/java/com/gaotao/modules/sys/service/SopService.java create mode 100644 src/main/java/com/gaotao/modules/sys/service/impl/SopServiceImpl.java create mode 100644 src/main/resources/mapper/sys/SopErrorDetailDao.xml create mode 100644 src/main/resources/mapper/sys/SopUrlConfigDao.xml diff --git a/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java b/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java index c53bacb..0f8d3cf 100644 --- a/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java +++ b/src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java @@ -472,7 +472,7 @@ public class WmsMessageServiceImpl implements WmsMessageService { saveWcsCallbackTask(inData, toWarehouseId, toLocationId); // 3. 立即更新部分状态(可能是移库出库)- rqrq - updateOrderTaskStatusForOutCallback(inData); + // updateOrderTaskStatusForOutCallback(inData); 禁用 立库回传的任务信息不准 wcsIntegrationMapper.reUpdatePalletDetailWcsFlag(inData.getSite(), inData.getPalletId()); log.info("出库回调处理完成 - rqrq,palletId={}, 已保存回调任务并更新pallet_detail的wcs_flag", diff --git a/src/main/java/com/gaotao/modules/sys/controller/SopController.java b/src/main/java/com/gaotao/modules/sys/controller/SopController.java new file mode 100644 index 0000000..4dae6c9 --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/controller/SopController.java @@ -0,0 +1,132 @@ +package com.gaotao.modules.sys.controller; + +import com.gaotao.common.utils.R; +import com.gaotao.modules.sys.entity.*; +import com.gaotao.modules.sys.service.SopService; +import org.apache.shiro.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.List; +import java.util.Map; + +/** + * SOP标准操作流程Controller - rqrq + */ +@RestController +@RequestMapping("/sys/sop") +public class SopController { + + @Autowired + private SopService sopService; + + private String getCurrentUser() { + try { + return (String) SecurityUtils.getSubject().getPrincipal(); + } catch (Exception e) { + return "system"; + } + } + + @PostMapping("/urlConfig/list") + public R getUrlConfigList(@RequestBody SopUrlConfigData data) { + Map result = sopService.getUrlConfigList(data); + return R.ok().put("rows", result.get("list")).put("total", result.get("total")); + } + + @PostMapping("/urlConfig/activeList") + public R getActiveUrlList() { + List list = sopService.getActiveUrlList(); + return R.ok().put("rows", list); + } + + /** + * 获取平台列表(PC/PDA)- rqrq + */ + @PostMapping("/urlConfig/platformList") + public R getPlatformList() { + List list = sopService.getPlatformList(); + return R.ok().put("rows", list); + } + + /** + * 根据平台获取模块列表 - rqrq + */ + @PostMapping("/urlConfig/moduleList") + public R getModuleListByPlatform(@RequestBody Map params) { + String platform = params.get("platform"); + List list = sopService.getModuleListByPlatform(platform); + return R.ok().put("rows", list); + } + + /** + * 根据平台和模块获取功能页面列表 - rqrq + */ + @PostMapping("/urlConfig/pageList") + public R getPageListByPlatformAndModule(@RequestBody Map params) { + String platform = params.get("platform"); + String moduleName = params.get("moduleName"); + List list = sopService.getPageListByPlatformAndModule(platform, moduleName); + return R.ok().put("rows", list); + } + + @PostMapping("/urlConfig/getByUrl") + public R getUrlConfigByUrl(@RequestBody Map params) { + String url = params.get("url"); + SopUrlConfig config = sopService.getUrlConfigByUrl(url); + return R.ok().put("row", config); + } + + @PostMapping("/urlConfig/save") + public R saveUrlConfig(@RequestBody SopUrlConfig config) { + sopService.saveUrlConfig(config, getCurrentUser()); + return R.ok(); + } + + @PostMapping("/urlConfig/delete") + public R deleteUrlConfig(@RequestBody Map params) { + String url = params.get("url"); + sopService.deleteUrlConfig(url, getCurrentUser()); + return R.ok(); + } + + @PostMapping("/errorDetail/list") + public R getErrorDetailList(@RequestBody SopErrorDetailData data) { + Map result = sopService.getErrorDetailList(data); + return R.ok().put("rows", result.get("list")).put("total", result.get("total")); + } + + @PostMapping("/errorDetail/getByUrl") + public R getErrorDetailByUrl(@RequestBody Map params) { + String url = params.get("url"); + List list = sopService.getErrorDetailByUrl(url); + return R.ok().put("rows", list); + } + + @PostMapping("/errorDetail/getFunctionButtons") + public R getFunctionButtonsByUrl(@RequestBody Map params) { + String url = params.get("url"); + List list = sopService.getFunctionButtonsByUrl(url); + return R.ok().put("rows", list); + } + + @PostMapping("/errorDetail/save") + public R saveErrorDetail(@RequestBody SopErrorDetail detail) { + sopService.saveErrorDetail(detail, getCurrentUser()); + return R.ok(); + } + + @PostMapping("/errorDetail/update") + public R updateErrorDetail(@RequestBody SopErrorDetail detail) { + sopService.updateErrorDetail(detail, getCurrentUser()); + return R.ok(); + } + + @PostMapping("/errorDetail/delete") + public R deleteErrorDetail(@RequestBody Map params) { + String url = (String) params.get("url"); + String functionButton = (String) params.get("functionButton"); + Integer seqNo = (Integer) params.get("seqNo"); + sopService.deleteErrorDetail(url, functionButton, seqNo, getCurrentUser()); + return R.ok(); + } +} diff --git a/src/main/java/com/gaotao/modules/sys/dao/SopErrorDetailDao.java b/src/main/java/com/gaotao/modules/sys/dao/SopErrorDetailDao.java new file mode 100644 index 0000000..6a8d05f --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/dao/SopErrorDetailDao.java @@ -0,0 +1,55 @@ +package com.gaotao.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gaotao.modules.sys.entity.SopErrorDetail; +import com.gaotao.modules.sys.entity.SopErrorDetailData; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * SOP错误详情Mapper + * + * @author rqrq + */ +@Mapper +public interface SopErrorDetailDao extends BaseMapper { + + /** + * 查询错误详情列表 - rqrq + */ + List getErrorDetailList(@Param("data") SopErrorDetailData data); + + /** + * 查询错误详情总数 - rqrq + */ + int getErrorDetailCount(@Param("data") SopErrorDetailData data); + + /** + * 根据URL查询错误详情 - rqrq + */ + List getErrorDetailByUrl(@Param("url") String url); + + /** + * 根据主键查询 - rqrq + */ + SopErrorDetail getByPrimaryKey(@Param("url") String url, + @Param("functionButton") String functionButton, + @Param("seqNo") Integer seqNo); + + /** + * 获取某按钮的最大序号 - rqrq + */ + Integer getMaxSeqNo(@Param("url") String url, @Param("functionButton") String functionButton); + + /** + * 更新错误详情 - rqrq + */ + int updateErrorDetail(@Param("data") SopErrorDetail data); + + /** + * 根据URL获取按钮列表(去重)- rqrq + */ + List getFunctionButtonsByUrl(@Param("url") String url); +} diff --git a/src/main/java/com/gaotao/modules/sys/dao/SopUrlConfigDao.java b/src/main/java/com/gaotao/modules/sys/dao/SopUrlConfigDao.java new file mode 100644 index 0000000..a363380 --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/dao/SopUrlConfigDao.java @@ -0,0 +1,38 @@ +package com.gaotao.modules.sys.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gaotao.modules.sys.entity.SopUrlConfig; +import com.gaotao.modules.sys.entity.SopUrlConfigData; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * SOP URL配置Mapper - rqrq + */ +@Mapper +public interface SopUrlConfigDao extends BaseMapper { + + List getUrlConfigList(@Param("data") SopUrlConfigData data); + + int getUrlConfigCount(@Param("data") SopUrlConfigData data); + + SopUrlConfig getByUrl(@Param("url") String url); + + List getActiveUrlList(); + + /** + * 获取平台列表(PC/PDA)- rqrq + */ + List getPlatformList(); + + /** + * 根据平台获取模块列表 - rqrq + */ + List getModuleListByPlatform(@Param("platform") String platform); + + /** + * 根据平台和模块获取功能页面列表 - rqrq + */ + List getPageListByPlatformAndModule(@Param("platform") String platform, @Param("moduleName") String moduleName); +} diff --git a/src/main/java/com/gaotao/modules/sys/entity/SopErrorDetail.java b/src/main/java/com/gaotao/modules/sys/entity/SopErrorDetail.java new file mode 100644 index 0000000..25fb304 --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/entity/SopErrorDetail.java @@ -0,0 +1,105 @@ +package com.gaotao.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * SOP错误详情表 + * 表名: sop_error_detail + * 主键: url + function_button + seq_no (联合主键) + * 用途: 存储各页面按钮的错误信息及处理方式 + * + * @author rqrq + */ +@Data +@TableName("sop_error_detail") +public class SopErrorDetail implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * URL路径,关联sop_url_config + */ + @TableField("url") + private String url; + + /** + * 功能/按钮名称 + */ + @TableField("function_button") + private String functionButton; + + /** + * 序号(同一按钮可能有多个错误) + */ + @TableField("seq_no") + private Integer seqNo; + + /** + * 错误信息 + */ + @TableField("error_message") + private String errorMessage; + + /** + * 错误类型:FRONTEND/BACKEND + */ + @TableField("error_type") + private String errorType; + + /** + * 错误来源(文件路径或类名) + */ + @TableField("error_source") + private String errorSource; + + /** + * 默认处理方式 + */ + @TableField("default_solution") + private String defaultSolution; + + /** + * 用户补充处理方式 + */ + @TableField("user_solution") + private String userSolution; + + /** + * 是否启用:Y/N + */ + @TableField("is_active") + private String isActive; + + /** + * 备注 + */ + @TableField("remark") + private String remark; + + /** + * 创建人 + */ + @TableField(value = "created_by", fill = FieldFill.INSERT) + private String createdBy; + + /** + * 创建时间 + */ + @TableField(value = "created_time", fill = FieldFill.INSERT) + private Date createdTime; + + /** + * 更新人 + */ + @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + + /** + * 更新时间 + */ + @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; +} diff --git a/src/main/java/com/gaotao/modules/sys/entity/SopErrorDetailData.java b/src/main/java/com/gaotao/modules/sys/entity/SopErrorDetailData.java new file mode 100644 index 0000000..47701d1 --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/entity/SopErrorDetailData.java @@ -0,0 +1,65 @@ +package com.gaotao.modules.sys.entity; + +import org.apache.ibatis.type.Alias; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * SOP错误详情业务实体类 + * 继承: SopErrorDetail + * 用途: 用于查询条件和分页 + * + * @author rqrq + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Alias("SopErrorDetailData") +public class SopErrorDetailData extends SopErrorDetail { + private static final long serialVersionUID = 1L; + + // ========== 分页参数 ========== + /** + * 当前页码 + */ + private Integer page; + + /** + * 每页条数 + */ + private Integer limit; + + // ========== 查询条件 ========== + /** + * 功能/按钮名称模糊查询 + * SQL: AND function_button LIKE '%' + #{searchFunctionButton} + '%' + */ + private String searchFunctionButton; + + /** + * 错误信息模糊查询 + * SQL: AND error_message LIKE '%' + #{searchErrorMessage} + '%' + */ + private String searchErrorMessage; + + /** + * 错误类型查询 + * SQL: AND error_type = #{searchErrorType} + */ + private String searchErrorType; + + // ========== 关联字段(非数据库字段)========== + /** + * 平台类型(来自sop_url_config):PC/PDA + */ + private String platform; + + /** + * 模块名称(来自sop_url_config) + */ + private String moduleName; + + /** + * 页面名称(来自sop_url_config) + */ + private String pageName; +} diff --git a/src/main/java/com/gaotao/modules/sys/entity/SopUrlConfig.java b/src/main/java/com/gaotao/modules/sys/entity/SopUrlConfig.java new file mode 100644 index 0000000..1a74be2 --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/entity/SopUrlConfig.java @@ -0,0 +1,52 @@ +package com.gaotao.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import java.io.Serializable; +import java.util.Date; + +/** + * SOP URL配置表 - rqrq + */ +@Data +@TableName("sop_url_config") +public class SopUrlConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.INPUT) + @TableField("url") + private String url; + + /** + * 平台类型:PC/PDA + */ + @TableField("platform") + private String platform; + + @TableField("module_name") + private String moduleName; + + @TableField("page_name") + private String pageName; + + @TableField("menu_id") + private String menuId; + + @TableField("is_active") + private String isActive; + + @TableField("remark") + private String remark; + + @TableField(value = "created_by", fill = FieldFill.INSERT) + private String createdBy; + + @TableField(value = "created_time", fill = FieldFill.INSERT) + private Date createdTime; + + @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + + @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; +} diff --git a/src/main/java/com/gaotao/modules/sys/entity/SopUrlConfigData.java b/src/main/java/com/gaotao/modules/sys/entity/SopUrlConfigData.java new file mode 100644 index 0000000..46c7cae --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/entity/SopUrlConfigData.java @@ -0,0 +1,55 @@ +package com.gaotao.modules.sys.entity; + +import org.apache.ibatis.type.Alias; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * SOP URL配置业务实体类 + * 继承: SopUrlConfig + * 用途: 用于查询条件和分页 + * + * @author rqrq + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Alias("SopUrlConfigData") +public class SopUrlConfigData extends SopUrlConfig { + private static final long serialVersionUID = 1L; + + // ========== 分页参数 ========== + /** + * 当前页码 + */ + private Integer page; + + /** + * 每页条数 + */ + private Integer limit; + + // ========== 查询条件 ========== + /** + * 平台类型查询 + * SQL: AND platform = #{searchPlatform} + */ + private String searchPlatform; + + /** + * 模块名称模糊查询 + * SQL: AND module_name LIKE '%' + #{searchModuleName} + '%' + */ + private String searchModuleName; + + /** + * 页面名称模糊查询 + * SQL: AND page_name LIKE '%' + #{searchPageName} + '%' + */ + private String searchPageName; + + /** + * URL模糊查询 + * SQL: AND url LIKE '%' + #{searchUrl} + '%' + */ + private String searchUrl; +} diff --git a/src/main/java/com/gaotao/modules/sys/service/SopService.java b/src/main/java/com/gaotao/modules/sys/service/SopService.java new file mode 100644 index 0000000..4ea2538 --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/service/SopService.java @@ -0,0 +1,48 @@ +package com.gaotao.modules.sys.service; + +import com.gaotao.modules.sys.entity.*; +import java.util.List; +import java.util.Map; + +/** + * SOP标准操作流程Service接口 - rqrq + */ +public interface SopService { + + Map getUrlConfigList(SopUrlConfigData data); + + List getActiveUrlList(); + + /** + * 获取平台列表(PC/PDA)- rqrq + */ + List getPlatformList(); + + /** + * 根据平台获取模块列表 - rqrq + */ + List getModuleListByPlatform(String platform); + + /** + * 根据平台和模块获取功能页面列表 - rqrq + */ + List getPageListByPlatformAndModule(String platform, String moduleName); + + SopUrlConfig getUrlConfigByUrl(String url); + + void saveUrlConfig(SopUrlConfig config, String operator); + + void deleteUrlConfig(String url, String operator); + + Map getErrorDetailList(SopErrorDetailData data); + + List getErrorDetailByUrl(String url); + + List getFunctionButtonsByUrl(String url); + + void saveErrorDetail(SopErrorDetail detail, String operator); + + void updateErrorDetail(SopErrorDetail detail, String operator); + + void deleteErrorDetail(String url, String functionButton, Integer seqNo, String operator); +} diff --git a/src/main/java/com/gaotao/modules/sys/service/impl/SopServiceImpl.java b/src/main/java/com/gaotao/modules/sys/service/impl/SopServiceImpl.java new file mode 100644 index 0000000..a9b908f --- /dev/null +++ b/src/main/java/com/gaotao/modules/sys/service/impl/SopServiceImpl.java @@ -0,0 +1,169 @@ +package com.gaotao.modules.sys.service.impl; + +import com.gaotao.modules.sys.dao.SopErrorDetailDao; +import com.gaotao.modules.sys.dao.SopUrlConfigDao; +import com.gaotao.modules.sys.entity.*; +import com.gaotao.modules.sys.service.SopService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * SOP标准操作流程Service实现 - rqrq + */ +@Service("sopService") +public class SopServiceImpl implements SopService { + + @Autowired + private SopUrlConfigDao sopUrlConfigDao; + + @Autowired + private SopErrorDetailDao sopErrorDetailDao; + + @Override + public Map getUrlConfigList(SopUrlConfigData data) { + System.out.println("========== SopService.getUrlConfigList 开始 =========="); + if (data.getPage() == null) data.setPage(1); + if (data.getLimit() == null) data.setLimit(20); + List list = sopUrlConfigDao.getUrlConfigList(data); + int total = sopUrlConfigDao.getUrlConfigCount(data); + Map result = new HashMap<>(); + result.put("list", list); + result.put("total", total); + System.out.println("========== SopService.getUrlConfigList 结束,共" + total + "条 =========="); + return result; + } + + @Override + public List getActiveUrlList() { + System.out.println("========== SopService.getActiveUrlList 开始 =========="); + List list = sopUrlConfigDao.getActiveUrlList(); + System.out.println("========== SopService.getActiveUrlList 结束 =========="); + return list; + } + + @Override + public List getPlatformList() { + System.out.println("========== SopService.getPlatformList 开始 =========="); + List list = sopUrlConfigDao.getPlatformList(); + System.out.println("========== SopService.getPlatformList 结束 =========="); + return list; + } + + @Override + public List getModuleListByPlatform(String platform) { + System.out.println("========== SopService.getModuleListByPlatform 开始 =========="); + List list = sopUrlConfigDao.getModuleListByPlatform(platform); + System.out.println("========== SopService.getModuleListByPlatform 结束 =========="); + return list; + } + + @Override + public List getPageListByPlatformAndModule(String platform, String moduleName) { + System.out.println("========== SopService.getPageListByPlatformAndModule 开始 =========="); + List list = sopUrlConfigDao.getPageListByPlatformAndModule(platform, moduleName); + System.out.println("========== SopService.getPageListByPlatformAndModule 结束 =========="); + return list; + } + + @Override + public SopUrlConfig getUrlConfigByUrl(String url) { + return sopUrlConfigDao.getByUrl(url); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveUrlConfig(SopUrlConfig config, String operator) { + System.out.println("========== SopService.saveUrlConfig 开始 =========="); + SopUrlConfig existing = sopUrlConfigDao.getByUrl(config.getUrl()); + if (existing != null) { + config.setUpdatedBy(operator); + config.setUpdatedTime(new Date()); + sopUrlConfigDao.updateById(config); + } else { + config.setCreatedBy(operator); + config.setCreatedTime(new Date()); + config.setIsActive("Y"); + sopUrlConfigDao.insert(config); + } + System.out.println("========== SopService.saveUrlConfig 结束 =========="); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteUrlConfig(String url, String operator) { + System.out.println("========== SopService.deleteUrlConfig 开始 =========="); + SopUrlConfig config = sopUrlConfigDao.getByUrl(url); + if (config != null) { + config.setIsActive("N"); + config.setUpdatedBy(operator); + config.setUpdatedTime(new Date()); + sopUrlConfigDao.updateById(config); + } + System.out.println("========== SopService.deleteUrlConfig 结束 =========="); + } + + @Override + public Map getErrorDetailList(SopErrorDetailData data) { + System.out.println("========== SopService.getErrorDetailList 开始 =========="); + if (data.getPage() == null) data.setPage(1); + if (data.getLimit() == null) data.setLimit(20); + List list = sopErrorDetailDao.getErrorDetailList(data); + int total = sopErrorDetailDao.getErrorDetailCount(data); + Map result = new HashMap<>(); + result.put("list", list); + result.put("total", total); + System.out.println("========== SopService.getErrorDetailList 结束 =========="); + return result; + } + + @Override + public List getErrorDetailByUrl(String url) { + return sopErrorDetailDao.getErrorDetailByUrl(url); + } + + @Override + public List getFunctionButtonsByUrl(String url) { + return sopErrorDetailDao.getFunctionButtonsByUrl(url); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveErrorDetail(SopErrorDetail detail, String operator) { + System.out.println("========== SopService.saveErrorDetail 开始 =========="); + Integer maxSeqNo = sopErrorDetailDao.getMaxSeqNo(detail.getUrl(), detail.getFunctionButton()); + detail.setSeqNo(maxSeqNo + 1); + detail.setCreatedBy(operator); + detail.setCreatedTime(new Date()); + detail.setIsActive("Y"); + sopErrorDetailDao.insert(detail); + System.out.println("========== SopService.saveErrorDetail 结束 =========="); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateErrorDetail(SopErrorDetail detail, String operator) { + System.out.println("========== SopService.updateErrorDetail 开始 =========="); + detail.setUpdatedBy(operator); + detail.setUpdatedTime(new Date()); + sopErrorDetailDao.updateErrorDetail(detail); + System.out.println("========== SopService.updateErrorDetail 结束 =========="); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteErrorDetail(String url, String functionButton, Integer seqNo, String operator) { + System.out.println("========== SopService.deleteErrorDetail 开始 =========="); + SopErrorDetail detail = sopErrorDetailDao.getByPrimaryKey(url, functionButton, seqNo); + if (detail != null) { + detail.setIsActive("N"); + detail.setUpdatedBy(operator); + sopErrorDetailDao.updateErrorDetail(detail); + } + System.out.println("========== SopService.deleteErrorDetail 结束 =========="); + } +} diff --git a/src/main/resources/mapper/sys/SopErrorDetailDao.xml b/src/main/resources/mapper/sys/SopErrorDetailDao.xml new file mode 100644 index 0000000..1c616d3 --- /dev/null +++ b/src/main/resources/mapper/sys/SopErrorDetailDao.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + UPDATE sop_error_detail + SET error_message = #{data.errorMessage}, + error_type = #{data.errorType}, + error_source = #{data.errorSource}, + default_solution = #{data.defaultSolution}, + user_solution = #{data.userSolution}, + is_active = #{data.isActive}, + remark = #{data.remark}, + updated_by = #{data.updatedBy}, + updated_time = GETDATE() + WHERE url = #{data.url} + AND function_button = #{data.functionButton} + AND seq_no = #{data.seqNo} + + + + + + diff --git a/src/main/resources/mapper/sys/SopUrlConfigDao.xml b/src/main/resources/mapper/sys/SopUrlConfigDao.xml new file mode 100644 index 0000000..1f1aaeb --- /dev/null +++ b/src/main/resources/mapper/sys/SopUrlConfigDao.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +