26 changed files with 1258 additions and 210 deletions
@ -0,0 +1,89 @@ |
|||
package com.epmet.plugin.power.dto.axis; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Data |
|||
public class PowerAxisLeaderDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 关联动力主轴ID |
|||
*/ |
|||
private String structReferenceId; |
|||
|
|||
/** |
|||
* 性别 1男2女0未知 |
|||
*/ |
|||
private String gender; |
|||
|
|||
/** |
|||
* 联系方式 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 简介 300字内 |
|||
*/ |
|||
private String interoduction; |
|||
|
|||
/** |
|||
* 头像 图片访问地址 |
|||
*/ |
|||
private String avatar; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package com.epmet.plugin.power.dto.axis; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Data |
|||
public class PowerAxisTagDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标签类别 动力主轴结构:STRUCT;动力主轴领导人: LEADER |
|||
*/ |
|||
private String tagCategory; |
|||
|
|||
/** |
|||
* 标签类别编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 标签类别名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 排序 正序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 禁用状态 0.正常 1.已禁用 |
|||
*/ |
|||
private String forbiddenFlag; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
package com.epmet.plugin.power.modules.axis.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO; |
|||
import com.epmet.plugin.power.modules.axis.excel.PowerAxisLeaderExcel; |
|||
import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("axisLeader") |
|||
public class PowerAxisLeaderController { |
|||
|
|||
@Autowired |
|||
private PowerAxisLeaderService powerAxisLeaderService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<PowerAxisLeaderDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PowerAxisLeaderDTO> page = powerAxisLeaderService.page(params); |
|||
return new Result<PageData<PowerAxisLeaderDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<PowerAxisLeaderDTO> get(@PathVariable("id") String id){ |
|||
PowerAxisLeaderDTO data = powerAxisLeaderService.get(id); |
|||
return new Result<PowerAxisLeaderDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody PowerAxisLeaderDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
powerAxisLeaderService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody PowerAxisLeaderDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
powerAxisLeaderService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
powerAxisLeaderService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PowerAxisLeaderDTO> list = powerAxisLeaderService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisLeaderExcel.class); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
package com.epmet.plugin.power.modules.axis.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; |
|||
import com.epmet.plugin.power.modules.axis.excel.PowerAxisTagExcel; |
|||
import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("axisTag") |
|||
public class PowerAxisTagController { |
|||
|
|||
@Autowired |
|||
private PowerAxisTagService powerAxisTagService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<PowerAxisTagDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PowerAxisTagDTO> page = powerAxisTagService.page(params); |
|||
return new Result<PageData<PowerAxisTagDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<PowerAxisTagDTO> get(@PathVariable("id") String id){ |
|||
PowerAxisTagDTO data = powerAxisTagService.get(id); |
|||
return new Result<PowerAxisTagDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody PowerAxisTagDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
powerAxisTagService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody PowerAxisTagDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
powerAxisTagService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
powerAxisTagService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PowerAxisTagDTO> list = powerAxisTagService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisTagExcel.class); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.plugin.power.modules.axis.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.plugin.power.modules.axis.entity.PowerAxisLeaderEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Mapper |
|||
public interface PowerAxisLeaderDao extends BaseDao<PowerAxisLeaderEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.plugin.power.modules.axis.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Mapper |
|||
public interface PowerAxisTagDao extends BaseDao<PowerAxisTagEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
package com.epmet.plugin.power.modules.axis.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("pli_power_axis_leader") |
|||
public class PowerAxisLeaderEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 关联动力主轴ID |
|||
*/ |
|||
private String structReferenceId; |
|||
|
|||
/** |
|||
* 性别 1男2女0未知 |
|||
*/ |
|||
private String gender; |
|||
|
|||
/** |
|||
* 联系方式 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 简介 300字内 |
|||
*/ |
|||
private String interoduction; |
|||
|
|||
/** |
|||
* 头像 图片访问地址 |
|||
*/ |
|||
private String avatar; |
|||
|
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
package com.epmet.plugin.power.modules.axis.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("pli_power_axis_tag") |
|||
public class PowerAxisTagEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标签类别 动力主轴结构:STRUCT;动力主轴领导人: LEADER |
|||
*/ |
|||
private String tagCategory; |
|||
|
|||
/** |
|||
* 标签类别编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 标签类别名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 排序 正序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 禁用状态 0.正常 1.已禁用 |
|||
*/ |
|||
private String forbiddenFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
package com.epmet.plugin.power.modules.axis.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Data |
|||
public class PowerAxisLeaderExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "客户ID") |
|||
private String customerId; |
|||
|
|||
@Excel(name = "姓名") |
|||
private String name; |
|||
|
|||
@Excel(name = "关联动力主轴ID") |
|||
private String structReferenceId; |
|||
|
|||
@Excel(name = "性别 1男2女0未知") |
|||
private String gender; |
|||
|
|||
@Excel(name = "联系方式") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "简介 300字内") |
|||
private String interoduction; |
|||
|
|||
@Excel(name = "头像 图片访问地址") |
|||
private String avatar; |
|||
|
|||
@Excel(name = "删除标识 0.未删除 1.已删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.epmet.plugin.power.modules.axis.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Data |
|||
public class PowerAxisTagExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "客户ID") |
|||
private String customerId; |
|||
|
|||
@Excel(name = "标签类别 动力主轴结构:STRUCT;动力主轴领导人: LEADER") |
|||
private String tagCategory; |
|||
|
|||
@Excel(name = "标签类别编码") |
|||
private String categoryCode; |
|||
|
|||
@Excel(name = "标签类别名称") |
|||
private String categoryName; |
|||
|
|||
@Excel(name = "排序 正序") |
|||
private Integer sort; |
|||
|
|||
@Excel(name = "禁用状态 0.正常 1.已禁用") |
|||
private String forbiddenFlag; |
|||
|
|||
@Excel(name = "删除标识 0.未删除 1.已删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.plugin.power.modules.axis.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Component |
|||
public class PowerAxisLeaderRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.plugin.power.modules.axis.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Component |
|||
public class PowerAxisTagRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
package com.epmet.plugin.power.modules.axis.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO; |
|||
import com.epmet.plugin.power.modules.axis.entity.PowerAxisLeaderEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
public interface PowerAxisLeaderService extends BaseService<PowerAxisLeaderEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PowerAxisLeaderDTO> |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
PageData<PowerAxisLeaderDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PowerAxisLeaderDTO> |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
List<PowerAxisLeaderDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return PowerAxisLeaderDTO |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
PowerAxisLeaderDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
void save(PowerAxisLeaderDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
void update(PowerAxisLeaderDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -0,0 +1,79 @@ |
|||
package com.epmet.plugin.power.modules.axis.service; |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; |
|||
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
public interface PowerAxisTagService extends BaseService<PowerAxisTagEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PowerAxisTagDTO> |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
PageData<PowerAxisTagDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PowerAxisTagDTO> |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
List<PowerAxisTagDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return PowerAxisTagDTO |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
PowerAxisTagDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
void save(PowerAxisTagDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
void update(PowerAxisTagDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-04-18 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
package com.epmet.plugin.power.modules.axis.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO; |
|||
import com.epmet.plugin.power.modules.axis.dao.PowerAxisLeaderDao; |
|||
import com.epmet.plugin.power.modules.axis.entity.PowerAxisLeaderEntity; |
|||
import com.epmet.plugin.power.modules.axis.redis.PowerAxisLeaderRedis; |
|||
import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 动力主轴领导人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Service |
|||
public class PowerAxisLeaderServiceImpl extends BaseServiceImpl<PowerAxisLeaderDao, PowerAxisLeaderEntity> implements PowerAxisLeaderService { |
|||
|
|||
@Autowired |
|||
private PowerAxisLeaderRedis powerAxisLeaderRedis; |
|||
|
|||
@Override |
|||
public PageData<PowerAxisLeaderDTO> page(Map<String, Object> params) { |
|||
IPage<PowerAxisLeaderEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PowerAxisLeaderDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PowerAxisLeaderDTO> list(Map<String, Object> params) { |
|||
List<PowerAxisLeaderEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PowerAxisLeaderDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PowerAxisLeaderEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PowerAxisLeaderEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public PowerAxisLeaderDTO get(String id) { |
|||
PowerAxisLeaderEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, PowerAxisLeaderDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(PowerAxisLeaderDTO dto) { |
|||
PowerAxisLeaderEntity entity = ConvertUtils.sourceToTarget(dto, PowerAxisLeaderEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(PowerAxisLeaderDTO dto) { |
|||
PowerAxisLeaderEntity entity = ConvertUtils.sourceToTarget(dto, PowerAxisLeaderEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
package com.epmet.plugin.power.modules.axis.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; |
|||
import com.epmet.plugin.power.modules.axis.dao.PowerAxisTagDao; |
|||
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; |
|||
import com.epmet.plugin.power.modules.axis.redis.PowerAxisTagRedis; |
|||
import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 动力主轴标签 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-04-18 |
|||
*/ |
|||
@Service |
|||
public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, PowerAxisTagEntity> implements PowerAxisTagService { |
|||
|
|||
@Autowired |
|||
private PowerAxisTagRedis powerAxisTagRedis; |
|||
|
|||
@Override |
|||
public PageData<PowerAxisTagDTO> page(Map<String, Object> params) { |
|||
IPage<PowerAxisTagEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PowerAxisTagDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PowerAxisTagDTO> list(Map<String, Object> params) { |
|||
List<PowerAxisTagEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PowerAxisTagDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PowerAxisTagEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PowerAxisTagEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public PowerAxisTagDTO get(String id) { |
|||
PowerAxisTagEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, PowerAxisTagDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(PowerAxisTagDTO dto) { |
|||
PowerAxisTagEntity entity = ConvertUtils.sourceToTarget(dto, PowerAxisTagEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(PowerAxisTagDTO dto) { |
|||
PowerAxisTagEntity entity = ConvertUtils.sourceToTarget(dto, PowerAxisTagEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<?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.epmet.plugin.power.modules.axis.dao.PowerAxisLeaderDao"> |
|||
|
|||
<resultMap type="com.epmet.plugin.power.modules.axis.entity.PowerAxisLeaderEntity" id="powerAxisLeaderMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="structReferenceId" column="STRUCT_REFERENCE_ID"/> |
|||
<result property="gender" column="GENDER"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="interoduction" column="INTERODUCTION"/> |
|||
<result property="avatar" column="AVATAR"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,23 @@ |
|||
<?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.epmet.plugin.power.modules.axis.dao.PowerAxisTagDao"> |
|||
|
|||
<resultMap type="com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity" id="powerAxisTagMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="tagCategory" column="TAG_CATEGORY"/> |
|||
<result property="categoryCode" column="CATEGORY_CODE"/> |
|||
<result property="categoryName" column="CATEGORY_NAME"/> |
|||
<result property="sort" column="SORT"/> |
|||
<result property="forbiddenFlag" column="FORBIDDEN_FLAG"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue