12 changed files with 317 additions and 32 deletions
@ -1 +1 @@ |
|||||
Subproject commit cc0e5d4a31687b9224edc53d7b8d6414e7005d6a |
Subproject commit 037ee6574bf347ae34d5251735a99c5511d81794 |
@ -1 +1 @@ |
|||||
Subproject commit f49128405cd591b9aab7f129df01518c5aea143e |
Subproject commit 9d7cf7e81ccc634751f032f72e5333a90eb40ee2 |
@ -1 +1 @@ |
|||||
Subproject commit 7d5b8709e3fa8224b3463e120f7b79af1feea28c |
Subproject commit 6c53fd985cbaae46046a44a2d84f1eb9bff86a9d |
@ -0,0 +1,61 @@ |
|||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.EpdcAppShowIdentityFormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO; |
||||
|
import com.elink.esua.epdc.service.UserInfoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* create by: zhangfenghe |
||||
|
* description: 党员亮身份表 |
||||
|
* create time: 2021/8/29$ 10:32$ |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("partyMember") |
||||
|
public class EpdcAppPartyMemberController { |
||||
|
|
||||
|
@Autowired |
||||
|
private UserInfoService userInfoService; |
||||
|
|
||||
|
@PostMapping("showIdentity") |
||||
|
public Result saveShowIdentity(@RequestBody EpdcAppShowIdentityFormDTO formDto){ |
||||
|
ValidatorUtils.validateEntity(formDto, AddGroup.class, DefaultGroup.class); |
||||
|
userInfoService.save(formDto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("dentityDetail/{userId}") |
||||
|
public Result<EpdcAppIdentityDetailResultDTO> getDentityDetail(@PathVariable("userId") String userId){ |
||||
|
EpdcAppIdentityDetailResultDTO data = userInfoService.getDentityDetail(userId); |
||||
|
return new Result<EpdcAppIdentityDetailResultDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 党建引领-党员亮身份推荐 |
||||
|
* @params [id] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/30 9:26 |
||||
|
*/ |
||||
|
@PostMapping("brightIdentity/recommended/{id}") |
||||
|
public Result recommended(@PathVariable("id") String id){ |
||||
|
return userInfoService.recommended(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 党建引领-党员亮身份取消推荐 |
||||
|
* @params [id] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/30 9:26 |
||||
|
*/ |
||||
|
@PostMapping("brightIdentity/recommendedCancel/{id}") |
||||
|
public Result recommendedCancel(@PathVariable("id") String id){ |
||||
|
return userInfoService.recommendedCancel(id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package com.elink.esua.epdc.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO; |
||||
|
import com.elink.esua.epdc.entity.UserInfoEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
/** |
||||
|
* |
||||
|
* 用户信息表-党员亮身份 |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/29 11:43 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface UserInfoDao extends BaseDao<UserInfoEntity> { |
||||
|
|
||||
|
String selectDentityIdByUserId(String userId); |
||||
|
|
||||
|
/** |
||||
|
*获取党员亮身份详情接口 |
||||
|
* @params [userId] |
||||
|
* @return com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO |
||||
|
* @author jyyzz |
||||
|
* @since 2021/8/29 11:44 |
||||
|
*/ |
||||
|
EpdcAppIdentityDetailResultDTO selectDentityDetail(String userId); |
||||
|
|
||||
|
/** |
||||
|
* 党建引领-党员亮身份推荐 |
||||
|
* @params [id] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/30 9:26 |
||||
|
*/ |
||||
|
void recommended(String id); |
||||
|
|
||||
|
/** |
||||
|
* 党建引领-党员亮身份取消推荐 |
||||
|
* @params [id] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/30 9:26 |
||||
|
*/ |
||||
|
void recommendedCancel(String id); |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.elink.esua.epdc.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* create by: zhangfenghe |
||||
|
* description: 用户信息表 |
||||
|
* create time: 2021/8/29$ 10:47$ |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@TableName("epdc_user_info") |
||||
|
public class UserInfoEntity extends BaseEpdcEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 头像地址 |
||||
|
*/ |
||||
|
private String headUrl; |
||||
|
|
||||
|
/** |
||||
|
* 格言 |
||||
|
*/ |
||||
|
private String motto; |
||||
|
|
||||
|
/** |
||||
|
* 承诺 |
||||
|
*/ |
||||
|
private String promise; |
||||
|
|
||||
|
/** |
||||
|
* 服务范围 |
||||
|
*/ |
||||
|
private String serviceArea; |
||||
|
|
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.EpdcAppShowIdentityFormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO; |
||||
|
import com.elink.esua.epdc.entity.UserInfoEntity; |
||||
|
|
||||
|
public interface UserInfoService extends BaseService<UserInfoEntity> { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 用户信息表 |
||||
|
* @params [dto] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/29 11:00 |
||||
|
*/ |
||||
|
void save(EpdcAppShowIdentityFormDTO dto); |
||||
|
|
||||
|
EpdcAppIdentityDetailResultDTO getDentityDetail(String userId); |
||||
|
|
||||
|
/** |
||||
|
* 党建引领-党员亮身份推荐 |
||||
|
* @params [id] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/30 9:26 |
||||
|
*/ |
||||
|
Result recommended(String id); |
||||
|
|
||||
|
/** |
||||
|
* 党建引领-党员亮身份取消推荐 |
||||
|
* @params [id] |
||||
|
* @return void |
||||
|
* @author zhangfenghe |
||||
|
* @since 2021/8/30 9:26 |
||||
|
*/ |
||||
|
Result recommendedCancel(String id); |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.dao.UserInfoDao; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.EpdcAppShowIdentityFormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO; |
||||
|
import com.elink.esua.epdc.entity.UserInfoEntity; |
||||
|
import com.elink.esua.epdc.service.UserInfoService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* create by: zhangfenghe |
||||
|
* description: 党员亮身份 |
||||
|
* create time: 2021/8/29$ 11:27$ |
||||
|
*/ |
||||
|
@Service |
||||
|
public class UserInfoServiceImpl extends BaseServiceImpl<UserInfoDao, UserInfoEntity> implements UserInfoService { |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(EpdcAppShowIdentityFormDTO dto) { |
||||
|
UserInfoEntity entity = ConvertUtils.sourceToTarget(dto,UserInfoEntity.class); |
||||
|
String id = baseDao.selectDentityIdByUserId(dto.getUserId()); |
||||
|
if ("".equalsIgnoreCase(id) || null == id){ |
||||
|
insert(entity); |
||||
|
}else { |
||||
|
entity.setId(id); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public EpdcAppIdentityDetailResultDTO getDentityDetail(String userId) { |
||||
|
EpdcAppIdentityDetailResultDTO dentityDetail = baseDao.selectDentityDetail(userId); |
||||
|
return dentityDetail; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result recommended(String id) { |
||||
|
AssertUtils.isBlank(id,"id"); |
||||
|
baseDao.recommended(id); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result recommendedCancel(String id) { |
||||
|
AssertUtils.isBlank(id,"id"); |
||||
|
baseDao.recommendedCancel(id); |
||||
|
return new Result(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
<?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.elink.esua.epdc.dao.UserInfoDao"> |
||||
|
|
||||
|
<select id="selectDentityDetail" resultType="com.elink.esua.epdc.dto.epdc.result.EpdcAppIdentityDetailResultDTO"> |
||||
|
SELECT |
||||
|
ui.HEAD_URL, |
||||
|
ui.MOTTO, |
||||
|
ui.PROMISE, |
||||
|
ui.SERVICE_AREA |
||||
|
FROM epdc_user_info ui |
||||
|
WHERE ui.USER_ID = #{userId} |
||||
|
AND ui.DEL_FLAG = '0' |
||||
|
|
||||
|
</select> |
||||
|
<select id="selectDentityIdByUserId" resultType="String"> |
||||
|
SELECT |
||||
|
id |
||||
|
FROM epdc_user_info |
||||
|
WHERE USER_ID = #{userId} |
||||
|
AND DEL_FLAG = '0' |
||||
|
</select> |
||||
|
<update id="recommended"> |
||||
|
UPDATE esua_epdc_user.epdc_user_info SET RECOMMEND_FLAG = '1' WHERE ID = #{id} AND DEL_FALG = '0' |
||||
|
</update> |
||||
|
<update id="recommendedCancel"> |
||||
|
UPDATE esua_epdc_user.epdc_user_info SET RECOMMEND_FLAG = '0' WHERE ID = #{id} AND DEL_FALG = '0' |
||||
|
</update> |
||||
|
</mapper> |
Loading…
Reference in new issue