| | |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | userAction.setIsdeleted(Constants.ZERO); |
| | | userAction.setCreateDate(new Date()); |
| | | userAction.setCreator(loginUserInfo.getId()); |
| | | if(Constants.equalsInteger(result.getType(),Constants.TWO)){ |
| | | userAction.setType(Constants.ONE); |
| | | } |
| | | if(Constants.equalsInteger(result.getType(),Constants.ZERO)){ |
| | | userAction.setType(Constants.TWO); |
| | | } |
| | | userAction.setMemberId(result.getId()+""); |
| | | userAction.setBeforeStatus(status); |
| | | userActionJoinMapper.insert(userAction); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateRemoveStatusById(List<Member> members) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | Date date=new Date(); |
| | | members.stream().forEach(s ->{ |
| | | Member result=memberMapper.selectById(s.getId()); |
| | | Integer status=result.getStatus(); |
| | | Member update = new Member(); |
| | | update.setEditDate(date); |
| | | update.setEditor(loginUserInfo.getId()); |
| | | update.setStatus(s.getStatus()); |
| | | update.setId(s.getId()); |
| | | memberMapper.updateById(update); |
| | | |
| | | UserAction userAction=new UserAction(); |
| | | userAction.setIsdeleted(Constants.ZERO); |
| | | userAction.setCreateDate(new Date()); |
| | | userAction.setCreator(loginUserInfo.getId()); |
| | | if(Constants.equalsInteger(result.getType(),Constants.TWO)){ |
| | | userAction.setType(Constants.ZERO); |
| | | } |
| | | if(Constants.equalsInteger(result.getType(),Constants.ZERO)){ |
| | | userAction.setType(Constants.THREE); |
| | | } |
| | | userAction.setMemberId(result.getId()+""); |
| | | userAction.setBeforeStatus(status); |
| | | userActionJoinMapper.insert(userAction); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | queryWrapper.leftJoin(Company.class,Company::getId,Member::getCompanyId); |
| | | queryWrapper.selectAll(Member.class) |
| | | .selectAs(Company::getName,MemberInfoDTO::getCompanyName) |
| | | .select(" (select count(v.id) from visits v where v.MEMBER_ID=t.id and v.ISDELETED=0) as visitsCount") |
| | | .select(" (select ua.CREATE_DATE from user_action ua where ua.MEMBER_ID=t.id and ua.ISDELETED=0 and ua.type=1 order by ua.CREATE_DATE limit 1) as userActionType1") |
| | | /* .select(" (select count(v.id) from visits v where v.MEMBER_ID=t.id and v.ISDELETED=0) as visitsCount")*/ |
| | | .select(" (select STARTTIME from visits v where v.MEMBER_ID=t.id and v.ISDELETED=0 order by CREATE_DATE limit 1) as visitsLastDate"); |
| | | |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getType()),Member::getType,pageWrap.getModel().getType()); |
| | |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getCompanyName()),Company::getName,pageWrap.getModel().getCompanyName()) |
| | | .like(StringUtils.isNotBlank(pageWrap.getModel().getIdcardNo()),Member::getIdcardNo,pageWrap.getModel().getIdcardNo()) |
| | | .eq(Member::getStatus,Constants.Status.ENABLE) |
| | | .eq(Objects.nonNull(pageWrap.getModel().getCode()),Member::getCode,pageWrap.getModel().getCode()) |
| | | .orderByDesc(Member::getCreateDate); |
| | | |
| | | |