Browse Source

新增动力主轴负责人关联关系相关代码

dev_power_axis
YUJT 3 years ago
parent
commit
bd3b47ecd9
  1. 2
      epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm
  2. 69
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisStructLeaderDTO.java
  3. 82
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java
  4. 16
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java
  5. 5
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisLeaderEntity.java
  6. 39
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisStructLeaderEntity.java
  7. 48
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/excel/PowerAxisStructLeaderExcel.java
  8. 30
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/redis/PowerAxisStructLeaderRedis.java
  9. 78
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java
  10. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java
  11. 85
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java
  12. 1
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml
  13. 20
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml
  14. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml

2
epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm

@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import ${main}.commons.mybatis.service.impl.BaseServiceImpl; import ${main}.commons.mybatis.service.impl.BaseServiceImpl;
import ${main}.commons.tools.page.PageData; import ${main}.commons.tools.page.PageData;
import ${main}.commons.tools.utils.ConvertUtils; import ${main}.commons.tools.utils.ConvertUtils;
import ${package}.commons.tools.constant.FieldConstant; import ${main}.commons.tools.constant.FieldConstant;
import ${package}.dao.${className}Dao; import ${package}.dao.${className}Dao;
import ${packageDTO}.${className}DTO; import ${packageDTO}.${className}DTO;
import ${package}.entity.${className}Entity; import ${package}.entity.${className}Entity;

69
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisStructLeaderDTO.java

@ -0,0 +1,69 @@
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-19
*/
@Data
public class PowerAxisStructLeaderDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 关联动力主轴ID
*/
private String structReferenceId;
/**
* 负责人ID
*/
private String leaderId;
/**
* 删除标识 0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

82
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java

@ -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.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO;
import com.epmet.plugin.power.modules.axis.excel.PowerAxisStructLeaderExcel;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
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-19
*/
@RestController
@RequestMapping("powerAxisStructLeader")
public class PowerAxisStructLeaderController {
@Autowired
private PowerAxisStructLeaderService powerAxisStructLeaderService;
@RequestMapping("page")
public Result<PageData<PowerAxisStructLeaderDTO>> page(@RequestParam Map<String, Object> params){
PageData<PowerAxisStructLeaderDTO> page = powerAxisStructLeaderService.page(params);
return new Result<PageData<PowerAxisStructLeaderDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<PowerAxisStructLeaderDTO> get(@PathVariable("id") String id){
PowerAxisStructLeaderDTO data = powerAxisStructLeaderService.get(id);
return new Result<PowerAxisStructLeaderDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody PowerAxisStructLeaderDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
powerAxisStructLeaderService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody PowerAxisStructLeaderDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
powerAxisStructLeaderService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
powerAxisStructLeaderService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PowerAxisStructLeaderDTO> list = powerAxisStructLeaderService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisStructLeaderExcel.class);
}
}

16
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java

@ -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.PowerAxisStructLeaderEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 动力主轴负责人关系
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-19
*/
@Mapper
public interface PowerAxisStructLeaderDao extends BaseDao<PowerAxisStructLeaderEntity> {
}

5
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisLeaderEntity.java

@ -31,11 +31,6 @@ public class PowerAxisLeaderEntity extends BaseEpmetEntity {
*/ */
private String name; private String name;
/**
* 关联动力主轴ID
*/
private String structReferenceId;
/** /**
* 性别 1男2女0未知 * 性别 1男2女0未知
*/ */

39
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/entity/PowerAxisStructLeaderEntity.java

@ -0,0 +1,39 @@
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-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pli_power_axis_struct_leader")
public class PowerAxisStructLeaderEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 关联动力主轴ID
*/
private String structReferenceId;
/**
* 负责人ID
*/
private String leaderId;
}

48
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/excel/PowerAxisStructLeaderExcel.java

@ -0,0 +1,48 @@
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-19
*/
@Data
public class PowerAxisStructLeaderExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "关联动力主轴ID")
private String structReferenceId;
@Excel(name = "负责人ID")
private String leaderId;
@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;
}

30
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/redis/PowerAxisStructLeaderRedis.java

@ -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-19
*/
@Component
public class PowerAxisStructLeaderRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

78
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java

