|
@@ -7,6 +7,7 @@ import com.management.platform.entity.*;
|
|
|
import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.PlanProcedureTotalService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.management.platform.service.ReportService;
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
@@ -47,6 +48,8 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
|
|
|
@Resource
|
|
|
private PlanSteelStampNumberMapper planSteelStampNumberMapper;
|
|
|
@Resource
|
|
|
+ private ReportService reportService;
|
|
|
+ @Resource
|
|
|
private ReportMapper reportMapper;
|
|
|
|
|
|
@Override
|
|
@@ -106,7 +109,7 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public HttpRespMsg getFillProcedureDetail(Integer id, String createDate) {
|
|
|
+ public HttpRespMsg getFillProcedureDetail(Integer id, String createDate, boolean deleteDuplicate) {
|
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
if (createDate == null) createDate = LocalDate.now().format(dtf);
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
@@ -115,7 +118,24 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
|
|
|
|
|
|
prodProcedureTeam.remove("steel_num_array");
|
|
|
//道工序是否自己已经填过了,有的话取数据
|
|
|
- Report oldReport = reportMapper.selectOne(new QueryWrapper<Report>().eq("user_procedure_team_id", id).eq("creator_id", token).eq("create_date", createDate));
|
|
|
+ List<Report> oldReportList = reportMapper.selectList(new QueryWrapper<Report>().eq("user_procedure_team_id", id).eq("creator_id", token).eq("create_date", createDate));
|
|
|
+ Report oldReport = null;
|
|
|
+ if (oldReportList.size() > 1) {
|
|
|
+ if (deleteDuplicate) {
|
|
|
+ //带删除多余数据的指令,则删除多余数据
|
|
|
+ oldReport = oldReportList.get(0);
|
|
|
+ for (int i = 1; i < oldReportList.size(); i++) {
|
|
|
+ Report item = oldReportList.get(i);
|
|
|
+ reportService.deleteReport(""+item.getId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //多条报工记录,返回错误信息
|
|
|
+ msg.setError("检测重复报工记录,是否删除多余数据?");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ } else if (oldReportList.size() > 0){
|
|
|
+ oldReport = oldReportList.get(0);
|
|
|
+ }
|
|
|
if (oldReport != null) {
|
|
|
prodProcedureTeam.put("oldReport", oldReport);
|
|
|
prodProcedureTeam.put("finishNum", oldReport.getFinishNum());
|