public function viewReport(Request $request, $projectId)
    {
        $this->initUser();
        $project = ProjectService::S()->getById($projectId);
        if (!$this->checkCanAccessProject($project)) {
            return ['status' => 500, 'message' => '访问错误!'];
        }
        $enterprise = EnterpriseService::S()->getById($project->eid);
        $type = $request->input('type', 'list');
        if ($type == 'list') {
            $data = ProjectReportService::S()->getListData($project);
            $str = view('pdf.ReportList', $data);
        } else if($type == 'checkSystem') {
            $data = ProjectReportService::S()->getCheckSystemData($project);
            $str = view('pdf.ReportCheckSystem', $data);
        } else if($type == 'checkList') {
            $data = ProjectReportService::S()->getCheckListData($project);
            $str = view('pdf.ReportCheckList', $data);
        }

        $waterText = $enterprise->fullName ?: $enterprise->name;
        $mpdf = new Mpdf();
        $mpdf->SetDisplayMode('fullpage');
        $mpdf->title = $project->name;
        $mpdf->autoScriptToLang = true;
        $mpdf->autoLangToFont = true;
//        $mpdf->SetProtection(array('copy','print'), 'a123456', 'a123456');

        $mpdf->SetWatermarkText($waterText,'0.1');// 添加水印
        $mpdf->showWatermarkText = true;
        $mpdf->watermark_font = 'Sun-ExtA'; // 水印字体
        $mpdf->SetHTMLHeader('
<table width="100%">
    <tr>
        <td width="50%">
    <img width="50pt" src="' . resource_path('/images/logo.png') . '" alt=""></td>
        <td width="50%" style="text-align: right;font-size: 7pt">通用评估报告</td>
    </tr>
</table>');
        $mpdf->SetHTMLFooter('
<table width="100%">
    <tr>
        <td align="center">{PAGENO}/{nbpg}</td>
    </tr>
</table>');
        $mpdf->WriteHTML($str, 2);
        $mpdf->Output();

        return 0;
    }
<div>
    <p style="text-align:center">
        <span style="font-family:黑体; font-size:18pt">{{$reportName}}</span>
    </p>

    <p style="height:20pt">&#xa0;</p>

    <p style="text-align:left;">
        <span style="font-family:黑体; font-size:12pt">一、项目基本情况</span>
    </p>
    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">企业名称:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$business->name}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">所属行业:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$business->industryStr}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">业务形态:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$business->patternStr}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">评估对象:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$func->name}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">评估模板:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$options['webConfigKV']['tpl'][$project->tpl]}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt">评估周期:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$project->createTime}} 创建评估项目</span></p>

    <p style="font-size:10.5pt; text-indent:60pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$currentTime}} 报告生成</span></p>

    <p style="height:20pt">&#xa0;</p>

    <!-- =========================================== 个人信息盘点 start =========================================== -->
    <p style="height:50pt">&#xa0;</p>

    <p style="font-size:12pt; text-align:left;">
        <span style="font-family:黑体; font-size:12pt">二、个人信息盘点</span>
    </p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">盘点负责人:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$project->managerName}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">盘点对象:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$func->name}}</span></p>

    <p style="font-size:10.5pt;"><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">盘点时间:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$process->lastTime}}</span></p>

    <p style="text-align:center">
        <span style="font-family:方正仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{$func->name}}处理的个人信息数据项基本情况</span>
    </p>

    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:10pt; font-family:方正仿宋_GB2312;">
        <tr>
            <td style="height:20pt;width:30pt;"></td>
            <td style="width:135pt;" colspan="2">个人信息主体</td>
            <td style="width:260pt;" colspan="4">数据项</td>
            <td style="" rowspan="2">合计</td>
        </tr>
        <tr>
            <td style="height:20pt;"></td>
            <td style="width:50pt;">主体名称</td>
            <td style="width:85pt;">主体所在地</td>
            <td style="width:130pt;" colspan="2">一般个人信息</td>
            <td style="width:130pt;" colspan="2">敏感个人信息</td>
        </tr>
        @foreach($mainbodyList as $mainbody)
            <tr>
                <td style="height:70pt;"></td>
                <td>{{$mainbody['name']}}</td>
                <td>{{$options['location'][$mainbody['location']]}}</td>
                <td style="width:30pt">{{$process->mainbodyDataItems[$mainbody['id']]['commonDataItemsCount'] ?? 0}}项
                </td>
                <td style="width:100pt">
                    @if(!empty($process->mainbodyDataItems[$mainbody['id']]['commonCats']))
                        @foreach($process->mainbodyDataItems[$mainbody['id']]['commonCats'] as $catId => $num)
                            {{$templateCat[$catId]}}{{$num}}项
                        @endforeach
                    @endif
                </td>
                <td style="width:30pt">{{$process->mainbodyDataItems[$mainbody['id']]['senseDataItemsCount'] ?? 0}}项</td>
                <td style="width:100pt">
                    @if(!empty($process->mainbodyDataItems[$mainbody['id']]['senseCats']))
                        @foreach($process->mainbodyDataItems[$mainbody['id']]['senseCats'] as $catId => $num)
                            {{$templateCat[$catId]}}{{$num}}项
                        @endforeach
                    @endif
                </td>
                <td>{{$mainbody['name']}}共计{{$process->mainbodyDataItems[$mainbody['id']]['dataItemsCount'] ?? 0}}项个人信息
                </td>
            </tr>
        @endforeach
        <tr>
            <td style="height:30pt;">合计</td>
            <td>合计共{{$stat['count']}}类用户</td>
            <td>分布在{{$stat['location']}}个国家/地区</td>
            <td colspan="2">共计{{$stat['common']}}项一般个人信息</td>
            <td colspan="2">共计{{$stat['sense']}}项敏感个人信息</td>
            <td>总计{{$stat['all']}}项个人信息</td>
        </tr>
    </table>

    <p style="height:10.5pt">&#xa0;</p>

    <p style="text-align:center">
        <span style="font-family:方正仿宋_GB2312; font-size:10.5pt; font-weight:bold;">{{$func->name}}的数据处理活动基本情况</span>
    </p>

    <p><span
            style="font-family:方正仿宋_GB2312; font-size:10.5pt; font-weight:bold">&#xa0;</span></p>

    <p><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">数据处理目的:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{\Util::getQuestionListData($project,70)}}</span>
    </p>

    <p><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">数据处理合法性基础:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{\Util::getQuestionListData($project,100)}}</span>
    </p>

    <p><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">  </span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt;">告知形式:</span><span
            style="font-family:仿宋_GB2312; font-size:10.5pt; font-weight:bold">{{\Util::getQuestionListData($project,180)}}</span>
    </p>

    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:12pt; font-family:方正仿宋_GB2312;">
        <tr>
            <td style="height:20pt;width:51pt;" rowspan="{{$process['collectUseMethodCount'] + 2}}">数据收集</td>
            <td style="width:130pt;">收集活动名称</td>
            <td style="width:130pt;">收集目的</td>
            <td style="width:130pt;">收集方式</td>
            <td style="width:130pt;">收集频率</td>
            <td style="width:130pt;">收集数据项</td>
        </tr>
        @if(!empty($collect->useMethod))
            @foreach($collect->useMethod as $useMethod)
                <tr>

                    <td style="height:20pt;">{{$useMethod['name']}}</td>
                    <td>{{$useMethod['target']}}</td>
                    <td>{{$useMethod['collectMethodInputSelect'] == 'select' ? $options['collectMethod'][$useMethod['collectMethod']] : $useMethod['collectMethodCustom']}}</td>
                    <td>{{$useMethod['frequence']}}</td>
                    <td>
                        @foreach($useMethod['dataItem'] as $mainbodyKey => $items)
                            {{$options['mainbodyKV'][$mainbodyKey]}}:<br/>
                            @foreach($items as $item)
                                {{explode("|", $item)[0]}}
                            @endforeach
                            <br/>
                        @endforeach
                        <br/>
                    </td>
                </tr>
            @endforeach
        @endif
    </table>
    <p style="height:10.5pt">&#xa0;</p>

    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:12pt; font-family:方正仿宋_GB2312;">
        <tr>
            <td style="height:20pt;width:50pt;" rowspan="{{$process['storeUseMethodCount'] + 2}}">数据存储</td>
            <td style="width:90pt;">存储活动名称</td>
            <td style="width:90pt;">存储目的</td>
            <td style="width:90pt;">存储介质</td>
            <td style="width:90pt;">涉及IT资产</td>
            <td style="width:90pt;">存储期限</td>
            <td style="width:90pt;">存储依据</td>
            <td style="width:90pt;">存储数据项</td>
        </tr>
        @if(!empty($store->useMethod))
            @foreach($store->useMethod as $useMethod)
                <tr>
                    <td style="height:20pt;">{{$useMethod['name']}}</td>
                    <td>{{$useMethod['purpose']}}</td>
                    <td>{{$useMethod['storeMethodInputSelect'] == 'select' ? $options['storeMethod'][$useMethod['storeMethod']] : $useMethod['storeMethodCustom']}}</td>
                    <td>{{$useMethod['assetsInputSelect'] == 'select' ? $options['assets'][$useMethod['assets']] : $useMethod['assetsCustom']}}</td>
                    <td>{{$useMethod['timeLimit']}}</td>
                    <td>{{$useMethod['timeLimitBase']}}</td>
                    <td style="height:10pt;">
                        @foreach($useMethod['mergedDataItem'] as $mainbodyKey => $items)
                                {{$options['mainbodyKV'][$mainbodyKey]}}:<br/>
                                @foreach($items as $item)
                                    {{explode("|", $item)[0]}}
                                @endforeach
                            <br/>
                        @endforeach
                    </td>
                </tr>
            @endforeach
        @endif
    </table>

    <p style="height:10.5pt">&#xa0;</p>

    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:12pt; font-family:方正仿宋_GB2312;">

        <tr>
            <td style="height:20pt;width:43pt;" rowspan="{{$process['useUseMethodCount'] + 2}}">数据使用</td>
            <td style="width:90pt;">使用活动名称</td>
            <td style="width:90pt;">使用目的</td>
            <td style="width:90pt;">使用者类型</td>
            <td style="width:90pt;">使用者所在地</td>
            <td style="width:90pt;">使用方式</td>
            <td style="width:90pt;">使用数据项</td>
        </tr>
        @if(!empty($use['useMethod']))
            @foreach($use['useMethod'] as $useMethod)
                <tr>
                    <td style="width:90pt;">{{$useMethod['name']}}</td>
                    <td style="width:90pt;">{{$useMethod['purpose']}}</td>
                    <td style="width:90pt;">{{$useMethod['useSideInputSelect'] == 'select' ? $options['useSide'][$useMethod['useSide']] : $useMethod['useSideCustom']}}</td>
                    <td style="width:90pt;">{{$options['location'][$useMethod['location']]}}</td>
                    <td style="width:90pt;">{{$useMethod['useMethodInputSelect'] == 'select' ? $options['useMethod'][$useMethod['useMethod']] : $useMethod['useMethodCustom']}}</td>
                    <td style="width:90pt;">
                        @foreach($useMethod['mergedDataItem'] as $mainbodyKey => $items)
                            {{$options['mainbodyKV'][$mainbodyKey]}}:<br/>
                            @foreach($items as $item)
                                {{explode("|", $item)[0]}}
                            @endforeach
                            <br/>
                        @endforeach
                    </td>
                </tr>
            @endforeach
        @endif
    </table>

    <p style="height:10.5pt">&#xa0;</p>

    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:12pt; font-family:方正仿宋_GB2312;">
        <tr>
            <td style="height:20pt;width:50pt;" rowspan="{{$process['transferUseMethodCount'] + 2}}">数据转移/披露</td>
            <td style="width:90pt;">转移/披露活动名称</td>
            <td style="width:90pt;">转移/披露目的</td>
            <td style="width:90pt;">转移/披露方式</td>
            <td style="width:90pt;">数据传输方式</td>
            <td style="width:90pt;">受托方/接收方类型</td>
            <td style="width:90pt;">转移/披露数据项</td>
        </tr>
        @if(!empty($transfer->useMethod))
            @foreach($transfer->useMethod as $useMethod)
                <tr>
                    <td style="height:20pt;">{{$useMethod['name']}}</td>
                    <td>{{$useMethod['purpose']}}</td>
                    <td>{{$useMethod['transferMethodInputSelect'] == 'select' ? $options['transferMethod'][$useMethod['transferMethod']] : $useMethod['transferMethodCustom']}}</td>
                    <td>{{$useMethod['dataTransferMethodInputSelect'] == 'select' ? $options['dataTransferMethod'][$useMethod['dataTransferMethod']] : $useMethod['dataTransferMethodCustom']}}</td>
                    <td>{{$useMethod['entityInputSelect'] == 'select' ? $options['entity'][$useMethod['entity']] : $useMethod['entityCustom']}}</td>
                    <td>
                        @foreach($useMethod['mergedDataItem'] as $mainbodyKey => $items)
                            {{$options['mainbodyKV'][$mainbodyKey]}}:<br/>
                            @foreach($items as $item)
                                {{explode("|", $item)[0]}}
                            @endforeach
                            <br/>
                        @endforeach
                    </td>
                </tr>
            @endforeach
        @endif
    </table>

    <p style="height:10.5pt">&#xa0;</p>

    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:12pt; font-family:方正仿宋_GB2312;">
        <tr>
            <td style="height:20pt;width:56pt;" rowspan="{{$process['handleUseMethodCount'] + 2}}">数据处置</td>
            <td style="width:180pt;">处置活动名称</td>
            <td style="width:180pt;">处置方式</td>
            <td style="width:180pt;">处置数据项</td>
        </tr>
        @if(!empty($handle->useMethod))
            @foreach($handle->useMethod as $useMethod)
                <tr>
                    <td style="height:20pt;">{{$useMethod['name']}}</td>
                    <td>{{$useMethod['handleMethodInputSelect'] == 'select' ? $options['handleMethod'][$useMethod['handleMethod']] : $useMethod['handleMethodCustom']}}</td>
                    <td>
                        @foreach($useMethod['mergedDataItem'] as $mainbodyKey => $items)
                            {{$options['mainbodyKV'][$mainbodyKey]}}:<br/>
                            @foreach($items as $item)
                                {{explode("|", $item)[0]}}
                            @endforeach
                            <br/>
                        @endforeach
                    </td>
                </tr>
            @endforeach
        @endif
    </table>

    <p style="height:10.5pt">&#xa0;</p>
    @if($crossUseMethods)
    <table cellspacing="0" cellpadding="0" border="1"
           style="vertical-align:middle;text-align:center;font-size:12pt; font-family:方正仿宋_GB2312;">
        <tr>
            <td style="height:20pt;width:51pt;" rowspan="{{count($crossUseMethods)+2}}">数据出境</td>
            <td style="width:130pt;">出境活动名称</td>
            <td style="width:130pt;">出境目的</td>
            <td style="width:130pt;">境外接收主体</td>
            <td style="width:130pt;">出境国家/地区</td>
            <td style="width:130pt;">出境数据项</td>
        </tr>
        @foreach($crossUseMethods as $useMethod)
            <tr>
                <td style="height:20pt;">{{$useMethod['name']}}</td>
                <td>{{$useMethod['purpose']}}</td>
                <td>
                    @if($useMethod['tableType'] == 'store')
                        {{$options['assets'][$useMethod['assets']]}}
                    @elseif($useMethod['tableType'] == 'use')
                        {{$useMethod['useSideInputSelect'] == 'select' ? $options['useSide'][$useMethod['useSide']] : $useMethod['useSideCustom']}}
                    @elseif($useMethod['tableType'] == 'transfer')
                        {{$options['entity'][$useMethod['entity']]}}
                    @endif

                </td>
                <td>{{$options['location'][$useMethod['location']]}}</td>
                <td>
                    @foreach($useMethod['mergedDataItem'] as $mainbodyKey => $items)
                        {{$options['mainbodyKV'][$mainbodyKey]}}:<br/>
                        @foreach($items as $item)
                            {{explode("|", $item)[0]}}
                        @endforeach
                        <br/>
                    @endforeach
                </td>
            </tr>
        @endforeach
    </table>
    @endif
</div>

兰亭
3 声望0 粉丝

认识的人越多,我就越喜欢狗


引用和评论

0 条评论