Commit 7aaf0076 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents 0d95b3da 6de77904
...@@ -13,6 +13,7 @@ import pwc.taxtech.atms.common.util.MyAsserts; ...@@ -13,6 +13,7 @@ import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.dto.approval.ApprovalDto; import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask; import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.service.impl.ApprovalService; import pwc.taxtech.atms.vat.service.impl.ApprovalService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -51,8 +52,8 @@ public class ApprovalController { ...@@ -51,8 +52,8 @@ public class ApprovalController {
@ResponseBody @ResponseBody
@RequestMapping(value = "/tasks/{assignee}") @RequestMapping(value = "/tasks/{assignee}")
public List<ApprovalTask> data(@PathVariable String assignee) {//accountant manager public List<ApprovalTaskInfo> data(@PathVariable String assignee) {//accountant manager
return approvalService.getTask(assignee); return approvalService.getTask();
} }
@ResponseBody @ResponseBody
......
...@@ -14,11 +14,11 @@ import pwc.taxtech.atms.common.AuthUserHelper; ...@@ -14,11 +14,11 @@ import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.util.MyAsserts; import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dto.approval.ApprovalDto; import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.BadParameterException; import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.PeriodApproveMapper; import pwc.taxtech.atms.vat.dao.PeriodApproveMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper; import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove; import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample; import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
import pwc.taxtech.atms.vat.entity.PeriodReport; import pwc.taxtech.atms.vat.entity.PeriodReport;
...@@ -26,8 +26,6 @@ import pwc.taxtech.atms.vat.entity.PeriodReportExample; ...@@ -26,8 +26,6 @@ import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import java.util.*; import java.util.*;
import static pwc.taxtech.atms.exception.Exceptions.SERVER_ERROR_EXCEPTION;
@Service @Service
public class ApprovalService { public class ApprovalService {
private static Logger logger = LoggerFactory.getLogger(ApprovalService.class); private static Logger logger = LoggerFactory.getLogger(ApprovalService.class);
...@@ -42,6 +40,7 @@ public class ApprovalService { ...@@ -42,6 +40,7 @@ public class ApprovalService {
@Autowired @Autowired
AuthUserHelper authUserHelper; AuthUserHelper authUserHelper;
@Transactional @Transactional
public void startInstanceAndAssignee(ApprovalDto dto) { public void startInstanceAndAssignee(ApprovalDto dto) {
PeriodApprove pa = new PeriodApprove(); PeriodApprove pa = new PeriodApprove();
...@@ -51,14 +50,10 @@ public class ApprovalService { ...@@ -51,14 +50,10 @@ public class ApprovalService {
} }
public List<ApprovalTask> getTask(String assignee) { public List<ApprovalTaskInfo> getTask() {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(assignee).list(); String userId = authUserHelper.getCurrentUserId();//TODO query user role from sesstion or db
List<ApprovalTask> list = new ArrayList<>(); String assignee = ("66933E7B-DA75-4B2E-B7D6-AB65DCA20D50".equalsIgnoreCase(userId)) ? "manager" : "accountant";
for (Task task : tasks) { return periodApproveMapper.queryApprovalList(assignee.equalsIgnoreCase("manager") ? null : userId);
ApprovalTask t = new ApprovalTask();
list.add(t.copyfrom(task));
}
return list;
} }
private void startInstance(ApprovalDto dto, PeriodApprove pa) { private void startInstance(ApprovalDto dto, PeriodApprove pa) {
...@@ -95,10 +90,11 @@ public class ApprovalService { ...@@ -95,10 +90,11 @@ public class ApprovalService {
pa.setTemplateIds(reportTemplateIds.toString()); pa.setTemplateIds(reportTemplateIds.toString());
pa.setStatus(Constant.APPROVAL_COMMITTED); pa.setStatus(Constant.APPROVAL_COMMITTED);
pa.setProjectId(dto.getProjectId()); pa.setProjectId(dto.getProjectId());
pa.setCreateBy(authUserHelper.getCurrentUserId()==null?"Admin":authUserHelper.getCurrentUserId()); pa.setCreateBy(authUserHelper.getCurrentUserId() == null ? "Admin" : authUserHelper.getCurrentUserId());
pa.setCreateTime(new Date()); pa.setCreateTime(new Date());
periodApproveMapper.insert(pa); periodApproveMapper.insert(pa);
} }
private void startAssignee(PeriodApprove pa) { private void startAssignee(PeriodApprove pa) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_ACCOUNTANT).processInstanceId( List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_ACCOUNTANT).processInstanceId(
pa.getInstanceId()).list(); pa.getInstanceId()).list();
......
...@@ -3,8 +3,10 @@ package pwc.taxtech.atms.vat.dao; ...@@ -3,8 +3,10 @@ package pwc.taxtech.atms.vat.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove; import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample; import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
...@@ -105,4 +107,27 @@ public interface PeriodApproveMapper extends MyVatMapper { ...@@ -105,4 +107,27 @@ public interface PeriodApproveMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(PeriodApprove record); int updateByPrimaryKey(PeriodApprove record);
@Select("<script>" +
"SELECT " +
" p.NAME AS projectName, " +
" pa.PERIOD AS period, " +
" pa.INSTANCE_ID AS instanceId, " +
" u1.USER_NAME AS createBy, " +
" u2.USER_NAME AS approvalBy, " +
" pa.STATUS AS status, " +
" pa.APPROVAL_RESUALT AS approvalResult, " +
" pa.CREATE_TIME AS createTime, " +
" pa.APPROVAL_TIME AS approvalTime, " +
" pa.REPORT_PATHS AS reportPaths " +
"FROM " +
" PERIOD_APPROVE pa " +
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
" JOIN \"USER\" u1 ON pa.CREATE_BY = u1.id " +
" LEFT JOIN \"USER\" u2 ON pa.APPROVAL_BY = u2.id " +
"<where> 1=1 " +
" <if test=\"createId != null and createId !='' \">AND pa.CREATE_BY=#{createId}</if>" +
"</where>" +
"</script>")
List<ApprovalTaskInfo> queryApprovalList(@Param("createId") String createId);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dpo;
import java.sql.Date;
public class ApprovalTaskInfo {
private String projectName;
private Integer period;
private String instanceId;
private String createBy;
private String approvalBy;
private String status;
private String approvalResult;
private Date createTime;
private Date approvalTime;
private String reportPaths;
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getApprovalBy() {
return approvalBy;
}
public void setApprovalBy(String approvalBy) {
this.approvalBy = approvalBy;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getApprovalResult() {
return approvalResult;
}
public void setApprovalResult(String approvalResult) {
this.approvalResult = approvalResult;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getApprovalTime() {
return approvalTime;
}
public void setApprovalTime(Date approvalTime) {
this.approvalTime = approvalTime;
}
public String getReportPaths() {
return reportPaths;
}
public void setReportPaths(String reportPaths) {
this.reportPaths = reportPaths;
}
}
...@@ -228,6 +228,22 @@ var frameworkModule = angular.module('app.framework', ['app.webservices', 'app.c ...@@ -228,6 +228,22 @@ var frameworkModule = angular.module('app.framework', ['app.webservices', 'app.c
sticky: true sticky: true
}); });
$stateProvider.state({
name: 'listApproval',
url: '/overview/listApproval',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat,appTranslation.appPart]);
}],
template: '<app-approve servicetypeid="2"></app-overview>',
}
},
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({ $stateProvider.state({
name: 'overviewAssetsManage', name: 'overviewAssetsManage',
url: '/overview/assetsManage', url: '/overview/assetsManage',
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
field: 'name', field: 'name',
name: $translate.instant('OrganizationStructureName'), name: $translate.instant('OrganizationStructureName'),
width: '50%', width: '50%',
cellTemplate: '<div class="orangization-structure-gridcell-name" style="text-align: center"><span style="text-align: center;float:left;">{{row.entity.name}}</span><span ng-hide="true">{{row.entity.id}}</span></div>' cellTemplate: '<div class="orangization-structure-gridcell-name" style="text-align: center"><span>{{row.entity.name}}</span><span ng-hide="true">{{row.entity.id}}</span></div>'
}, { }, {
field: 'isActive', field: 'isActive',
name: $translate.instant('OrganizationStructureStatus'), name: $translate.instant('OrganizationStructureStatus'),
......
(function () {
'use strict';
angular.module('app.config', [])
// region of current application
.constant('region', 'zh-CN')
//.constant('region', 'en-US')
// version of current application
.constant('version', '1.0.0.0')
// Exceptionless Server URL
.constant('exceptionlessServerURL', '')
.run([
'region', function (region) {
$.when(
$.getJSON("/Scripts/cldr/main/zh/numbers.json"),
$.getJSON("/Scripts/cldr/main/zh/ca-gregorian.json"),
$.getJSON("/Scripts/cldr/supplemental/likelySubtags.json")
).then(function () {
return [].slice.apply(arguments, [0]).map(function (result) {
return result[0];
});
}).then(Globalize.load).then(function () {
Globalize.locale("zh-CN");
// Globalize.locale("en-US");
DevExpress.localization.locale(region);
//DevExpress.localization.locale(navigator.language || navigator.browserLanguage);
});
}
]);
}());
\ No newline at end of file
This diff is collapsed.
...@@ -12,8 +12,9 @@ ...@@ -12,8 +12,9 @@
}, apiConfig.createVat()); }, apiConfig.createVat());
}, },
queryOutputInvoiceItemList: function (invoiceID) { approvalTasks: function () {
return $http.get('/outputInvoiceImport/queryOutputInvoiceItemList/' + invoiceID, apiConfig.createVat()); var assignee='accountant';
return $http.get('/approval/tasks/'+assignee, apiConfig.createVat());
}, },
getExportOutputInvoiceList: function (param) { getExportOutputInvoiceList: function (param) {
......
<div id="app-approve" class="app-overview ">
<div class="app-overview-left">
<div class="group-operate-icon" style="margin-bottom: 5px;">
<span class="operate-icon left-first" title="机构" ng-click="dimensionOrgShow('','orgName')"><i
class="fa fa-sitemap fa-2x orgName" aria-hidden="true"></i></span><span class="operate-icon"
title="事业部"
ng-click="dimensionOrgShow('businessUnitID','businessUnitName')">
<i class="fa fa-bank fa-2x businessUnitName" aria-hidden="true"></i>
</span><span class="operate-icon" title="区域" ng-click="dimensionOrgShow('areaID','areaName')">
<i class="material-icons areaName">place</i>
</span><span class="operate-icon" title="机构层级" ng-click="dimensionOrgShow('structureID','structureName')">
<i class="fa fa-mortar-board fa-2x structureName"></i>
</span><span class="operate-icon" title="行业" ng-click="dimensionOrgShow('industryID','industryName')">
<i class="fa fa-bars fa-2x industryName" aria-hidden="true"></i>
</span>
</div>
<perfect-scrollbar class="scroller" wheel-propagation="true" wheel-speed="1" min-scrollbar-length="20">
<div ui-tree data-drag-enabled="false">
<ul ui-tree-nodes="" ng-model="orgData">
<li ng-repeat="item in orgData track by $index" ui-tree-node ng-include="'tree_view_template'">
</li>
</ul>
</div>
</perfect-scrollbar>
</div>
<div class="app-overview-right">
<div class="row" style="margin:20px; display:none;">
<div class="col-lg-2 col-md-2 col-sm-2">
<span class="textLabelHeader" translate="TotalProjectRecords"></span> <span class="textLabelHeader">{{queryResults.length}}</span>
<span translate="NumberOfTaskes"></span>
</div>
<div class="col-lg-8 col-md-8 col-sm-8">
<span translate="CurrentlyInProgress" class=""> </span> <i
class="badge progressNumberBadges marginRight10">3</i>
<span translate="AlreadyCompleted" class=""> </span> <i
class="badge progressNumberBadges marginRight10">4</i>
<span translate="NotYetStart" class=""> </span> <i
class="badge progressNumberBadges marginRight10 ">5</i>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<div id="app-workflow-action-panel" class="pull-right">
<i class="fa fa-calendar red-color" style="font-size:20px;"></i>
<input type="text" class="datepicker"
style="border-width: 0; outline: none; width: 100px; cursor: pointer; z-index: 1000"
readonly="readonly"/>
<i class="fa fa-caret-down red-color" style="font-size:10px;"></i>
</div>
</div>
</div>
<div style="display:none;">
<span translate="AssignmentsList" class="textLabelHeader"></span>
<hr/>
</div>
<div class="new-right-header">
<div class="head-row">
<span class="total-projects">报表审批</span>
</div>
<div class="project-staus">
<span style="padding-right: 10px;" class="result-style">{{projectMsg}}</span>
<span style="padding-right:10px;">提审中</span><span class="num-style">{{ongoingNum}}</span>
<span style="padding-right:10px;padding-left:20px;">通过</span><span
class="num-style">{{notBeginNum}}</span>
<span style="padding-right:10px;padding-left:20px;">未通过</span><span
class="num-style">{{completedNum}}</span>
<span style="padding-right:10px;padding-left:20px;">作废</span><span
class="num-style">{{completedNum}}</span>
</div>
<div class="task-list">
<span class="taskMsg" ng-show="serviceTypeId !=='12'">审批列表</span>
</div>
</div>
<div class="new-right-body">
<div class="right-header">
<div class="col-lg-3 col-md-3" style="padding-left:20px;">
<div class="search-container">
<input id="txtSmartSearch" class="search-input" type="text" value="" placeholder="提审人"
ng-model="searchKeyword" ng-change="smartSearch(false)"/><span
ng-class="(searchKeyword!==undefined && searchKeyword.length>0)? 'glyphicon glyphicon-remove input-group-addon search-icon':'glyphicon glyphicon-search input-group-addon search-icon'"
search ng-click="smartSearch(true)"></span>
</div>
</div>
<div class="overview-picker">
<input type="text" id="overviewDatepicker" class="datepicker vat-subheader" style="width:120px;"
readonly="readonly"/>
<i class="fa fa-calendar vat-subheader red-color" style="width:20px;"></i>
</div>
<span class="clear"></span>
</div>
<div class="vat-preview-input-invoice" id="mainPreviewDiv">
<div id="mainAreaDiv" class="main-area">
<div class="inputInvoiceGrid" ui-grid-expandable ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
frameworkModule.directive('appApprove', ['$log', 'region', 'enums',
function ($log, region, enums) {
'use strict';
$log.debug('appOverview.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/framework/app-approve/app-approve.html' + '?_=' + Math.random(),
replace: true,
scope: {
servicetypeid : '='
},
controller: 'appApproveController',
link: function ($scope, $element, $attr) {
var ele = $(".datepicker");
ele.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
viewMode: 1,
minViewMode: 1,
autoclose: true,//选中之后自动隐藏日期选择框
clearBtn: false,//清除按钮
todayBtn: false,//今日按钮
format: $scope.dateFormat//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).on('changeDate', function (e) {
$scope.changeDate(e);
});
ele.datepicker("setDate", $scope.selectedDate);
$scope.elePicker = ele;
}
};
}
]);
\ No newline at end of file
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
<span class="nav-icon-color">{{'MenuVAT' | translate}}</span> <span class="nav-icon-color">{{'MenuVAT' | translate}}</span>
</a> </a>
</div> </div>
<div class="nav-element-left">
<a ui-sref="listApproval">
<span class="nav-icon-color">{{'报表审批' | translate}}</span>
</a>
</div>
<!--<div class="nav-element-left">--> <!--<div class="nav-element-left">-->
<!--<a ui-sref="summaryDashboard" hover-show="second">--> <!--<a ui-sref="summaryDashboard" hover-show="second">-->
<!--<span class="nav-icon-color">{{'MenuTaxAnalysisPlatform' | translate}}</span>--> <!--<span class="nav-icon-color">{{'MenuTaxAnalysisPlatform' | translate}}</span>-->
......
webservices.factory('vatSessionService', ['$log', 'localStorageService', function ($log, localStorageService) {
'use strict';
$log.debug('vatSessionService.ctor()...');
var date = new Date();
var month = date.getMonth();
var projectyear = date.getFullYear();
if (month <= 0) {
month = 1;
}
var logUser =
{
ID: "66933E7B-DA75-4B2E-B7D6-AB65DCA20D50",
UserName: "Admin",
};
var userPermission = {};
var queryDto = {
searchKeyword: '',
fieldId: '',
filedName: 'orgName',
checkedOrgs: {},
};
var reset = function () {
var date = new Date();
var m = date.getMonth();
if (m <= 0) {
m = 1;
}
this.month = m;
setProperty("month", m);
};
var cacheObj = {
month: month,
userPermission: {},
project: { year: 2017 },
projects: [],
dataChanged: false
};
var temp = localStorageService.get('tesla-cache');
if (temp) {
cacheObj = temp;
} else {
localStorageService.set('tesla-cache', cacheObj);
}
var setProperty = function (propertyName, propertyValue) {
cacheObj[propertyName] = propertyValue
//$cookieStore.put('tesla-cache', JSON.stringify(apiTokenObj));
localStorageService.set('tesla-cache', cacheObj);
}
var getProperty = function (propertyName) {
//console.log($cookieStore.get('tesla-cache'));
return cacheObj[propertyName];
}
// 跳转到admin或者outputinvoice management 需要清空所选择的project,不然会影响权限
var clearSelectProject = function () {
var tempProject = { year: 2017 };
setProperty('project', tempProject);
};
return {
month: month,
year: projectyear,
project: { year: 2017 },
projects: [],
dataChanged: false,
logUser: logUser,
reset: reset,
userPermission: userPermission,
queryDto: queryDto,
setProperty: setProperty,
getProperty: getProperty,
clearSelectProject: clearSelectProject,
}
}]);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.

var noPermissionPageModule = angular.module('app.noPermissionPage', [])
.run(['$log', function ($log) {
$log.debug('app.noPermissionPage.run()...');
}])
.config(['$controllerProvider', '$compileProvider', '$filterProvider', '$provide', 'scriptDependencyProvider', '$stateProvider', '$urlRouterProvider',
function ($controllerProvider, $compileProvider, $filterProvider, $provide, scriptDependencyProvider, $stateProvider, $urlRouterProvider) {
'use strict';
// this is required to add controller/directive/filter/service after angular bootstrap
bindModule(noPermissionPageModule, $controllerProvider, $compileProvider, $filterProvider, $provide);
$stateProvider.state({
name: 'noPermissionPage',
url: '/noPermissionPage',
views: {
'@': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.noPermissionPage]);
}],
template: '<no-permission-page></no-permission-page>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.noPermissionPage),
deepStateRedirect: true,
sticky: true
});
}]);
\ 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