parent
b2ca8786ad
commit
b814814f6d
|
|
@ -1,6 +1,8 @@
|
||||||
package com.nu.dto;
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
@ -21,6 +23,8 @@ public class ElderTagAsyncMQDto implements Serializable {
|
||||||
private String type;
|
private String type;
|
||||||
/**标签名称*/
|
/**标签名称*/
|
||||||
private String tagName;
|
private String tagName;
|
||||||
|
/**说明*/
|
||||||
|
private java.lang.String describ;
|
||||||
/**价格*/
|
/**价格*/
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
/**图标*/
|
/**图标*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.nu.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ElderTagTypeMQDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
private String id;
|
||||||
|
/**标签类型名称*/
|
||||||
|
private String typeName;
|
||||||
|
/**是否启用 0启用 1未启用*/
|
||||||
|
private String izEnabled;
|
||||||
|
/**是否删除 0未删除 1删除*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -47,12 +47,15 @@ public class CanAddElderTag implements Serializable {
|
||||||
/**标签类型 tx体型标签 qx情绪标签*/
|
/**标签类型 tx体型标签 qx情绪标签*/
|
||||||
@Excel(name = "标签类型", width = 20,dicCode = "elder_tag_type")
|
@Excel(name = "标签类型", width = 20,dicCode = "elder_tag_type")
|
||||||
@ApiModelProperty(value = "标签类型 tx体型标签 qx情绪标签")
|
@ApiModelProperty(value = "标签类型 tx体型标签 qx情绪标签")
|
||||||
@Dict(dicCode = "elder_tag_type")
|
|
||||||
private java.lang.String type;
|
private java.lang.String type;
|
||||||
/**标签名称*/
|
/**标签名称*/
|
||||||
@Excel(name = "标签名称", width = 30)
|
@Excel(name = "标签名称", width = 30)
|
||||||
@ApiModelProperty(value = "标签名称")
|
@ApiModelProperty(value = "标签名称")
|
||||||
private java.lang.String tagName;
|
private java.lang.String tagName;
|
||||||
|
/**说明*/
|
||||||
|
@Excel(name = "说明", width = 40)
|
||||||
|
@ApiModelProperty(value = "说明")
|
||||||
|
private java.lang.String describ;
|
||||||
/**价格*/
|
/**价格*/
|
||||||
@Excel(name = "价格(元)", width = 20)
|
@Excel(name = "价格(元)", width = 20)
|
||||||
@ApiModelProperty(value = "价格")
|
@ApiModelProperty(value = "价格")
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -50,12 +51,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
public class ElderTagController extends JeecgController<ElderTag, IElderTagService> {
|
public class ElderTagController extends JeecgController<ElderTag, IElderTagService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IElderTagService elderTagService;
|
private IElderTagService elderTagService;
|
||||||
@Autowired
|
|
||||||
private ISysBaseAPI sysBaseAPI;
|
|
||||||
@Autowired
|
|
||||||
private RabbitMQUtil rabbitMQUtil;
|
|
||||||
@Autowired
|
|
||||||
private ICanAddElderTagService canAddElderTagService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
|
|
@ -136,57 +132,15 @@ public class ElderTagController extends JeecgController<ElderTag, IElderTagServi
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "长者标签-添加")
|
@AutoLog(value = "长者标签-添加")
|
||||||
@ApiOperation(value = "长者标签-添加", notes = "长者标签-添加")
|
@ApiOperation(value = "长者标签-添加", notes = "长者标签-添加")
|
||||||
@RequiresPermissions("eldertag:nu_elder_tag:add")
|
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody ElderTag elderTag) {
|
public Result<String> add(@RequestBody ElderTag elderTag) {
|
||||||
QueryWrapper<ElderTag> queryWrapper = new QueryWrapper<>();
|
Result<String> error = elderTagService.add(elderTag);
|
||||||
queryWrapper.eq("type", elderTag.getType());
|
if (error != null) return error;
|
||||||
queryWrapper.eq("tag_name", elderTag.getTagName());
|
|
||||||
ElderTag one = elderTagService.getOne(queryWrapper);
|
|
||||||
if (one != null) {
|
|
||||||
return Result.error("长者标签已存在!");
|
|
||||||
}
|
|
||||||
|
|
||||||
//临时切换至管理平台
|
|
||||||
DynamicDataSourceContextHolder.push("ope");
|
|
||||||
List<CanAddElderTag> canAddList;
|
|
||||||
try {
|
|
||||||
canAddList = canAddElderTagService.list();
|
|
||||||
} finally {
|
|
||||||
DynamicDataSourceContextHolder.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean needSetId = true;
|
|
||||||
for (int i = 0; i < canAddList.size(); i++) {
|
|
||||||
CanAddElderTag canAddElderTag = canAddList.get(i);
|
|
||||||
if (
|
|
||||||
canAddElderTag.getType().equals(elderTag.getType()) &&
|
|
||||||
canAddElderTag.getTagName().equals(elderTag.getTagName())
|
|
||||||
) {
|
|
||||||
needSetId = false;
|
|
||||||
elderTag.setId(canAddElderTag.getTagId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
|
||||||
if (needSetId) {
|
|
||||||
elderTag.setId(deptInfo.getString("code") + IdUtil.simpleUUID());
|
|
||||||
}
|
|
||||||
elderTag.setSysOrgCode(deptInfo.getString("code"));
|
|
||||||
//处理静态资源
|
|
||||||
elderTagService.handleMediaFile(elderTag);
|
|
||||||
elderTagService.save(elderTag);
|
|
||||||
|
|
||||||
//同步给管理平台
|
|
||||||
{
|
|
||||||
ElderTagAsyncMQDto elderTagAsyncMQDto = new ElderTagAsyncMQDto();
|
|
||||||
BeanUtils.copyProperties(elderTag, elderTagAsyncMQDto);
|
|
||||||
rabbitMQUtil.sendToExchange("hldy.eldettag", "hldy.eldettag.newadd", elderTagAsyncMQDto);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
|
|
@ -195,7 +149,6 @@ public class ElderTagController extends JeecgController<ElderTag, IElderTagServi
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "长者标签-编辑")
|
@AutoLog(value = "长者标签-编辑")
|
||||||
@ApiOperation(value = "长者标签-编辑", notes = "长者标签-编辑")
|
@ApiOperation(value = "长者标签-编辑", notes = "长者标签-编辑")
|
||||||
@RequiresPermissions("eldertag:nu_elder_tag:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody ElderTag elderTag) {
|
public Result<String> edit(@RequestBody ElderTag elderTag) {
|
||||||
//处理静态资源
|
//处理静态资源
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,16 @@ public class ElderTag implements Serializable {
|
||||||
/**标签类型*/
|
/**标签类型*/
|
||||||
@Excel(name = "标签类型", width = 15)
|
@Excel(name = "标签类型", width = 15)
|
||||||
@ApiModelProperty(value = "标签类型")
|
@ApiModelProperty(value = "标签类型")
|
||||||
@Dict(dicCode = "elder_tag_type")
|
@Dict(dictTable = "nu_elder_tag_type",dicText = "type_name",dicCode = "id")
|
||||||
private java.lang.String type;
|
private java.lang.String type;
|
||||||
/**标签名称*/
|
/**标签名称*/
|
||||||
@Excel(name = "标签名称", width = 15)
|
@Excel(name = "标签名称", width = 15)
|
||||||
@ApiModelProperty(value = "标签名称")
|
@ApiModelProperty(value = "标签名称")
|
||||||
private java.lang.String tagName;
|
private java.lang.String tagName;
|
||||||
|
/**说明*/
|
||||||
|
@Excel(name = "说明", width = 40)
|
||||||
|
@ApiModelProperty(value = "说明")
|
||||||
|
private java.lang.String describ;
|
||||||
/**价格*/
|
/**价格*/
|
||||||
@Excel(name = "价格", width = 15)
|
@Excel(name = "价格", width = 15)
|
||||||
@ApiModelProperty(value = "价格")
|
@ApiModelProperty(value = "价格")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.eldertag.service;
|
||||||
import com.nu.dto.ElderTagMQDto;
|
import com.nu.dto.ElderTagMQDto;
|
||||||
import com.nu.modules.eldertag.entity.ElderTag;
|
import com.nu.modules.eldertag.entity.ElderTag;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -23,4 +24,6 @@ public interface IElderTagService extends IService<ElderTag> {
|
||||||
void insertAllDirectives(List<ElderTag> needAddETList);
|
void insertAllDirectives(List<ElderTag> needAddETList);
|
||||||
|
|
||||||
List<ElderTag> compareList(ElderTag elderTag);
|
List<ElderTag> compareList(ElderTag elderTag);
|
||||||
|
|
||||||
|
Result<String> add(ElderTag elderTag);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
package com.nu.modules.eldertag.service.impl;
|
package com.nu.modules.eldertag.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.nu.dto.*;
|
import com.nu.dto.*;
|
||||||
|
import com.nu.modules.canaddeldertag.entity.CanAddElderTag;
|
||||||
|
import com.nu.modules.canaddeldertag.service.ICanAddElderTagService;
|
||||||
import com.nu.modules.eldertag.entity.ElderTag;
|
import com.nu.modules.eldertag.entity.ElderTag;
|
||||||
import com.nu.modules.eldertag.mapper.ElderTagMapper;
|
import com.nu.modules.eldertag.mapper.ElderTagMapper;
|
||||||
import com.nu.modules.eldertag.service.IElderTagService;
|
import com.nu.modules.eldertag.service.IElderTagService;
|
||||||
|
|
@ -13,7 +17,11 @@ import com.nu.modules.mq.eldertag.listener.ElderTagMQListener;
|
||||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||||
import com.nu.utils.HttpRequestUtil;
|
import com.nu.utils.HttpRequestUtil;
|
||||||
import com.nu.utils.NuFileUtils;
|
import com.nu.utils.NuFileUtils;
|
||||||
|
import com.nu.utils.RabbitMQUtil;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
import org.apache.commons.compress.utils.Lists;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -38,6 +46,12 @@ public class ElderTagServiceImpl extends ServiceImpl<ElderTagMapper, ElderTag> i
|
||||||
private ElderTagMQListener elderTagMQListener;
|
private ElderTagMQListener elderTagMQListener;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigApi sysConfigApi;
|
private ISysConfigApi sysConfigApi;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
@Autowired
|
||||||
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
@Autowired
|
||||||
|
private ICanAddElderTagService canAddElderTagService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将资源放到静态目录中
|
* 将资源放到静态目录中
|
||||||
|
|
@ -182,4 +196,54 @@ public class ElderTagServiceImpl extends ServiceImpl<ElderTagMapper, ElderTag> i
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> add(ElderTag elderTag) {
|
||||||
|
//先查下本平台是否存在
|
||||||
|
QueryWrapper<ElderTag> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("type", elderTag.getType());
|
||||||
|
queryWrapper.eq("tag_name", elderTag.getTagName());
|
||||||
|
ElderTag one = baseMapper.selectOne(queryWrapper);
|
||||||
|
if (one != null) {
|
||||||
|
return Result.error("长者标签已存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//临时切换至管理平台
|
||||||
|
DynamicDataSourceContextHolder.push("ope");
|
||||||
|
List<CanAddElderTag> canAddList;
|
||||||
|
try {
|
||||||
|
canAddList = canAddElderTagService.list();
|
||||||
|
} finally {
|
||||||
|
DynamicDataSourceContextHolder.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean needSetId = true;
|
||||||
|
for (int i = 0; i < canAddList.size(); i++) {
|
||||||
|
CanAddElderTag canAddElderTag = canAddList.get(i);
|
||||||
|
if (
|
||||||
|
canAddElderTag.getType().equals(elderTag.getType()) &&
|
||||||
|
canAddElderTag.getTagName().equals(elderTag.getTagName())
|
||||||
|
) {
|
||||||
|
needSetId = false;
|
||||||
|
elderTag.setId(canAddElderTag.getTagId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||||
|
if (needSetId) {
|
||||||
|
elderTag.setId(deptInfo.getString("code") + IdUtil.simpleUUID());
|
||||||
|
}
|
||||||
|
elderTag.setSysOrgCode(deptInfo.getString("code"));
|
||||||
|
//处理静态资源
|
||||||
|
handleMediaFile(elderTag);
|
||||||
|
baseMapper.insert(elderTag);
|
||||||
|
|
||||||
|
//同步给管理平台
|
||||||
|
{
|
||||||
|
ElderTagAsyncMQDto elderTagAsyncMQDto = new ElderTagAsyncMQDto();
|
||||||
|
BeanUtils.copyProperties(elderTag, elderTagAsyncMQDto);
|
||||||
|
rabbitMQUtil.sendToExchange("hldy.eldettag", "hldy.eldettag.newadd", elderTagAsyncMQDto);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,197 @@
|
||||||
|
package com.nu.modules.eldertagmain.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.nu.modules.eldertag.entity.ElderTag;
|
||||||
|
import com.nu.modules.eldertag.service.IElderTagService;
|
||||||
|
import com.nu.modules.eldertagmain.entity.ElderTagMain;
|
||||||
|
import com.nu.modules.eldertagmain.service.IElderTagMainService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签管理
|
||||||
|
* @Author: zmy
|
||||||
|
* @Date: 2025-08-13
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags = "长者标签管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/elder/elderTagMain")
|
||||||
|
@Slf4j
|
||||||
|
public class ElderTagMainController extends JeecgController<ElderTagMain, IElderTagMainService> {
|
||||||
|
@Autowired
|
||||||
|
private IElderTagMainService elderTagMainService;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
@Autowired
|
||||||
|
private IElderTagService elderTagService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param elderTagMain
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "长者标签管理-分页列表查询")
|
||||||
|
@ApiOperation(value = "长者标签管理-分页列表查询", notes = "长者标签管理-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ElderTagMain>> queryPageList(ElderTagMain elderTagMain,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<ElderTagMain> queryWrapper = QueryGenerator.initQueryWrapper(elderTagMain, req.getParameterMap());
|
||||||
|
queryWrapper.orderByAsc("sort");
|
||||||
|
Page<ElderTagMain> page = new Page<ElderTagMain>(pageNo, pageSize);
|
||||||
|
IPage<ElderTagMain> pageList = elderTagMainService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param elderTagMain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签管理-添加")
|
||||||
|
@ApiOperation(value = "长者标签管理-添加", notes = "长者标签管理-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody ElderTagMain elderTagMain) {
|
||||||
|
elderTagMainService.handleMediaFile(elderTagMain);
|
||||||
|
elderTagMainService.save(elderTagMain);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量添加
|
||||||
|
*
|
||||||
|
* @param elderTagMainList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签管理-批量添加")
|
||||||
|
@ApiOperation(value = "长者标签管理-批量添加", notes = "长者标签管理-批量添加")
|
||||||
|
@PostMapping(value = "/batchAdd")
|
||||||
|
public Result<String> batchAdd(@RequestBody List<ElderTagMain> elderTagMainList) {
|
||||||
|
elderTagMainList.stream().forEach(m -> {
|
||||||
|
ElderTag elderTag = new ElderTag();
|
||||||
|
BeanUtils.copyProperties(m, elderTag);
|
||||||
|
elderTag.setPrice(new BigDecimal("0"));
|
||||||
|
elderTag.setType(m.getTypeId());
|
||||||
|
elderTag.setIzEnabled("0");
|
||||||
|
elderTag.setDelFlag("0");
|
||||||
|
elderTagService.add(elderTag);
|
||||||
|
});
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param elderTagMain
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签管理-编辑")
|
||||||
|
@ApiOperation(value = "长者标签管理-编辑", notes = "长者标签管理-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody ElderTagMain elderTagMain) {
|
||||||
|
elderTagMainService.handleMediaFile(elderTagMain);
|
||||||
|
elderTagMainService.updateById(elderTagMain);
|
||||||
|
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签管理-通过id删除")
|
||||||
|
@ApiOperation(value = "长者标签管理-通过id删除", notes = "长者标签管理-通过id删除")
|
||||||
|
@RequiresPermissions("eldertag:nu_elder_tag:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
elderTagMainService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签管理-批量删除")
|
||||||
|
@ApiOperation(value = "长者标签管理-批量删除", notes = "长者标签管理-批量删除")
|
||||||
|
@RequiresPermissions("eldertag:nu_elder_tag:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.elderTagMainService.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<ElderTagMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
ElderTagMain elderTagMain = elderTagMainService.getById(id);
|
||||||
|
if (elderTagMain == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(elderTagMain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param elderTagMain
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("eldertag:nu_elder_tag:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, ElderTagMain elderTagMain) {
|
||||||
|
return super.exportXls(request, elderTagMain, ElderTagMain.class, "长者标签管理");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("eldertag:nu_elder_tag:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, ElderTagMain.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.nu.modules.eldertagmain.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签管理
|
||||||
|
* @Author: zmy
|
||||||
|
* @Date: 2025-08-13
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_elder_tag_main")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_elder_tag_main对象", description="长者标签管理")
|
||||||
|
public class ElderTagMain implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
/**标签类型*/
|
||||||
|
@ApiModelProperty(value = "标签类型")
|
||||||
|
@Dict(dictTable = "nu_elder_tag_type",dicText = "type_name",dicCode = "id")
|
||||||
|
private String typeId;
|
||||||
|
/**标签名称*/
|
||||||
|
@Excel(name = "标签名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "标签名称")
|
||||||
|
private String tagName;
|
||||||
|
/**说明*/
|
||||||
|
@Excel(name = "说明", width = 40)
|
||||||
|
@ApiModelProperty(value = "说明")
|
||||||
|
private String describ;
|
||||||
|
/**价格*/
|
||||||
|
@Excel(name = "价格", width = 15)
|
||||||
|
@ApiModelProperty(value = "价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
/**图标*/
|
||||||
|
@Excel(name = "图标", width = 15)
|
||||||
|
@ApiModelProperty(value = "图标")
|
||||||
|
private String pic;
|
||||||
|
/**图标md5值*/
|
||||||
|
@ApiModelProperty(value = "图标md5值")
|
||||||
|
private String picMd5;
|
||||||
|
/**排序*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
/**是否启用*/
|
||||||
|
@Excel(name = "是否启用", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
@Dict(dicCode = "iz_enabled")
|
||||||
|
private String izEnabled;
|
||||||
|
/**是否删除*/
|
||||||
|
@Excel(name = "是否删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否删除")
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
/**创建人*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建日期")
|
||||||
|
private Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新日期")
|
||||||
|
private Date updateTime;
|
||||||
|
/**所属机构*/
|
||||||
|
@ApiModelProperty(value = "所属机构")
|
||||||
|
private String sysOrgCode;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.eldertagmain.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nu.modules.eldertagmain.entity.ElderTagMain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签管理
|
||||||
|
* @Author: zmy
|
||||||
|
* @Date: 2025-08-13
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ElderTagMainMapper extends BaseMapper<ElderTagMain> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.nu.modules.eldertagmain.mapper.ElderTagMainMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.nu.modules.eldertagmain.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nu.modules.eldertagmain.entity.ElderTagMain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签管理
|
||||||
|
* @Author: zmy
|
||||||
|
* @Date: 2025-08-13
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IElderTagMainService extends IService<ElderTagMain> {
|
||||||
|
|
||||||
|
void handleMediaFile(ElderTagMain elderTagMain);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.nu.modules.eldertagmain.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nu.modules.eldertagmain.entity.ElderTagMain;
|
||||||
|
import com.nu.modules.eldertagmain.mapper.ElderTagMainMapper;
|
||||||
|
import com.nu.modules.eldertagmain.service.IElderTagMainService;
|
||||||
|
import com.nu.utils.NuFileUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签管理
|
||||||
|
* @Author: zmy
|
||||||
|
* @Date: 2025-08-13
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ElderTagMainServiceImpl extends ServiceImpl<ElderTagMainMapper, ElderTagMain> implements IElderTagMainService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMediaFile(ElderTagMain elderTagMain) {
|
||||||
|
//需要存储的路径
|
||||||
|
String mediaFileSavePath = "/eldertag/" + elderTagMain.getTagName();
|
||||||
|
//图标
|
||||||
|
String previewFile = elderTagMain.getPic();
|
||||||
|
// 处理文件并获取更新后的路径
|
||||||
|
Map<String, String> newFileMap = NuFileUtils.processFile(mediaFileSavePath, previewFile);
|
||||||
|
if (newFileMap != null) {
|
||||||
|
elderTagMain.setPic(newFileMap.get("path"));
|
||||||
|
elderTagMain.setPicMd5(newFileMap.get("md5"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,223 @@
|
||||||
|
package com.nu.modules.eldertagtype.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 cn.hutool.core.util.IdUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||||
|
import com.nu.dto.ElderTagAsyncMQDto;
|
||||||
|
import com.nu.dto.ElderTagTypeMQDto;
|
||||||
|
import com.nu.modules.canaddeldertag.entity.CanAddElderTag;
|
||||||
|
import com.nu.modules.eldertagtypere.entity.ElderTagTypeRe;
|
||||||
|
import com.nu.modules.eldertagtypere.service.IElderTagTypeReService;
|
||||||
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
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.eldertagtype.entity.ElderTagType;
|
||||||
|
import com.nu.modules.eldertagtype.service.IElderTagTypeService;
|
||||||
|
|
||||||
|
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.BeanUtils;
|
||||||
|
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-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags = "长者标签类型")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/elder/elderTagType")
|
||||||
|
@Slf4j
|
||||||
|
public class ElderTagTypeController extends JeecgController<ElderTagType, IElderTagTypeService> {
|
||||||
|
@Autowired
|
||||||
|
private IElderTagTypeService elderTagTypeService;
|
||||||
|
@Autowired
|
||||||
|
private IElderTagTypeReService elderTagTypeReService;
|
||||||
|
@Autowired
|
||||||
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
@Autowired
|
||||||
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param elderTagType
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "长者标签类型-分页列表查询")
|
||||||
|
@ApiOperation(value = "长者标签类型-分页列表查询", notes = "长者标签类型-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ElderTagType>> queryPageList(ElderTagType elderTagType,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<ElderTagType> queryWrapper = QueryGenerator.initQueryWrapper(elderTagType, req.getParameterMap());
|
||||||
|
Page<ElderTagType> page = new Page<ElderTagType>(pageNo, pageSize);
|
||||||
|
IPage<ElderTagType> pageList = elderTagTypeService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param elderTagType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签类型-添加")
|
||||||
|
@ApiOperation(value = "长者标签类型-添加", notes = "长者标签类型-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody ElderTagType elderTagType) {
|
||||||
|
//临时切换至管理平台
|
||||||
|
DynamicDataSourceContextHolder.push("ope");
|
||||||
|
List<ElderTagTypeRe> tagTypeReList;
|
||||||
|
try {
|
||||||
|
tagTypeReList = elderTagTypeReService.list();
|
||||||
|
} finally {
|
||||||
|
DynamicDataSourceContextHolder.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean needSetId = true;
|
||||||
|
for (int i = 0; i < tagTypeReList.size(); i++) {
|
||||||
|
ElderTagTypeRe elderTagTypeRe = tagTypeReList.get(i);
|
||||||
|
if (elderTagTypeRe.getTypeName().equals(elderTagType.getTypeName())) {
|
||||||
|
needSetId = false;
|
||||||
|
elderTagType.setId(elderTagTypeRe.getTypeId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||||
|
if (needSetId) {
|
||||||
|
elderTagType.setId(deptInfo.getString("code") + IdUtil.simpleUUID());
|
||||||
|
}
|
||||||
|
elderTagTypeService.save(elderTagType);
|
||||||
|
|
||||||
|
//同步给管理平台
|
||||||
|
{
|
||||||
|
ElderTagTypeMQDto elderTagTypeMQDto = new ElderTagTypeMQDto();
|
||||||
|
BeanUtils.copyProperties(elderTagType, elderTagTypeMQDto);
|
||||||
|
rabbitMQUtil.sendToExchange("hldy.eldettagtype", "hldy.eldettagtype.newadd", elderTagTypeMQDto);
|
||||||
|
}
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param elderTagType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签类型-编辑")
|
||||||
|
@ApiOperation(value = "长者标签类型-编辑", notes = "长者标签类型-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody ElderTagType elderTagType) {
|
||||||
|
elderTagTypeService.updateById(elderTagType);
|
||||||
|
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) {
|
||||||
|
elderTagTypeService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签类型-批量删除")
|
||||||
|
@ApiOperation(value = "长者标签类型-批量删除", notes = "长者标签类型-批量删除")
|
||||||
|
@RequiresPermissions("eldertagtype:nu_elder_tag_type:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.elderTagTypeService.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<ElderTagType> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
ElderTagType elderTagType = elderTagTypeService.getById(id);
|
||||||
|
if (elderTagType == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(elderTagType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param elderTagType
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("eldertagtype:nu_elder_tag_type:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, ElderTagType elderTagType) {
|
||||||
|
return super.exportXls(request, elderTagType, ElderTagType.class, "长者标签类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("eldertagtype:nu_elder_tag_type:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, ElderTagType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.nu.modules.eldertagtype.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_elder_tag_type")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_elder_tag_type对象", description="长者标签类型")
|
||||||
|
public class ElderTagType implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**标签类型名称*/
|
||||||
|
@Excel(name = "标签类型名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "标签类型名称")
|
||||||
|
private java.lang.String typeName;
|
||||||
|
/**是否启用 0启用 1未启用*/
|
||||||
|
@Excel(name = "是否启用 0启用 1未启用", width = 15, dicCode = "iz_enabled")
|
||||||
|
@Dict(dicCode = "iz_enabled")
|
||||||
|
@ApiModelProperty(value = "是否启用 0启用 1未启用")
|
||||||
|
private java.lang.String izEnabled;
|
||||||
|
/**是否删除 0未删除 1删除*/
|
||||||
|
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||||
|
@TableLogic
|
||||||
|
private java.lang.String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.nu.modules.eldertagtype.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.nu.modules.eldertagtype.entity.ElderTagType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ElderTagTypeMapper extends BaseMapper<ElderTagType> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.nu.modules.eldertagtype.mapper.ElderTagTypeMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.eldertagtype.service;
|
||||||
|
|
||||||
|
import com.nu.modules.eldertagtype.entity.ElderTagType;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IElderTagTypeService extends IService<ElderTagType> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.nu.modules.eldertagtype.service.impl;
|
||||||
|
|
||||||
|
import com.nu.modules.eldertagtype.entity.ElderTagType;
|
||||||
|
import com.nu.modules.eldertagtype.mapper.ElderTagTypeMapper;
|
||||||
|
import com.nu.modules.eldertagtype.service.IElderTagTypeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ElderTagTypeServiceImpl extends ServiceImpl<ElderTagTypeMapper, ElderTagType> implements IElderTagTypeService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
package com.nu.modules.eldertagtypere.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import com.nu.modules.eldertagtypere.entity.ElderTagTypeRe;
|
||||||
|
import com.nu.modules.eldertagtypere.service.IElderTagTypeReService;
|
||||||
|
|
||||||
|
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.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
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-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="长者标签类型")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/elder/elderTagTypeRe")
|
||||||
|
@Slf4j
|
||||||
|
public class ElderTagTypeReController extends JeecgController<ElderTagTypeRe, IElderTagTypeReService> {
|
||||||
|
@Autowired
|
||||||
|
private IElderTagTypeReService elderTagTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param elderTagType
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "长者标签类型-分页列表查询")
|
||||||
|
@ApiOperation(value="长者标签类型-分页列表查询", notes="长者标签类型-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ElderTagTypeRe>> queryPageList(ElderTagTypeRe elderTagType,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<ElderTagTypeRe> queryWrapper = QueryGenerator.initQueryWrapper(elderTagType, req.getParameterMap());
|
||||||
|
Page<ElderTagTypeRe> page = new Page<ElderTagTypeRe>(pageNo, pageSize);
|
||||||
|
IPage<ElderTagTypeRe> pageList = elderTagTypeService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param elderTagType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签类型-添加")
|
||||||
|
@ApiOperation(value="长者标签类型-添加", notes="长者标签类型-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody ElderTagTypeRe elderTagType) {
|
||||||
|
elderTagTypeService.save(elderTagType);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param elderTagType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签类型-编辑")
|
||||||
|
@ApiOperation(value="长者标签类型-编辑", notes="长者标签类型-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody ElderTagTypeRe elderTagType) {
|
||||||
|
elderTagTypeService.updateById(elderTagType);
|
||||||
|
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) {
|
||||||
|
elderTagTypeService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "长者标签类型-批量删除")
|
||||||
|
@ApiOperation(value="长者标签类型-批量删除", notes="长者标签类型-批量删除")
|
||||||
|
@RequiresPermissions("eldertagtype:nu_elder_tag_type:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.elderTagTypeService.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<ElderTagTypeRe> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
ElderTagTypeRe elderTagType = elderTagTypeService.getById(id);
|
||||||
|
if(elderTagType==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(elderTagType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param elderTagType
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("eldertagtype:nu_elder_tag_type:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, ElderTagTypeRe elderTagType) {
|
||||||
|
return super.exportXls(request, elderTagType, ElderTagTypeRe.class, "长者标签类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("eldertagtype:nu_elder_tag_type:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, ElderTagTypeRe.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.nu.modules.eldertagtypere.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_elder_tag_type_re")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_elder_tag_type对象", description="长者标签类型")
|
||||||
|
public class ElderTagTypeRe implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
/**标签类型id*/
|
||||||
|
@Excel(name = "标签类型id", width = 15)
|
||||||
|
@ApiModelProperty(value = "标签类型id")
|
||||||
|
private String typeId;
|
||||||
|
/**标签类型名称*/
|
||||||
|
@Excel(name = "标签类型名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "标签类型名称")
|
||||||
|
private String typeName;
|
||||||
|
/**是否启用 0启用 1未启用*/
|
||||||
|
@Excel(name = "是否启用 0启用 1未启用", width = 15, dicCode = "iz_enabled")
|
||||||
|
@Dict(dicCode = "iz_enabled")
|
||||||
|
@ApiModelProperty(value = "是否启用 0启用 1未启用")
|
||||||
|
private String izEnabled;
|
||||||
|
/**是否删除 0未删除 1删除*/
|
||||||
|
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.eldertagtypere.mapper;
|
||||||
|
|
||||||
|
import com.nu.modules.eldertagtypere.entity.ElderTagTypeRe;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ElderTagTypeReMapper extends BaseMapper<ElderTagTypeRe> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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.nu.modules.eldertagtypere.mapper.ElderTagTypeReMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.nu.modules.eldertagtypere.service;
|
||||||
|
|
||||||
|
import com.nu.modules.eldertagtypere.entity.ElderTagTypeRe;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IElderTagTypeReService extends IService<ElderTagTypeRe> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.nu.modules.eldertagtypere.service.impl;
|
||||||
|
|
||||||
|
import com.nu.modules.eldertagtypere.entity.ElderTagTypeRe;
|
||||||
|
import com.nu.modules.eldertagtypere.mapper.ElderTagTypeReMapper;
|
||||||
|
import com.nu.modules.eldertagtypere.service.IElderTagTypeReService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 长者标签类型
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-08-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ElderTagTypeReServiceImpl extends ServiceImpl<ElderTagTypeReMapper, ElderTagTypeRe> implements IElderTagTypeReService {
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue