| @@ -34,7 +34,7 @@ public class WxUserResumeController extends BaseController { | |||||
| if (null == record) record = new WxUserResume(); | if (null == record) record = new WxUserResume(); | ||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setSortColumns(BaseEntity.SortField.Id_DESC); | record.setSortColumns(BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxUserResume> page = wxUserResumeService.listAsPage(record, pageNum, pageSize); | |||||
| PageInfo<WxUserResume> page = wxUserResumeService.listAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -49,6 +49,7 @@ public class UploadController extends BaseController { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| try { | try { | ||||
| String fileName = multiReq.getOriginalFilename(); | |||||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | ||||
| String fileFormat = ""; | String fileFormat = ""; | ||||
| if (dot >= 0) { | if (dot >= 0) { | ||||
| @@ -56,6 +57,10 @@ public class UploadController extends BaseController { | |||||
| } | } | ||||
| ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | ResultData data = aliyunOSS.uploadFile(tenantEntity.getTenantId(), fileFormat, multiReq.getInputStream()); | ||||
| if(data.code == ResultData.SUCCESS) { | |||||
| Map _data = (Map)data.data; | |||||
| _data.put("fileName", fileName); | |||||
| } | |||||
| return data; | return data; | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| @@ -11,6 +12,7 @@ import com.iformall.domain.po.WxUserResume; | |||||
| import com.iformall.domain.vo.WxActivityJoinQuestionAnswer; | import com.iformall.domain.vo.WxActivityJoinQuestionAnswer; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.SysConfigService; | import com.iformall.service.SysConfigService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxUserResumeService; | import com.iformall.service.WxUserResumeService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -31,7 +33,6 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| /** | /** | ||||
| * @author gongbiao | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("api/resume") | @RequestMapping("api/resume") | ||||
| @@ -41,6 +42,8 @@ public class WxUserResumeController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxUserResumeService wxUserResumeService; | private WxUserResumeService wxUserResumeService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("提交简历") | @ApiOperation("提交简历") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| @@ -49,8 +52,25 @@ public class WxUserResumeController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "参数不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "参数不能为空"); | ||||
| } | } | ||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setUserId(this.getMemberId()); | |||||
| WxCUserBasicInfo cuser = wxCUserBasicInfoService.getById(record.getUserId(), record.getFinalTenantId()); | |||||
| if (null == cuser) { | |||||
| return new ResultData(Result.ERROR,"会员信息未查询到"); | |||||
| } | |||||
| record.setUserPhone(cuser.getPhone()); | |||||
| wxUserResumeService.saveOrUpdate(record); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("提交简历") | |||||
| @GetMapping("myResume") | |||||
| public ResultData myResume(WxUserResume record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setUserId(this.getMemberId()); | |||||
| PageInfo<WxUserResume> page = wxUserResumeService.listAsPage(record, 1, 1); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | } | ||||
| @@ -3,9 +3,14 @@ package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumCUserBaseInfoSex; | |||||
| import com.iformall.utils.DateUtils; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import java.time.LocalDate; | |||||
| import java.time.Period; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @TableName(value = "wx_user_resume") | @TableName(value = "wx_user_resume") | ||||
| @@ -24,12 +29,38 @@ public class WxUserResume extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="userName") | @io.swagger.annotations.ApiModelProperty(value="",name="userName") | ||||
| private String userName; | private String userName; | ||||
| @io.swagger.annotations.ApiModelProperty(value="",name="fileName") | |||||
| private String fileName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="filePath") | @io.swagger.annotations.ApiModelProperty(value="",name="filePath") | ||||
| private String filePath; | private String filePath; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "addCount") | @io.swagger.annotations.ApiModelProperty(value = "", name = "addCount") | ||||
| private String content; | private String content; | ||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCUserBaseInfoSex",name="sex") | |||||
| private Integer sex; | |||||
| @TableField(exist = false) | |||||
| private String sexName; | |||||
| public String getSexName() { | |||||
| if (null != sex) { | |||||
| return EnumCUserBaseInfoSex.getEnum(sex).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="birthDay") | |||||
| private Date birthDay; | |||||
| @TableField(exist = false) | |||||
| private Integer age; | |||||
| public Integer getAge() { | |||||
| if (null != birthDay) { | |||||
| int age = DateUtils.getBetweenYears(birthDay,new Date()); | |||||
| return age; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="createTime") | @io.swagger.annotations.ApiModelProperty(value="",name="createTime") | ||||
| private Date createTime; | private Date createTime; | ||||
| @@ -21,4 +21,6 @@ public interface WxUserResumeService { | |||||
| */ | */ | ||||
| PageInfo<WxUserResume> listAsPage(WxUserResume record, Integer pageIndex, Integer pageSize); | PageInfo<WxUserResume> listAsPage(WxUserResume record, Integer pageIndex, Integer pageSize); | ||||
| void saveOrUpdate(WxUserResume record); | |||||
| } | } | ||||
| @@ -2,10 +2,13 @@ package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxUserResume; | import com.iformall.domain.po.WxUserResume; | ||||
| import com.iformall.mapper.WxUserResumeMapper; | import com.iformall.mapper.WxUserResumeMapper; | ||||
| import com.iformall.service.WxUserResumeService; | import com.iformall.service.WxUserResumeService; | ||||
| import java.util.Date; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -23,5 +26,19 @@ public class WxUserResumeServiceImpl implements WxUserResumeService { | |||||
| PageInfo<WxUserResume> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxUserResumeMapper.findList(record)); | PageInfo<WxUserResume> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxUserResumeMapper.findList(record)); | ||||
| return page; | return page; | ||||
| } | } | ||||
| @Override | |||||
| public void saveOrUpdate(WxUserResume record) { | |||||
| if (null == record.getId()) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateTime(new Date()); | |||||
| record.setUpdateTime(new Date()); | |||||
| wxUserResumeMapper.insert(record); | |||||
| }else { | |||||
| record.setUpdateTime(new Date()); | |||||
| wxUserResumeMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -8,14 +8,18 @@ | |||||
| <result column="user_id" jdbcType="BIGINT" property="userId" /> | <result column="user_id" jdbcType="BIGINT" property="userId" /> | ||||
| <result column="user_phone" jdbcType="VARCHAR" property="userPhone" /> | <result column="user_phone" jdbcType="VARCHAR" property="userPhone" /> | ||||
| <result column="user_name" jdbcType="VARCHAR" property="userName" /> | <result column="user_name" jdbcType="VARCHAR" property="userName" /> | ||||
| <result column="file_name" jdbcType="VARCHAR" property="fileName" /> | |||||
| <result column="file_path" jdbcType="VARCHAR" property="filePath" /> | <result column="file_path" jdbcType="VARCHAR" property="filePath" /> | ||||
| <result column="content" jdbcType="VARCHAR" property="content" /> | <result column="content" jdbcType="VARCHAR" property="content" /> | ||||
| <result column="sex" jdbcType="INTEGER" property="sex" /> | |||||
| <result column="birth_day" jdbcType="DATE" property="birthDay" /> | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | ||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | ||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`user_phone`,`user_name`,`file_path`,`content`,`create_time`,`update_time` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`user_phone`,`user_name`,`file_name`,`file_path`,`content`, | |||||
| `sex`,`birth_day`,`create_time`,`update_time` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -36,6 +40,10 @@ | |||||
| and `user_id` = #{userId} | and `user_id` = #{userId} | ||||
| </if> | </if> | ||||
| <if test=" null != sex "> | |||||
| and `sex` = #{sex} | |||||
| </if> | |||||
| <if test=" null != userPhone and '' != userPhone"> | <if test=" null != userPhone and '' != userPhone"> | ||||
| and `user_phone` like concat('%', #{userPhone},'%') | and `user_phone` like concat('%', #{userPhone},'%') | ||||
| </if> | </if> | ||||
| @@ -44,6 +52,10 @@ | |||||
| and `user_name` like concat('%', #{userName},'%') | and `user_name` like concat('%', #{userName},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != content and '' != content"> | |||||
| and `content` like concat('%', #{content},'%') | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||