|
@@ -6,14 +6,16 @@ import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.PlanProcedureTotalService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
-import org.apache.logging.log4j.util.Chars;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -42,6 +44,8 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
|
|
|
private ProdProcedureTeamMapper prodProcedureTeamMapper;
|
|
|
@Resource
|
|
|
private PlanSteelStampNumberMapper planSteelStampNumberMapper;
|
|
|
+ @Resource
|
|
|
+ private ReportMapper reportMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg getReportForWorkList(String vehicleNum) {
|
|
@@ -98,8 +102,11 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg getFillProcedureDetail(Integer id) {
|
|
|
+ public HttpRespMsg getFillProcedureDetail(Integer id, String createDate) {
|
|
|
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ if (createDate == null) createDate = LocalDate.now().format(dtf);
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ String token = request.getHeader("TOKEN");
|
|
|
HashMap prodProcedureTeam = prodProcedureTeamMapper.getFillProcedureDetail(id);
|
|
|
Integer planId = Integer.valueOf(String.valueOf(prodProcedureTeam.get("plan_id")));
|
|
|
List<PlanSteelStampNumber> planSteelStampNumberList = planSteelStampNumberMapper.selectList(new QueryWrapper<PlanSteelStampNumber>().eq("plan_id", planId));
|
|
@@ -152,10 +159,28 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- prodProcedureTeam.put("planSteelStampNumberList",list.stream().distinct().sorted());
|
|
|
+
|
|
|
if (prodProcedureTeam == null) {
|
|
|
msg.setError("找不到该数据");
|
|
|
} else {
|
|
|
+ Stream<String> sorted = list.stream().distinct().sorted();
|
|
|
+ List<String> collect = sorted.collect(Collectors.toList());
|
|
|
+ //如果钢印号有其他人已经填过了,就不显示
|
|
|
+ List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id", "steel_num_array").eq("plan_id", planId));
|
|
|
+ List<String> filledSteelNumList=new ArrayList<>();
|
|
|
+
|
|
|
+ for (Report report : reportList) {
|
|
|
+ //自己当天填的不算
|
|
|
+ if(dtf.format(report.getCreateDate()).equals(createDate)&&report.getCreatorId().equals(token)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(report.getSteelNumArray())){
|
|
|
+ String[] split = report.getSteelNumArray().split(",");
|
|
|
+ filledSteelNumList.addAll(Arrays.asList(split));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> collect1 = collect.stream().filter(item -> !filledSteelNumList.contains(item)).collect(Collectors.toList());
|
|
|
+ prodProcedureTeam.put("planSteelStampNumberList",collect1);
|
|
|
msg.setData(prodProcedureTeam);
|
|
|
}
|
|
|
return msg;
|