项目状态控制
parent
01b0f0e997
commit
48a979e5ab
|
@ -42,19 +42,19 @@ public class Project {
|
|||
* 概算、预算、结算、决算:审核状态:0草稿,1待审核,2审核通过,3审核不通过
|
||||
*/
|
||||
@Column(name = "approve_status_estimate")
|
||||
private Integer approveStatusEstimate;
|
||||
private int approveStatusEstimate = -1;
|
||||
@Column(name = "approve_status_budget")
|
||||
private Integer approveStatusBudget;
|
||||
private int approveStatusBudget = -1;
|
||||
@Column(name = "approve_status_settle")
|
||||
private Integer approveStatusSettle;
|
||||
private int approveStatusSettle = -1;
|
||||
@Column(name = "approve_status_final")
|
||||
private Integer approveStatusFinal;
|
||||
private int approveStatusFinal = -1;
|
||||
|
||||
/**
|
||||
* 审核人id
|
||||
*/
|
||||
@Column(name = "approve_id")
|
||||
private Integer approveId;
|
||||
private int approveId = 0;
|
||||
@Column(name = "approve_name")
|
||||
private String approveName;
|
||||
/**
|
||||
|
@ -204,39 +204,8 @@ public class Project {
|
|||
this.statusDesc = statusDesc;
|
||||
}
|
||||
|
||||
public Integer getApproveStatusEstimate() {
|
||||
return approveStatusEstimate;
|
||||
}
|
||||
|
||||
public void setApproveStatusEstimate(Integer approveStatusEstimate) {
|
||||
this.approveStatusEstimate = approveStatusEstimate;
|
||||
}
|
||||
|
||||
public Integer getApproveStatusBudget() {
|
||||
return approveStatusBudget;
|
||||
}
|
||||
|
||||
public void setApproveStatusBudget(Integer approveStatusBudget) {
|
||||
this.approveStatusBudget = approveStatusBudget;
|
||||
}
|
||||
|
||||
public Integer getApproveStatusSettle() {
|
||||
return approveStatusSettle;
|
||||
}
|
||||
|
||||
public void setApproveStatusSettle(Integer approveStatusSettle) {
|
||||
this.approveStatusSettle = approveStatusSettle;
|
||||
}
|
||||
|
||||
public Integer getApproveStatusFinal() {
|
||||
return approveStatusFinal;
|
||||
}
|
||||
|
||||
public void setApproveStatusFinal(Integer approveStatusFinal) {
|
||||
this.approveStatusFinal = approveStatusFinal;
|
||||
}
|
||||
|
||||
public Integer getApproveStatus() {
|
||||
public int getApproveStatus() {
|
||||
if(status == STATUS_ESTIMATE){
|
||||
return approveStatusEstimate;
|
||||
}
|
||||
|
@ -249,25 +218,17 @@ public class Project {
|
|||
if(status == STATUS_FINAL){
|
||||
return approveStatusFinal;
|
||||
}
|
||||
return null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public String getApproveStatusDesc() {
|
||||
Integer approveStatus = getApproveStatus();
|
||||
if(null == approveStatus){
|
||||
int approveStatus = getApproveStatus();
|
||||
if(-1 == approveStatus){
|
||||
return "未知";
|
||||
}
|
||||
return ApproveStatusEnum.parseApproveStatus(approveStatus).getApproveStatusDesc();
|
||||
}
|
||||
|
||||
public Integer getApproveId() {
|
||||
return approveId;
|
||||
}
|
||||
|
||||
public void setApproveId(Integer approveId) {
|
||||
this.approveId = approveId;
|
||||
}
|
||||
|
||||
public String getApproveName() {
|
||||
return approveName;
|
||||
}
|
||||
|
@ -435,4 +396,44 @@ public class Project {
|
|||
public void setLastUpdateTime(Date lastUpdateTime) {
|
||||
this.lastUpdateTime = lastUpdateTime;
|
||||
}
|
||||
|
||||
public int getApproveStatusEstimate() {
|
||||
return approveStatusEstimate;
|
||||
}
|
||||
|
||||
public void setApproveStatusEstimate(int approveStatusEstimate) {
|
||||
this.approveStatusEstimate = approveStatusEstimate;
|
||||
}
|
||||
|
||||
public int getApproveStatusBudget() {
|
||||
return approveStatusBudget;
|
||||
}
|
||||
|
||||
public void setApproveStatusBudget(int approveStatusBudget) {
|
||||
this.approveStatusBudget = approveStatusBudget;
|
||||
}
|
||||
|
||||
public int getApproveStatusSettle() {
|
||||
return approveStatusSettle;
|
||||
}
|
||||
|
||||
public void setApproveStatusSettle(int approveStatusSettle) {
|
||||
this.approveStatusSettle = approveStatusSettle;
|
||||
}
|
||||
|
||||
public int getApproveStatusFinal() {
|
||||
return approveStatusFinal;
|
||||
}
|
||||
|
||||
public void setApproveStatusFinal(int approveStatusFinal) {
|
||||
this.approveStatusFinal = approveStatusFinal;
|
||||
}
|
||||
|
||||
public int getApproveId() {
|
||||
return approveId;
|
||||
}
|
||||
|
||||
public void setApproveId(int approveId) {
|
||||
this.approveId = approveId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,13 +86,15 @@ public class ActListenerService {
|
|||
String businessKey = processInstance.getBusinessKey();
|
||||
logger.info("businessKey : {}", businessKey);
|
||||
|
||||
if (candidateUsers != null && !candidateUsers.isEmpty() && businessKey != null) {
|
||||
try {
|
||||
int adminId = Integer.parseInt(candidateUsers.get(0));
|
||||
projectInstanceService.updateApprover(Integer.parseInt(businessKey), adminId);
|
||||
} catch (Exception e) {
|
||||
logger.error("", e);
|
||||
try {
|
||||
int adminId = 0;
|
||||
if (!candidateUsers.isEmpty()) {
|
||||
adminId = Integer.parseInt(candidateUsers.get(0));
|
||||
}
|
||||
projectInstanceService.updateApprover(Integer.parseInt(businessKey), adminId);
|
||||
} catch (Exception e) {
|
||||
logger.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,9 +110,13 @@ public class ProjectInstanceService {
|
|||
*/
|
||||
public void updateApprover(int projectId, int adminId){
|
||||
Project project = projectRepository.findOne(projectId);
|
||||
Admin admin = adminService.getAdminById(adminId);
|
||||
if (adminId == 0) {
|
||||
project.setApproveName("");
|
||||
}else {
|
||||
Admin admin = adminService.getAdminById(adminId);
|
||||
project.setApproveName(admin.getRealName());
|
||||
}
|
||||
project.setApproveId(adminId);
|
||||
project.setApproveName(admin.getUserName());
|
||||
project.setLastUpdateTime(new Date());
|
||||
projectRepository.saveAndFlush(project);
|
||||
}
|
||||
|
@ -137,6 +141,12 @@ public class ProjectInstanceService {
|
|||
project.setApproveStatusFinal(approveStatusEnum.getApproveStatus());
|
||||
}
|
||||
|
||||
if (approveStatusEnum.getApproveStatus() == ApproveStatusEnum.APPROVAL_PASSED.getApproveStatus()) {
|
||||
//审批通过设置审批人为空
|
||||
project.setApproveId(0);
|
||||
project.setApproveName("");
|
||||
}
|
||||
|
||||
project.setLastUpdateTime(new Date());
|
||||
projectRepository.saveAndFlush(project);
|
||||
}
|
||||
|
|
|
@ -212,7 +212,7 @@ public class ProjectService {
|
|||
project.setProjectContributionProfitRateThreshold(projectConfigBeanConfig.getProjectContributionProfitRateThreshold());
|
||||
project.setUnderwrittenTaxRate(projectConfigBeanConfig.getUnderwrittenTaxRate());
|
||||
|
||||
project.setApproveId(null);
|
||||
project.setApproveId(0);
|
||||
project.setApproveName("");
|
||||
|
||||
//TODO 获取登录人的部门信息
|
||||
|
|
|
@ -210,7 +210,8 @@
|
|||
|
||||
<#-- </@shiro.hasPermission>
|
||||
<@shiro.hasPermission name="PROJECT_EDIT">-->
|
||||
<#if list.status==5 && (list.approveStatusBudget=0 || list.approveStatusBudget=3)>
|
||||
<#--概算审核通过 才可以发起预算-->
|
||||
<#if list.approveStatusEstimate=2 && (list.approveStatusBudget==0 || list.approveStatusBudget==3) >
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/budgetEdit?id=${list.id}'"><span
|
||||
|
@ -218,16 +219,22 @@
|
|||
</button>
|
||||
</#if>
|
||||
<#-- </@shiro.hasPermission>-->
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/settle/add?id=${list.id}'"><span
|
||||
class="am-icon-pencil-square-o"></span>填写结算表
|
||||
</button>
|
||||
|
||||
<#--预算审核通过 才可以发起结算-->
|
||||
<#if list.approveStatusBudget=2 >
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/settle/add?id=${list.id}'"><span
|
||||
class="am-icon-pencil-square-o"></span>填写结算表
|
||||
</button>
|
||||
</#if>
|
||||
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/final/edit?id=${list.id}'"><span
|
||||
class="am-icon-pencil-square-o"></span>发起决算
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/detail?id=${list.id}'"><span
|
||||
|
@ -244,11 +251,13 @@
|
|||
</#if>
|
||||
|
||||
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/taskRecords/${list.id?c}'"><span
|
||||
class="am-icon-pencil-square-o"></span>查看审核流程
|
||||
</button>
|
||||
<#if list.approveStatusEstimate != 0 >
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/taskRecords/${list.id?c}'"><span
|
||||
class="am-icon-pencil-square-o"></span>查看审核流程
|
||||
</button>
|
||||
</#if>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue