| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | |
| | | if (Objects.isNull(erpVisitDTO) |
| | | || StringUtils.isBlank(erpVisitDTO.getName()) |
| | | || StringUtils.isBlank(erpVisitDTO.getPhone()) |
| | | || StringUtils.isBlank(erpVisitDTO.getCompanyName()) |
| | | || Objects.isNull(erpVisitDTO.getIdcardType()) |
| | | || StringUtils.isBlank(erpVisitDTO.getIdcardNo()) |
| | | || Objects.isNull(erpVisitDTO.getStarttime()) |
| | |
| | | for (ErpWithVisitDTO erpWithVisitDTO : erpWithVisitDTOList) { |
| | | Visits withVisits = new Visits(); |
| | | BeanUtils.copyProperties(erpWithVisitDTO, withVisits); |
| | | withVisits.setCompanyName(visits.getCompanyName()); |
| | | withVisits.setReason(visits.getReason()); |
| | | visitsList.add(withVisits); |
| | | } |
| | | visits.setWithUserList(visitsList); |
| | |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(erpVisitDTO,"/visitBiz/resource/crateVisit",null,Constants.ZERO); |
| | | saveInterfaceLog(erpVisitDTO,"/visitBiz/resource/createVisit",null,Constants.ZERO); |
| | | } |
| | | } |
| | | |
| | | private void saveInterfaceLog(Object param, String path,String result,Integer type) { |
| | | @Transactional(propagation = Propagation.NOT_SUPPORTED) |
| | | void saveInterfaceLog(Object param, String path, String result, Integer type) { |
| | | InterfaceLog interfaceLog=new InterfaceLog(); |
| | | interfaceLog.setType(type); |
| | | interfaceLog.setCreateDate(new Date()); |
| | |
| | | private void isValidBaseParam(Visits visits) { |
| | | if(visits.getEndtime() == null |
| | | || visits.getStarttime() == null |
| | | // || StringUtils.isBlank(visits.getReason()) |
| | | || StringUtils.isBlank(visits.getReason()) |
| | | || StringUtils.isBlank( visits.getName()) |
| | | || StringUtils.isBlank( visits.getPhone()) |
| | | || StringUtils.isBlank( visits.getCompanyName()) |
| | | || visits.getIdcardType() == null |
| | | // || StringUtils.isBlank( visits.getFaceImg() ) |
| | | || StringUtils.isBlank( visits.getIdcardNo() ) |
| | |
| | | if(!Constants.equalsInteger(Constants.ONE, member.getCanVisit())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该拜访人暂时不能接受您的拜访申请~"); |
| | | } |
| | | if(StringUtils.isBlank(member.getHkId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该拜访人未下发暂时不能接受您的拜访申请~"); |
| | | } |
| | | return member; |
| | | } |
| | | |