OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-11-17 61037a004e28c5e508a62f42022d20d6872dc672
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
 * Created by wisestone on 2018-01-04.
 */
'use strict';
 
define(['app'], function (app) {
    app.factory("Issue", ['$http', '$log', '$upload', '$rootScope', function ($http, $log, $upload, $rootScope) {
 
        //  파일 업로드 진행율을 표시해준다.
        function fileUploadProgress(evt) {
            if (evt.config.file.length > 0) {
 
                var progress = parseInt(100.0 * evt.loaded / evt.total);
 
                var body = {
                    display : progress < 100,    //  표시 여부
                    clientFileCount : evt.config.file.length,  //  클라이언트 업로드 파일 개수
                    clientProgress: progress + "%", //  진행률
                    serverFileName : null,    //  서버 업로드 파일 명
                    serverProgress : null,
                    totalFileCount : null, //  전체 업로드 개수
                    uploadFileCount : null //  진행중인 업로드 파일 개수
                };
 
                $rootScope.$broadcast("displayFileUpload", body);
            }
        }
 
        return {
            find : function (conditions) {
                return $http.post("issue/find", conditions).then(function (response) {
                    $log.debug("이슈 목록 데이터 : ", response);
                    return response;
                });
            },
            add : function (conditions) {
                conditions.url = "issue/add";
                return $upload.upload(conditions).progress(function (evt) {
                    //  파일 업로드 진행율을 표시해준다.
                    fileUploadProgress(evt);
 
                }).then(function (response) {
                    $log.debug("이슈 생성 결과 : ", response);
                    return response;
                });
            },
            modifyParentIssue : function (conditions) {
                return $http.post("issue/modifyParentIssue", conditions).then(function (response) {
                    $log.debug("상위 일감 수정 결과 : ", response);
                    return response;
                });
            },
            modify : function (conditions) {
                conditions.url = "issue/modify";
                return $upload.upload(conditions).progress(function (evt) {
                    //  파일 업로드 진행율을 표시해준다.
                    fileUploadProgress(evt);
 
                }).then(function (response) {
                    $log.debug("이슈 수정 결과 : ", response);
                    return response;
                });
            },
            detail : function (conditions) {
                return $http.post("issue/detail", conditions).then(function (response) {
                    $log.debug("이슈 상세 데이터 : ", response);
                    return response;
                });
            },
            remove : function (conditions) {
                return $http.post("issue/remove", conditions).then(function (response) {
                    $log.debug("이슈 삭제 결과 : ", response);
                    return response;
                });
            },
            importExcel : function (conditions) {
                conditions.url = "issue/importExcel";
                return $upload.upload(conditions).then(function (response) {
                    $log.debug("이슈 Import 결과 : ", response);
                    return response;
                });
            },
            modifyMultiIssueStatus : function (conditions) {
                return $http.post("issue/modifyMultiIssueStatus", conditions).then(function (response) {
                    $log.debug("다중 이슈 상태 변경 결과 : ", response);
                    return response;
                });
            },
            sendEmail : function (conditions) {
                return $http.post("issue/sendEmail", conditions).then(function (response) {
                    $log.debug("이슈 이메일 발송 결과 : ", response);
                    return response;
                });
            },
        }
    }
    ])
});