Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | @ApiOperation(value = "æ·»å é¡¹ç®æ£éªåæ°") |
| | | @PostMapping("/addItemParameter") |
| | | public Result addItemParameterList(@RequestBody StructureItemParameter itemParameter) { |
| | | public Result addItemParameter(@RequestBody StructureItemParameter itemParameter) { |
| | | return Result.success(capacityScopeService.addItemParameter(itemParameter)); |
| | | } |
| | | |
| | |
| | | return Result.success(capacityScopeService.upItemParameter(itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åé¡¹ç®æ£éªåæ°å表") |
| | | @ApiOperation(value = "è·åæ£éªå¯¹è±¡") |
| | | @PostMapping("/selectTestObjectList") |
| | | public Result selectTestObjectList(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | |
| | | return Result.success(capacityScopeService.selectTestObjectList(page, pageTestObjectDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å é¡¹ç®æ£éªåæ°") |
| | | @ApiOperation(value = "æ·»å æ£éªå¯¹è±¡") |
| | | @PostMapping("/addTestObject") |
| | | public Result addTestObject(@RequestBody StructureTestObject testObject) { |
| | | return Result.success(capacityScopeService.addTestObject(testObject)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤é¡¹ç®æ£éªåæ°") |
| | | @ApiOperation(value = "å 餿£éªå¯¹è±¡") |
| | | @PostMapping("/delTestObject") |
| | | public Result<?> delTestObject(Integer id) { |
| | | return Result.success(capacityScopeService.delTestObject(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹é¡¹ç®æ£éªåæ°") |
| | | @ApiOperation(value = "ä¿®æ¹æ£éªå¯¹è±¡") |
| | | @PostMapping("/upTestObject") |
| | | public Result upTestObject(@RequestBody StructureTestObject testObject) { |
| | | return Result.success(capacityScopeService.upTestObject(testObject)); |
| | |
| | | public class PageTestObjectDto extends StructureTestObject { |
| | | @ValueTableShow(2) |
| | | @ApiModelProperty(value = "å建人") |
| | | private Integer createUserName; |
| | | private String createUserName; |
| | | |
| | | @ValueTableShow(4) |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private Integer updateUserName; |
| | | private String updateUserName; |
| | | } |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | |
| | | |
| | | @ValueTableShow(6) |
| | | @ApiModelProperty(value = "åä»·(å
)") |
| | | private Double price; |
| | | private BigDecimal price; |
| | | |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty(value = "å·¥æ¶(H)") |
| | |
| | | public Map<String, Object> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(PageTestObjectDto.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectItemParameterList"); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectTestObjectList"); |
| | | if(map1.get("look")==1) pageTestObjectDto.setCreateUser(map1.get("userId")); |
| | | map.put("body", structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto))); |
| | | return map; |
| | |
| | | |
| | | @Override |
| | | public int addTestObject(StructureTestObject testObject) { |
| | | System.out.println(testObject); |
| | | return structureTestObjectMapper.insert(testObject); |
| | | } |
| | | |
| | |
| | | <mapper namespace="com.yuanchu.mom.mapper.StructureTestObjectMapper"> |
| | | |
| | | <select id="selectTestObjectList" resultType="com.yuanchu.mom.dto.PageTestObjectDto"> |
| | | select * from ( |
| | | select sto.id, |
| | | sto.specimen_name, |
| | | u1.name createUserName, |
| | | sto.create_time, |
| | | u2.name updateUserName, |
| | | sto.update_time |
| | | sto.specimen_name, |
| | | u1.name create_user_name, |
| | | sto.create_time, |
| | | u2.name update_user_name, |
| | | sto.update_time |
| | | from structure_test_object sto |
| | | left join user u1 on sto.create_user = u1.id |
| | | left join user u2 on sto.update_user = u2.id |
| | | left join user u1 on sto.create_user = u1.id |
| | | left join user u2 on sto.update_user = u2.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.config; |
| | | |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.SystemLogMapper; |
| | | import com.yuanchu.mom.pojo.SystemLog; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * @Author æ´å |
| | | * @Date 2024/2/27 |
| | | */ |
| | | @Component |
| | | public class LogConfig implements HandlerInterceptor { |
| | | |
| | | @Resource |
| | | private SystemLogMapper systemLogMapper; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | |
| | | if (handler instanceof HandlerMethod) { |
| | | if (request.getRequestURL().toString().contains("/error") || |
| | | request.getRequestURL().toString().contains("/outPath") || |
| | | request.getRequestURL().toString().contains("/user/enter")) { |
| | | return HandlerInterceptor.super.preHandle(request, response, handler); |
| | | } |
| | | HandlerMethod h = (HandlerMethod)handler; |
| | | Method method = h.getMethod(); |
| | | ApiOperation annotation = method.getAnnotation(ApiOperation.class); |
| | | if (annotation == null) { |
| | | return HandlerInterceptor.super.preHandle(request, response, handler); |
| | | } |
| | | String value = annotation.value(); |
| | | if (value.contains("è·å")||value.contains("æ¥è¯¢")){ |
| | | return HandlerInterceptor.super.preHandle(request, response, handler); |
| | | } |
| | | SystemLog systemLog = new SystemLog(); |
| | | systemLog.setMethod(method.getName()); |
| | | systemLog.setMethodName(value); |
| | | systemLogMapper.insert(systemLog); |
| | | } |
| | | return HandlerInterceptor.super.preHandle(request, response, handler); |
| | | } |
| | | |
| | | @Override |
| | | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { |
| | | HandlerInterceptor.super.postHandle(request, response, handler, modelAndView); |
| | | } |
| | | |
| | | @Override |
| | | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
| | | HandlerInterceptor.super.afterCompletion(request, response, handler, ex); |
| | | } |
| | | } |
| | |
| | | @Resource |
| | | private PowerConfig powerConfig; |
| | | |
| | | @Resource |
| | | private LogConfig logConfig; |
| | | |
| | | @Value("${file.path}") |
| | | private String filePath; |
| | | |
| | |
| | | protected void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(fiferConfig).addPathPatterns("/**"); |
| | | registry.addInterceptor(powerConfig).addPathPatterns("/**"); |
| | | registry.addInterceptor(logConfig).addPathPatterns("/**"); |
| | | super.addInterceptors(registry); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.PageSystemLogDto; |
| | | import com.yuanchu.mom.pojo.SystemLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * ç³»ç»æ¥å¿(SystemLog)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-27 15:33:14 |
| | | */ |
| | | @Mapper |
| | | public interface SystemLogMapper extends BaseMapper<SystemLog> { |
| | | |
| | | IPage<PageSystemLogDto> selectSystemLogList(Page page, QueryWrapper<PageSystemLogDto> ew); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.yuanchu.mom.annotation.ValueTableShow; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author æ´å |
| | | * @Date 2024/2/27 |
| | | */ |
| | | @Data |
| | | public class PageSystemLogDto extends SystemLog { |
| | | |
| | | @ValueTableShow(3) |
| | | @ApiModelProperty(value = "å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.yuanchu.mom.annotation.ValueTableShow; |
| | | import com.yuanchu.mom.common.OrderBy; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * ç³»ç»æ¥å¿(SystemLog)表对象 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-27 15:33:14 |
| | | */ |
| | | @Data |
| | | public class SystemLog extends OrderBy implements Serializable { |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ValueTableShow(1) |
| | | @ApiModelProperty(value = "æ¹æ³") |
| | | private String method; |
| | | |
| | | @ValueTableShow(2) |
| | | @ApiModelProperty(value = "æ¹æ³æè¿°") |
| | | private String methodName; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ValueTableShow(4) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.yuanchu.mom.mapper.SystemLogMapper"> |
| | | <select id="selectSystemLogList" resultType="com.yuanchu.mom.pojo.PageSystemLogDto"> |
| | | select * from ( |
| | | select sl.id, |
| | | sl.method, |
| | | sl.method_name, |
| | | u.name create_user_name, |
| | | sl.create_time |
| | | from system_log sl |
| | | left join user u on sl.create_user = u.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.PageSystemLogDto; |
| | | import com.yuanchu.mom.service.SystemLogService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç³»ç»æ¥å¿(SystemLog)表æ§å¶å± |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-27 17:04:09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/systemLog") |
| | | @Api(tags = "ç³»ç»æ¥å¿") |
| | | @AllArgsConstructor |
| | | public class SystemLogController { |
| | | |
| | | private SystemLogService systemLogService; |
| | | |
| | | @ApiOperation(value = "è·åç³»ç»æ¥å¿å表") |
| | | @PostMapping("/selectSystemLogList") |
| | | public Result selectSystemLogList(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | PageSystemLogDto pageSystemLogDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), PageSystemLogDto.class); |
| | | return Result.success(systemLogService.selectSystemLogList(page, pageSystemLogDto)); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.PageSystemLogDto; |
| | | import com.yuanchu.mom.pojo.SystemLog; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç³»ç»æ¥å¿(SystemLog)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-27 17:04:09 |
| | | */ |
| | | public interface SystemLogService extends IService<SystemLog> { |
| | | |
| | | Map<String, Object> selectSystemLogList(Page page, PageSystemLogDto pageSystemLogDto); |
| | | } |
| | | |
ÎļþÃû´Ó user-server/src/main/java/com/yuanchu/mom/service/imp/PowerServiceImpl.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.mom.service.imp; |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
ÎļþÃû´Ó user-server/src/main/java/com/yuanchu/mom/service/imp/RoleServiceImp.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.mom.service.imp; |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.mapper.SystemLogMapper; |
| | | import com.yuanchu.mom.pojo.PageSystemLogDto; |
| | | import com.yuanchu.mom.pojo.SystemLog; |
| | | import com.yuanchu.mom.service.SystemLogService; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç³»ç»æ¥å¿(SystemLog)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-27 17:04:09 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class SystemLogServiceImpl extends ServiceImpl<SystemLogMapper, SystemLog> implements SystemLogService { |
| | | |
| | | private GetLook getLook; |
| | | |
| | | private SystemLogMapper systemLogMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectSystemLogList(Page page, PageSystemLogDto pageSystemLogDto) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(PageSystemLogDto.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectSystemLogList"); |
| | | if(map1.get("look")==1) pageSystemLogDto.setCreateUser(map1.get("userId")); |
| | | map.put("body", systemLogMapper.selectSystemLogList(page, QueryWrappers.queryWrappers(pageSystemLogDto))); |
| | | return map; |
| | | } |
| | | } |
| | | |
ÎļþÃû´Ó user-server/src/main/java/com/yuanchu/mom/service/imp/UserServiceImp.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.mom.service.imp; |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |