Commit b1710906 authored by Mccoy Z Xia's avatar Mccoy Z Xia

compliance info

parent 7aba8b6a
......@@ -37,4 +37,9 @@ public class CalendarEventController {
return calendarEventServiceImpl.deleteEvent(id);
}
@GetMapping("getEventByEntityId/{id}")
public OperationResultDto getEventByEntityId(@PathVariable("id") Long entityId){
return calendarEventServiceImpl.getEventByEntityId(entityId);
}
}
......@@ -10,4 +10,5 @@ public interface ICalendarEventService {
OperationResultDto updateEvent(CalendarEvent event);
OperationResultDto deleteEvent(Long id);
OperationResultDto getEventByEntityId(Long entityId);
}
......@@ -15,6 +15,7 @@ import pwc.taxtech.atms.dto.calendar.CalendarDisplayQueryParamDto;
import pwc.taxtech.atms.service.ICalendarEventService;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -83,4 +84,16 @@ public class CalendarEventServiceImpl extends BaseService implements ICalendarEv
return new OperationResultDto(result, msg);
}
@Override
public OperationResultDto getEventByEntityId(Long entityId) {
List<CalendarEventDto> dtoList = new ArrayList<>();
try {
dtoList = calendarExtMapper.getEventByEntityId(entityId);
} catch (Exception e) {
log.error("getEventByEntityId error", e);
}
return OperationResultDto.success(dtoList);
}
}
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.calendar.dao.ext;
import org.apache.ibatis.annotations.*;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.calendar.dto.CalendarEventDto;
import pwc.taxtech.atms.calendar.dto.CalendarJurisdictionDto;
import pwc.taxtech.atms.calendar.dto.CalendarTaskTypeDto;
import pwc.taxtech.atms.calendar.dto.EntityDto;
......@@ -99,4 +100,20 @@ public interface CalendarExtMapper extends MyMapper {
"WHERE action_id = #{actionId}\n" +
"ORDER BY area")
List<CalendarJurisdictionDto> getJurisdictionListByActionId(Long actionId);
@Select("SELECT\n" +
"\tid,\n" +
"\ttask_name AS taskName,\n" +
"\tnotes,\n" +
"\teffective_date AS effectiveDate,\n" +
"\tdue_date AS dueDate,\n" +
"\tSTATUS,\n" +
"\tis_enable AS isEnable\n" +
"FROM\n" +
"\tcalendar_event\n" +
"WHERE\n" +
"\tentity_id = #{entityId}\n" +
"ORDER BY\n" +
"\tupdate_time")
List<CalendarEventDto> getEventByEntityId(Long entityId);
}
......@@ -40,6 +40,8 @@ public class CalendarEventDto implements Serializable {
private Byte status;
private Byte isEnable;
private Integer orderIndex;
private String notes;
......@@ -162,4 +164,12 @@ public class CalendarEventDto implements Serializable {
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Byte getIsEnable() {
return isEnable;
}
public void setIsEnable(Byte isEnable) {
this.isEnable = isEnable;
}
}
infrastructureModule
.controller('OrganizationManageController', ['$scope', '$location', '$log', 'orgHKService', '$interval', 'uiGridTreeViewConstants', 'uiGridConstants', 'SweetAlert', '$translate', '$timeout', 'apiInterceptor', '$q', 'loginContext', '$cookies', 'Upload', 'FileSaver',
function ($scope, $location, $log, orgHKService, $interval, uiGridTreeViewConstants, uiGridConstants, SweetAlert, $translate, $timeout, apiInterceptor, $q, loginContext, $cookies, Upload, FileSaver) {
.controller('OrganizationManageController', ['$scope', '$location', '$log', 'orgHKService', '$interval', 'uiGridTreeViewConstants', 'uiGridConstants', 'SweetAlert', '$translate', '$timeout', 'apiInterceptor', '$q', 'loginContext', '$cookies', 'Upload', 'FileSaver', "taxCalendarEventService",
function ($scope, $location, $log, orgHKService, $interval, uiGridTreeViewConstants, uiGridConstants, SweetAlert, $translate, $timeout, apiInterceptor, $q, loginContext, $cookies, Upload, FileSaver, taxCalendarEventService) {
'use strict';
$scope.expanded = false;
......@@ -282,6 +282,8 @@
$scope.orgSubsidariesDatasource = data.orgSubsidaryDtos;
$scope.orgDirectorsDatasource = data.orgDirectorDtos;
getEventsOfCurrentEntity();
});
};
......@@ -646,6 +648,8 @@
$scope.orgSubsidariesDatasource = org.orgSubsidaryDtos;
$scope.orgDirectorsDatasource = org.orgDirectorDtos;
$scope.showSingle = true;
getEventsOfCurrentEntity();
};
$scope.showAll = function () {
......@@ -694,8 +698,7 @@
if (ret.result) {
//todo: add the result data to exist attachments files list
$scope.attachmentDatasource = $scope.attachmentDatasource.concat(ret.data);
}
else {
} else {
if (ret.resultMsg && ret.resultMsg.length > 0) {
swal({
title: $translate.instant('FailureTitle'),
......@@ -714,8 +717,7 @@
}, function (evt) {
$scope.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
});
}
else {
} else {
}
};
......@@ -822,8 +824,7 @@
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteDirector2(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
} catch (e) {
$log.error(e);
}
}
......@@ -936,8 +937,7 @@
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteShareholder2(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
} catch (e) {
$log.error(e);
}
}
......@@ -1088,8 +1088,7 @@
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteDocument(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
} catch (e) {
$log.error(e);
}
}
......@@ -1277,6 +1276,103 @@
selectAllText: $translate.instant('SelectAll')
};
var getEventsOfCurrentEntity = function () {
taxCalendarEventService.getEventByEntityId($scope.selectCompany.id).success(function (res) {
if (res.result) {
initCompliance(res.data);
}
}).error(function () {
initCompliance([]);
});
};
var initCompliance = function (calendarEventList) {
var tempEventList = angular.copy(calendarEventList);
var complianceStore = new DevExpress.data.ArrayStore({
key: "id",
data: tempEventList
});
$scope.selectedItemKeys = [];
$scope.batchSaveDisabled = true;
var statusDesc = [{
"id": 0, "name": "N/A"
}, {
"id": 1, "name": "Enable"
}];
$scope.complianceSaveButtonOptions = {
text: "Save",
height: 34,
width: 100,
onClick: function () {
$.each($scope.selectedItemKeys, function () {
complianceStore.byKey(this).done(function (data) {
console.log(data);
})
});
$("#complianceContainer").dxDataGrid("instance").refresh();
},
bindingOptions: {
disabled: 'batchSaveDisabled'
}
};
$scope.complianceGridOptions = {
dataSource: complianceStore,
showBorders: false,
paging: {
enabled: false
},
editing: {
mode: "cell",
allowUpdating: true
},
selection: {
mode: "multiple"
},
onSelectionChanged: function (data) {
$scope.selectedItemKeys = data.selectedRowKeys;
$scope.batchSaveDisabled = !$scope.selectedItemKeys.length;
},
columns: [
{
dataField: "taskName",
caption: "Action Item"
}, {
dataField: "isEnable",
caption: "Show in calendar",
dataType: "boolean",
width: 150
}, {
dataField: "effectiveDate",
dataType: "date",
width: 150
}, {
dataField: "dueDate",
dataType: "date",
width: 150
}, {
dataField: "status",
width: 150,
lookup: {
dataSource: statusDesc,
displayExpr: "name",
valueExpr: "id"
}
}, {
dataField: "notes",
caption: "Due date logic"
}
]
};
};
(function initialize() {
$log.debug('organizationManageController.ctor()...');
$scope.title = $translate.instant('OrganizationManageTitle');
......@@ -1291,8 +1387,7 @@
$scope.isLoadComplete = true;
if ($scope.location) {
$scope.showHeader = false;
}
else {
} else {
$scope.showHeader = true;
}
}, 500);
......
......@@ -350,7 +350,10 @@
<span class="compliance-lable">{{'ComplianceCheckList'|translate}}</span>
</div>
<div class="org-compliance-info-body">
<div id="ComplianceGridContainer" dx-data-grid="complianceGridOptions" style="margin-top: 10px;">
<!-- <div id="ComplianceGridContainer" dx-data-grid="complianceGridOptions" style="margin-top: 10px;"></div>-->
<div id="data-grid-compliance">
<div id="complianceSaveSelected" dx-button="complianceSaveButtonOptions"></div>
<div id="complianceContainer" dx-data-grid="complianceGridOptions"></div>
</div>
</div>
</div>
......
......@@ -1310,3 +1310,20 @@
}
margin-top: 20px;
}
#data-grid-compliance {
min-height: 700px;
#complianceContainer {
padding-top: 45px;
}
#complianceSaveSelected {
float: right;
margin: 10px 20px;
}
.dx-button-text {
line-height: 0;
}
}
......@@ -11,10 +11,14 @@ function ($http, apiConfig, httpCacheService) {
update: function (model) {
return $http.post('/calendarEvent/update', model, apiConfig.create());
}
,
},
deleteEvent: function (id) {
return $http.get('/calendarEvent/delete/' + id, apiConfig.create());
},
getEventByEntityId: function (id) {
return $http.get('/calendarEvent/getEventByEntityId/' + id, apiConfig.create());
}
};
}]);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment