IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> 2021-08-04 -> 正文阅读

[开发工具]2021-08-04

项目:
1->元数据
select *from t_plat_function t where t.ID = ‘8c495b995282411bb9402433fcd39864’;
– 表2
select *from t_plat_function_component t where t.func_id = ‘8c495b995282411bb9402433fcd39864’;

– 表3
select *from t_plat_function_model t where t.func_id = ‘8c495b995282411bb9402433fcd39864’;

– 表4
select * from t_plat_meta_model t where t.ID=‘67a2cf99588c4339a95765c5593c2128’;

– 表5
select *from t_plat_meta_model_action t where t.model_id =‘67a2cf99588c4339a95765c5593c2128’;

– 表6
select * from t_plat_meta_model_column t where t.model_id =‘67a2cf99588c4339a95765c5593c2128’;

– 表7
select * from t_plat_service t where t.ID = ‘89e2c95e83f2466b88b68eafb3895d68’;

– 表8
select * from t_plat_service_data t where t.serv_id = ‘89e2c95e83f2466b88b68eafb3895d68’;

–>前端用react先简单写一套跑起来
–>基本的单表查询已经出来了
–>后端idea上写一个api接口 restlu风格
在这里插入图片描述

@Tag(name = "活动管理")
@RequestMapping("/v1/ecc/activity")
public interface EccActivityRemoteService {


    @Operation(description = "活动新增", tags = "活动管理")
    @PostMapping("/save")
    String createActivityInfo(@RequestBody ActivityVo activityVo);


    @Operation(description = "活动编辑", tags = "活动管理")
    @PostMapping("/updateActivityVo/{id}")
    String updateActivityVo(@RequestBody ActivityVo activityVo, @PathVariable("id") String id);



    @Operation(description = "活动删除", tags = "活动管理")
    @GetMapping("/deleteActivityVo/{id}")
    Map<String,Object> deleteActivityVo(@PathVariable("id") String id);


    @Operation(description = "状态更新", tags = "活动管理")
    @GetMapping("/updateStatus")
    void updateStatus();



}

–>vo包这个包里面主要是放的页面需要显示的东西

@Getter
@Setter
public class ActivityVo extends AbstractVo {

    /*活动id*/
    private String id;


    /*活动名称*/
    private String name;


    /*活动地点*/
    private String location;


    /*活动日期*/
    private Date beginDay;



    /*活动时间*/
    private Date[] activityTime;



    /*报名是否*/
    private String signUp;



    /*活动描述*/
    private String description;



    /*活动图片*/
    private String photo;




}

—>Controller层

   //活动模块
    int ACTVITY_ID_EMPTY = 202100068;
    int ACTVITY_SPID_EMPTY = 202100069;
    int ACTVITY_NAME_EMPTY = 202100070;
    int ACTVITY_LOCATION_EMPTY = 202100071;
    int ACTVITY_BEGINDAY_EMPTY = 202100072;
    int ACTVITY_ACTIVITYTIME_EMPTY = 202100073;
    int ACTVITY_SIGNUP_EMPTY = 202100074;


    //报名
    int ACTVITYSIGNUP_ID_EMPTY = 202100075;
    int ACTVITYSIGNUP_SPID_EMPTY = 202100076;
    int ACTVITYSIGNUP_NAME_EMPTY = 202100077;
    int ACTVITYSIGNUP_PHONE_EMPTY = 202100078;

—>Controller层

@RestController
public class EccActivityController extends BaseController implements EccActivityRemoteService {

    private static final String url = PropertyHolder.getProperty("fdfs.config.url");


    @Resource
    private EccActivityService eccActivityService;
    @Resource
    private EccActivitySignUpService eccActivitySignUpService;


    @Override
    public String createActivityInfo(@RequestBody ActivityVo activityVo) {

        // 验证活动名称
        Assert.notNull(activityVo.getName(), EccErrorCodeDef.ACTVITY_NAME_EMPTY);
        //验证活动地点
        Assert.notNull(activityVo.getLocation(), EccErrorCodeDef.ACTVITY_LOCATION_EMPTY);
        //验证活动日期
        Assert.notNull(activityVo.getBeginDay(), EccErrorCodeDef.ACTVITY_BEGINDAY_EMPTY);
        //验证活动时间
        Assert.notNull(activityVo.getActivityTime(), EccErrorCodeDef.ACTVITY_ACTIVITYTIME_EMPTY);
        //验证报名
        Assert.notNull(activityVo.getSignUp(), EccErrorCodeDef.ACTVITY_SIGNUP_EMPTY);


        // 保存数据
        OmActivityInfoEntity activityInfoEntity = new OmActivityInfoEntity();
        activityInfoEntity.setName(activityVo.getName());
        activityInfoEntity.setLocation(activityVo.getLocation());
        activityInfoEntity.setBeginDay(activityVo.getBeginDay());
        activityInfoEntity.setBeginDate(activityVo.getActivityTime()[0]);
        activityInfoEntity.setEndDate(activityVo.getActivityTime()[1]);

        if (StringUtils.isEmpty(activityVo.getSignUp())) {
            activityInfoEntity.setSignUp(GlobalConstants.NO);
        } else {
            activityInfoEntity.setSignUp(activityVo.getSignUp());
        }

        activityInfoEntity.setDescription(activityVo.getDescription());

        if (!StringUtils.isEmpty(activityVo.getPhoto())){
            activityInfoEntity.setPhoto(url+activityVo.getPhoto());
        }



        activityInfoEntity.setCreateTime(DateUtil.getCurrentDate());
        activityInfoEntity.setUpdateTime(DateUtil.getCurrentDate());

        activityInfoEntity.setSpId(super.getSpId());
        return eccActivityService.createActivityInfo(activityInfoEntity);


    }

    @Override
    public String updateActivityVo(ActivityVo activityVo, String id) {

        return eccActivityService.updateActivityVo(activityVo,id);

    }




    //删除
    @Override
    public Map<String,Object> deleteActivityVo(String id) {
        OmActivityInfoEntity activityInfoEntity = eccActivityService.getActuvityInfoById(id);
        Map<String,Object> resultMap = new HashMap<>();
        if(activityInfoEntity!=null){
            List<OmActivitySignUpEntity> signUpEntityList = eccActivitySignUpService.getSignUpInfoByPid(id);
            if(CollectionUtils.isEmpty(signUpEntityList)) {
                eccActivityService.deleteVisitor(activityInfoEntity);
                resultMap.put("resultCode","0");
                resultMap.put("resultMsg","删除成功");
                return resultMap;
            }else{
                resultMap.put("resultCode","1");
                resultMap.put("resultMsg","删除失败,活动已有人员报名");
                return resultMap;
            }
        }else{
            resultMap.put("resultCode","1");
            resultMap.put("resultMsg","删除失败,活动不存在");
            return resultMap;
        }
    }

    @Override
    public void updateStatus() {
        eccActivityService.updateStatus();
    }


}

```service层

```java
public interface EccActivityService {


    /*活动创建*/
    String createActivityInfo(OmActivityInfoEntity activityInfoEntity);

    //活动详情
    String updateActivityVo(ActivityVo activityVo, String id);


    //活动删除
    void deleteVisitor(@RequestBody OmActivityInfoEntity omActivityInfoEntity);



    // 1、根据Id 去查最新活动信息
    OmActivityInfoEntity getActuvityInfoById(String id);


    void updateStatus();
}

– 实现类

