|
@@ -260,6 +260,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
String[] providerIdString = project.getProviderIds().split(",");
|
|
String[] providerIdString = project.getProviderIds().split(",");
|
|
List<String> providerIdList = Arrays.asList(providerIdString);
|
|
List<String> providerIdList = Arrays.asList(providerIdString);
|
|
for (String s : providerIdList) {
|
|
for (String s : providerIdList) {
|
|
|
|
+ if (StringUtils.isEmpty(s)) continue;
|
|
Map<String,Object> map=new HashMap<>();
|
|
Map<String,Object> map=new HashMap<>();
|
|
Optional<ProviderInfo> providerInfo = providerInfoList.stream().filter(pi -> pi.getId().equals(Integer.parseInt(s))).findFirst();
|
|
Optional<ProviderInfo> providerInfo = providerInfoList.stream().filter(pi -> pi.getId().equals(Integer.parseInt(s))).findFirst();
|
|
if(providerInfo.isPresent()){
|
|
if(providerInfo.isPresent()){
|
|
@@ -2594,17 +2595,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
String idSb = "";
|
|
String idSb = "";
|
|
providerCell=row.getCell(8+i);
|
|
providerCell=row.getCell(8+i);
|
|
HSSFCell cell = row.getCell(10);
|
|
HSSFCell cell = row.getCell(10);
|
|
|
|
+ System.out.println("当前分类:"+providerCategoryList.get(j).getProviderCategoryName()+", categoryId="+providerCategoryList.get(j).getId());
|
|
|
|
+ String categoryName = providerCategoryList.get(j).getProviderCategoryName();
|
|
|
|
+ Integer categoryId = providerCategoryList.get(j).getId();
|
|
if(providerCell!=null){
|
|
if(providerCell!=null){
|
|
providerCell.setCellType(CellType.STRING);
|
|
providerCell.setCellType(CellType.STRING);
|
|
- String stringCellValue = providerCell.getStringCellValue();
|
|
|
|
|
|
+ String stringCellValue = providerCell.getStringCellValue().trim();
|
|
if(!StringUtils.isEmpty(stringCellValue)){
|
|
if(!StringUtils.isEmpty(stringCellValue)){
|
|
String[] split = stringCellValue.split(",");
|
|
String[] split = stringCellValue.split(",");
|
|
|
|
+
|
|
for (int i1 = 0; i1 < split.length; i1++) {
|
|
for (int i1 = 0; i1 < split.length; i1++) {
|
|
- int finalJ = j;
|
|
|
|
- int finalI = i1;
|
|
|
|
- Optional<ProviderInfo> first = providerInfoList.stream().filter(pd -> pd.getProviderName().equals(split[finalI])&&pd.getProviderCategoryId().equals(providerCategoryList.get(finalJ).getId())).findFirst();
|
|
|
|
|
|
+ String curProviderName = split[i1].trim();
|
|
|
|
+ Optional<ProviderInfo> first = providerInfoList.stream().filter(pd -> pd.getProviderName().equals(curProviderName)&&pd.getProviderCategoryId().equals(categoryId)).findFirst();
|
|
if(!first.isPresent()){
|
|
if(!first.isPresent()){
|
|
- msg.setError("供应商["+split[i1]+"]在供应商分类["+providerCategoryList.get(j).getProviderCategoryName()+"]不存在");
|
|
|
|
|
|
+ msg.setError("供应商["+curProviderName+"]在供应商分类["+providerCategoryList.get(j).getProviderCategoryName()+"]不存在");
|
|
return msg;
|
|
return msg;
|
|
}else {
|
|
}else {
|
|
if(i1==split.length-1){
|
|
if(i1==split.length-1){
|
|
@@ -2637,10 +2641,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if (startDateCell !=null && !StringUtils.isEmpty(startDateCell.getDateCellValue())) {
|
|
if (startDateCell !=null && !StringUtils.isEmpty(startDateCell.getDateCellValue())) {
|
|
project.setPlanStartDate(LocalDate.parse(sdf.format(startDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
project.setPlanStartDate(LocalDate.parse(sdf.format(startDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
}
|
|
}
|
|
- if (endDateCell !=null && !StringUtils.isEmpty(endDateCell.getDateCellValue())) {
|
|
|
|
|
|
+ if (endDateCell !=null && endDateCell.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(endDateCell.getDateCellValue())) {
|
|
project.setPlanEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
project.setPlanEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
}
|
|
}
|
|
- if (amountCell !=null && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
|
|
|
|
|
|
+ if (amountCell !=null && endDateCell.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
}
|
|
}
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
@@ -4052,7 +4056,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
return new HttpRespMsg();
|
|
return new HttpRespMsg();
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
+ @Override
|
|
public HttpRespMsg getUserWorkingTimeStatic(String startDate, String endDate, Integer pageIndex, Integer pageSize, HttpServletRequest request,String userId,Integer departmentId) {
|
|
public HttpRespMsg getUserWorkingTimeStatic(String startDate, String endDate, Integer pageIndex, Integer pageSize, HttpServletRequest request,String userId,Integer departmentId) {
|
|
User targetUser = userMapper.selectById(request.getHeader("token"));
|
|
User targetUser = userMapper.selectById(request.getHeader("token"));
|
|
List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看全部人员工时统计");
|
|
List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看全部人员工时统计");
|
|
@@ -4082,7 +4086,29 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private List<Department> getSubDepts(Department dp, List<Department> list) {
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg batchDeleteProject(String projectIdArray, HttpServletRequest request) {
|
|
|
|
+ String token = request.getHeader("TOKEN");
|
|
|
|
+ User user = userMapper.selectById(token);
|
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
|
+ List<Integer> array = JSONArray.parseArray(projectIdArray, Integer.class);
|
|
|
|
+ Integer integer = array.get(0);
|
|
|
|
+ //校验项目归属
|
|
|
|
+ Integer companyId = projectMapper.selectById(integer).getCompanyId();
|
|
|
|
+ if (companyId.intValue() != user.getCompanyId().intValue()) {
|
|
|
|
+ httpRespMsg.setError("无权操作");
|
|
|
|
+ } else {
|
|
|
|
+ for (Integer id : array) {
|
|
|
|
+ System.out.println("删除项目id=="+id);
|
|
|
|
+ deleteProData(id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return httpRespMsg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private List<Department> getSubDepts(Department dp, List<Department> list) {
|
|
List<Department> collect = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());
|
|
List<Department> collect = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());
|
|
List<Department> allList = new ArrayList<>();
|
|
List<Department> allList = new ArrayList<>();
|
|
allList.addAll(collect);
|
|
allList.addAll(collect);
|