|
@@ -21,15 +21,21 @@ import org.jeecg.modules.app.vo.LoginUserVO;
|
|
|
import org.jeecg.modules.app.vo.MsgInfoVO;
|
|
|
import org.jeecg.modules.app.vo.MsgVO;
|
|
|
import org.jeecg.modules.system.app.entity.FamilyMembers;
|
|
|
+import org.jeecg.modules.system.app.entity.StatisticsInfo;
|
|
|
import org.jeecg.modules.system.app.mapper.FamilyMembersMapper;
|
|
|
+import org.jeecg.modules.system.app.mapper.StatisticsInfoMapper;
|
|
|
import org.jeecg.modules.system.entity.*;
|
|
|
import org.jeecg.modules.system.mapper.*;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.UUID;
|
|
|
|
|
@@ -58,7 +64,11 @@ public class UserServiceImpl implements IUserService {
|
|
|
@Resource
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ StatisticsInfoMapper statisticsInfoMapper;
|
|
|
+
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public LoginUserVO wechatLogin(String code) {
|
|
|
try {
|
|
|
WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(code);
|
|
@@ -87,6 +97,28 @@ public class UserServiceImpl implements IUserService {
|
|
|
throw new JeecgBootException("登录失败", SC_INTERNAL_SERVER_ERROR_500);
|
|
|
}
|
|
|
familyMembersMapper.insert(new FamilyMembers().setDelFlag(0).setUserId(user.getId()).setUserType(0).setRealNameStatus(0));
|
|
|
+ int dateAsInt = Integer.parseInt(
|
|
|
+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))
|
|
|
+ );
|
|
|
+ //查询当天是否有平台统计信息
|
|
|
+ StatisticsInfo statisticsInfo= statisticsInfoMapper.findByOrgCode("A01",dateAsInt);
|
|
|
+ SysDepart byOrgCode = sysDepartMapper.findByOrgCode("A01");
|
|
|
+ if (byOrgCode==null){
|
|
|
+ throw new JeecgBootException("登录失败,平台部门不存在", SC_INTERNAL_SERVER_ERROR_500);
|
|
|
+ }
|
|
|
+ if (statisticsInfo==null){
|
|
|
+ statisticsInfo=new StatisticsInfo();
|
|
|
+ statisticsInfo.setDateDaily(dateAsInt);
|
|
|
+ statisticsInfo.setOrgCode(byOrgCode.getOrgCode());
|
|
|
+ statisticsInfo.setDeptId(byOrgCode.getId());
|
|
|
+ statisticsInfo.setAddNumber(1);
|
|
|
+ statisticsInfo.setUpdateTime(new Date());
|
|
|
+ statisticsInfo.setCreateTime(new Date());
|
|
|
+ }else {
|
|
|
+ statisticsInfo.setAddNumber(statisticsInfo.getAddNumber()+1);
|
|
|
+ statisticsInfo.setUpdateTime(new Date());
|
|
|
+ }
|
|
|
+ statisticsInfoMapper.insert(statisticsInfo);
|
|
|
}
|
|
|
return generateLoginUserVO(user);
|
|
|
} catch (WxErrorException e) {
|