parent
762b45407b
commit
d55b807001
|
|
@ -21,6 +21,8 @@ public class ElderTagAsyncMQDto implements Serializable {
|
|||
private String type;
|
||||
/**标签名称*/
|
||||
private String tagName;
|
||||
/**说明*/
|
||||
private java.lang.String describ;
|
||||
/**价格*/
|
||||
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;
|
||||
}
|
||||
|
|
@ -49,6 +49,10 @@ public class CanAddElderTag implements Serializable {
|
|||
@Excel(name = "标签名称", width = 15)
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private java.lang.String tagName;
|
||||
/**说明*/
|
||||
@Excel(name = "说明", width = 40)
|
||||
@ApiModelProperty(value = "说明")
|
||||
private java.lang.String describ;
|
||||
/**价格*/
|
||||
@Excel(name = "价格", width = 15)
|
||||
@ApiModelProperty(value = "价格")
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ public class ElderTag implements Serializable {
|
|||
@Excel(name = "标签名称", width = 15)
|
||||
@ApiModelProperty(value = "标签名称")
|
||||
private java.lang.String tagName;
|
||||
/**说明*/
|
||||
@Excel(name = "说明", width = 40)
|
||||
@ApiModelProperty(value = "说明")
|
||||
private java.lang.String describ;
|
||||
/**价格*/
|
||||
@Excel(name = "价格", width = 15)
|
||||
@ApiModelProperty(value = "价格")
|
||||
|
|
|
|||
|
|
@ -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/elderTagType")
|
||||
@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 {
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
package com.nu.mq.eldertag.listener;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.dto.ElderTagAsyncMQDto;
|
||||
import com.nu.dto.ElderTagTypeMQDto;
|
||||
import com.nu.dto.StatusMQDto;
|
||||
import com.nu.enums.MQStatus;
|
||||
import com.nu.modules.async.entity.AsyncStatus;
|
||||
|
|
@ -10,12 +12,15 @@ import com.nu.modules.async.service.IAsyncMainService;
|
|||
import com.nu.modules.async.service.IAsyncStatusService;
|
||||
import com.nu.modules.canaddeldertag.entity.CanAddElderTag;
|
||||
import com.nu.modules.canaddeldertag.service.ICanAddElderTagService;
|
||||
import com.nu.modules.eldertagtypere.entity.ElderTagTypeRe;
|
||||
import com.nu.modules.eldertagtypere.service.IElderTagTypeReService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -31,6 +36,8 @@ public class ElderTaggMQListener {
|
|||
private IAsyncStatusService asyncStatusService;
|
||||
@Autowired
|
||||
private ICanAddElderTagService canAddElderTagService;
|
||||
@Autowired
|
||||
private IElderTagTypeReService elderTagTypeService;
|
||||
|
||||
/**
|
||||
* 其他平台新增指令
|
||||
|
|
@ -47,6 +54,7 @@ public class ElderTaggMQListener {
|
|||
CanAddElderTag canAddElderTag = new CanAddElderTag();
|
||||
canAddElderTag.setTagId(dto.getId());
|
||||
canAddElderTag.setTagName(dto.getTagName());
|
||||
canAddElderTag.setDescrib(dto.getDescrib());
|
||||
canAddElderTag.setPrice(dto.getPrice());
|
||||
canAddElderTag.setCreateTime(new Date());
|
||||
canAddElderTag.setSysOrgCode(dto.getSysOrgCode());
|
||||
|
|
@ -54,6 +62,22 @@ public class ElderTaggMQListener {
|
|||
canAddElderTagService.save(canAddElderTag);
|
||||
}
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "hldy.eldettagtype.newadd"), exchange = @Exchange(name = "hldy.eldettagtype", type = ExchangeTypes.DIRECT), key = "hldy.eldettagtype.newadd"), errorHandler = "elderTaggMQErrorHandler")
|
||||
public void addTagType(ElderTagTypeMQDto dto) {
|
||||
QueryWrapper<ElderTagTypeRe> qw = new QueryWrapper<>();
|
||||
qw.eq("type_name", dto.getTypeName());
|
||||
ElderTagTypeRe one = elderTagTypeService.getOne(qw);
|
||||
if (one != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ElderTagTypeRe elderTagType = new ElderTagTypeRe();
|
||||
BeanUtils.copyProperties(dto,elderTagType);
|
||||
elderTagType.setId(IdUtil.simpleUUID());
|
||||
elderTagType.setTypeId(dto.getId());
|
||||
elderTagTypeService.save(elderTagType);
|
||||
}
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(value = @Queue(name = "eldertag.async.result"), exchange = @Exchange(name = "hldy.eldertag", type = ExchangeTypes.DIRECT), key = "eldertag.async.result"), errorHandler = "elderTaggMQErrorHandler")
|
||||
public void handleNu002AsyncMessageStatus(StatusMQDto dto) {
|
||||
LambdaQueryWrapper<AsyncStatus> qw = new LambdaQueryWrapper<>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue