Browse Source

签到

master
sunyuchao 3 years ago
parent
commit
a24696f745
  1. 21
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActSignFormDTO.java
  2. 11
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActSignInRecordController.java
  3. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActSignInRecordService.java
  4. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java

21
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActSignFormDTO.java

@ -13,11 +13,30 @@ public class PartyActSignFormDTO implements Serializable {
/**
* 活动Id
*/
@NotBlank(message = "活动Id不能为空",groups = {AddGroup.class})
@NotBlank(message = "活动Id不能为空",groups = {UpdateGroup.class})
private String icPartyActId;
/**
* 签到地点
*/
@NotBlank(message = "签到地点不能为空",groups = {AddGroup.class})
private String address;
/**
* 签到地点纬度
*/
@NotBlank(message = "签到地点纬度不能为空",groups = {AddGroup.class})
private String latitude;
/**
* 签到地点经度
*/
@NotBlank(message = "签到地点经度不能为空",groups = {AddGroup.class})
private String longitude;
private Integer pageNo = 1;
private Integer pageSize = 20;
private Boolean isPage = false;
//token中信息
private String customerId;
private String userId;
}

11
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActSignInRecordController.java

@ -36,7 +36,7 @@ public class IcPartyActSignInRecordController {
@RequestMapping("list")
public Result<PageData<IcPartyActSignInRecordDTO>> list(@RequestBody PartyActSignFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class);
return new Result<PageData<IcPartyActSignInRecordDTO>>().ok(icPartyActSignInRecordService.list(formDTO));
}
@ -72,4 +72,13 @@ public class IcPartyActSignInRecordController {
return new Result();
}
@PostMapping("sign")
public Result sign(@LoginUser TokenDto tokenDto, @RequestBody PartyActSignFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icPartyActSignInRecordService.sign(formDTO);
return new Result();
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActSignInRecordService.java

@ -72,4 +72,6 @@ public interface IcPartyActSignInRecordService extends BaseService<IcPartyActSig
* @return
*/
Boolean checkSignIn(String icPartyActId, String userId);
void sign(PartyActSignFormDTO dto);
}

27
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java

@ -5,10 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcPartyActSignInRecordDao;
import com.epmet.modules.partyOrg.entity.IcPartyActSignInRecordEntity;
import com.epmet.modules.partyOrg.service.IcPartyActSignInRecordService;
@ -17,8 +22,10 @@ import com.epmet.resi.partymember.dto.partyOrg.form.PartyActSignFormDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Arrays;
import java.util.List;
@ -32,6 +39,8 @@ import java.util.Map;
*/
@Service
public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl<IcPartyActSignInRecordDao, IcPartyActSignInRecordEntity> implements IcPartyActSignInRecordService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
@ -96,4 +105,22 @@ public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl<IcPartyAc
return false;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void sign(PartyActSignFormDTO formDTO) {
//1.查询用户居民信息
IssueInitiatorFormDTO user = new IssueInitiatorFormDTO();
user.setUserId(formDTO.getUserId());
Result<CustomerUserDetailResultDTO> result = epmetUserOpenFeignClient.customerUserDetail(user);
if (!result.success() && null == result.getData()) {
throw new RenException("获取当前登录人居民信息失败");
}
//保存签到记录数据
IcPartyActSignInRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPartyActSignInRecordEntity.class);
entity.setEpmetUserId(formDTO.getUserId());
entity.setIdCard(result.getData().getIdNum());
entity.setUserRealName(result.getData().getName());
insert(entity);
}
}
Loading…
Cancel
Save