|
@@ -10,10 +10,7 @@ import com.management.platform.entity.*;
|
|
|
import com.management.platform.entity.vo.*;
|
|
|
import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.*;
|
|
|
-import com.management.platform.util.ExcelUtil;
|
|
|
-import com.management.platform.util.HttpRespMsg;
|
|
|
-import com.management.platform.util.ListUtil;
|
|
|
-import com.management.platform.util.WorkDayCalculateUtils;
|
|
|
+import com.management.platform.util.*;
|
|
|
import org.apache.poi.EncryptedDocumentException;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
@@ -80,6 +77,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
@Resource
|
|
|
private ReportMapper reportMapper;
|
|
|
@Resource
|
|
|
+ private DepartmentService departmentService;
|
|
|
+ @Resource
|
|
|
private SubProjectMapper subProjectMapper;
|
|
|
@Resource
|
|
|
private ParticipationMapper participationMapper;
|
|
@@ -151,6 +150,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
UserCustomMapper userCustomMapper;
|
|
|
@Resource
|
|
|
SubUserCustomMapper subUserCustomMapper;
|
|
|
+ @Resource
|
|
|
+ OperationRecordService operationRecordService;
|
|
|
|
|
|
|
|
|
@Resource
|
|
@@ -520,6 +521,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ Project oldProject = projectMapper.selectById(id);
|
|
|
isNew = false;
|
|
|
//修改项目
|
|
|
//检查项目编号不能重复
|
|
@@ -669,6 +671,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
financeProjectsMapper.update(fp, new QueryWrapper<FinanceProjects>().eq("project_id", p.getId()));
|
|
|
}
|
|
|
}
|
|
|
+ Project newProject = projectMapper.selectById(id);
|
|
|
+ String path = Project.class.getClassLoader().getResource("/").getPath();
|
|
|
+ BeanChangeUtil<Project> beanChangeUtil=new BeanChangeUtil();
|
|
|
+ String content = beanChangeUtil.contrastObj(oldProject, newProject);
|
|
|
+ OperationRecord operationRecord =new OperationRecord();
|
|
|
+ operationRecord.setOperatorName(user.getName());
|
|
|
+ operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
+ operationRecord.setCompanyId(companyId);
|
|
|
+ operationRecord.setContent(content);
|
|
|
+ operationRecord.setModuleName("项目管理");
|
|
|
+ if(!StringUtils.isEmpty(content.trim())){
|
|
|
+ System.out.println(operationRecord);
|
|
|
+ operationRecordService.save(operationRecord);
|
|
|
+ }
|
|
|
}
|
|
|
if (httpRespMsg.code.equals("ok")) {
|
|
|
//编辑关系
|
|
@@ -2938,8 +2954,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
endDateCell = row.getCell(8+i+k+c);
|
|
|
amountCell = row.getCell(9+i+k+c);
|
|
|
if(company.getId()==936){
|
|
|
- warrantyEndDateCell=row.getCell(10+i+k+c);
|
|
|
- warrantyStartDateCell=row.getCell(11+i+k+c);
|
|
|
+ warrantyStartDateCell=row.getCell(10+i+k+c);
|
|
|
+ warrantyEndDateCell=row.getCell(11+i+k+c);
|
|
|
projectCategorySubCell=row.getCell(12+i+k+c);
|
|
|
regionCell=row.getCell(13+i+k+c);
|
|
|
buCell=row.getCell(14+i+k+c);
|
|
@@ -2974,8 +2990,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
endDateCell = row.getCell(9+i+k+c);
|
|
|
amountCell = row.getCell(10+i+k+c);
|
|
|
if(company.getId()==936){
|
|
|
- warrantyEndDateCell=row.getCell(11+i+k+c);
|
|
|
- warrantyStartDateCell=row.getCell(12+i+k+c);
|
|
|
+ warrantyStartDateCell=row.getCell(11+i+k+c);
|
|
|
+ warrantyEndDateCell=row.getCell(12+i+k+c);
|
|
|
projectCategorySubCell=row.getCell(13+i+k+c);
|
|
|
regionCell=row.getCell(14+i+k+c);
|
|
|
buCell=row.getCell(15+i+k+c);
|
|
@@ -3578,7 +3594,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
try {
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
- List<Map<String, Object>> list = projectMapper.getCustomDataSum(companyId, startDate, endDate, projectId, userId);
|
|
|
List<String> headList = new ArrayList<String>();
|
|
|
headList.add("序号");
|
|
|
headList.add("姓名");
|
|
@@ -3594,7 +3609,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
//计算合计的费用
|
|
|
- List<Map<String, Object>> membList = projectMapper.getProjectCusDataSumItem(companyId, startDate, endDate, projectId, userId);
|
|
|
+ //检查是否有查看全公司数值的权限
|
|
|
+ User curUser = userMapper.selectById(request.getHeader("TOKEN"));
|
|
|
+ List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(curUser.getRoleId(), "查看全公司数值");
|
|
|
+ List<Integer> deptIds = null;
|
|
|
+ if (functionList.size() == 0) {
|
|
|
+ //检查是否有负责的部门
|
|
|
+ deptIds = departmentService.getAllManagedDeptIdList(curUser, null);
|
|
|
+ if (deptIds.size() == 0) {
|
|
|
+ deptIds.add(-1);//没有负责的部门,无权查看
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> membList = projectMapper.getProjectCusDataSumItem(companyId, startDate, endDate, projectId, userId, deptIds);
|
|
|
List<Map<String, Object>> membDetailList = projectMapper.getProjectCusDataDetailItem(companyId, startDate, endDate, projectId, userId);
|
|
|
for (Map<String, Object> membMap : membList) {
|
|
|
List<String> membRowData = new ArrayList<String>();
|