@ -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.PowerAxisStructLeaderDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import java.util.List;
import java.util.Map;
/**
* 动力主轴负责人关系
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-19
*/
public interface PowerAxisStructLeaderService extends BaseService<PowerAxisStructLeaderEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PowerAxisStructLeaderDTO>
* @author generator
* @date 2022-04-19
*/
PageData<PowerAxisStructLeaderDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PowerAxisStructLeaderDTO>
* @author generator
* @date 2022-04-19
*/
List<PowerAxisStructLeaderDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PowerAxisStructLeaderDTO
* @author generator
* @date 2022-04-19
*/
PowerAxisStructLeaderDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-04-19
*/
void save(PowerAxisStructLeaderDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-04-19
*/
void update(PowerAxisStructLeaderDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-04-19
*/
void delete(String[] ids);
}

4
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java

@ -9,10 +9,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO; import com.epmet.plugin.power.dto.axis.PowerAxisLeaderDTO;
import com.epmet.plugin.power.modules.axis.dao.PowerAxisLeaderDao; 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.entity.PowerAxisLeaderEntity;
import com.epmet.plugin.power.modules.axis.redis.PowerAxisLeaderRedis;
import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -29,8 +27,6 @@ import java.util.Map;
@Service @Service
public class PowerAxisLeaderServiceImpl extends BaseServiceImpl<PowerAxisLeaderDao, PowerAxisLeaderEntity> implements PowerAxisLeaderService { public class PowerAxisLeaderServiceImpl extends BaseServiceImpl<PowerAxisLeaderDao, PowerAxisLeaderEntity> implements PowerAxisLeaderService {
@Autowired
private PowerAxisLeaderRedis powerAxisLeaderRedis;
@Override @Override
public PageData<PowerAxisLeaderDTO> page(Map<String, Object> params) { public PageData<PowerAxisLeaderDTO> page(Map<String, Object> params) {

85
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java

@ -0,0 +1,85 @@
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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructLeaderDao;
import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
import org.apache.commons.lang3.StringUtils;
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-19
*/
@Service
public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl<PowerAxisStructLeaderDao, PowerAxisStructLeaderEntity> implements PowerAxisStructLeaderService {
// @Autowired
// private PowerAxisStructLeaderRedis powerAxisStructLeaderRedis;
@Override
public PageData<PowerAxisStructLeaderDTO> page(Map<String, Object> params) {
IPage<PowerAxisStructLeaderEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PowerAxisStructLeaderDTO.class);
}
@Override
public List<PowerAxisStructLeaderDTO> list(Map<String, Object> params) {
List<PowerAxisStructLeaderEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PowerAxisStructLeaderDTO.class);
}
private QueryWrapper<PowerAxisStructLeaderEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PowerAxisStructLeaderEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PowerAxisStructLeaderDTO get(String id) {
PowerAxisStructLeaderEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PowerAxisStructLeaderDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PowerAxisStructLeaderDTO dto) {
PowerAxisStructLeaderEntity entity = ConvertUtils.sourceToTarget(dto, PowerAxisStructLeaderEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PowerAxisStructLeaderDTO dto) {
PowerAxisStructLeaderEntity entity = ConvertUtils.sourceToTarget(dto, PowerAxisStructLeaderEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

1
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisLeaderDao.xml

@ -7,7 +7,6 @@
<result property="id" column="ID"/> <result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/> <result property="customerId" column="CUSTOMER_ID"/>
<result property="name" column="NAME"/> <result property="name" column="NAME"/>
<result property="structReferenceId" column="STRUCT_REFERENCE_ID"/>
<result property="gender" column="GENDER"/> <result property="gender" column="GENDER"/>
<result property="mobile" column="MOBILE"/> <result property="mobile" column="MOBILE"/>
<result property="interoduction" column="INTERODUCTION"/> <result property="interoduction" column="INTERODUCTION"/>

20
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml

@ -0,0 +1,20 @@
<?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.PowerAxisStructLeaderDao">
<resultMap type="com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity" id="powerAxisStructLeaderMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="structReferenceId" column="STRUCT_REFERENCE_ID"/>
<result property="leaderId" column="LEADER_ID"/>
<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>

2
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml

@ -28,7 +28,7 @@
</resultMap> </resultMap>
<select id="listSimpleAll" resultMap="listSimpleAllResultMap"> <select id="listSimpleAll" resultMap="listSimpleAllResultMap">
select t.TAG_CATEGORY,t.CATEGORY_NAME,t.CATEGORY_CODE from pli_power_axis_tag t where t.DEL_FLAG = '0' and t.FORBIDDEN_FLAG = '0' select t.TAG_CATEGORY,t.CATEGORY_NAME,t.CATEGORY_CODE from pli_power_axis_tag t where t.DEL_FLAG = '0' and t.FORBIDDEN_FLAG = '0' order by t.SORT
</select> </select>

Loading…
Cancel
Save