Browse Source

资料审核

change 3 năm trước cách đây
mục cha
commit
ddae63f909

+ 80 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/base/ProfileTpUserController.java

@@ -0,0 +1,80 @@
+package com.zhongzheng.controller.base;
+
+import java.util.List;
+import java.util.Arrays;
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+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.zhongzheng.modules.base.service.IProfileTpUserService;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 填写资料审核Controller
+ * 
+ * @author ruoyi
+ * @date 2021-12-20
+ */
+@Api(value = "填写资料审核控制器", tags = {"填写资料审核管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/system/user")
+public class ProfileTpUserController extends BaseController {
+
+    private final IProfileTpUserService iProfileTpUserService;
+
+    /**
+     * 查询填写资料审核列表
+     */
+    @ApiOperation("查询填写资料审核列表")
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo<ProfileTpUserVo> list(ProfileTpUserQueryBo bo) {
+        startPage();
+        List<ProfileTpUserVo> list = iProfileTpUserService.queryList(bo);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取填写资料审核详细信息
+     */
+    @ApiOperation("获取填写资料审核详细信息")
+    @PreAuthorize("@ss.hasPermi('system:user:query')")
+    @GetMapping("/{id}")
+    public AjaxResult<ProfileTpUserVo> getInfo(@PathVariable("id" ) Long id) {
+        return AjaxResult.success(iProfileTpUserService.queryById(id));
+    }
+
+
+    /**
+     * 修改填写资料审核
+     */
+    @ApiOperation("修改填写资料审核")
+    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+    @Log(title = "填写资料审核", businessType = BusinessType.UPDATE)
+    @PostMapping()
+    public AjaxResult<Void> edit(@RequestBody ProfileTpUserEditBo bo) {
+        return toAjax(iProfileTpUserService.updateByEditBo(bo) ? 1 : 0);
+    }
+
+}

+ 6 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/base/ProfileTpController.java

@@ -5,6 +5,8 @@ import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.base.bo.ProfileTpAddBo;
 import com.zhongzheng.modules.base.bo.ProfileTpEditBo;
 import com.zhongzheng.modules.base.bo.ProfileTpQueryBo;
@@ -12,6 +14,7 @@ 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 com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -35,6 +38,7 @@ public class ProfileTpController extends BaseController {
 
     private final IProfileTpService iProfileTpService;
     private final IProfileTpUserService iProfileTpUserService;
+    private final WxTokenService wxTokenService;
 
     /**
      * 查询资料模板列表
@@ -65,6 +69,8 @@ public class ProfileTpController extends BaseController {
     @Log(title = "填写资料审核", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody ProfileTpUserAddBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
         return toAjax(iProfileTpUserService.insertByAddBo(bo) ? 1 : 0);
     }
 }

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

@@ -3,6 +3,7 @@ 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 com.zhongzheng.common.utils.SecurityUtils;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -76,6 +77,13 @@ public class ProfileTpUserServiceImpl extends ServiceImpl<ProfileTpUserMapper, P
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
+        add.setChangeStatus(0);
+        add.setCreateBy(SecurityUtils.getUsername());
+        add.setOneTime(DateUtils.getNowTime());
+        add.setLastTime(DateUtils.getNowTime());
+        add.setUserId(bo.getUserId());
+        add.setCurrentStatus(1L);
+        add.setStatus(2);
         return this.save(add);
     }