服务指令-镜像码管理-增加镜像码使用日志
This commit is contained in:
parent
18e3b56434
commit
15310a8f13
|
|
@ -0,0 +1,177 @@
|
|||
package com.nu.modules.directivesynclog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.directivesynclog.entity.DirectiveSyncLogInfo;
|
||||
import com.nu.modules.directivesynclog.service.IDirectiveSyncLogInfoService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令镜像日志详情表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="服务指令镜像日志详情表")
|
||||
@RestController
|
||||
@RequestMapping("/directivesynclog/directiveSyncLogInfo")
|
||||
@Slf4j
|
||||
public class DirectiveSyncLogInfoController extends JeecgController<DirectiveSyncLogInfo, IDirectiveSyncLogInfoService> {
|
||||
@Autowired
|
||||
private IDirectiveSyncLogInfoService directiveSyncLogInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveSyncLogInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令镜像日志详情表-分页列表查询")
|
||||
@ApiOperation(value="服务指令镜像日志详情表-分页列表查询", notes="服务指令镜像日志详情表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@DS("ope")
|
||||
public Result<IPage<DirectiveSyncLogInfo>> queryPageList(DirectiveSyncLogInfo directiveSyncLogInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<DirectiveSyncLogInfo> queryWrapper = QueryGenerator.initQueryWrapper(directiveSyncLogInfo, req.getParameterMap());
|
||||
Page<DirectiveSyncLogInfo> page = new Page<DirectiveSyncLogInfo>(pageNo, pageSize);
|
||||
IPage<DirectiveSyncLogInfo> pageList = directiveSyncLogInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveSyncLogInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志详情表-添加")
|
||||
@ApiOperation(value="服务指令镜像日志详情表-添加", notes="服务指令镜像日志详情表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveSyncLogInfo directiveSyncLogInfo) {
|
||||
directiveSyncLogInfoService.save(directiveSyncLogInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveSyncLogInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志详情表-编辑")
|
||||
@ApiOperation(value="服务指令镜像日志详情表-编辑", notes="服务指令镜像日志详情表-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveSyncLogInfo directiveSyncLogInfo) {
|
||||
directiveSyncLogInfoService.updateById(directiveSyncLogInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志详情表-通过id删除")
|
||||
@ApiOperation(value="服务指令镜像日志详情表-通过id删除", notes="服务指令镜像日志详情表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
directiveSyncLogInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志详情表-批量删除")
|
||||
@ApiOperation(value="服务指令镜像日志详情表-批量删除", notes="服务指令镜像日志详情表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.directiveSyncLogInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令镜像日志详情表-通过id查询")
|
||||
@ApiOperation(value="服务指令镜像日志详情表-通过id查询", notes="服务指令镜像日志详情表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveSyncLogInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
DirectiveSyncLogInfo directiveSyncLogInfo = directiveSyncLogInfoService.getById(id);
|
||||
if(directiveSyncLogInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveSyncLogInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveSyncLogInfo
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveSyncLogInfo directiveSyncLogInfo) {
|
||||
return super.exportXls(request, directiveSyncLogInfo, DirectiveSyncLogInfo.class, "服务指令镜像日志详情表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveSyncLogInfo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
package com.nu.modules.directivesynclog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.directivesynclog.entity.DirectiveSyncLogMain;
|
||||
import com.nu.modules.directivesynclog.service.IDirectiveSyncLogMainService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令镜像日志主表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-12-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "服务指令镜像日志主表")
|
||||
@RestController
|
||||
@RequestMapping("/directivesynclog/directiveSyncLogMain")
|
||||
@Slf4j
|
||||
public class DirectiveSyncLogMainController extends JeecgController<DirectiveSyncLogMain, IDirectiveSyncLogMainService> {
|
||||
@Autowired
|
||||
private IDirectiveSyncLogMainService directiveSyncLogMainService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param directiveSyncLogMain
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令镜像日志主表-分页列表查询")
|
||||
@ApiOperation(value = "服务指令镜像日志主表-分页列表查询", notes = "服务指令镜像日志主表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@DS("ope")
|
||||
public Result<IPage<DirectiveSyncLogMain>> queryPageList(DirectiveSyncLogMain directiveSyncLogMain,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("opeOrgCode", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("targetOrgCode", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<DirectiveSyncLogMain> queryWrapper = QueryGenerator.initQueryWrapper(directiveSyncLogMain, req.getParameterMap(), customeRuleMap);
|
||||
Page<DirectiveSyncLogMain> page = new Page<DirectiveSyncLogMain>(pageNo, pageSize);
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
queryWrapper.eq("target_org_code",deptInfo.getString("code"));
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<DirectiveSyncLogMain> pageList = directiveSyncLogMainService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param directiveSyncLogMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志主表-添加")
|
||||
@ApiOperation(value = "服务指令镜像日志主表-添加", notes = "服务指令镜像日志主表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody DirectiveSyncLogMain directiveSyncLogMain) {
|
||||
directiveSyncLogMainService.save(directiveSyncLogMain);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param directiveSyncLogMain
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志主表-编辑")
|
||||
@ApiOperation(value = "服务指令镜像日志主表-编辑", notes = "服务指令镜像日志主表-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DirectiveSyncLogMain directiveSyncLogMain) {
|
||||
directiveSyncLogMainService.updateById(directiveSyncLogMain);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志主表-通过id删除")
|
||||
@ApiOperation(value = "服务指令镜像日志主表-通过id删除", notes = "服务指令镜像日志主表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
directiveSyncLogMainService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "服务指令镜像日志主表-批量删除")
|
||||
@ApiOperation(value = "服务指令镜像日志主表-批量删除", notes = "服务指令镜像日志主表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.directiveSyncLogMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "服务指令镜像日志主表-通过id查询")
|
||||
@ApiOperation(value = "服务指令镜像日志主表-通过id查询", notes = "服务指令镜像日志主表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<DirectiveSyncLogMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
DirectiveSyncLogMain directiveSyncLogMain = directiveSyncLogMainService.getById(id);
|
||||
if (directiveSyncLogMain == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(directiveSyncLogMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param directiveSyncLogMain
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, DirectiveSyncLogMain directiveSyncLogMain) {
|
||||
return super.exportXls(request, directiveSyncLogMain, DirectiveSyncLogMain.class, "服务指令镜像日志主表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, DirectiveSyncLogMain.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -111,6 +111,7 @@ public class DirectiveSyncLogInfo implements Serializable {
|
|||
*/
|
||||
@Excel(name = "周期类型 1日常护理 2周期护理 3即时护理", width = 15)
|
||||
@ApiModelProperty(value = "周期类型 1日常护理 2周期护理 3即时护理")
|
||||
@Dict(dicCode = "period_type")
|
||||
private java.lang.String cycleType;
|
||||
/**
|
||||
* 服务说明
|
||||
|
|
|
|||
Loading…
Reference in New Issue