Commit bed8588d authored by nie'hong's avatar nie'hong

修改bug

parent b0361372
......@@ -89,7 +89,7 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
int updateAutoExamine(@Param("workIds") List<Integer> workIds);
/**
* 获取人员项目工时
* 获取人员项目工时,请假的projectId为-1,调休为-2
*/
List<UserWorkTimeStatisticsByProject> getUserProjectWorkTimeStatistics(Map<String, Object> map);
......
......@@ -139,7 +139,7 @@
'participants',p.cost_budget,p.work_time,p.start_time,p.end_time,
if(cost is NULL,0,0 + cast(cost as char)) as 'currentLaborCost',if(total_time is NULL,0,0 + cast(total_time as
char)) as 'totalCurrentWorkingHours',
if ( p.end_time!=null,if (p.end_time>curdate(),'否','是'),'否') as 'isItOverdue',
if (p.end_time is not null,if (p.end_time>curdate(),'否','是'),'否') as 'isItOverdue',
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)/10000 as 'cost'
FROM work_project_time_cost
......@@ -147,7 +147,7 @@
LEFT JOIN (select id,`name` as 'manager_name'from work_user) lu on p.manager_id=lu.id
LEFT JOIN work_dept d on p.dept_id=d.id
LEFT JOIN work_user_project up ON p.id = up.project_id
LEFT JOIN work_user u on u.id = up.user_id
LEFT JOIN (select id,`name` from work_user where status =1) u on u.id = up.user_id
<where>
<if test="deptAndManager >0">
<if test="null !=type">
......@@ -196,7 +196,7 @@
</if>
)
</if>
AND u.status = 1
</where>
......
......@@ -14,6 +14,8 @@ public enum ChangeTypeEnum {
PARTICIPANTS(7, "参与人员"),
PROJECT_NUMBER(8, "项目/商机编号"),
PROJECT_NAME(9, "项目/商机名称"),
BUSINESS_ID(10,"对应商机编号"),
BUSINESS_NAME(11, "对应商机名称")
;
......
......@@ -52,8 +52,12 @@ public class ModifyProjectVo {
private String businessId;
private String businessIdReason;
private String businessName;
private String businessNameReason;
private String oaProjectId;
private String oaProjectIdReason;
......@@ -62,6 +66,7 @@ public class ModifyProjectVo {
private String projectNameReason;
// 变更人Id
private Integer reviserId;
// 是否加入变更项
......
......@@ -753,8 +753,6 @@ public class StatisticsServiceImpl implements StatisticsService {
projectNumbers1.setBusinessNumbers(businessNumbers);
userProjectWorkTimeStatistic.setProjectNumbers(projectNumbers1);
//清除查询用户id
map.remove("userId");
}
return userProjectWorkTimeStatistics;
......@@ -1009,16 +1007,33 @@ public class StatisticsServiceImpl implements StatisticsService {
* 这里k从2变为4
*/
// 写入工时
for (int k = 4; k < row1_lastCellNum; k++) {
if (row_1.getCell(k) != null && projectWorkTimeAndType2.getProjectName().equals(row_1.getCell(k).getStringCellValue())) {
// for (int k = 4; k < row1_lastCellNum; k++) {
// if (row_1.getCell(k) != null && projectWorkTimeAndType2.getProjectName().equals(row_1.getCell(k).getStringCellValue())) {
// if (projectWorkTimeAndType2.getNormalTime() != null) {
// HSSFCell cell_k_1 = row_i.createCell(k);
// cell_k_1.setCellValue(projectWorkTimeAndType2.getNormalTime());
// }
// if (projectWorkTimeAndType2.getOverTime() != null) {
// HSSFCell cell_k_2 = row_i.createCell(k + 1);
// cell_k_2.setCellValue(projectWorkTimeAndType2.getOverTime());
// }
// }
// }
// 写入工时
for (int i1 = 0; i1 < projectWorkTimeAndType.size(); i1++) {
ProjectWorkTimeAndType projectWorkTimeAndType3 = projectWorkTimeAndType.get(i1);
// 项目主键相同或者不为项目商机时工时类型相同
if ((projectWorkTimeAndType2.getProjectId() != null && projectWorkTimeAndType2.getProjectId().equals(projectWorkTimeAndType3.getProjectId()))
|| (projectWorkTimeAndType2.getProjectId() == null && projectWorkTimeAndType2.getWorkTimeType().equals(projectWorkTimeAndType3.getWorkTimeType()))) {
if (projectWorkTimeAndType2.getNormalTime() != null) {
HSSFCell cell_k_1 = row_i.createCell(k);
HSSFCell cell_k_1 = row_i.createCell(2 * i1 + 4);
cell_k_1.setCellValue(projectWorkTimeAndType2.getNormalTime());
}
if (projectWorkTimeAndType2.getOverTime() != null) {
HSSFCell cell_k_2 = row_i.createCell(k + 1);
HSSFCell cell_k_2 = row_i.createCell(2 * i1 + 4 + 1);
cell_k_2.setCellValue(projectWorkTimeAndType2.getOverTime());
}
break;
}
}
}
......
......@@ -420,7 +420,46 @@ public class WorkProjectServiceImpl implements WorkProjectService {
workProjectChange.setReviserId(modifyProjectVo.getReviserId());
workProjectChanges.add(workProjectChange);
}
if (!StringUtils.isBlank(modifyProjectVo.getBusinessIdReason())) {
if (StringUtils.isBlank(modifyProjectVo.getBusinessId())) {
throw new BaseCustomException("666", "请填写项目对应商机编号");
}
if (!StringUtils.isBlank(workProject.getBusinessId())) {
if (modifyProjectVo.getBusinessId().equals(workProject.getBusinessId())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.theNewContent_IsEqual_ToTheOriginal_Content);
}
}
WorkProjectChange workProjectChange = new WorkProjectChange();
workProjectChange.setProjectId(modifyProjectVo.getProjectId());
workProjectChange.setModifyTime(new Date());
workProjectChange.setChangeType(10);
workProjectChange.setModifyBefore(workProject.getBusinessId());
workProjectChange.setModifyAfter(modifyProjectVo.getBusinessId());
workProjectChange.setReason(modifyProjectVo.getBusinessIdReason());
workProjectChange.setOperationType(2);
workProjectChange.setReviserId(modifyProjectVo.getReviserId());
workProjectChanges.add(workProjectChange);
}
if (!StringUtils.isBlank(modifyProjectVo.getBusinessNameReason())) {
if (StringUtils.isBlank(modifyProjectVo.getBusinessName())) {
throw new BaseCustomException("666", "请填写项目对应商机名称");
}
if (!StringUtils.isBlank(workProject.getBusinessName())) {
if (modifyProjectVo.getBusinessName().equals(workProject.getBusinessName())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.theNewContent_IsEqual_ToTheOriginal_Content);
}
}
WorkProjectChange workProjectChange = new WorkProjectChange();
workProjectChange.setProjectId(modifyProjectVo.getProjectId());
workProjectChange.setModifyTime(new Date());
workProjectChange.setChangeType(11);
workProjectChange.setModifyBefore(workProject.getBusinessName());
workProjectChange.setModifyAfter(modifyProjectVo.getBusinessName());
workProjectChange.setReason(modifyProjectVo.getBusinessNameReason());
workProjectChange.setOperationType(2);
workProjectChange.setReviserId(modifyProjectVo.getReviserId());
workProjectChanges.add(workProjectChange);
}
if (!StringUtils.isBlank(modifyProjectVo.getDeptIdReason())) {
if (!workProject.getDeptId().equals(modifyProjectVo.getDeptId())) {
......@@ -607,7 +646,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
// 新增项目的校验
if (createProjectVo.getType().equals(PROJECT_CODE)) {
if ( null == createProjectVo.getStartTime() || null == createProjectVo.getEndTime() || StringUtils.isBlank(createProjectVo.getOaProjectId()) || null == createProjectVo.getWorkTime() || null == createProjectVo.getCostBudget() || null == createProjectVo.getDeptId() ||
if (null == createProjectVo.getStartTime() || null == createProjectVo.getEndTime() || StringUtils.isBlank(createProjectVo.getOaProjectId()) || null == createProjectVo.getWorkTime() || null == createProjectVo.getCostBudget() || null == createProjectVo.getDeptId() ||
StringUtils.isBlank(createProjectVo.getProjectName()) || null == createProjectVo.getDeptId() || CollectionUtils.isEmpty(createProjectVo.getUserIds())) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}
......@@ -645,7 +684,6 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
// 在oa数据库中查找对应信息
OaProject oaProject = oaProjectService.getOaProjectByNoAndName(createProjectVo, manager.getOaUserId());
if (oaProject == null) {
......
......@@ -1422,7 +1422,6 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
workLeave.setModifyTime(DateUtil.getTime(new Date(),"yyyy-MM-dd-HH-mm-ss"));
int workLeaveCount = workLeaveMapper.insert(workLeave);
if (workOrderCount == 0 || workCollectCount == 0 || workLeaveCount == 0) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.UPDATE_DATA_FAIL);
}
......
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