|
@@ -28,6 +28,7 @@ import java.text.NumberFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.*;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.format.DateTimeParseException;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.Executor;
|
|
@@ -125,10 +126,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
Integer companyId = user.getCompanyId();
|
|
|
report.setCreatorId(token);
|
|
|
LocalDate today = LocalDate.now();
|
|
|
- report.setCreateDate(today);
|
|
|
+ LocalDate targetDate = null;
|
|
|
+ if (report.getId() == null) {
|
|
|
+ report.setCreateDate(today);
|
|
|
+ targetDate = today;
|
|
|
+ } else {
|
|
|
+ Report report1 = reportMapper.selectById(report.getId());
|
|
|
+ targetDate = report1.getCreateDate();
|
|
|
+ report.setCreateDate(report1.getCreateDate());
|
|
|
+ }
|
|
|
report.setCompanyId(companyId);
|
|
|
|
|
|
Plan plan = planMapper.selectById(report.getPlanId());
|
|
|
+ if (plan.getNum() == 0) {
|
|
|
+ httpRespMsg.setError("该计划件数为0,无法报工");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
if (plan.getPlanType() == 0) {
|
|
|
//普通计划检查产品是否存在
|
|
|
Product product = productMapper.selectById(plan.getProductId());
|
|
@@ -139,65 +152,59 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
|
|
|
//检查今日该员工的该工序是否已经有报工
|
|
|
- Report todayReport = reportMapper.selectOne(new QueryWrapper<Report>().eq("creator_id", token).eq("user_procedure_team_id", report.getUserProcedureTeamId()).eq("create_date", today));
|
|
|
+ Report todayReport = reportMapper.selectOne(new QueryWrapper<Report>().eq("creator_id", token).eq("user_procedure_team_id", report.getUserProcedureTeamId()).eq("create_date", targetDate));
|
|
|
//计算工作时长
|
|
|
ProdProcedureTeam prodProcedureTeam = prodProcedureTeamMapper.selectById(report.getUserProcedureTeamId());
|
|
|
+ //总计划任务的工序中有总工时和总工价
|
|
|
+ PlanProcedureTotal planProcedureTotal = planProcedureTotalMapper.selectOne(new QueryWrapper<PlanProcedureTotal>().eq("plan_id", report.getPlanId()).eq("prod_procedure_id", report.getProdProcedureId()));
|
|
|
double curReportTime = 0.0;
|
|
|
- //查找上一次该工序的报工
|
|
|
- Integer lastProgress = 0;
|
|
|
- Report beforeTodayReport = reportMapper.selectOne(new QueryWrapper<Report>().eq("creator_id", token).eq("user_procedure_team_id", report.getUserProcedureTeamId()).lt("create_date", today).orderByDesc("create_date").last("limit 1"));
|
|
|
- //查找今天之前是否有报工,有的话取上次报工进度,没有的话取分配下来时的报工进度
|
|
|
- if (beforeTodayReport != null) {
|
|
|
- if (report.getProgress() <= beforeTodayReport.getProgress()) {
|
|
|
- httpRespMsg.setError("进度必须大于上次报工进度("+beforeTodayReport.getProgress()+"%)");
|
|
|
- return httpRespMsg;
|
|
|
- }
|
|
|
- //去上次报工的进度
|
|
|
- lastProgress = beforeTodayReport.getProgress();
|
|
|
- } else {
|
|
|
- //今天之前没有报过工
|
|
|
- if (todayReport == null) {
|
|
|
- lastProgress = prodProcedureTeam.getProgress();
|
|
|
- if (report.getProgress() <= lastProgress) {
|
|
|
- httpRespMsg.setError("进度必须大于上次报工进度("+lastProgress+"%)");
|
|
|
- return httpRespMsg;
|
|
|
- }
|
|
|
- } else {
|
|
|
- //今天报过工了,prodProcedureTeam中的是报过的工时,应该从0开始算才对
|
|
|
- lastProgress = 0;
|
|
|
- }
|
|
|
- if (report.getProgress() <= lastProgress) {
|
|
|
- httpRespMsg.setError("进度必须大于上次报工进度("+lastProgress+"%)");
|
|
|
- return httpRespMsg;
|
|
|
- }
|
|
|
+
|
|
|
+ //核算本次填报的件数是否合法
|
|
|
+ List<Report> allFileProcReportList = reportMapper.selectList(new QueryWrapper<Report>().eq("plan_id", report.getPlanId()).eq("prod_procedure_id", report.getProdProcedureId()));
|
|
|
+ allFileProcReportList.forEach(all->{
|
|
|
+ System.out.println(all.getCreatorId()+" "+all.getCreateDate()+" "+all.getFinishNum());
|
|
|
+ });
|
|
|
+ final LocalDate fDate = targetDate;
|
|
|
+ double allFileProcNum = allFileProcReportList.stream().filter(item->!(item.getCreatorId().equals(token) && item.getCreateDate().isEqual(fDate))).mapToDouble(Report::getFinishNum).sum();
|
|
|
+ if (allFileProcNum + report.getFinishNum() > plan.getNum()) {
|
|
|
+ httpRespMsg.setError("填报的件数超过了剩余可填报件数:"+(plan.getNum() - allFileProcNum)+", 请联系班组长协调解决");
|
|
|
+ return httpRespMsg;
|
|
|
}
|
|
|
- int addProgress = report.getProgress() - lastProgress;
|
|
|
- curReportTime = (prodProcedureTeam.getWorkTime() * (addProgress)/100);
|
|
|
+// double addNum = report.getFinishNum() - lastFinishNum;
|
|
|
+ Integer num = plan.getNum();//总件数
|
|
|
+ double addPercent = report.getFinishNum() / num;
|
|
|
+// curReportTime = (prodProcedureTeam.getWorkTime() * (addProgress)/100);
|
|
|
//按比例获取本次进度的工钱
|
|
|
- BigDecimal earnMoney = prodProcedureTeam.getJobOfMoney().multiply(new BigDecimal(addProgress)).divide(new BigDecimal(100));
|
|
|
+// BigDecimal earnMoney = prodProcedureTeam.getJobOfMoney().multiply(new BigDecimal(addProgress)).divide(new BigDecimal(100));
|
|
|
+ //新版计算报工的工时和价钱;根据填报件数的占比计算工时和价钱
|
|
|
+ double earnMoney = planProcedureTotal.getTotalWages() * addPercent;
|
|
|
+ curReportTime = planProcedureTotal.getTotalWorkingHours() * addPercent;
|
|
|
report.setWorkingTime(curReportTime);//本次报工的工时数
|
|
|
- report.setCost(earnMoney);//本次报工的成本
|
|
|
+ report.setCost(new BigDecimal(earnMoney));//本次报工的成本
|
|
|
report.setDeptId(plan.getStationId());
|
|
|
if (plan.getPlanType() == 0) {
|
|
|
report.setProductId(plan.getProductId());
|
|
|
}
|
|
|
|
|
|
- if (report.getProgress() == 100) {
|
|
|
+ if (report.getIsFinish() != null && report.getIsFinish().booleanValue()) {
|
|
|
//设置质检人
|
|
|
if (report.getCheckType() == 0) {
|
|
|
report.setCheckerId(user.getId());
|
|
|
}
|
|
|
prodProcedureTeam.setCheckerId(report.getCheckerId());
|
|
|
+
|
|
|
}
|
|
|
prodProcedureTeam.setUpdateTime(LocalDateTime.now());
|
|
|
- prodProcedureTeam.setProgress(report.getProgress());
|
|
|
+// prodProcedureTeam.setProgress(report.getProgress());
|
|
|
//更新填写的钢印号
|
|
|
prodProcedureTeam.setSteelNumArray(report.getSteelNumArray());
|
|
|
- if (report.getProgress() == 100) {
|
|
|
+ if (report.getIsFinish() != null && report.getIsFinish().booleanValue()) {
|
|
|
//完工了
|
|
|
prodProcedureTeam.setStatus(2);//顺利完工
|
|
|
+ report.setStatus(2);//顺利完工
|
|
|
} else if (report.getIsTerminated() != null && report.getIsTerminated().booleanValue()) {
|
|
|
prodProcedureTeam.setStatus(3);//中止
|
|
|
+ report.setStatus(3);//中止
|
|
|
}
|
|
|
|
|
|
if (todayReport == null) {
|
|
@@ -434,27 +441,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
return allList;
|
|
|
}
|
|
|
-//
|
|
|
-// //获取本人某天工作时间和已提交的报告
|
|
|
-// @Override
|
|
|
-// public HttpRespMsg getReport(String date, HttpServletRequest request) {
|
|
|
-// HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
-// try {
|
|
|
-// String userId = request.getHeader("Token");
|
|
|
-// Integer companyId = userMapper.selectById(userId).getCompanyId();
|
|
|
-// Company company = companyMapper.selectById(companyId);
|
|
|
-// Map<String, Object> resultMap = new HashMap<>();
|
|
|
-// //获取某日本人的所有日志
|
|
|
-// List<Report> reports = reportMapper.selectList(new QueryWrapper<Report>()
|
|
|
-// .eq("creator_id", userId)
|
|
|
-// .eq("create_date", LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
|
|
|
+
|
|
|
+ //获取本人某天工作时间和已提交的报告
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getReport(String date, HttpServletRequest request) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ try {
|
|
|
+ String userId = request.getHeader("Token");
|
|
|
+ Integer companyId = userMapper.selectById(userId).getCompanyId();
|
|
|
+ Company company = companyMapper.selectById(companyId);
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ //获取某日本人的所有日志
|
|
|
+ List<Report> reports = reportMapper.selectList(new QueryWrapper<Report>()
|
|
|
+ .eq("creator_id", userId)
|
|
|
+ .eq("create_date", LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
|
|
|
// List<Integer> integerList = reports.stream().map(Report::getProjectId).collect(Collectors.toList());
|
|
|
// List<Project> allProjectList = projectMapper.selectList(new QueryWrapper<Project>()
|
|
|
// .eq("company_id", userMapper.selectById(userId).getCompanyId()));
|
|
|
// List<SubProject> subProjectList = integerList.size() > 0?subProjectMapper.selectList(new QueryWrapper<SubProject>().in("project_id",integerList)):new ArrayList<>();
|
|
|
// List<ProjectAuditor> auditorList = integerList.size() > 0?projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().in("project_id", integerList)): new ArrayList<>();
|
|
|
//
|
|
|
-// ;
|
|
|
//
|
|
|
//// List<UserRecentTask> taskList = integerList.size() > 0?userRecentTaskMapper.selectList(new QueryWrapper<UserRecentTask>().in("project_id", integerList).orderByDesc("id")):new ArrayList<>();
|
|
|
// List<Profession> professions = professionMapper.selectList(new QueryWrapper<Profession>().eq("company_id", companyId));
|
|
@@ -462,204 +468,28 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
// List<ReportExtraDegree> degreeList = reportExtraDegreeMapper.selectList(new QueryWrapper<ReportExtraDegree>().eq("company_id", companyId));
|
|
|
// List<TaskGroup> taskGroups = integerList.size() > 0?taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", integerList)):new ArrayList<>();
|
|
|
// List<Stages> stagesList = integerList.size() > 0?stagesMapper.selectList(new QueryWrapper<Stages>().in("project_id", integerList)) : new ArrayList<>();
|
|
|
-// //获取当前项目的子项目列表,任务分组,任务列表,项目相关维度列表
|
|
|
-// reports.forEach(r->{
|
|
|
-// r.setSubProjectList(subProjectList.stream().filter(s->s.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
-// r.setTaskList(taskMapper.recentSimpleList(r.getProjectId(), userId));
|
|
|
-// //获取当前项目的工程专业进度
|
|
|
-// List<ReportProfessionProgress> progressList = reportProfessionProgressService.list(new QueryWrapper<ReportProfessionProgress>().eq("report_id", r.getId()));
|
|
|
-// //去掉当前项目上已经不存在的专业
|
|
|
-// List<ProjectProfession> projectProfessions = projectProfessionMapper.selectList(new QueryWrapper<ProjectProfession>().eq("project_id", r.getProjectId()));
|
|
|
-// progressList = progressList.stream().filter(p->projectProfessions.stream().anyMatch(pp->pp.getProfessionId().equals(p.getProfessionId()))).collect(Collectors.toList());
|
|
|
-// progressList.stream().forEach(p->{
|
|
|
-// p.setProfessionName(professions.stream().filter(m->m.getId().equals(p.getProfessionId())).findFirst().get().getName());
|
|
|
-// });
|
|
|
-// r.setProfessionProgressList(progressList);
|
|
|
-// //获取任务阶段列表
|
|
|
-// if (company.getPackageProject() == 1 && r.getGroupId() != null && r.getGroupId() != 0) {
|
|
|
-// r.setStages(stagesList.stream().filter(s->s.getGroupId() !=null && s.getGroupId().equals(r.getGroupId())).collect(Collectors.toList()));
|
|
|
-// }
|
|
|
-// //处理图片
|
|
|
-// if (!StringUtils.isEmpty(r.getPicStr()) && !r.getPicStr().equals("@")) {
|
|
|
-// JSONArray array = JSONArray.parseArray(r.getPicStr().replaceAll("@", ","));
|
|
|
-// List<String> list = new ArrayList<>();
|
|
|
-// for (int i=0;i<array.size(); i++) {
|
|
|
-// String picName = array.getString(i);
|
|
|
-// if (!picName.contains(".")) {
|
|
|
-// picName += ".jpg";
|
|
|
-// }
|
|
|
-// list.add("/upload/"+picName);
|
|
|
-// }
|
|
|
-// r.setPics(list);
|
|
|
-// }
|
|
|
-// if (r.getMultiWorktime() == 1) {
|
|
|
-// //设置多个工时情况下的报告列表
|
|
|
-// String timeStr = r.getContent();
|
|
|
-// if (timeStr != null) {
|
|
|
-// JSONArray parse = JSONArray.parseArray(timeStr);
|
|
|
-// List<WorktimeItem> list = new ArrayList<>();
|
|
|
-// for (int i=0;i<parse.size(); i++) {
|
|
|
-// JSONObject obj = parse.getJSONObject(i);
|
|
|
-// list.add(JSONObject.toJavaObject(obj, WorktimeItem.class));
|
|
|
-// }
|
|
|
-// r.setWorktimeList(list);
|
|
|
-// }
|
|
|
-// }
|
|
|
//
|
|
|
-// //处理维度列表数据
|
|
|
-// if (timeTypeMapper.selectById(companyId).getCustomDegreeActive() == 1) {
|
|
|
-// Project project = allProjectList.stream().filter(p -> p.getId().equals(r.getProjectId())).findFirst().get();
|
|
|
-// String associateDegrees = project.getAssociateDegrees();
|
|
|
-// List<HashMap> degreeMapList = new ArrayList<>();
|
|
|
-// if (associateDegrees != null) {
|
|
|
-// String[] split = associateDegrees.split("\\,");
|
|
|
-// for (int i=0;i<split.length; i++) {
|
|
|
-// HashMap map = new HashMap();
|
|
|
-// if (!StringUtils.isEmpty(split[i])) {
|
|
|
-// Integer id = Integer.parseInt(split[i]);
|
|
|
-// map.put("id", id);
|
|
|
-// map.put("name", degreeList.stream().filter(d->d.getId().equals(id)).findFirst().get().getName());
|
|
|
-// degreeMapList.add(map);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// r.setDegreeList(degreeMapList);
|
|
|
-// }
|
|
|
-// //检查是否是按照任务分组负责人审核
|
|
|
-//// Project curProject = allProjectList.stream().filter(ap->ap.getId().equals(r.getProjectId())).findFirst().get();
|
|
|
-// int reportAuditType = timeTypeMapper.selectById(companyId).getReportAuditType();
|
|
|
-// //分组
|
|
|
-// if (company.getPackageProject() == 1) {
|
|
|
-// if (reportAuditType == 0) {
|
|
|
-// r.setTaskGroups(taskGroups.stream().filter(tg->tg.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
-// if (r.getGroupId() != null && r.getGroupId() != 0) {
|
|
|
-// Optional<TaskGroup> optinal = taskGroups.stream().filter(tg->tg.getId().equals(r.getGroupId())).findFirst();
|
|
|
-// if (optinal.isPresent()) {
|
|
|
-// r.setGroupName(optinal.get().getName());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else if (reportAuditType == 1 || reportAuditType == 2){
|
|
|
-// List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>());
|
|
|
-// if (groupParticipatorList.size() > 0) {
|
|
|
-// List<Integer> groupIds = groupParticipatorList.stream().map(GroupParticipator::getGroupId).collect(Collectors.toList());
|
|
|
-// List<TaskGroup> findGroups = taskGroups.stream().filter(tg->groupIds.contains(tg.getId()) || userId.equals(tg.getInchargerId())).collect(Collectors.toList());
|
|
|
-// r.setTaskGroups(findGroups);
|
|
|
-// if (r.getGroupId() != null && r.getGroupId() != 0) {
|
|
|
-// Optional<TaskGroup> optinal = taskGroups.stream().filter(tg->tg.getId().equals(r.getGroupId())).findFirst();
|
|
|
-// if (optinal.isPresent()) {
|
|
|
-// r.setGroupName(optinal.get().getName());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //项目的审核人
|
|
|
-// if (reportAuditType == 0) {
|
|
|
-// r.setAuditUserList(auditorList.stream().filter(au->au.getProjectId().equals(r.getProjectId())).collect(Collectors.toList()));
|
|
|
-// if (r.getProjectAuditorId() != null) {
|
|
|
-// Optional<ProjectAuditor> auItem = auditorList.stream().filter(au->au.getAuditorId().equals(r.getProjectAuditorId())).findFirst();
|
|
|
-// if (auItem.isPresent()) {
|
|
|
-// r.setProjectAuditorName(auItem.get().getAuditorName());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else if (reportAuditType == 1 || reportAuditType == 2) {
|
|
|
-// if (r.getGroupId() != null && r.getGroupId() != 0) {
|
|
|
-// //直接获取分组的负责人作为审核人
|
|
|
-// Optional<TaskGroup> tgoup = taskGroups.stream().filter(tg->tg.getId().equals(r.getGroupId())).findFirst();
|
|
|
-// if (tgoup.isPresent()) {
|
|
|
-// TaskGroup curGroup = tgoup.get();
|
|
|
-// if (curGroup.getInchargerId() != null) {
|
|
|
-// User user = userMapper.selectById(curGroup.getInchargerId());
|
|
|
-// HashMap map = new HashMap();
|
|
|
-// map.put("auditorId", user.getId());
|
|
|
-// map.put("auditorName", user.getName());
|
|
|
-// List list = new ArrayList();
|
|
|
-// list.add(map);
|
|
|
-// r.setAuditUserList(list);
|
|
|
-// if (r.getProjectAuditorId() != null) {
|
|
|
-// r.setProjectAuditorName(user.selectById(r.getProjectAuditorId()).getName());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } else if (reportAuditType == 3) {
|
|
|
-// //获取日报对应已经设置好的审核人和抄送人
|
|
|
-// ReportAuditorSetting reportAuditorSetting = reportAuditorSettingMapper.selectById(r.getId());
|
|
|
-// r.setAuditorSetting(reportAuditorSetting);
|
|
|
-// //手机端数据
|
|
|
-// if (reportAuditorSetting.getAuditorFirst() != null) {
|
|
|
-// User auditorItem = userMapper.selectOne(new QueryWrapper<User>().select("id, name").eq("id", reportAuditorSetting.getAuditorFirst()));
|
|
|
-// r.setAuditorFirst(auditorItem);
|
|
|
-// }
|
|
|
-// if (reportAuditorSetting.getAuditorSec() != null) {
|
|
|
-// User auditorItem = userMapper.selectOne(new QueryWrapper<User>().select("id, name").eq("id", reportAuditorSetting.getAuditorSec()));
|
|
|
-// r.setAuditorSec(auditorItem);
|
|
|
-// }
|
|
|
-// if (reportAuditorSetting.getAuditorThird() != null) {
|
|
|
-// User auditorItem = userMapper.selectOne(new QueryWrapper<User>().select("id, name").eq("id", reportAuditorSetting.getAuditorThird()));
|
|
|
-// r.setAuditorThird(auditorItem);
|
|
|
-// }
|
|
|
-// if (reportAuditorSetting.getCcUserid() != null) {
|
|
|
-// User auditorItem = userMapper.selectOne(new QueryWrapper<User>().select("id, name").eq("id", reportAuditorSetting.getCcUserid()));
|
|
|
-// r.setCcUserid(auditorItem);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// });
|
|
|
// resultMap.put("report", reports);
|
|
|
-// TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
-// if (timeType.getShowDdCardtime() == 1) {
|
|
|
-// List<UserDingdingTime> dingdingTimes = userDingdingTimeMapper.selectList(new QueryWrapper<UserDingdingTime>()
|
|
|
-// .eq("user_id", userId).eq("work_date", date));
|
|
|
-// if (dingdingTimes.size() > 0) {
|
|
|
-// UserDingdingTime time = dingdingTimes.get(0);
|
|
|
-// resultMap.put("time", time);
|
|
|
-// }
|
|
|
-// }else if(timeType.getSyncFanwei()==1){
|
|
|
-// List<UserFvTime> userFvTimeList = userFvTimeMapper.selectList(new QueryWrapper<UserFvTime>()
|
|
|
-// .eq("user_id", userId).eq("work_date", date));
|
|
|
-// if (userFvTimeList.size() > 0) {
|
|
|
-// UserFvTime time = userFvTimeList.get(0);
|
|
|
-// resultMap.put("time", time);
|
|
|
-// }
|
|
|
-// } else if (timeType.getShowCorpwxCardtime() == 1) {
|
|
|
-// User user = userMapper.selectById(userId);
|
|
|
-// List<UserCorpwxTime> corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
|
|
|
-// .eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
|
|
|
-// if (corpwxTimes.size() > 0) {
|
|
|
-// UserCorpwxTime time = corpwxTimes.get(0);
|
|
|
-// resultMap.put("time", time);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// //顺便返回公司的工作时间设置
|
|
|
-// resultMap.put("timeType",timeType);
|
|
|
-// //返回公司的项目工时预警的成本项列表
|
|
|
-// List<ProjectBasecostSetting> timeBasecostList = new ArrayList<>();
|
|
|
-// if (company.getPackageProject() == 1) {
|
|
|
-// timeBasecostList = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", companyId).eq("alarm_type", 1));
|
|
|
-// }
|
|
|
-// //当天是否是工作日
|
|
|
-// DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
-// LocalDate lDate = LocalDate.parse(date, dtf);
|
|
|
-// boolean isWorkDay = companyId == 817 ? WorkDayCalculateUtils.isWorkDayExceptSaturday(lDate) : WorkDayCalculateUtils.isWorkDay(lDate);
|
|
|
-// resultMap.put("isWorkDay", isWorkDay);
|
|
|
-//
|
|
|
-// resultMap.put("timeBasecostList",timeBasecostList);
|
|
|
-//
|
|
|
-// httpRespMsg.data = resultMap;
|
|
|
-// } catch (NullPointerException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// //httpRespMsg.setError("验证失败");
|
|
|
-// httpRespMsg.setError(MessageUtils.message("Company.validationError"));
|
|
|
-// return httpRespMsg;
|
|
|
-// } catch (DateTimeParseException e) {
|
|
|
-// //httpRespMsg.setError("日期格式有误");
|
|
|
-// httpRespMsg.setError(MessageUtils.message("date.formatError"));
|
|
|
-// return httpRespMsg;
|
|
|
-// }
|
|
|
-// return httpRespMsg;
|
|
|
-// }
|
|
|
+
|
|
|
+ //当天是否是工作日
|
|
|
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate lDate = LocalDate.parse(date, dtf);
|
|
|
+ boolean isWorkDay = WorkDayCalculateUtils.isWorkDay(lDate);
|
|
|
+ resultMap.put("isWorkDay", isWorkDay);
|
|
|
+
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
+ } catch (NullPointerException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("Company.validationError"));
|
|
|
+ return httpRespMsg;
|
|
|
+ } catch (DateTimeParseException e) {
|
|
|
+ //httpRespMsg.setError("日期格式有误");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("date.formatError"));
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
//
|
|
|
// @Override
|
|
|
// public HttpRespMsg getCardTime(String date, HttpServletRequest request) {
|