diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java new file mode 100644 index 0000000000..782e21231f --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java @@ -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; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java new file mode 100644 index 0000000000..6b9398b62e --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java @@ -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; +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java new file mode 100644 index 0000000000..2c5b143236 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java @@ -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> page(@RequestBody ThirdAppManageFormDTO formDTO){ + PageData page = thirdAppManageService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail/{id}") + public Result get(@PathVariable("id") String id){ + ThirdAppManageDTO data = thirdAppManageService.get(id); + return new Result().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(); + } + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java new file mode 100644 index 0000000000..e930e21767 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java @@ -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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java new file mode 100644 index 0000000000..a44b474fc4 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java @@ -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; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java new file mode 100644 index 0000000000..fbc7216cb8 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java @@ -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 { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-02-03 + */ + PageData 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); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java new file mode 100644 index 0000000000..edfcd0c477 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java @@ -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 implements ThirdAppManageService { + + @Override + public PageData page(ThirdAppManageFormDTO formDTO) { + PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper 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 list = baseDao.selectList(wrapper); + PageInfo 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); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql new file mode 100644 index 0000000000..563fcf3815 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql @@ -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='烟台第三方应用管理'; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml new file mode 100644 index 0000000000..afbc2b77fa --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file