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