forked from luyan/epmet-cloud-lingshan
9 changed files with 537 additions and 0 deletions
@ -0,0 +1,112 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
public class ThirdAppManageDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 应用名称 |
|||
*/ |
|||
@NotBlank(message = "应用名称不能为空") |
|||
private String name; |
|||
|
|||
/** |
|||
* 应用链接 |
|||
*/ |
|||
@NotBlank(message = "应用链接不能为空") |
|||
private String link; |
|||
|
|||
/** |
|||
* 账号 |
|||
*/ |
|||
@NotBlank(message = "测试账号不能为空") |
|||
private String account; |
|||
|
|||
/** |
|||
* 密码 |
|||
*/ |
|||
@NotBlank(message = "测试密码不能为空") |
|||
private String password; |
|||
|
|||
/** |
|||
* 应用介绍 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 第三方公司名 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
@NotBlank(message = "联系人不能为空") |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
@NotBlank(message = "联系电话不能为空") |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除 1:删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
public class ThirdAppManageFormDTO extends PageFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
|
|||
/** |
|||
* 应用名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 第三方公司名 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 |
|||
*/ |
|||
private String status; |
|||
} |
@ -0,0 +1,83 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
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.dto.ThirdAppManageDTO; |
|||
import com.epmet.dto.form.ThirdAppManageFormDTO; |
|||
import com.epmet.service.ThirdAppManageService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("thirdAppManage") |
|||
public class ThirdAppManageController { |
|||
|
|||
@Autowired |
|||
private ThirdAppManageService thirdAppManageService; |
|||
|
|||
@PostMapping("page") |
|||
public Result<PageData<ThirdAppManageDTO>> page(@RequestBody ThirdAppManageFormDTO formDTO){ |
|||
PageData<ThirdAppManageDTO> page = thirdAppManageService.page(formDTO); |
|||
return new Result<PageData<ThirdAppManageDTO>>().ok(page); |
|||
} |
|||
|
|||
@PostMapping("detail/{id}") |
|||
public Result<ThirdAppManageDTO> get(@PathVariable("id") String id){ |
|||
ThirdAppManageDTO data = thirdAppManageService.get(id); |
|||
return new Result<ThirdAppManageDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody ThirdAppManageDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
thirdAppManageService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @Param dto |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:18 |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("audit") |
|||
public Result audit(@RequestBody ThirdAppManageDTO dto){ |
|||
//效验数据
|
|||
thirdAppManageService.audit(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 发布 |
|||
* |
|||
* @Param dto |
|||
* @Return {@link Result} |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:18 |
|||
*/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("release") |
|||
public Result release(@RequestBody ThirdAppManageDTO dto){ |
|||
//效验数据
|
|||
thirdAppManageService.release(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.ThirdAppManageEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Mapper |
|||
public interface ThirdAppManageDao extends BaseDao<ThirdAppManageEntity> { |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("third_app_manage") |
|||
public class ThirdAppManageEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 应用名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 应用链接 |
|||
*/ |
|||
private String link; |
|||
|
|||
/** |
|||
* 账号 |
|||
*/ |
|||
private String account; |
|||
|
|||
/** |
|||
* 密码 |
|||
*/ |
|||
private String password; |
|||
|
|||
/** |
|||
* 应用介绍 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 第三方公司名 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 |
|||
*/ |
|||
private String status; |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.ThirdAppManageDTO; |
|||
import com.epmet.dto.form.ThirdAppManageFormDTO; |
|||
import com.epmet.entity.ThirdAppManageEntity; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
public interface ThirdAppManageService extends BaseService<ThirdAppManageEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param formDTO |
|||
* @return PageData<ThirdAppManageDTO> |
|||
* @author generator |
|||
* @date 2023-02-03 |
|||
*/ |
|||
PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ThirdAppManageDTO |
|||
* @author generator |
|||
* @date 2023-02-03 |
|||
*/ |
|||
ThirdAppManageDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2023-02-03 |
|||
*/ |
|||
void save(ThirdAppManageDTO dto); |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
void audit(ThirdAppManageDTO dto); |
|||
|
|||
/** |
|||
* 发布 |
|||
* |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
void release(ThirdAppManageDTO dto); |
|||
} |
@ -0,0 +1,92 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.dao.ThirdAppManageDao; |
|||
import com.epmet.dto.ThirdAppManageDTO; |
|||
import com.epmet.dto.form.ThirdAppManageFormDTO; |
|||
import com.epmet.entity.ThirdAppManageEntity; |
|||
import com.epmet.service.ThirdAppManageService; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.github.pagehelper.page.PageMethod; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 烟台第三方应用管理 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-02-03 |
|||
*/ |
|||
@Service |
|||
public class ThirdAppManageServiceImpl extends BaseServiceImpl<ThirdAppManageDao, ThirdAppManageEntity> implements ThirdAppManageService { |
|||
|
|||
@Override |
|||
public PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO) { |
|||
PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|||
LambdaQueryWrapper<ThirdAppManageEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getName()), ThirdAppManageEntity::getName, formDTO.getName()); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getCompanyName()), ThirdAppManageEntity::getCompanyName, formDTO.getCompanyName()); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getContacts()), ThirdAppManageEntity::getContacts, formDTO.getContacts()); |
|||
wrapper.like(StringUtils.isNotBlank(formDTO.getMobile()), ThirdAppManageEntity::getMobile, formDTO.getMobile()); |
|||
wrapper.eq(StringUtils.isNotBlank(formDTO.getStatus()), ThirdAppManageEntity::getStatus, formDTO.getStatus()); |
|||
wrapper.orderByDesc(ThirdAppManageEntity::getCreatedTime); |
|||
List<ThirdAppManageEntity> list = baseDao.selectList(wrapper); |
|||
PageInfo<ThirdAppManageEntity> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(ConvertUtils.sourceToTarget(list, ThirdAppManageDTO.class), pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public ThirdAppManageDTO get(String id) { |
|||
ThirdAppManageEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ThirdAppManageDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ThirdAppManageDTO dto) { |
|||
ThirdAppManageEntity entity = ConvertUtils.sourceToTarget(dto, ThirdAppManageEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @param dto |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
@Override |
|||
public void audit(ThirdAppManageDTO dto) { |
|||
ThirdAppManageEntity entity = new ThirdAppManageEntity(); |
|||
entity.setId(dto.getId()); |
|||
entity.setStatus(dto.getStatus()); |
|||
baseDao.updateById(entity); |
|||
} |
|||
|
|||
/** |
|||
* 发布 |
|||
* |
|||
* @param dto |
|||
* @Param dto |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2023/2/3 14:19 |
|||
*/ |
|||
@Override |
|||
public void release(ThirdAppManageDTO dto) { |
|||
ThirdAppManageEntity entity = new ThirdAppManageEntity(); |
|||
entity.setId(dto.getId()); |
|||
entity.setStatus(NumConstant.THREE_STR); |
|||
baseDao.updateById(entity); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
CREATE TABLE `third_app_manage` ( |
|||
`ID` varchar(64) NOT NULL COMMENT 'id', |
|||
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', |
|||
`NAME` varchar(64) NOT NULL COMMENT '应用名称', |
|||
`LINK` varchar(128) NOT NULL COMMENT '应用链接', |
|||
`ACCOUNT` varchar(64) NOT NULL COMMENT '账号', |
|||
`PASSWORD` varchar(64) NOT NULL COMMENT '密码', |
|||
`REMARK` text COMMENT '应用介绍', |
|||
`COMPANY_NAME` varchar(64) DEFAULT '0' COMMENT '第三方公司名', |
|||
`CONTACTS` varchar(64) NOT NULL COMMENT '联系人', |
|||
`MOBILE` varchar(32) NOT NULL COMMENT '联系电话', |
|||
`STATUS` varchar(1) DEFAULT '0' COMMENT '状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】', |
|||
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', |
|||
`DEL_FLAG` tinyint(1) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', |
|||
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', |
|||
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', |
|||
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台第三方应用管理'; |
@ -0,0 +1,27 @@ |
|||
<?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.dao.ThirdAppManageDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.ThirdAppManageEntity" id="thirdAppManageMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="name" column="NAME"/> |
|||
<result property="link" column="LINK"/> |
|||
<result property="account" column="ACCOUNT"/> |
|||
<result property="password" column="PASSWORD"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="companyName" column="COMPANY_NAME"/> |
|||
<result property="contacts" column="CONTACTS"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="status" column="STATUS"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<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