Commit 99b8cb6b authored by neo's avatar neo

[DEV] fix appoavle info retern and add get first template info

parent e5aafd7d
......@@ -14,6 +14,7 @@ import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.service.impl.ApprovalService;
import javax.servlet.http.HttpServletResponse;
......@@ -56,6 +57,12 @@ public class ApprovalController {
return approvalService.getTask();
}
@ResponseBody
@RequestMapping(value = "/templateInfo/{templateId}")
public PeriodTemplate getFirstTemplate(@PathVariable Long templateId) {//accountant manager
return approvalService.getTemplateInfo(templateId);
}
@ResponseBody
@RequestMapping(value = "/check/{taskId}")
public void check(@PathVariable String taskId, @RequestParam String decide) {//only for manager role
......
......@@ -18,14 +18,14 @@ import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.PeriodApproveMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
import pwc.taxtech.atms.vat.entity.PeriodReport;
import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import pwc.taxtech.atms.vat.entity.*;
import java.util.*;
import static pwc.taxtech.atms.common.util.SpringContextUtil.periodTemplateMapper;
@Service
public class ApprovalService {
private static Logger logger = LoggerFactory.getLogger(ApprovalService.class);
......@@ -39,6 +39,8 @@ public class ApprovalService {
PeriodReportMapper reportMapper;
@Autowired
AuthUserHelper authUserHelper;
@Autowired
PeriodTemplateMapper periodTemplateMapper;
@Transactional
......@@ -57,12 +59,9 @@ public class ApprovalService {
}
private void startInstance(ApprovalDto dto, PeriodApprove pa) {
PeriodReportExample pre = new PeriodReportExample();
pre.createCriteria().andProjectIdEqualTo(dto.getProjectId()).andPeriodEqualTo(dto.getPeriod());
List<PeriodReport> currentReports = reportMapper.selectByExample(pre);
List<PeriodReport> currentReports = reportMapper.selectOrderReportIds(dto.getProjectId(),dto.getPeriod());
MyAsserts.assertNotEmpty(currentReports, Exceptions.NOT_FOUND_REPORT_EXCEPTION);
pa.setId(UUID.randomUUID().toString());
pa.setPeriod(dto.getPeriod());
pa.setYear(dto.getYear());
......@@ -155,4 +154,7 @@ public class ApprovalService {
}
public PeriodTemplate getTemplateInfo(Long templateId) {
return periodTemplateMapper.selectByPrimaryKey(templateId);
}
}
......@@ -120,7 +120,9 @@ public interface PeriodApproveMapper extends MyVatMapper {
" pa.APPROVAL_RESUALT AS approvalResult, " +
" pa.CREATE_TIME AS createTime, " +
" pa.APPROVAL_TIME AS approvalTime, " +
" pa.REPORT_PATHS AS reportPaths " +
" pa.REPORT_PATHS AS reportPaths," +
" pa.REPORT_IDS as reportIds, " +
" pa.TEMPLATE_IDS as templateIds" +
"FROM " +
" PERIOD_APPROVE pa " +
" INNER JOIN PROJECT p ON pa.PROJECT_ID = p.ID " +
......
......@@ -118,4 +118,18 @@ public interface PeriodReportMapper extends MyVatMapper {
" AND pds.PERIOD = #{period}" +
"")
int hasManualDataSource(@Param("projectId") String projectId, @Param("period") Integer period);
@Select("" +
"SELECT " +
" r.ID as id,r.TEMPLATE_ID as templateId " +
"FROM " +
" PERIOD_REPORT r " +
" LEFT JOIN PERIOD_TEMPLATE pt ON r.TEMPLATE_ID = pt.TEMPLATE_ID " +
"WHERE " +
" r.PROJECT_ID = '1' " +
" AND r.PERIOD = 10 " +
"ORDER BY " +
" pt.ORDER_INDEX" +
"")
List<PeriodReport> selectOrderReportIds(String projectId, Integer period);
}
\ No newline at end of file
......@@ -14,6 +14,8 @@ public class ApprovalTaskInfo {
private Date createTime;
private Date approvalTime;
private String reportPaths;
private String reportIds;
private String templateIds;
public String getProjectName() {
return projectName;
......@@ -102,4 +104,20 @@ public class ApprovalTaskInfo {
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getReportIds() {
return reportIds;
}
public void setReportIds(String reportIds) {
this.reportIds = reportIds;
}
public String getTemplateIds() {
return templateIds;
}
public void setTemplateIds(String templateIds) {
this.templateIds = templateIds;
}
}
......@@ -17,7 +17,7 @@ webservices.factory('projectService', ['$http', 'apiConfig', function ($http, ap
return $http.get('/project/getAllProjectList?orgID=' + orgID + '&serviceID=' + serviceID + (projectYear==null?'':'&projectYear=' + projectYear), apiConfig.create());
},
getProjectByID: function (projectID) {
return $http.get('/project/getProject?projectID=' + projectID, apiConfig.create());
return $http.get('/project/getProject?projectId=' + projectID, apiConfig.create());
},
getProjectExceptSelected: function (userId) {
return $http.get('/project/displayExceptSelected?userID=' + userId, apiConfig.create());
......
......@@ -97,19 +97,4 @@
</div>
</div>
</div>
<script type="text/ng-template" id="liucheng.html">
<div class="modal-content" style="width:900px">
<div class="modal-header" style="width:900px">
<div class="modal-title" id="modal-title">报表审批流程</div>
</div>
<div class="modal-body" id="modal-body" style="width:900px">
<div class="content">
<img src="../../../app-resources/images/vat/liucheng.png">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-third" data-dismiss="modal" ng-click="cancel()">关闭</button>
</div>
</div>
</script>
</div>
\ No newline at end of file
......@@ -70,7 +70,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
projectService.setProjectStatus( temp, constant.ProjectStatusEnum.UnStarted).success(function (or) {
if (or.result) {
vatSessionService.project.projectStatusList[temp] = constant.ProjectStatusEnum.UnStarted;
initStatus(vatSessionService.project.id, vatSessionService.project.id, temp);
initStatus(vatSessionService.project.id, temp);
}
else {
SweetAlert.error($translate.instant('SetProjectStatusError'));
......@@ -79,7 +79,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
}
else { //已经导入的话,更新最新项目状态
vatSessionService.project.projectStatusList[temp] = or.data.status;
initStatus(vatSessionService.project.id, vatSessionService.project.id, temp);
initStatus( vatSessionService.project.id, temp);
}
}
});
......@@ -665,13 +665,11 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
}
}
function initStatus(dbName, id, month) {
function initStatus(id, month) {
$q.all([
projectService.getProjectStatus(id, month),
//vatWorkflowService.getWorkflowDetailByDb(dbName, month)
]).then(function (result) {
var statusData = result[0].data;
// var workflowData = result[1].data;
if (statusData.result) {
$log.debug("vat-layout.ctrl.js initStatus set project importSubStatus");
vatSessionService.project.importSubStatus = statusData.data.importSubStatus;
......@@ -682,11 +680,6 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
$log.debug(vatSessionService.project.importSubStatus);
}
// if (workflowData.result) {
// $log.debug("vat-layout.ctrl.js initStatus set project workflow");
// vatSessionService.project.workflow = workflowData.data;
// $log.debug(vatSessionService.project.workflow);
// }
});
}
......@@ -700,7 +693,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
$scope.displaySubStatus = false;//导入子状态是否显示
$scope.displayApproveDetails = false;//审核详细详细是否显示
$scope.triggerSchedulerJob = triggerSchedulerJob;
initStatus(vatSessionService.project.id, vatSessionService.project.id, vatSessionService.month);
initStatus(vatSessionService.project.id, vatSessionService.month);
$scope.setPermissionMenu();
......
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