k94314517
2024-03-07 cc80794e556bbe1e43f9c1369e1dfc9c61318fda
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -54,6 +54,7 @@
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;
@@ -114,6 +115,7 @@
            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())
@@ -155,6 +157,8 @@
                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);
@@ -163,11 +167,12 @@
        }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());
@@ -568,9 +573,10 @@
    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() )
@@ -917,6 +923,9 @@
        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;
    }