| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.IdentityInfoMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.model.IdentityInfo; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.service.business.IdentityInfoService; |
| | | 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 io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | |
| | | @Autowired |
| | | private IdentityInfoMapper identityInfoMapper; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Override |
| | | public Integer create(IdentityInfo identityInfo) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<IdentityInfo> findMemberList(IdentityInfo identityInfo) { |
| | | if(identityInfo.getMemberId() == null){ |
| | | return new ArrayList<>(); |
| | | } |
| | | Member member = memberMapper.selectById(identityInfo.getMemberId()); |
| | | if(identityInfo == null || Constants.equalsInteger(member.getDeleted(),Constants.ONE)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<IdentityInfo> list = new ArrayList<>(); |
| | | |
| | | String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INENTITY_FILES).getCode(); |
| | | //类型:0=用工身份;1=货运身份;2=供餐身份; |
| | | if(!Constants.equalsInteger(member.getWorkerIdentity(),Constants.ZERO)){//用工身份 |
| | | addMemberModelByType(member.getId(),Constants.ZERO,list,path); |
| | | } |
| | | if(!Constants.equalsInteger(member.getDriverIdentity(),Constants.ZERO)){//货运身份 |
| | | addMemberModelByType(member.getId(),Constants.ONE,list,path); |
| | | } |
| | | if(!Constants.equalsInteger(member.getChefIdentity(),Constants.ZERO)){//供餐很粉 |
| | | addMemberModelByType(member.getId(),Constants.TWO,list,path); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | private void addMemberModelByType(Integer id,Integer type, List<IdentityInfo> list,String path) { |
| | | LambdaQueryWrapper<IdentityInfo> wrapper = new LambdaQueryWrapper<IdentityInfo>() |
| | | .orderByDesc(IdentityInfo::getCreateTime )//取最新一条 |
| | | .eq(IdentityInfo::getMemberId,id) |
| | | .eq(IdentityInfo::getType,type) |
| | | .eq(IdentityInfo::getDeleted,Constants.ZERO) |
| | | .last("limit 1"); |
| | | IdentityInfo model = identityInfoMapper.selectOne(wrapper); |
| | | if(model !=null){ |
| | | if(StringUtils.isNotBlank(model.getImg1())){ |
| | | model.setImg1(path+model.getImg1()); |
| | | } |
| | | if(StringUtils.isNotBlank(model.getImg2())){ |
| | | model.setImg1(path+model.getImg2()); |
| | | } |
| | | if(StringUtils.isNotBlank(model.getImg3())) { |
| | | model.setImg1(path + model.getImg3()); |
| | | } |
| | | if(StringUtils.isNotBlank(model.getImg4())){ |
| | | model.setImg1(path+model.getImg4()); |
| | | } |
| | | list.add(model); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PageData<IdentityInfo> findPage(PageWrap<IdentityInfo> pageWrap) { |
| | | IPage<IdentityInfo> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<IdentityInfo> queryWrapper = new QueryWrapper<>(); |