import com.hbasesoft.spcp.ecc.dao.EccOmActivitySignUpDao;
import com.hbasesoft.spcp.ecc.entity.OmActivityInfoEntity;
import com.hbasesoft.spcp.ecc.entity.OmActivitySignUpEntity;
import com.hbasesoft.spcp.ecc.entity.UmElderlyInfoEntity;
import com.hbasesoft.spcp.ecc.entity.UmIcRelationEntity;
import com.hbasesoft.spcp.ecc.service.EccActivitySignUpService;
import com.hbasesoft.spcp.ecc.vo.AcyivitySignUpVo;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EccActivitySignUpServiceImpl implements EccActivitySignUpService {


    @Resource
    EccOmActivitySignUpDao eccOmActivitySignUpDao;


    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public String createActivitySingUp(OmActivitySignUpEntity OmActivitySignUpEntity) {
        return eccOmActivitySignUpDao.save(OmActivitySignUpEntity).toString();
    }



    @Override
    @Transactional(readOnly = true)
    public List<OmActivitySignUpEntity> getAcyivitySignUpVoByIdNumber(String activityId, String idNumber,String Phone) {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(OmActivitySignUpEntity.class);
        detachedCriteria.add(Restrictions.eq(OmActivitySignUpEntity.ACTIVITY_ID, activityId));
        detachedCriteria.add(Restrictions.eq(OmActivitySignUpEntity.ID_NUMBER, idNumber));
        detachedCriteria.add(Restrictions.eq(OmActivitySignUpEntity.ACTIVITYSIGNUP_PHONE, Phone));
        List<OmActivitySignUpEntity> omActivitySignUpEntity = eccOmActivitySignUpDao.queryByCriteria(detachedCriteria);
        return omActivitySignUpEntity;
    }



    //取消报名
    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void delectAcyivitySignUp(OmActivitySignUpEntity omActivitySignUpEntity) {
        eccOmActivitySignUpDao.delete(omActivitySignUpEntity);
    }


    //签到更新
    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void updateActivitySignUp(OmActivitySignUpEntity omActivitySignUpEntity) {
        eccOmActivitySignUpDao.update(omActivitySignUpEntity);
    }



    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public OmActivitySignUpEntity getAcyivitySignUpVoById(String id) {
        return eccOmActivitySignUpDao.get(id);
    }

    @Override
    @Transactional(readOnly = true)
    public List<OmActivitySignUpEntity> queryAcyivitySignUp() {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(OmActivitySignUpEntity.class);
        return eccOmActivitySignUpDao.queryByCriteria(detachedCriteria);
    }


    @Override
    @Transactional(readOnly = true)
    public List<OmActivitySignUpEntity> getSignUpInfoByPid(String activityId) {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(OmActivitySignUpEntity.class);
        detachedCriteria.add(Restrictions.eq(OmActivitySignUpEntity.ACTIVITY_ID,activityId));
        return eccOmActivitySignUpDao.queryByCriteria(detachedCriteria);
    }
}

– Dao层

@Dao
public interface EccOmActivityInfoDao extends IBaseDao<OmActivityInfoEntity> {
}

– entity


```java
package com.hbasesoft.spcp.ecc.entity;

import com.hbasesoft.framework.db.core.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;

@Entity(name = "OM_ACTIVITY_INFO")
@Setter
@Getter
public class OmActivityInfoEntity extends BaseEntity {


    public final static String BEGIN_DAY = "beginDay";
    public final static String LOCATION = "location";
    public static final String ID = "id";
    /** ID */
    @Id
    @GeneratedValue(generator = "paymentableGenerator")
    @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
    @Column(name = "id")
    private String id;

    /**sp_id**/
    @Column(name = "sp_id")
    private String spId;

    /**name**/
    @Column(name = "name")
    private String name;

    /**location**/
    @Column(name = "location")
    private String location;


    /**begin_day**/
    @Column(name = "begin_day")
    private Date beginDay;



    /**begin_date**/
    @Column(name = "begin_date")
    private Date beginDate;


    /**end_date**/
    @Column(name = "end_date")
    private Date endDate;



    /**sign_up**/
    @Column(name = "sign_up")
    private String signUp;


    /**status**/
    @Column(name = "status")
    private String status;



    /**photo**/
    @Column(name = "photo")
    private String photo;



    /**description**/
    @Column(name = "description")
    private String description;



    /**update_time**/
    @Column(name = "update_time")
    private Date updateTime;



    /**create_time**/
    @Column(name = "create_time")
    private Date createTime;








}

![在这里插入图片描述](https://img-blog.csdnimg.cn/b952ab9b9ace4b28bee5d2f6f9eb236b.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MTYyMTg5Mw==,size_16,color_FFFFFF,t_70)


![在这里插入图片描述](https://img-blog.csdnimg.cn/6e5982779a7144ae9aa931ed1a2e56e2.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MTYyMTg5Mw==,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/171a8f6f7bca4bc48bef623c00ec895a.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MTYyMTg5Mw==,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/bf46ba5f3d494c649a34aa10d010e155.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MTYyMTg5Mw==,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/68b026a867ea45849128f0bfe84751f7.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl81MTYyMTg5Mw==,size_16,color_FFFFFF,t_70)

  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章      下一篇文章      查看所有文章
加:2021-08-05 17:33:21  更:2021-08-05 17:35:40 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年12日历 -2024/12/22 13:24:41-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码