diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesInspectionReportController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesInspectionReportController.java index b7078cb72..9907e72cd 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesInspectionReportController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesInspectionReportController.java @@ -1,7 +1,12 @@ package com.op.mes.controller; import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; import com.op.mes.domain.MesInspectionReport; +import com.op.mes.domain.ProOrderWorkorder; import com.op.mes.service.IMesInspectionReportService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -27,6 +32,12 @@ public class MesInspectionReportController extends BaseController { return iMesInspectionReportService.selfMutualInspectionData(mesInspectionReport); } + //修改表头表位内容 + @PutMapping("/updateTable") + public AjaxResult updateTable(@RequestBody MesInspectionReport mesInspectionReport) { + return iMesInspectionReportService.updateTable(mesInspectionReport); + } + //查询产线 @GetMapping("/getLineCodeList") public List getLineCodeList() { @@ -34,6 +45,20 @@ public class MesInspectionReportController extends BaseController { return list; } + //查询产品列表 + @GetMapping("/getProductList") + public List getProductList(MesInspectionReport mesInspectionReport) { + List list = iMesInspectionReportService.getProductList(mesInspectionReport); + return list; + } + + //通过查询工单列表查询日期码 + @GetMapping("/getWorkList") + public List getWorkList(MesInspectionReport mesInspectionReport) { + List list = iMesInspectionReportService.getWorkList(mesInspectionReport); + return list; + } + //首检记录 左侧报表 主体 查询 @GetMapping("/listFirstInspectionLeft") public List firstInspectionLeftList(MesInspectionReport mesInspectionReport) { diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesInspectionReport.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesInspectionReport.java index 2cc552980..5dcccac9a 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesInspectionReport.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesInspectionReport.java @@ -3,6 +3,11 @@ package com.op.mes.domain; import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; + //MES自检互检 public class MesInspectionReport extends BaseEntity { private static final long serialVersionUID = 1L; @@ -45,7 +50,7 @@ public class MesInspectionReport extends BaseEntity { private String productDate; @Excel(name = "检查日期") - private String checkDate; + private Date checkDate; @Excel(name = "产品编码") private String productCode; @@ -67,6 +72,8 @@ public class MesInspectionReport extends BaseEntity { //项目名 private String projectName; + //项目名 + private String projectCode; //线体名 private String lineName; @@ -78,12 +85,6 @@ public class MesInspectionReport extends BaseEntity { //班组 private String team; - //动态增加字段 -// private Map dynamicTime; -// -// public void setDynamicTime(String dynamicTimeName, String value) { dynamicTime.put(dynamicTimeName,value); } -// public String getDynamicTime(String dynamicTimeName) { return dynamicTime.get(dynamicTimeName); } - public void setId(String id) { this.id = id; } public String getId() { return id; } @@ -121,8 +122,8 @@ public class MesInspectionReport extends BaseEntity { public void setProductDate(String productDate) { this.productDate = productDate; } public String getProductDate() { return productDate; } - public void setCheckDate(String checkDate) { this.checkDate = checkDate; } - public String getCheckDate() { return checkDate; } + public void setCheckDate(Date checkDate) { this.checkDate = checkDate; } + public Date getCheckDate() { return checkDate; } public void setProductCode(String productCode) { this.productCode = productCode; } public String getProductCode() { return productCode; } @@ -145,6 +146,9 @@ public class MesInspectionReport extends BaseEntity { public void setProjectName(String projectName) { this.projectName = projectName; } public String getProjectName() { return projectName; } + public void setProjectCode(String projectCode) { this.projectCode = projectCode; } + public String getProjectCode() { return projectCode; } + public void setOpenLine(String openLine) { this.openLine = openLine; } public String getOpenLine() { return openLine; } @@ -156,4 +160,112 @@ public class MesInspectionReport extends BaseEntity { public void setLineName(String lineName) { this.lineName = lineName; } public String getLineName() { return lineName; } + + private Integer row;//行 + private Integer col;//列 + private String type;//项目名、日期、对错号码 + private String data; + private Date time; + + // row的set和get方法 + public void setRow(Integer row) { + this.row = row; + } + + public Integer getRow() { + return row; + } + + // col的set和get方法 + public void setCol(Integer col) { + this.col = col; + } + + public Integer getCol() { + return col; + } + + // type的set和get方法 + public void setType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + // data的set和get方法 + public void setData(String data) { + this.data = data; + } + + public String getData() { + return data; + } + + // time的set和get方法 + public void setTime(Date time) { + this.time = time; + } + + public Date getTime() { + return time; + } + + //产线列表 + public List productList; + //日期码列表 + public List dateCodeList; + + // productList的get方法 + public List getProductList() { + return productList; + } + + // productList的set方法 + public void setProductList(List productList) { + this.productList = productList; + } + + // dateCodeList的get方法 + public List getDateCodeList() { + return dateCodeList; + } + + // dateCodeList的set方法 + public void setDateCodeList(List dateCodeList) { + this.dateCodeList = dateCodeList; + } + + private String workorderId;//工单号 + // get方法,用于获取工单号的值 + public String getWorkorderId() { + return workorderId; + } + + // set方法,用于设置工单号的值 + public void setWorkorderId(String workorderId) { + this.workorderId = workorderId; + } + + private ArrayList>> tableData; + + public ArrayList>> getTableData() { + return tableData; + } + + public void setTableData(ArrayList>> tableData) { + this.tableData = tableData; + } + + private String factoryCode; + + // row的set和get方法 + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesInspectionReportMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesInspectionReportMapper.java index c2cb67c85..3d50bd83c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesInspectionReportMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesInspectionReportMapper.java @@ -1,13 +1,15 @@ package com.op.mes.mapper; import com.op.mes.domain.MesInspectionReport; +import com.op.mes.domain.ProOrderWorkorder; +import org.apache.ibatis.annotations.Param; import java.util.List; public interface MesInspectionReportMapper { List selectSelfMutualInspectionList(MesInspectionReport mesInspectionReport);//查询自检互检列表 - List selectProjectName(String param);//自检互检左侧项目 - List selectTimeArray(MesInspectionReport mesInspectionReport);//查询所有时间 + List selectProjectName(String param);//自检互检左侧项目 + List selectTimeArray(MesInspectionReport mesInspectionReport);//查询所有时间 MesInspectionReport selectSelfMutualInspectionData(MesInspectionReport mesInspectionReport); List getLineCodeList(); @@ -15,4 +17,16 @@ public interface MesInspectionReportMapper { List selectTeamArray(MesInspectionReport mesInspectionReport);//班组 List selectCheckBoxList(MesInspectionReport mesInspectionReport); + List getProductList(MesInspectionReport mesInspectionReport);//查询产品列表 + List getDataCodeList(MesInspectionReport data); + + void updateHeaderFooter(MesInspectionReport mesInspectionReport); + + void updateTableBody(MesInspectionReport mesInspectionReport); + + void updateBatch(@Param("list")List updateList); + + void addBatch(@Param("list")List updateList); + + List getWorkList(MesInspectionReport mesInspectionReport); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesInspectionReportService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesInspectionReportService.java index 0f2942181..7f055178b 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesInspectionReportService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesInspectionReportService.java @@ -1,6 +1,8 @@ package com.op.mes.service; +import com.op.common.core.web.domain.AjaxResult; import com.op.mes.domain.MesInspectionReport; +import com.op.mes.domain.ProOrderWorkorder; import java.util.List; @@ -18,4 +20,10 @@ public interface IMesInspectionReportService { List selectPointInspectionList(MesInspectionReport mesInspectionReport);//产品转换/完产清线点检表 List selectCheckBoxList(MesInspectionReport mesInspectionReport);//点检上方备选框 + + List getProductList(MesInspectionReport mesInspectionReport);//查询产线 + + AjaxResult updateTable(MesInspectionReport mesInspectionReport);//修改表头 表尾部 表主体 + + List getWorkList(MesInspectionReport mesInspectionReport); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesInspectionReportServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesInspectionReportServiceImpl.java index e72c0ee92..be04086a9 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesInspectionReportServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesInspectionReportServiceImpl.java @@ -3,8 +3,13 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.parser.Feature; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.context.SecurityContextHolder; +import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.core.web.domain.AjaxResult; import com.op.mes.domain.MesInspectionReport; +import com.op.mes.domain.ProOrderWorkorder; import com.op.mes.mapper.MesInspectionReportMapper; import com.op.mes.service.IMesInspectionReportService; import org.slf4j.Logger; @@ -26,35 +31,82 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi @Override @DS("#header.poolName") public List selectSelfMutualInspectionList(MesInspectionReport mesInspectionReport) { - mesInspectionReport.setReportName("ConversionReport"); + //mesInspectionReport.setReportName("ConversionReport"); List list = mesInspectionReportMapper.selectSelfMutualInspectionList(mesInspectionReport); //1.查询左侧边 列 存入 - String param = "self_mutual_inspection"; - List projectNames = mesInspectionReportMapper.selectProjectName(param); - List timeArray = mesInspectionReportMapper.selectTimeArray(mesInspectionReport); + String param = ""; + if(mesInspectionReport.getReportName().equals("ConversionReport")){ + param = "self_mutual_inspection"; + }else if(mesInspectionReport.getReportName().equals("ConversionReportLeft")){ + param = "first_inspection_left"; + } + + MesInspectionReport buildDTO = new MesInspectionReport(); + buildDTO.setCheckTimeS(""); + buildDTO.setCheckTimeE(""); + + List projectNames = mesInspectionReportMapper.selectProjectName(param); + List timeArray = mesInspectionReportMapper.selectTimeArray(mesInspectionReport); List listDTO = new ArrayList<>(); - for(String projectName : projectNames){ - Map dynamicTime = new LinkedHashMap<>(); - dynamicTime.put("开始-结束",projectName); + for(MesInspectionReport project : projectNames){ + Map dynamicTime = new LinkedHashMap<>(); + MesInspectionReport dto = new MesInspectionReport(); + dto.setData(project.getProjectName()); + dto.setType("projectName"); + dto.setProjectName(project.getProjectName());//项目名 + dto.setProjectCode(project.getProjectCode());//项目编码 + dynamicTime.put("开始-结束",dto); + if(CollectionUtils.isEmpty(timeArray)){ - dynamicTime.put("", ""); - dynamicTime.put(" ", ""); - dynamicTime.put(" ", ""); + dynamicTime.put("", new MesInspectionReport()); + dynamicTime.put(" ", new MesInspectionReport()); + dynamicTime.put(" ", new MesInspectionReport()); }else{ - for(String time : timeArray){ + for(MesInspectionReport time : timeArray){ List result = list.stream() - .filter(MesInspectionReport -> MesInspectionReport.getTimeArray().equals(time)) // 条件1:符合开始时间结束时间 - .filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(projectName)) // 条件2:符合当前项目名 + .filter(MesInspectionReport -> MesInspectionReport.getTimeArray().equals(time.getTimeArray())) // 条件1:符合开始时间结束时间 + .filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(project.getProjectName())) // 条件2:符合当前项目名 .collect(Collectors.toList()); // 收集结果 + if(!CollectionUtils.isEmpty(result)){ if(StringUtils.isNotBlank(result.get(0).getCheckResult())){ - dynamicTime.put(time, result.get(0).getCheckResult()); + if(project.getProjectName().equals("日期码") || project.getProjectName().equals("生产批号")){ + result.get(0).setType("dataCode"); + }else if(project.getProjectName().equals("灌装量/净含量/喷药量")){ + result.get(0).setType("sprayAmount"); + }else{ + result.get(0).setType("rightWrong"); + } + result.get(0).setData(result.get(0).getCheckResult()); + dynamicTime.put(time.getTimeArray(), result.get(0)); }else{ - dynamicTime.put(time, ""); + MesInspectionReport result0 = new MesInspectionReport(); + if(project.getProjectName().equals("日期码")|| project.getProjectName().equals("生产批号")){ + result0.setType("dataCode"); + }else if(project.getProjectName().equals("灌装量/净含量/喷药量")){ + result0.setType("sprayAmount"); + }else{ + result0.setType("rightWrong"); + } + result0.setCheckTimeS(time.getCheckTimeS()); + result0.setCheckTimeE(time.getCheckTimeE()); + result0.setTableLine(time.getTableLine()); + dynamicTime.put(time.getTimeArray(), result0); } }else{ - dynamicTime.put(time, ""); + MesInspectionReport result0 = new MesInspectionReport(); + if(project.getProjectName().equals("日期码")|| project.getProjectName().equals("生产批号")){ + result0.setType("dataCode"); + }else if(project.getProjectName().equals("灌装量/净含量/喷药量")){ + result0.setType("sprayAmount"); + }else{ + result0.setType("rightWrong"); + } + result0.setCheckTimeS(time.getCheckTimeS()); + result0.setCheckTimeE(time.getCheckTimeE()); + result0.setTableLine(time.getTableLine()); + dynamicTime.put(time.getTimeArray(), result0); } } } @@ -65,17 +117,14 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi if(timeArray.size() < 3){ for(int i = 0 ; i < 3-(timeArray.size()) ; i++){ if(i == 0){ - dynamicTime.put(string1, ""); + dynamicTime.put(string1,new MesInspectionReport()); }else if(i == 1){ - dynamicTime.put(string2, ""); + dynamicTime.put(string2,new MesInspectionReport()); } } } - String s = JSON.toJSONString(dynamicTime); -// Object object = JSON.parseObject(s, Object.class); -// LinkedHashMap linkedMap = JSON.parseObject(s, LinkedHashMap.class); JSONObject object = JSONObject.parseObject(s, Feature.OrderedField); log.info("动态添加属性: = {}",object); listDTO.add(object); @@ -84,11 +133,88 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi return listDTO; } + @Override + @DS("#header.poolName") + //修改表头部和表尾部 + public AjaxResult updateTable(MesInspectionReport mesInspectionReport) { + mesInspectionReport.setUpdateBy(SecurityContextHolder.getUserName()); + mesInspectionReport.setUpdateTime(DateUtils.getNowDate()); + //更新表头和表尾 也就是数据库的主表内容 + mesInspectionReport.setCreateBy(StringUtils.isBlank(mesInspectionReport.getCreateBy())? + SecurityContextHolder.getUserName() : mesInspectionReport.getCreateBy()); + mesInspectionReportMapper.updateHeaderFooter(mesInspectionReport); + + //需要新增的 + List addList = new ArrayList<>(); + //需要修改的 + List updateList = new ArrayList<>(); + + ArrayList>> tableData = mesInspectionReport.getTableData(); + if (tableData!= null) { + for (LinkedHashMap> item : tableData) { + //提取出来开始结束那一行数据的 项目名字 + String projectName = (String) item.get("开始-结束").get("projectName"); + String projectCode = (String) item.get("开始-结束").get("projectCode"); + + for (Map.Entry> entry : item.entrySet()) { + if(!entry.getKey().equals("开始-结束")){ + LinkedHashMap innerMap = entry.getValue(); + String dataValue = (String) innerMap.get("data"); + String idValue = (String) innerMap.get("id"); + String checkTimeS = (String) innerMap.get("checkTimeS"); + String checkTimeE = (String) innerMap.get("checkTimeE"); + Integer tableLine = (Integer) innerMap.get("tableLine"); //实际上是列的意思 + + //如果是新的需要插入的值 ,那么说明没有id + if(StringUtils.isBlank(idValue) && StringUtils.isNotBlank(dataValue)){ + MesInspectionReport addDto = new MesInspectionReport(); + addDto.setId(IdUtils.fastSimpleUUID());//自动生成id + addDto.setBelongTo(mesInspectionReport.getId());//主表id + addDto.setInfoCode(projectCode); + addDto.setInfoName(projectName); + addDto.setCreateTime(DateUtils.getNowDate()); + addDto.setCreateBy(SecurityContextHolder.getUserName()); + addDto.setCheckResult(dataValue); + addDto.setCheckTimeS(checkTimeS); + addDto.setCheckTimeE(StringUtils.isBlank(checkTimeE)? "" : checkTimeE); + addDto.setTableLine(tableLine); + addDto.setDelFlag("0"); + addList.add(addDto); + }else if(StringUtils.isNotBlank(idValue) && StringUtils.isNotBlank(dataValue)){ + MesInspectionReport updateDto = new MesInspectionReport(); + updateDto.setId(idValue); + updateDto.setUpdateBy(SecurityContextHolder.getUserName()); + updateDto.setUpdateTime(DateUtils.getNowDate()); + updateDto.setCheckResult(dataValue); + updateDto.setCheckTimeS(checkTimeS); + updateDto.setCheckTimeE(StringUtils.isBlank(checkTimeE)? "" : checkTimeE); + updateList.add(updateDto); + } + } + } + } + } + + //更新表的主体部分 也就是数据库的子表 + if(updateList.size() > 0 ){ + mesInspectionReportMapper.updateBatch(updateList); + } + + if(addList.size() >0){ + mesInspectionReportMapper.addBatch(addList); + } + + return AjaxResult.success(); + } + @Override @DS("#header.poolName") public MesInspectionReport selfMutualInspectionData(MesInspectionReport mesInspectionReport) { - //'ConversionReport' MesInspectionReport data = mesInspectionReportMapper.selectSelfMutualInspectionData(mesInspectionReport); + if(mesInspectionReport.getWorkorderId() != null){ + List dateCodeList = mesInspectionReportMapper.getDataCodeList(mesInspectionReport); + data.setDateCodeList(dateCodeList); + } return data; } @@ -99,6 +225,22 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi return list; } + @Override + @DS("#header.poolName") + public List getProductList(MesInspectionReport mesInspectionReport) { + List productList = mesInspectionReportMapper.getProductList(mesInspectionReport); + return productList; + } + + @Override + @DS("#header.poolName") + public List getWorkList(MesInspectionReport mesInspectionReport) { + List workList = mesInspectionReportMapper.getWorkList(mesInspectionReport); + return workList; + } + + + ////////左右报表都不需要 //首检左报表 @Override @DS("#header.poolName") @@ -117,32 +259,32 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi List list = mesInspectionReportMapper.selectSelfMutualInspectionList(mesInspectionReport); //2..查询左侧边 列 存入 String param = "first_inspection_left"; - List projectNames = mesInspectionReportMapper.selectProjectName(param); + List projectNames = mesInspectionReportMapper.selectProjectName(param); - List timeArray = mesInspectionReportMapper.selectTimeArray(mesInspectionReport); + List timeArray = mesInspectionReportMapper.selectTimeArray(mesInspectionReport); List listDTO = new ArrayList<>(); - for(String projectName : projectNames){ + for(MesInspectionReport project : projectNames){ Map dynamicTime = new LinkedHashMap<>(); - dynamicTime.put("开始-结束",projectName); + dynamicTime.put("开始-结束",project.getProjectName()); if(CollectionUtils.isEmpty(timeArray)){ dynamicTime.put("", ""); dynamicTime.put(" ", ""); dynamicTime.put(" ", ""); }else{ - for(String time : timeArray){ + for(MesInspectionReport time : timeArray){ List result = list.stream() - .filter(MesInspectionReport -> MesInspectionReport.getTimeArray().equals(time)) // 条件1:符合开始时间结束时间 - .filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(projectName)) // 条件2:符合当前项目名 + .filter(MesInspectionReport -> MesInspectionReport.getTimeArray().equals(time.getTimeArray())) // 条件1:符合开始时间结束时间 + .filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(project.getProjectName())) // 条件2:符合当前项目名 .collect(Collectors.toList()); // 收集结果 if(!CollectionUtils.isEmpty(result)){ if(StringUtils.isNotBlank(result.get(0).getCheckResult())){ - dynamicTime.put(time, result.get(0).getCheckResult()); + dynamicTime.put(time.getTimeArray(), result.get(0).getCheckResult()); }else{ - dynamicTime.put(time, ""); + dynamicTime.put(time.getTimeArray(), ""); } }else{ - dynamicTime.put(time, ""); + dynamicTime.put(time.getTimeArray(), ""); } } } @@ -176,32 +318,32 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi List list = mesInspectionReportMapper.selectSelfMutualInspectionList(mesInspectionReport); //2..查询左侧边 列 存入 String param = "first_inspection_right"; - List projectNames = mesInspectionReportMapper.selectProjectName(param); + List projectNames = mesInspectionReportMapper.selectProjectName(param); - List timeArray = mesInspectionReportMapper.selectTimeArray(mesInspectionReport); + List timeArray = mesInspectionReportMapper.selectTimeArray(mesInspectionReport); List listDTO = new ArrayList<>(); - for(String projectName : projectNames){ + for(MesInspectionReport project : projectNames){ Map dynamicTime = new LinkedHashMap<>(); - dynamicTime.put("开始-结束",projectName); + dynamicTime.put("开始-结束",project.getProjectName()); if(CollectionUtils.isEmpty(timeArray)){ dynamicTime.put("", ""); dynamicTime.put(" ", ""); dynamicTime.put(" ", ""); }else{ - for(String time : timeArray){ + for(MesInspectionReport time : timeArray){ List result = list.stream() - .filter(MesInspectionReport -> MesInspectionReport.getTimeArray().equals(time)) // 条件1:符合开始时间结束时间 - .filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(projectName)) // 条件2:符合当前项目名 + .filter(MesInspectionReport -> MesInspectionReport.getTimeArray().equals(time.getTimeArray())) // 条件1:符合开始时间结束时间 + .filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(project.getProjectName())) // 条件2:符合当前项目名 .collect(Collectors.toList()); // 收集结果 if(!CollectionUtils.isEmpty(result)){ if(StringUtils.isNotBlank(result.get(0).getCheckResult())){ - dynamicTime.put(time, result.get(0).getCheckResult()); + dynamicTime.put(time.getTimeArray(), result.get(0).getCheckResult()); }else{ - dynamicTime.put(time, ""); + dynamicTime.put(time.getTimeArray(), ""); } }else{ - dynamicTime.put(time, ""); + dynamicTime.put(time.getTimeArray(), ""); } } } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesInspectionReportMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesInspectionReportMapper.xml index b560f3ab2..78c7d3c67 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesInspectionReportMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesInspectionReportMapper.xml @@ -35,7 +35,7 @@ - + - + select dict_label as projectName , dict_code as projectCode ,dict_sort as tableLine from base_dict_data where dict_type = #{param} order by dict_sort asc @@ -88,24 +78,23 @@ order by dict_sort asc - select - mtsd.check_time_s + '-' + mtsd.check_time_e as timeArray + mtsd.check_time_s as checkTimeS, + mtsd.check_time_e as checkTimeE, + mtsd.check_time_s + '-' + mtsd.check_time_e as timeArray, + mtsd.table_line as tableLine from mes_table_self mts left join mes_table_self_detial mtsd on mts.id = mtsd.belong_to and mts.del_flag = '0' and mtsd.del_flag = '0' - - and CONVERT(date, mts.check_date) = dateadd(day, -1, CONVERT(date,#{checkDate})) - - - and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) - + and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) and mts.line_code = #{lineCode} and mts.report_name = #{reportName} + and mtsd.table_line is not null - group by mtsd.check_time_s,mtsd.check_time_e + group by mtsd.check_time_s , mtsd.check_time_e , mtsd.table_line order by mtsd.check_time_s @@ -125,29 +114,18 @@ + + + + + + update mes_table_self + + remark = #{remark}, + create_by = #{createBy}, + bz = #{bz}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + + update mes_table_self_detial + + check_time_s = #{item.checkTimeS}, + check_time_e = #{item.checkTimeE}, + check_result = #{item.checkResult}, + update_by = #{item.updateBy}, + update_time = #{item.updateTime}, + + where id = #{item.id} + + + + + insert into mes_table_self_detial( + id, belong_to, + remark, bz, + create_by, create_time, + update_by, update_time, + factory_code, del_flag, + check_time_s, check_time_e, + check_result, info_code, + info_name, table_line + ) values + + ( + #{item.id}, #{item.belongTo}, + #{item.remark}, #{item.bz}, + #{item.createBy}, #{item.createTime}, + #{item.updateBy}, #{item.updateTime}, + #{item.factoryCode}, #{item.delFlag}, + #{item.checkTimeS}, #{item.checkTimeE}, + #{item.checkResult}, #{item.infoCode}, + #{item.infoName}, #{item.tableLine} + ) + + + diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java index 1b088f0fd..db7e7ed42 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java @@ -498,7 +498,16 @@ public class WmsToWCSmissionController { */ @PostMapping("/ScanCodeWholePallet") public AjaxResult ScanCodeWholePallet(@RequestBody WmsProductPutTrayCode wmsProductPutTrayCode) { - return AjaxResult.success(wmsProductPutService.ScanCodeWholePallet(wmsProductPutTrayCode)); + List wmsFpStorageNewsSns= wmsProductPutService.ScanCodeWholePallet(wmsProductPutTrayCode); + if (wmsFpStorageNewsSns!=null&&wmsFpStorageNewsSns.size()>0){ + WmsFpStorageNewsSn wmsFpStorageNewsSn1= wmsFpStorageNewsSns.get(0); + if( wmsFpStorageNewsSn1.getBatchNumber().contains(wmsProductPutTrayCode.getBatchNumber())){ + return AjaxResult.success("扫描成功",wmsFpStorageNewsSns); + }else { + return AjaxResult.success("请查看批次是否与订单相同"); + } + } + return AjaxResult.success("扫描成功",wmsFpStorageNewsSns); } /** * 成品销售出库----单箱扫码 diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPutTrayCode.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPutTrayCode.java index 9f4dc49ea..c18b2f70e 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPutTrayCode.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsProductPutTrayCode.java @@ -31,6 +31,16 @@ public class WmsProductPutTrayCode extends BaseEntity { */ @Excel(name = "箱码") private String barcode; + @Excel(name = "批次号") + private String batchNumber; + + public String getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(String batchNumber) { + this.batchNumber = batchNumber; + } /** * 库位 diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 6993b06e6..e53a28163 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -2102,7 +2102,8 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { return result; } - public void OutboundPostingzcSAPGY(List orderList) { + public String OutboundPostingzcSAPGY(List orderList) { + String TEM="操作成功"; //先根据出库单获取 // * 退料的移动类型为 262 // * 领料的移动类型为 261-- and wms_ods_procure_out_order.Order_Status='3' @@ -2183,6 +2184,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { order.setUserDefined10("3");//失败 odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2); } + TEM=msg; } if (sapMaterialPostingFCList.size() > 0) { //反冲过账 @@ -2218,11 +2220,14 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { } } } else {// + order.setUserDefined9(""); order.setUserDefined10("3");//失败 odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2FC); } + TEM=msg; } + return TEM; } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index baafad3c6..146b19e35 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java @@ -913,7 +913,8 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn(); wmsFpStorageNewsSn.setSn(wmsProductPutTrayCode.getSn()); wmsFpStorageNewsSn.setActiveFlag("1"); - List wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnSTList(wmsFpStorageNewsSn); + List wmsFpStorageNewsSns = wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnSTList(wmsFpStorageNewsSn); + return wmsFpStorageNewsSns; } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml index c13df621e..41a0e2c1a 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -27,12 +27,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, factory_code, wa_code, wl_code, material_code, material_name, unit, supply_name, amnount_plan, amount_real, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, create_by, gmt_create, modified_by, gmt_modified from bp_raw_material_in + SELECT + id, + factory_code, + wa_code, + wl_code, + material_code, + material_name, + unit, + supply_name, + amnount_plan, + COALESCE(amount_real, 0) AS amount_real, -- 使用COALESCE函数处理NULL值 + user_defined1, + user_defined2, + user_defined3, + user_defined4, + user_defined5, + create_by, + gmt_create, + modified_by, + gmt_modified + FROM + bp_raw_material_in - - +