|
@@ -134,6 +134,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
@Value(value = "${upload.path}")
|
|
|
private String path;
|
|
|
|
|
|
+
|
|
|
+ public static final Object locker = new Object();
|
|
|
+ public static int times = 0;
|
|
|
+
|
|
|
@Override
|
|
|
public synchronized HttpRespMsg submitReport(Report report, HttpServletRequest request) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
@@ -162,6 +166,7 @@ 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", targetDate));
|
|
|
+ System.out.println(LocalDateTime.now().toString()+", 读取Report 是否为Null = "+todayReport == null);
|
|
|
//计算工作时长
|
|
|
ProdProcedureTeam prodProcedureTeam = prodProcedureTeamMapper.selectById(report.getUserProcedureTeamId());
|
|
|
//总计划任务的工序中有总工时和总工价
|
|
@@ -214,6 +219,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
if (todayReport == null) {
|
|
|
reportMapper.insert(report);
|
|
|
+ log.debug("插入Report, ===id=="+report.getId()+"=="+report.getCreatorId()+" "+report.getCreateDate());
|
|
|
+ System.out.println(LocalDateTime.now().toString()+" 插入Report, ===id=="+report.getId()+"=="+report.getCreatorId()+" "+report.getCreateDate());
|
|
|
//处理钢印号
|
|
|
if (!StringUtils.isEmpty(report.getSteelNumArray())) {
|
|
|
JSONArray array = JSONArray.parseArray(report.getSteelNumArray());
|
|
@@ -249,7 +256,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
planProcedureTotal.setTotalFillTime(workingTime);
|
|
|
planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
|
|
|
- System.out.println("planProcedureTotal.getId()=="+planProcedureTotal.getId()+"--进度 1 workingTime:"+workingTime+" totalWorkingHours:"+planProcedureTotal.getTotalWorkingHours()+" totalProgress:"+planProcedureTotal.getTotalProgress());
|
|
|
planProcedureTotalMapper.updateById(planProcedureTotal);
|
|
|
//检查该计划下的所有工序是否都已经完成
|
|
|
List<PlanProcedureTotal> planProcedureTotalList = planProcedureTotalMapper.selectList(new QueryWrapper<PlanProcedureTotal>().eq("plan_id", planProcedureTotal.getPlanId()));
|