Commit b8afc3cf authored by cq990612's avatar cq990612

优化代码结构

parent 16c24fc2
...@@ -61,12 +61,10 @@ public enum BASE_RESP_CODE_ENUM { ...@@ -61,12 +61,10 @@ public enum BASE_RESP_CODE_ENUM {
NEW_PASSWORD_IS_HTE_SAME_OLD_PASSWORD("639","新密码不能与旧密码相同"), NEW_PASSWORD_IS_HTE_SAME_OLD_PASSWORD("639","新密码不能与旧密码相同"),
PASSWORD_FORMAT_ERROR("640","密码由6到16位数字组成"), PASSWORD_FORMAT_ERROR("640","密码由6到16位数字组成"),
INCOMPLETE_WORK_ORDER_INFORMATION("621","请填写完整的工单信息"), INCOMPLETE_WORK_ORDER_INFORMATION("621","请填写完整的工单信息"),
NOT_MANAGER_TYPE("642","没有可以管理的类型项目"),
HAVE_ORDER_DELETE("643", "有工单被用户删除,审批失败,请重新审批"), HAVE_ORDER_DELETE("643", "有工单被用户删除,审批失败,请重新审批"),
ORDER_EXAMINE("644","该工单已经被审批,请刷新查看"), ORDER_EXAMINE("644","该工单已经被审批,请刷新查看"),
NO_WORK_ORDERS_HAVE_BEEN_REJECTED("645", "暂无驳回未提交工单"), NO_WORK_ORDERS_HAVE_BEEN_REJECTED("645", "暂无驳回未提交工单"),
LEAVE_JOB_USER("646","账号状态异常,请联系管理员"), LEAVE_JOB_USER("646","账号状态异常,请联系管理员"),
ItemType_Does_NotMatch("647","工时类型和项目名称不匹配"),
PROJECT_NOT_USER("648", "该项目还没有参与人员"), PROJECT_NOT_USER("648", "该项目还没有参与人员"),
theNewContent_IsEqual_ToTheOriginal_Content("649","更新内容与旧内容一致,更新失败"), theNewContent_IsEqual_ToTheOriginal_Content("649","更新内容与旧内容一致,更新失败"),
REASON_CANNOT_BE_EMPTY("650", "更变原因不能为空"), REASON_CANNOT_BE_EMPTY("650", "更变原因不能为空"),
...@@ -75,7 +73,7 @@ public enum BASE_RESP_CODE_ENUM { ...@@ -75,7 +73,7 @@ public enum BASE_RESP_CODE_ENUM {
ORDINARY_MEMBERS_ARE_MANAGEMENT("653", "普通成员不能有管理角色"), ORDINARY_MEMBERS_ARE_MANAGEMENT("653", "普通成员不能有管理角色"),
REPEAT_WITH_OLDTIME("654", "日期与其他节假日或工作日冲突"), REPEAT_WITH_OLDTIME("654", "日期与其他节假日或工作日冲突"),
BUDGET_CANNOT_BELESSTHAN_ZERO("655", "预算不能小于0"), BUDGET_CANNOT_BELESSTHAN_ZERO("655", "预算不能小于0"),
ITEMOADUPLICATE("656", "项目OA重复"), ITEMOADUPLICATE("656", "OA编号重复"),
NO_AUTHORITY("657", "暂无该权限"), NO_AUTHORITY("657", "暂无该权限"),
THEPERIOD_CANNOT_BELESS_THANONEDAY("658", "设置的期限不能小于1天"), THEPERIOD_CANNOT_BELESS_THANONEDAY("658", "设置的期限不能小于1天"),
DUPLICATE_HOLIDAY_NAME("659", "节假日名称重复"), DUPLICATE_HOLIDAY_NAME("659", "节假日名称重复"),
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
select p.id,p.oa_project_id,p.project_name,p.type,p.create_time,p.is_conclusion, select p.id,p.oa_project_id,p.project_name,p.type,p.create_time,p.is_conclusion,
GROUP_CONCAT(DISTINCT(u.name)) as 'participants',p.cost_budget,p.work_time,p.start_time,p.end_time, GROUP_CONCAT(DISTINCT(u.name)) as 'participants',p.cost_budget,p.work_time,p.start_time,p.end_time,
if(cost is NULL,0.00,cost) as 'currentLaborCost',if(total_time is NULL,0.00,total_time) as 'totalCurrentWorkingHours', if(cost is NULL,0.00,cost) as 'currentLaborCost',if(total_time is NULL,0.00,total_time) as 'totalCurrentWorkingHours',
if(now() BETWEEN p.start_time and p.end_time,'否','是') as 'isItOverdue', if(p.end_time>=curdate(),'否','是') as 'isItOverdue',
if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange' if(p.create_time = p.modify_time,'否','是') as 'isThereABudgetChange'
from work_project p LEFT JOIN (select project_id,SUM(total_time) as 'total_time',SUM(cost) as 'cost' from work_project p LEFT JOIN (select project_id,SUM(total_time) as 'total_time',SUM(cost) as 'cost'
FROM work_project_time_cost FROM work_project_time_cost
......
package cn.wisenergy.model.enums;
public enum ProjectTypeEnum {
PROJECT(1, "项目", 1),
BUSINESS_OPPORTUNITY(2, "商机", 1),
LEAVE(3, "请假", 2),
COMPENSATORY_LEAVE(4, "调休", 2),
EXTERNAL_BUSINESS(5, "外部商务、技术交流", 3),
INTERNAL_TRAINING(6, "内部培训、技术准备、管理", 3),
OTHER_NON_PROJECTS(7, "其他非项目/商机工作", 3),
;
private Integer type;
private String typeName;
// 1:项目经理 2:自动审批 3:其他管理员
private Integer reviewer;
ProjectTypeEnum(Integer type, String typeName, Integer reviewer) {
this.reviewer = reviewer;
this.type = type;
this.typeName = typeName;
}
public Integer getType() {
return type;
}
public String getTypeName() {
return typeName;
}
public Integer getReviewer() {
return reviewer;
}
}
...@@ -348,8 +348,8 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -348,8 +348,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
WorkProjectChange workProjectChange = new WorkProjectChange(); WorkProjectChange workProjectChange = new WorkProjectChange();
workProjectChange.setProjectId(modifyProjectVo.getProjectId()); workProjectChange.setProjectId(modifyProjectVo.getProjectId());
workProjectChange.setModifyTime(new Date()); workProjectChange.setModifyTime(new Date());
workProjectChange.setChangeType(2); workProjectChange.setChangeType(2);
workProjectChange.setModifyBefore(workProject.getWorkTime().toString()); workProjectChange.setModifyBefore(workProject.getWorkTime().toString());
workProjectChange.setModifyAfter(modifyProjectVo.getWorkTime().setScale(2, BigDecimal.ROUND_HALF_UP).toString()); workProjectChange.setModifyAfter(modifyProjectVo.getWorkTime().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
workProjectChange.setReason(modifyProjectVo.getWorkTimeReason()); workProjectChange.setReason(modifyProjectVo.getWorkTimeReason());
...@@ -477,6 +477,9 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -477,6 +477,9 @@ public class WorkProjectServiceImpl implements WorkProjectService {
} }
} }
if (null != modifyProjectVo.getCostBudget()) { if (null != modifyProjectVo.getCostBudget()) {
if (BigDecimal.ZERO.compareTo(modifyProjectVo.getCostBudget()) > 0) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.BUDGET_CANNOT_BELESSTHAN_ZERO);
}
if (StringUtils.isBlank(modifyProjectVo.getCostBudgetReason())) { if (StringUtils.isBlank(modifyProjectVo.getCostBudgetReason())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.REASON_CANNOT_BE_EMPTY); throw new BaseCustomException(BASE_RESP_CODE_ENUM.REASON_CANNOT_BE_EMPTY);
} }
...@@ -485,6 +488,9 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -485,6 +488,9 @@ public class WorkProjectServiceImpl implements WorkProjectService {
} }
} }
if (null != modifyProjectVo.getWorkTime()) { if (null != modifyProjectVo.getWorkTime()) {
if (BigDecimal.ZERO.compareTo(modifyProjectVo.getWorkTime()) > 0) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.BUDGET_CANNOT_BELESSTHAN_ZERO);
}
if (StringUtils.isBlank(modifyProjectVo.getWorkTimeReason())) { if (StringUtils.isBlank(modifyProjectVo.getWorkTimeReason())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.REASON_CANNOT_BE_EMPTY); throw new BaseCustomException(BASE_RESP_CODE_ENUM.REASON_CANNOT_BE_EMPTY);
} }
......
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