Bladeren bron

资料审核

change 3 jaren geleden
bovenliggende
commit
c03c8747af

+ 8 - 47
zhongzheng-api/src/main/java/com/zhongzheng/controller/base/ProfileTpController.java

@@ -8,7 +8,9 @@ import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.modules.base.bo.ProfileTpAddBo;
 import com.zhongzheng.modules.base.bo.ProfileTpEditBo;
 import com.zhongzheng.modules.base.bo.ProfileTpQueryBo;
+import com.zhongzheng.modules.base.bo.ProfileTpUserAddBo;
 import com.zhongzheng.modules.base.service.IProfileTpService;
+import com.zhongzheng.modules.base.service.IProfileTpUserService;
 import com.zhongzheng.modules.base.vo.ProfileTpVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -32,6 +34,7 @@ import java.util.List;
 public class ProfileTpController extends BaseController {
 
     private final IProfileTpService iProfileTpService;
+    private final IProfileTpUserService iProfileTpUserService;
 
     /**
      * 查询资料模板列表
@@ -44,28 +47,7 @@ public class ProfileTpController extends BaseController {
         return getDataTable(list);
     }
 
-    /**
-     * 获取所有使用商品ID
-     */
-    @ApiOperation("获取所有使用商品ID")
-    @GetMapping("/goods_list")
-    public AjaxResult<List<String>> goods_list(ProfileTpQueryBo bo) {
-        List<String> list = iProfileTpService.selectAllUseGoods(bo);
-        return AjaxResult.success(list);
-    }
 
-    /**
-     * 导出资料模板列表
-     */
-   /* @ApiOperation("导出资料模板列表")
-    @PreAuthorize("@ss.hasPermi('system:tp:export')")
-    @Log(title = "资料模板", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult<ProfileTpVo> export(ProfileTpQueryBo bo) {
-        List<ProfileTpVo> list = iProfileTpService.queryList(bo);
-        ExcelUtil<ProfileTpVo> util = new ExcelUtil<ProfileTpVo>(ProfileTpVo.class);
-        return util.exportExcel(list, "资料模板");
-    }*/
 
     /**
      * 获取资料模板详细信息
@@ -77,33 +59,12 @@ public class ProfileTpController extends BaseController {
     }
 
     /**
-     * 新增资料模板
+     * 新增填写资料审核
      */
-    @ApiOperation("新增资料模板")
-    @Log(title = "资料模板", businessType = BusinessType.INSERT)
+    @ApiOperation("新增填写资料审核")
+    @Log(title = "填写资料审核", businessType = BusinessType.INSERT)
     @PostMapping()
-    public AjaxResult<Void> add(@RequestBody ProfileTpAddBo bo) {
-        return toAjax(iProfileTpService.insertByAddBo(bo) ? 1 : 0);
-    }
-
-    /**
-     * 修改资料模板
-     */
-    @ApiOperation("修改资料模板")
-    @Log(title = "资料模板", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    public AjaxResult<Void> edit(@RequestBody ProfileTpEditBo bo) {
-        return toAjax(iProfileTpService.updateByEditBo(bo) ? 1 : 0);
+    public AjaxResult<Void> add(@RequestBody ProfileTpUserAddBo bo) {
+        return toAjax(iProfileTpUserService.insertByAddBo(bo) ? 1 : 0);
     }
-
-    /**
-     * 删除资料模板
-     */
-   /* @ApiOperation("删除资料模板")
-    @PreAuthorize("@ss.hasPermi('system:tp:remove')")
-    @Log(title = "资料模板" , businessType = BusinessType.DELETE)
-    @DeleteMapping("/{profileTpIds}")
-    public AjaxResult<Void> remove(@PathVariable Long[] profileTpIds) {
-        return toAjax(iProfileTpService.deleteWithValidByIds(Arrays.asList(profileTpIds), true) ? 1 : 0);
-    }*/
 }

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/ProfileTpUserAddBo.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.base.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 填写资料审核添加对象 profile_tp_user
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Data
+@ApiModel("填写资料审核添加对象")
+public class ProfileTpUserAddBo {
+
+    /** 用户ID */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+    /** 审核状态  1通过 0不通过 2待审 */
+    @ApiModelProperty("审核状态  1通过 0不通过 2待审")
+    private Integer status;
+    /** 添加时间 */
+    @ApiModelProperty("添加时间")
+    private Long createTime;
+    /** 修改时间 */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+    /** 第一次提交时间 */
+    @ApiModelProperty("第一次提交时间")
+    private Long oneTime;
+    /** 最后一次提交时间 */
+    @ApiModelProperty("最后一次提交时间")
+    private Long lastTime;
+    /** key值 */
+    @ApiModelProperty("key值")
+    private String keyValue;
+    /** 指派操作者 */
+    @ApiModelProperty("指派操作者")
+    private String createBy;
+    /** 当前状态 1为当前 2为审核记录 */
+    @ApiModelProperty("当前状态 1为当前 2为审核记录")
+    private Long currentStatus;
+    /** 变更状态 0变更 1否 */
+    @ApiModelProperty("变更状态 0变更 1否")
+    private Integer changeStatus;
+}

+ 61 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/ProfileTpUserEditBo.java

@@ -0,0 +1,61 @@
+package com.zhongzheng.modules.base.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 填写资料审核编辑对象 profile_tp_user
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Data
+@ApiModel("填写资料审核编辑对象")
+public class ProfileTpUserEditBo {
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long id;
+
+    /** 用户ID */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    /** 审核状态  1通过 0不通过 2待审 */
+    @ApiModelProperty("审核状态  1通过 0不通过 2待审")
+    private Integer status;
+
+
+    /** 修改时间 */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+
+    /** 第一次提交时间 */
+    @ApiModelProperty("第一次提交时间")
+    private Long oneTime;
+
+    /** 最后一次提交时间 */
+    @ApiModelProperty("最后一次提交时间")
+    private Long lastTime;
+
+    /** key值 */
+    @ApiModelProperty("key值")
+    private String keyValue;
+
+    /** 当前状态 1为当前 2为审核记录 */
+    @ApiModelProperty("当前状态 1为当前 2为审核记录")
+    private Long currentStatus;
+
+    /** 变更状态 0变更 1否 */
+    @ApiModelProperty("变更状态 0变更 1否")
+    private Integer changeStatus;
+
+}

+ 63 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/ProfileTpUserQueryBo.java

@@ -0,0 +1,63 @@
+package com.zhongzheng.modules.base.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+
+import com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 填写资料审核分页查询对象 profile_tp_user
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("填写资料审核分页查询对象")
+public class ProfileTpUserQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 用户ID */
+	@ApiModelProperty("用户ID")
+	private Long userId;
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	/** 审核状态  1通过 0不通过 2待审 */
+	@ApiModelProperty("审核状态  1通过 0不通过 2待审")
+	private Integer status;
+	/** 第一次提交时间 */
+	@ApiModelProperty("第一次提交时间")
+	private Long oneTime;
+	/** 最后一次提交时间 */
+	@ApiModelProperty("最后一次提交时间")
+	private Long lastTime;
+	/** key值 */
+	@ApiModelProperty("key值")
+	private String keyValue;
+	/** 当前状态 1为当前 2为审核记录 */
+	@ApiModelProperty("当前状态 1为当前 2为审核记录")
+	private Long currentStatus;
+	/** 变更状态 0变更 1否 */
+	@ApiModelProperty("变更状态 0变更 1否")
+	private Integer changeStatus;
+}

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/domain/ProfileTpUser.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.base.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 填写资料审核对象 profile_tp_user
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("profile_tp_user")
+public class ProfileTpUser implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
+    /** 用户ID */
+    private Long userId;
+    /** 商品ID */
+    private Long goodsId;
+    /** 审核状态  1通过 0不通过 2待审 */
+    private Integer status;
+    /** 添加时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 修改时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+    /** 第一次提交时间 */
+    private Long oneTime;
+    /** 最后一次提交时间 */
+    private Long lastTime;
+    /** key值 */
+    private String keyValue;
+    /** 指派操作者 */
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+    /** 当前状态 1为当前 2为审核记录 */
+    private Long currentStatus;
+    /** 变更状态 0变更 1否 */
+    private Integer changeStatus;
+}

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/mapper/ProfileTpUserMapper.java

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.base.mapper;
+
+import com.zhongzheng.modules.base.domain.ProfileTpUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 填写资料审核Mapper接口
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+public interface ProfileTpUserMapper extends BaseMapper<ProfileTpUser> {
+
+}

