Browse Source
feat(sys): 新增SOP标准操作流程管理功能
feat(sys): 新增SOP标准操作流程管理功能
- 创建SopController提供URL配置和错误详情的CRUD接口 - 实现SopService接口定义标准操作流程相关业务方法 - 添加SopUrlConfig和SopErrorDetail实体类及数据访问层 - 配置MyBatis映射文件支持URL配置和错误详情的数据库操作 - 实现SopServiceImpl完成URL配置、错误详情的增删改查逻辑 - 在WmsMessageServiceImpl中禁用不准确的立库回传任务状态更新master
12 changed files with 913 additions and 1 deletions
-
2src/main/java/com/gaotao/modules/api/service/impl/WmsMessageServiceImpl.java
-
132src/main/java/com/gaotao/modules/sys/controller/SopController.java
-
55src/main/java/com/gaotao/modules/sys/dao/SopErrorDetailDao.java
-
38src/main/java/com/gaotao/modules/sys/dao/SopUrlConfigDao.java
-
105src/main/java/com/gaotao/modules/sys/entity/SopErrorDetail.java
-
65src/main/java/com/gaotao/modules/sys/entity/SopErrorDetailData.java
-
52src/main/java/com/gaotao/modules/sys/entity/SopUrlConfig.java
-
55src/main/java/com/gaotao/modules/sys/entity/SopUrlConfigData.java
-
48src/main/java/com/gaotao/modules/sys/service/SopService.java
-
169src/main/java/com/gaotao/modules/sys/service/impl/SopServiceImpl.java
-
117src/main/resources/mapper/sys/SopErrorDetailDao.xml
-
76src/main/resources/mapper/sys/SopUrlConfigDao.xml
@ -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<String, Object> result = sopService.getUrlConfigList(data); |
|||
return R.ok().put("rows", result.get("list")).put("total", result.get("total")); |
|||
} |
|||
|
|||
@PostMapping("/urlConfig/activeList") |
|||
public R getActiveUrlList() { |
|||
List<SopUrlConfig> list = sopService.getActiveUrlList(); |
|||
return R.ok().put("rows", list); |
|||
} |
|||
|
|||
/** |
|||
* 获取平台列表(PC/PDA)- rqrq |
|||
*/ |
|||
@PostMapping("/urlConfig/platformList") |
|||
public R getPlatformList() { |
|||
List<String> list = sopService.getPlatformList(); |
|||
return R.ok().put("rows", list); |
|||
} |
|||
|
|||
/** |
|||
* 根据平台获取模块列表 - rqrq |
|||
*/ |
|||
@PostMapping("/urlConfig/moduleList") |
|||
public R getModuleListByPlatform(@RequestBody Map<String, String> params) { |
|||
String platform = params.get("platform"); |
|||
List<String> list = sopService.getModuleListByPlatform(platform); |
|||
return R.ok().put("rows", list); |
|||
} |
|||
|
|||
/** |
|||
* 根据平台和模块获取功能页面列表 - rqrq |
|||
*/ |
|||
@PostMapping("/urlConfig/pageList") |
|||
public R getPageListByPlatformAndModule(@RequestBody Map<String, String> params) { |
|||
String platform = params.get("platform"); |
|||
String moduleName = params.get("moduleName"); |
|||
List<SopUrlConfig> list = sopService.getPageListByPlatformAndModule(platform, moduleName); |
|||
return R.ok().put("rows", list); |
|||
} |
|||
|
|||
@PostMapping("/urlConfig/getByUrl") |
|||
public R getUrlConfigByUrl(@RequestBody Map<String, String> 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<String, String> params) { |
|||
String url = params.get("url"); |
|||
sopService.deleteUrlConfig(url, getCurrentUser()); |
|||
return R.ok(); |
|||
} |
|||
|
|||
@PostMapping("/errorDetail/list") |
|||
public R getErrorDetailList(@RequestBody SopErrorDetailData data) { |
|||
Map<String, Object> 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<String, String> params) { |
|||
String url = params.get("url"); |
|||
List<SopErrorDetailData> list = sopService.getErrorDetailByUrl(url); |
|||
return R.ok().put("rows", list); |
|||
} |
|||
|
|||
@PostMapping("/errorDetail/getFunctionButtons") |
|||
public R getFunctionButtonsByUrl(@RequestBody Map<String, String> params) { |
|||
String url = params.get("url"); |
|||
List<String> 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<String, Object> 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(); |
|||
} |
|||
} |
|||
@ -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<SopErrorDetail> { |
|||
|
|||
/** |
|||
* 查询错误详情列表 - rqrq |
|||
*/ |
|||
List<SopErrorDetailData> getErrorDetailList(@Param("data") SopErrorDetailData data); |
|||
|
|||
/** |
|||
* 查询错误详情总数 - rqrq |
|||
*/ |
|||
int getErrorDetailCount(@Param("data") SopErrorDetailData data); |
|||
|
|||
/** |
|||
* 根据URL查询错误详情 - rqrq |
|||
*/ |
|||
List<SopErrorDetailData> 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<String> getFunctionButtonsByUrl(@Param("url") String url); |
|||
} |
|||
@ -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<SopUrlConfig> { |
|||
|
|||
List<SopUrlConfigData> getUrlConfigList(@Param("data") SopUrlConfigData data); |
|||
|
|||
int getUrlConfigCount(@Param("data") SopUrlConfigData data); |
|||
|
|||
SopUrlConfig getByUrl(@Param("url") String url); |
|||
|
|||
List<SopUrlConfig> getActiveUrlList(); |
|||
|
|||
/** |
|||
* 获取平台列表(PC/PDA)- rqrq |
|||
*/ |
|||
List<String> getPlatformList(); |
|||
|
|||
/** |
|||
* 根据平台获取模块列表 - rqrq |
|||
*/ |
|||
List<String> getModuleListByPlatform(@Param("platform") String platform); |
|||
|
|||
/** |
|||
* 根据平台和模块获取功能页面列表 - rqrq |
|||
*/ |
|||
List<SopUrlConfig> getPageListByPlatformAndModule(@Param("platform") String platform, @Param("moduleName") String moduleName); |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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; |
|||
} |
|||
@ -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<String, Object> getUrlConfigList(SopUrlConfigData data); |
|||
|
|||
List<SopUrlConfig> getActiveUrlList(); |
|||
|
|||
/** |
|||
* 获取平台列表(PC/PDA)- rqrq |
|||
*/ |
|||
List<String> getPlatformList(); |
|||
|
|||
/** |
|||
* 根据平台获取模块列表 - rqrq |
|||
*/ |
|||
List<String> getModuleListByPlatform(String platform); |
|||
|
|||
/** |
|||
* 根据平台和模块获取功能页面列表 - rqrq |
|||
*/ |
|||
List<SopUrlConfig> getPageListByPlatformAndModule(String platform, String moduleName); |
|||
|
|||
SopUrlConfig getUrlConfigByUrl(String url); |
|||
|
|||
void saveUrlConfig(SopUrlConfig config, String operator); |
|||
|
|||
void deleteUrlConfig(String url, String operator); |
|||
|
|||
Map<String, Object> getErrorDetailList(SopErrorDetailData data); |
|||
|
|||
List<SopErrorDetailData> getErrorDetailByUrl(String url); |
|||
|
|||
List<String> 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); |
|||
} |
|||
@ -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<String, Object> getUrlConfigList(SopUrlConfigData data) { |
|||
System.out.println("========== SopService.getUrlConfigList 开始 =========="); |
|||
if (data.getPage() == null) data.setPage(1); |
|||
if (data.getLimit() == null) data.setLimit(20); |
|||
List<SopUrlConfigData> list = sopUrlConfigDao.getUrlConfigList(data); |
|||
int total = sopUrlConfigDao.getUrlConfigCount(data); |
|||
Map<String, Object> result = new HashMap<>(); |
|||
result.put("list", list); |
|||
result.put("total", total); |
|||
System.out.println("========== SopService.getUrlConfigList 结束,共" + total + "条 =========="); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public List<SopUrlConfig> getActiveUrlList() { |
|||
System.out.println("========== SopService.getActiveUrlList 开始 =========="); |
|||
List<SopUrlConfig> list = sopUrlConfigDao.getActiveUrlList(); |
|||
System.out.println("========== SopService.getActiveUrlList 结束 =========="); |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public List<String> getPlatformList() { |
|||
System.out.println("========== SopService.getPlatformList 开始 =========="); |
|||
List<String> list = sopUrlConfigDao.getPlatformList(); |
|||
System.out.println("========== SopService.getPlatformList 结束 =========="); |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public List<String> getModuleListByPlatform(String platform) { |
|||
System.out.println("========== SopService.getModuleListByPlatform 开始 =========="); |
|||
List<String> list = sopUrlConfigDao.getModuleListByPlatform(platform); |
|||
System.out.println("========== SopService.getModuleListByPlatform 结束 =========="); |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public List<SopUrlConfig> getPageListByPlatformAndModule(String platform, String moduleName) { |
|||
System.out.println("========== SopService.getPageListByPlatformAndModule 开始 =========="); |
|||
List<SopUrlConfig> 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<String, Object> getErrorDetailList(SopErrorDetailData data) { |
|||
System.out.println("========== SopService.getErrorDetailList 开始 =========="); |
|||
if (data.getPage() == null) data.setPage(1); |
|||
if (data.getLimit() == null) data.setLimit(20); |
|||
List<SopErrorDetailData> list = sopErrorDetailDao.getErrorDetailList(data); |
|||
int total = sopErrorDetailDao.getErrorDetailCount(data); |
|||
Map<String, Object> result = new HashMap<>(); |
|||
result.put("list", list); |
|||
result.put("total", total); |
|||
System.out.println("========== SopService.getErrorDetailList 结束 =========="); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public List<SopErrorDetailData> getErrorDetailByUrl(String url) { |
|||
return sopErrorDetailDao.getErrorDetailByUrl(url); |
|||
} |
|||
|
|||
@Override |
|||
public List<String> 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 结束 =========="); |
|||
} |
|||
} |
|||
@ -0,0 +1,117 @@ |
|||
<?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.gaotao.modules.sys.dao.SopErrorDetailDao"> |
|||
|
|||
<!-- rqrq - 查询错误详情列表 --> |
|||
<select id="getErrorDetailList" resultType="SopErrorDetailData"> |
|||
SELECT d.url, d.function_button AS functionButton, d.seq_no AS seqNo, |
|||
d.error_message AS errorMessage, d.error_type AS errorType, |
|||
d.error_source AS errorSource, d.default_solution AS defaultSolution, |
|||
d.user_solution AS userSolution, d.is_active AS isActive, d.remark, |
|||
d.created_by AS createdBy, d.created_time AS createdTime, |
|||
d.updated_by AS updatedBy, d.updated_time AS updatedTime, |
|||
c.platform, c.module_name AS moduleName, c.page_name AS pageName |
|||
FROM sop_error_detail d |
|||
LEFT JOIN sop_url_config c ON d.url = c.url |
|||
WHERE d.is_active = 'Y' |
|||
<if test="data.url != null and data.url != ''"> |
|||
AND d.url = #{data.url} |
|||
</if> |
|||
<if test="data.functionButton != null and data.functionButton != ''"> |
|||
AND d.function_button = #{data.functionButton} |
|||
</if> |
|||
<if test="data.searchFunctionButton != null and data.searchFunctionButton != ''"> |
|||
AND d.function_button LIKE '%' + #{data.searchFunctionButton} + '%' |
|||
</if> |
|||
<if test="data.searchErrorMessage != null and data.searchErrorMessage != ''"> |
|||
AND d.error_message LIKE '%' + #{data.searchErrorMessage} + '%' |
|||
</if> |
|||
<if test="data.searchErrorType != null and data.searchErrorType != ''"> |
|||
AND d.error_type = #{data.searchErrorType} |
|||
</if> |
|||
ORDER BY d.url, d.function_button, d.seq_no |
|||
OFFSET (#{data.page} - 1) * #{data.limit} ROWS |
|||
FETCH NEXT #{data.limit} ROWS ONLY |
|||
</select> |
|||
|
|||
<!-- rqrq - 查询错误详情总数 --> |
|||
<select id="getErrorDetailCount" resultType="int"> |
|||
SELECT COUNT(1) |
|||
FROM sop_error_detail d |
|||
WHERE d.is_active = 'Y' |
|||
<if test="data.url != null and data.url != ''"> |
|||
AND d.url = #{data.url} |
|||
</if> |
|||
<if test="data.functionButton != null and data.functionButton != ''"> |
|||
AND d.function_button = #{data.functionButton} |
|||
</if> |
|||
<if test="data.searchFunctionButton != null and data.searchFunctionButton != ''"> |
|||
AND d.function_button LIKE '%' + #{data.searchFunctionButton} + '%' |
|||
</if> |
|||
<if test="data.searchErrorMessage != null and data.searchErrorMessage != ''"> |
|||
AND d.error_message LIKE '%' + #{data.searchErrorMessage} + '%' |
|||
</if> |
|||
<if test="data.searchErrorType != null and data.searchErrorType != ''"> |
|||
AND d.error_type = #{data.searchErrorType} |
|||
</if> |
|||
</select> |
|||
|
|||
<!-- rqrq - 根据URL查询错误详情 --> |
|||
<select id="getErrorDetailByUrl" resultType="SopErrorDetailData"> |
|||
SELECT d.url, d.function_button AS functionButton, d.seq_no AS seqNo, |
|||
d.error_message AS errorMessage, d.error_type AS errorType, |
|||
d.error_source AS errorSource, d.default_solution AS defaultSolution, |
|||
d.user_solution AS userSolution, d.is_active AS isActive, d.remark, |
|||
c.platform, c.module_name AS moduleName, c.page_name AS pageName |
|||
FROM sop_error_detail d |
|||
LEFT JOIN sop_url_config c ON d.url = c.url |
|||
WHERE d.is_active = 'Y' AND d.url = #{url} |
|||
ORDER BY d.function_button, d.seq_no |
|||
</select> |
|||
|
|||
<!-- rqrq - 根据主键查询 --> |
|||
<select id="getByPrimaryKey" resultType="com.gaotao.modules.sys.entity.SopErrorDetail"> |
|||
SELECT url, function_button AS functionButton, seq_no AS seqNo, |
|||
error_message AS errorMessage, error_type AS errorType, |
|||
error_source AS errorSource, default_solution AS defaultSolution, |
|||
user_solution AS userSolution, is_active AS isActive, remark, |
|||
created_by AS createdBy, created_time AS createdTime, |
|||
updated_by AS updatedBy, updated_time AS updatedTime |
|||
FROM sop_error_detail |
|||
WHERE url = #{url} AND function_button = #{functionButton} AND seq_no = #{seqNo} |
|||
</select> |
|||
|
|||
<!-- rqrq - 获取某按钮的最大序号 --> |
|||
<select id="getMaxSeqNo" resultType="java.lang.Integer"> |
|||
SELECT ISNULL(MAX(seq_no), 0) |
|||
FROM sop_error_detail |
|||
WHERE url = #{url} AND function_button = #{functionButton} |
|||
</select> |
|||
|
|||
<!-- rqrq - 更新错误详情 --> |
|||
<update id="updateErrorDetail"> |
|||
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} |
|||
</update> |
|||
|
|||
<!-- rqrq - 根据URL获取按钮列表 --> |
|||
<select id="getFunctionButtonsByUrl" resultType="java.lang.String"> |
|||
SELECT DISTINCT function_button |
|||
FROM sop_error_detail |
|||
WHERE url = #{url} AND is_active = 'Y' |
|||
ORDER BY function_button |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,76 @@ |
|||
<?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.gaotao.modules.sys.dao.SopUrlConfigDao"> |
|||
|
|||
<!-- rqrq - 查询URL配置列表 --> |
|||
<select id="getUrlConfigList" resultType="SopUrlConfigData"> |
|||
SELECT url, platform, module_name AS moduleName, page_name AS pageName, |
|||
menu_id AS menuId, is_active AS isActive, remark, |
|||
created_by AS createdBy, created_time AS createdTime, |
|||
updated_by AS updatedBy, updated_time AS updatedTime |
|||
FROM sop_url_config |
|||
WHERE is_active = 'Y' |
|||
<if test="data.searchPlatform != null and data.searchPlatform != ''"> |
|||
AND platform = #{data.searchPlatform} |
|||
</if> |
|||
<if test="data.searchUrl != null and data.searchUrl != ''"> |
|||
AND url LIKE '%' + #{data.searchUrl} + '%' |
|||
</if> |
|||
<if test="data.searchModuleName != null and data.searchModuleName != ''"> |
|||
AND module_name LIKE '%' + #{data.searchModuleName} + '%' |
|||
</if> |
|||
ORDER BY platform, module_name, page_name |
|||
OFFSET (#{data.page} - 1) * #{data.limit} ROWS |
|||
FETCH NEXT #{data.limit} ROWS ONLY |
|||
</select> |
|||
|
|||
<!-- rqrq - 查询URL配置总数 --> |
|||
<select id="getUrlConfigCount" resultType="int"> |
|||
SELECT COUNT(1) FROM sop_url_config WHERE is_active = 'Y' |
|||
<if test="data.searchPlatform != null and data.searchPlatform != ''"> |
|||
AND platform = #{data.searchPlatform} |
|||
</if> |
|||
<if test="data.searchUrl != null and data.searchUrl != ''"> |
|||
AND url LIKE '%' + #{data.searchUrl} + '%' |
|||
</if> |
|||
<if test="data.searchModuleName != null and data.searchModuleName != ''"> |
|||
AND module_name LIKE '%' + #{data.searchModuleName} + '%' |
|||
</if> |
|||
</select> |
|||
|
|||
<!-- rqrq - 根据URL查询配置 --> |
|||
<select id="getByUrl" resultType="com.gaotao.modules.sys.entity.SopUrlConfig"> |
|||
SELECT url, platform, module_name AS moduleName, page_name AS pageName, |
|||
menu_id AS menuId, is_active AS isActive, remark, |
|||
created_by AS createdBy, created_time AS createdTime, |
|||
updated_by AS updatedBy, updated_time AS updatedTime |
|||
FROM sop_url_config WHERE url = #{url} |
|||
</select> |
|||
|
|||
<!-- rqrq - 查询所有启用的URL配置 --> |
|||
<select id="getActiveUrlList" resultType="com.gaotao.modules.sys.entity.SopUrlConfig"> |
|||
SELECT url, platform, module_name AS moduleName, page_name AS pageName, |
|||
menu_id AS menuId, is_active AS isActive |
|||
FROM sop_url_config WHERE is_active = 'Y' ORDER BY platform, module_name, page_name |
|||
</select> |
|||
|
|||
<!-- rqrq - 获取平台列表 --> |
|||
<select id="getPlatformList" resultType="java.lang.String"> |
|||
SELECT DISTINCT platform FROM sop_url_config WHERE is_active = 'Y' ORDER BY platform |
|||
</select> |
|||
|
|||
<!-- rqrq - 根据平台获取模块列表 --> |
|||
<select id="getModuleListByPlatform" resultType="java.lang.String"> |
|||
SELECT DISTINCT module_name FROM sop_url_config |
|||
WHERE is_active = 'Y' AND platform = #{platform} ORDER BY module_name |
|||
</select> |
|||
|
|||
<!-- rqrq - 根据平台和模块获取功能页面列表 --> |
|||
<select id="getPageListByPlatformAndModule" resultType="com.gaotao.modules.sys.entity.SopUrlConfig"> |
|||
SELECT url, platform, module_name AS moduleName, page_name AS pageName |
|||
FROM sop_url_config |
|||
WHERE is_active = 'Y' AND platform = #{platform} AND module_name = #{moduleName} |
|||
ORDER BY page_name |
|||
</select> |
|||
|
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue