| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import cn.hutool.core.util.PhoneUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.Jwt.JwtPayLoad; |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.core.annotation.excel.ExcelImporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.wx.WXConstant; |
| | | import com.doumee.dao.admin.request.LaborEmpowerDTO; |
| | | import com.doumee.dao.admin.request.LaborMemberDTO; |
| | | import com.doumee.dao.admin.response.MemberInfoDTO; |
| | | import com.doumee.dao.business.MemberMapper; |
| | |
| | | import com.doumee.dao.business.model.Empower; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.TrainTime; |
| | | import com.doumee.dao.web.response.WxAuthorizeVO; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | @Autowired |
| | | private TrainTimeMapper trainTimeMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Override |
| | | public Integer create(Member member) { |
| | | memberMapper.insert(member); |
| | |
| | | |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | if (PhoneUtil.isPhone(member.getPhone())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"电话号码格式有误"); |
| | | } |
| | | if (IdcardUtil.isValidCard(member.getIdcardNo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"身份证号格式有误"); |
| | | } |
| | |
| | | QueryWrapper<Member> wrapper = new QueryWrapper<>(member); |
| | | return memberMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void importMemberBatch(LaborEmpowerDTO laborEmpowerDTO) { |
| | | try { |
| | | ExcelImporter ie = new ExcelImporter(laborEmpowerDTO.getFile(),0,0); |
| | | |
| | | List<LaborEmpowerDTO.LaborMemberEmpower> dataList = ie.getDataList(LaborEmpowerDTO.LaborMemberEmpower.class,null); |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"文件无数据记录"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | // |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /********************************************公众号接口***********************************************************************/ |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信授权接口 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public WxAuthorizeVO wxAuthorize(String code){ |
| | | String appId = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_APPID).getCode(); |
| | | String appSecret = systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_SECRET).getCode(); |
| | | String getTokenUrl = WXConstant.GET_USER_INFO_URL.replace("CODE", code) |
| | | .replace("APPID", appId).replace("SECRET", appSecret); |
| | | JSONObject tokenJson = JSONObject.parseObject(HttpsUtil.get(getTokenUrl,true)); |
| | | String openId = null; |
| | | if(!Objects.isNull(tokenJson.get("access_token"))){ |
| | | openId = tokenJson.getString("openid"); |
| | | } |
| | | WxAuthorizeVO wxAuthorizeVO = new WxAuthorizeVO(); |
| | | wxAuthorizeVO.setOpenid(openId); |
| | | return wxAuthorizeVO; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |