Commit 501ac08a by 杨伟程

日睡眠图表

parent e110043c
......@@ -18,6 +18,8 @@ import com.makeit.utils.third.wechat.WxUserInfo;
import com.makeit.utils.third.wechat.WechatUtil;
import com.makeit.utils.user.TokenUtil;
import com.makeit.utils.user.wechat.WechatUserInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -33,12 +35,16 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
@Autowired
private PlatOrgService platOrgService;
private static final Logger logger = LoggerFactory.getLogger(PlatElderChildrenInfoUserLoginWechatServiceImpl.class);
@Override
@Transactional
public WechatUserInfo login(WechatLoginPhoneDTO dto) {
WxUserInfo userInfo = WechatUtil.login(dto);
logger.info("userinfo:{}", userInfo);
PlatElderChildrenInfo childrenInfo = platElderChildrenInfoService.getOne(new QueryWrapper<PlatElderChildrenInfo>().lambda()
.eq(PlatElderChildrenInfo::getOpenid, userInfo.getOpenId()));
if (childrenInfo == null) {
......@@ -49,8 +55,6 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
PlatOrgSplitDTO vo = platOrgService.getOrgSplitVO(dto.getOrgId());
childrenInfo = new PlatElderChildrenInfo();
childrenInfo.setCityOrgId(vo.getCityOrgId());
childrenInfo.setDistrictOrgId(vo.getDistrictOrgId());
childrenInfo.setStreetOrgId(vo.getStreetOrgId());
......@@ -58,6 +62,8 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
childrenInfo.setCreateBy(userInfo.getNickName());
logger.info("children:{}", childrenInfo);
}
childrenInfo.setPhone(userInfo.getPhoneNumber());
......@@ -69,8 +75,8 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
childrenInfo.setUpdateBy(userInfo.getNickName());
PlatElderChildrenInfo finalChildrenInfo = childrenInfo;
NoFillUtil.executeCreate(()->{
NoFillUtil.executeUpdate(()->{
NoFillUtil.executeCreate(() -> {
NoFillUtil.executeUpdate(() -> {
platElderChildrenInfoService.saveOrUpdate(finalChildrenInfo);
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment