18756
2024-08-22 c2f5f01fc53df89330e9e4c8092ee86d42ab5be4
src/main/java/com/product/administration/service/ConferenceManagerService.java
@@ -505,16 +505,23 @@
    }
    @Override
    public HashMap getSignInfo(FieldSetEntity fse) throws BaseException {
    public HashMap getSignOrVisitInfo(FieldSetEntity fse) throws BaseException {
       String meeting_uuid = fse.getString("meeting_uuid");
       //type=1就是签到数据,type=2就是访问数据
        String type = fse.getString("type");
        List<Object> params=new ArrayList<>();
        params.add(meeting_uuid);
        params.add(meeting_uuid);
        StringBuilder sb=new StringBuilder();
        sb.append(" SELECT c.* FROM ( ");
        sb.append(" SELECT b.staff_id,b.uuid as meeting_uuid,f.show_name,l.uuid as dept_uuid,l.org_level_name,n.sign_status ");
        sb.append(" SELECT b.staff_id,b.uuid as meeting_uuid,f.show_name,l.uuid as dept_uuid,l.org_level_name,");
        if(type.equals("1")){
         sb.append(" n.sign_status");
        }else {
            sb.append(" n.visit_status");
        }
        sb.append(" FROM (" );
        sb.append(" SELECT y.*, ");
        sb.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( participator, ',', n ), ',', - 1 ) AS staff_id");
@@ -526,7 +533,12 @@
        sb.append(" )b ");
        sb.append(" LEFT JOIN product_sys_staffs f on b.staff_id=f.user_id ");
        sb.append(" LEFT JOIN product_sys_org_levels l on f.dept_uuid=l.uuid ");
        sb.append(" LEFT JOIN product_oa_conference_sign n on b.staff_id=n.user_id and n.meeting_uuid=? ");
        if(type.equals("1")){
            sb.append(" LEFT JOIN product_oa_conference_sign n ");
        }else {
            sb.append(" LEFT JOIN product_oa_conference_visit n ");
        }
        sb.append(" on b.staff_id=n.user_id and n.meeting_uuid=? ");
        sb.append(" )c");
        DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(),params.toArray());
@@ -595,10 +607,10 @@
            }
        }
        sign_down=sign_all-sign_count;
        hashMapResult.put("sign_down",sign_count);
        hashMapResult.put("no_sign",sign_down);
        hashMapResult.put("listDateNoSign",listDateNoSign);
        hashMapResult.put("listDateSign",listDateSign);
        hashMapResult.put("signOrvisit_down",sign_count);
        hashMapResult.put("no_signOrvisit",sign_down);
        hashMapResult.put("listDateNoSignOrVisit",listDateNoSign);
        hashMapResult.put("listDateSignOrVisit",listDateSign);
        return  hashMapResult;
    }
@@ -841,6 +853,38 @@
            fieldSetEntity.setValue(CmnConst.CREATED_BY, fieldSetEntity.getString(CmnConst.CREATED_BY + "_save_value"));
            fieldSetEntity.setValue("meetint_type", fieldSetEntity.getString("meetint_type_save_value"));
        }
        //存储访问记录
        SystemUser currentUser = SpringMVCContextHolder.getCurrentUser();
        String fliter="meeting_uuid='"+fse.getUUID()+"' and  user_id='"+currentUser.getUser_id()+"'";
        DataTableEntity product_oa_conference_visit = baseDao.listTable("product_oa_conference_visit", fliter);
        if(product_oa_conference_visit.getRows()!=0){
            FieldSetEntity fieldSetEntity1 = product_oa_conference_visit.getFieldSetEntity(0);
            Integer visit_count = fieldSetEntity1.getInteger("visit_count");
            visit_count++;
            fieldSetEntity1.setValue("visit_count",visit_count);
            fieldSetEntity1.setValue("visit_date_new",new Date());
            baseDao.update(fieldSetEntity1);
        }else {
        FieldSetEntity fieldSetEntityVisit = new FieldSetEntity();
        fieldSetEntityVisit.setTableName("product_oa_conference_visit");
        fieldSetEntityVisit.setValue("visit_user",currentUser.getUser_name());
        fieldSetEntityVisit.setValue("user_id",currentUser.getUser_id());
        fieldSetEntityVisit.setValue("org_level_uuid","00000000-0000-0000-0000-000000000000");
        fieldSetEntityVisit.setValue("organization",currentUser.getDept_uuid());
        fieldSetEntityVisit.setValue("organization_name",currentUser.getCurrentDept().getString("org_level_name"));
        fieldSetEntityVisit.setValue("visit_date_first",new Date());
        fieldSetEntityVisit.setValue("visit_date_new",new Date());
        fieldSetEntityVisit.setValue("visit_count",1);
        fieldSetEntityVisit.setValue("visit_status","已访问");
        fieldSetEntityVisit.setValue("meeting_uuid",fse.getUUID());
        BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fieldSetEntityVisit);
        baseDao.add(fieldSetEntityVisit);
        }
        return fieldSetEntity;
    }