|
@@ -10,6 +10,7 @@ import com.github.zuihou.business.centralToolMagazine.entity.ToolManagement;
|
|
|
import com.github.zuihou.business.centralToolMagazine.service.ToolManagementService;
|
|
|
import com.github.zuihou.business.centralToolMagazine.dto.ToolManagementPageDTO;
|
|
|
import com.github.zuihou.business.centralToolMagazine.dto.ToolManagementSaveDTO;
|
|
|
+import com.github.zuihou.common.util.StringUtil;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
|
|
|
import com.github.zuihou.log.annotation.SysLog;
|
|
@@ -17,6 +18,9 @@ import com.github.zuihou.tenant.entity.Productionresource;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -38,6 +42,8 @@ import java.util.List;
|
|
|
@Api(value = "ToolManagement", tags = "刀库管理")
|
|
|
@SysLog(enabled = true)
|
|
|
public class ToolManagementController extends SuperCacheController<ToolManagementService, Long, ToolManagement, ToolManagementPageDTO, ToolManagementSaveDTO, ToolManagementUpdateDTO> {
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate redisTemplate;
|
|
|
|
|
|
@Override
|
|
|
public void query(PageParams<ToolManagementPageDTO> params, IPage<ToolManagement> page, Long defSize) {
|
|
@@ -98,4 +104,21 @@ public class ToolManagementController extends SuperCacheController<ToolManagemen
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @PostMapping("/setRule")
|
|
|
+ public R setRule(@RequestBody ToolManagement toolManagement) {
|
|
|
+ if(StringUtil.isNotEmpty(toolManagement.getConfig())){
|
|
|
+ redisTemplate.opsForValue().set("CHANGE_TOOL_CONFIG",toolManagement.getConfig());
|
|
|
+ }
|
|
|
+ return success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/getRule")
|
|
|
+ public R getRule() {
|
|
|
+ Object obj = redisTemplate.opsForValue().get("CHANGE_TOOL_CONFIG");
|
|
|
+ if(obj == null){
|
|
|
+ return fail("");
|
|
|
+ }
|
|
|
+ return success(obj.toString());
|
|
|
+ }
|
|
|
+
|
|
|
}
|