+ 52 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/IProfileTpUserService.java

@@ -0,0 +1,52 @@
+package com.zhongzheng.modules.base.service;
+
+import com.zhongzheng.modules.base.domain.ProfileTpUser;
+import com.zhongzheng.modules.base.vo.ProfileTpUserVo;
+import com.zhongzheng.modules.base.bo.ProfileTpUserQueryBo;
+import com.zhongzheng.modules.base.bo.ProfileTpUserAddBo;
+import com.zhongzheng.modules.base.bo.ProfileTpUserEditBo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 填写资料审核Service接口
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+public interface IProfileTpUserService extends IService<ProfileTpUser> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	ProfileTpUserVo queryById(Long id);
+
+	/**
+	 * 查询列表
+	 */
+	List<ProfileTpUserVo> queryList(ProfileTpUserQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入填写资料审核
+	 * @param bo 填写资料审核新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(ProfileTpUserAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改填写资料审核
+	 * @param bo 填写资料审核编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(ProfileTpUserEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 106 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileTpUserServiceImpl.java

@@ -0,0 +1,106 @@
+package com.zhongzheng.modules.base.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.utils.DateUtils;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.Page;
+import com.zhongzheng.modules.base.bo.ProfileTpUserAddBo;
+import com.zhongzheng.modules.base.bo.ProfileTpUserQueryBo;
+import com.zhongzheng.modules.base.bo.ProfileTpUserEditBo;
+import com.zhongzheng.modules.base.domain.ProfileTpUser;
+import com.zhongzheng.modules.base.mapper.ProfileTpUserMapper;
+import com.zhongzheng.modules.base.vo.ProfileTpUserVo;
+import com.zhongzheng.modules.base.service.IProfileTpUserService;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 填写资料审核Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Service
+public class ProfileTpUserServiceImpl extends ServiceImpl<ProfileTpUserMapper, ProfileTpUser> implements IProfileTpUserService {
+
+    @Override
+    public ProfileTpUserVo queryById(Long id){
+        ProfileTpUser db = this.baseMapper.selectById(id);
+        return BeanUtil.toBean(db, ProfileTpUserVo.class);
+    }
+
+    @Override
+    public List<ProfileTpUserVo> queryList(ProfileTpUserQueryBo bo) {
+        LambdaQueryWrapper<ProfileTpUser> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getUserId() != null, ProfileTpUser::getUserId, bo.getUserId());
+        lqw.eq(bo.getGoodsId() != null, ProfileTpUser::getGoodsId, bo.getGoodsId());
+        lqw.eq(bo.getStatus() != null, ProfileTpUser::getStatus, bo.getStatus());
+        lqw.eq(bo.getOneTime() != null, ProfileTpUser::getOneTime, bo.getOneTime());
+        lqw.eq(bo.getLastTime() != null, ProfileTpUser::getLastTime, bo.getLastTime());
+        lqw.eq(StrUtil.isNotBlank(bo.getKeyValue()), ProfileTpUser::getKeyValue, bo.getKeyValue());
+        lqw.eq(bo.getCurrentStatus() != null, ProfileTpUser::getCurrentStatus, bo.getCurrentStatus());
+        lqw.eq(bo.getChangeStatus() != null, ProfileTpUser::getChangeStatus, bo.getChangeStatus());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<ProfileTpUserVo> entity2Vo(Collection<ProfileTpUser> collection) {
+        List<ProfileTpUserVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, ProfileTpUserVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<ProfileTpUser> page = (Page<ProfileTpUser>)collection;
+            Page<ProfileTpUserVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(ProfileTpUserAddBo bo) {
+        ProfileTpUser add = BeanUtil.toBean(bo, ProfileTpUser.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(ProfileTpUserEditBo bo) {
+        ProfileTpUser update = BeanUtil.toBean(bo, ProfileTpUser.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(ProfileTpUser entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+}

+ 59 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/vo/ProfileTpUserVo.java

@@ -0,0 +1,59 @@
+package com.zhongzheng.modules.base.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 填写资料审核视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Data
+@ApiModel("填写资料审核视图对象")
+public class ProfileTpUserVo {
+	private static final long serialVersionUID = 1L;
+
+	/** $pkColumn.columnComment */
+	@ApiModelProperty("$pkColumn.columnComment")
+	private Long id;
+
+	/** 用户ID */
+	@Excel(name = "用户ID")
+	@ApiModelProperty("用户ID")
+	private Long userId;
+	/** 商品ID */
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	/** 审核状态  1通过 0不通过 2待审 */
+	@Excel(name = "审核状态  1通过 0不通过 2待审")
+	@ApiModelProperty("审核状态  1通过 0不通过 2待审")
+	private Integer status;
+	/** 第一次提交时间 */
+	@Excel(name = "第一次提交时间")
+	@ApiModelProperty("第一次提交时间")
+	private Long oneTime;
+	/** 最后一次提交时间 */
+	@Excel(name = "最后一次提交时间")
+	@ApiModelProperty("最后一次提交时间")
+	private Long lastTime;
+	/** key值 */
+	@Excel(name = "key值")
+	@ApiModelProperty("key值")
+	private String keyValue;
+	/** 当前状态 1为当前 2为审核记录 */
+	@Excel(name = "当前状态 1为当前 2为审核记录")
+	@ApiModelProperty("当前状态 1为当前 2为审核记录")
+	private Long currentStatus;
+	/** 变更状态 0变更 1否 */
+	@Excel(name = "变更状态 0变更 1否")
+	@ApiModelProperty("变更状态 0变更 1否")
+	private Integer changeStatus;
+}

+ 23 - 0
zhongzheng-system/src/main/resources/mapper/modules/base/ProfileTpUserMapper.xml

@@ -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.zhongzheng.modules.basem.mapper.ProfileTpUserMapper">
+
+    <resultMap type="com.zhongzheng.modules.base.domain.ProfileTpUser" id="ProfileTpUserResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="status" column="status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="oneTime" column="one_time"/>
+        <result property="lastTime" column="last_time"/>
+        <result property="keyValue" column="key_value"/>
+        <result property="createBy" column="create_by"/>
+        <result property="currentStatus" column="current_status"/>
+        <result property="changeStatus" column="change_status"/>
+    </resultMap>
+
+
+</mapper>