Browse Source

资料审核

change 3 years ago
parent
commit
cfd75c88df

+ 24 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/base/ProfileTpController.java

@@ -9,6 +9,7 @@ import com.zhongzheng.modules.base.bo.*;
 import com.zhongzheng.modules.base.service.IProfileTpService;
 import com.zhongzheng.modules.base.service.IUserProfileService;
 import com.zhongzheng.modules.base.vo.ProfileTpVo;
+import com.zhongzheng.modules.base.vo.UserProfileVo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -70,7 +71,29 @@ public class ProfileTpController extends BaseController {
         return toAjax(iUserProfileService.insertByAddBo(bo) ? 1 : 0);
     }
 
-    @ApiOperation("新增填写资料审核")
+    /**
+     * 修改填写资料审核
+     */
+    @ApiOperation("修改填写资料审核")
+    @PostMapping("edit")
+    public AjaxResult<Void> edit(@RequestBody UserProfileEditBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return toAjax(iUserProfileService.updateByEditBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 获取填写资料审核详细信息
+     */
+    @ApiOperation("获取填写资料审核详细信息")
+    @GetMapping("/getInfo")
+    public AjaxResult<UserProfileVo> getInfo(UserProfileQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserProfileService.getInfo(bo));
+    }
+
+    @ApiOperation("导出word七大员")
     @PostMapping("/addWord")
     public AjaxResult<Void> addWord(@RequestBody UserProfileAddBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/mapper/UserProfileMapper.java

@@ -16,4 +16,6 @@ import java.util.List;
 public interface UserProfileMapper extends BaseMapper<UserProfile> {
 
     List<UserProfileVo> selectUserProfile(UserProfileQueryBo bo);
+
+    UserProfileVo getInfo(UserProfileQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/IUserProfileService.java

@@ -51,4 +51,6 @@ public interface IUserProfileService extends IService<UserProfile> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
 	String addWord(UserProfileAddBo bo);
+
+	UserProfileVo getInfo(UserProfileQueryBo bo);
 }

+ 20 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -95,10 +95,22 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
 
     @Override
     public Boolean updateByEditBo(UserProfileEditBo bo) {
-        UserProfile update = BeanUtil.toBean(bo, UserProfile.class);
-        validEntityBeforeSave(update);
+        UserProfile update = new UserProfile();
+        update.setId(bo.getId());
+        update.setCurrentStatus(2L);
         update.setUpdateTime(DateUtils.getNowTime());
-        return this.updateById(update);
+        this.updateById(update);
+
+        UserProfile addProfile = BeanUtil.toBean(bo,UserProfile.class);
+        addProfile.setCreateTime(DateUtils.getNowTime());
+        addProfile.setUpdateTime(DateUtils.getNowTime());
+        addProfile.setStatus(2);
+        UserProfileVo userProfileVo = this.queryById(bo.getId());
+        addProfile.setOneTime(userProfileVo.getOneTime());
+        addProfile.setLastTime(DateUtils.getNowTime());
+        addProfile.setCurrentStatus(1L);
+        addProfile.setChangeStatus(0);
+        return this.save(update);
     }
 
     /**
@@ -146,6 +158,11 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         return "11";
     }
 
+    @Override
+    public UserProfileVo getInfo(UserProfileQueryBo bo) {
+        return baseMapper.getInfo(bo);
+    }
+
     /**
      * 远程读取image转换为Base64字符串
      *

+ 34 - 0
zhongzheng-system/src/main/resources/mapper/modules/base/UserProfileMapper.xml

@@ -70,4 +70,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         order by up.create_time desc
     </select>
+
+    <select id="getInfo" parameterType="com.zhongzheng.modules.base.bo.UserProfileQueryBo" resultMap="UserProfileVo">
+        SELECT
+        up.*,
+        (SELECT u.realname FROM `user` u where u.user_id = up.user_id) as realname,
+        (SELECT u.user_account FROM `user` u where u.user_id = up.user_id) as user_account,
+        (SELECT u.telphone FROM `user` u where u.user_id = up.user_id) as telphone,
+        (SELECT u.id_card FROM `user` u where u.user_id = up.user_id) as id_card,
+        (SELECT g.goods_name FROM goods g where up.goods_id = g.goods_id) as goods_name,
+        (SELECT g.`code` FROM goods g where up.goods_id = g.goods_id) as goods_code,
+        (SELECT cet.education_name FROM goods g LEFT JOIN course_education_type cet on g.education_type_id = cet.id where up.goods_id = g.goods_id) as education_name,
+        (SELECT cet.project_name FROM goods g LEFT JOIN course_project_type cet on g.project_id = cet.id where up.goods_id = g.goods_id) as project_name,
+        (SELECT cet.business_name FROM goods g LEFT JOIN course_business cet on g.business_id = cet.id where up.goods_id = g.goods_id) as business_name
+        FROM
+        user_profile up
+        where 1=1
+          and up.current_status = 1
+        <if test="status != null and status.size()!=0 ">
+            AND up.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="id != null and id !='' ">
+            AND up.id =#{id}
+        </if>
+        <if test="userId != null and userId !='' ">
+            AND up.user_id =#{userId}
+        </if>
+        <if test="goodsId != null and goodsId !='' ">
+            AND up.goods_id =#{goodsId}
+        </if>
+        order by up.create_time desc LIMIT 1
+    </select>
 </mapper>