|
|
@@ -124,9 +124,31 @@ public class MesProductArcWeldingController extends BaseController {
|
|
|
mesProductArcWelding.setPage(new Page<>(request, response));
|
|
|
Page<MesProductArcWelding> page = mesProductArcWeldingService.findPage(mesProductArcWelding);
|
|
|
fillOprnoTitle(page.getList());
|
|
|
+ fillCreateByFromProductRecord(page.getList());
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ private void fillCreateByFromProductRecord(List<MesProductArcWelding> list) {
|
|
|
+ if (ListUtils.isEmpty(list)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map<String, String> updateByMap = new HashMap<>();
|
|
|
+ for (MesProductArcWelding record : list) {
|
|
|
+ if (StringUtils.isBlank(record.getSn()) || StringUtils.isBlank(record.getOprno())
|
|
|
+ || StringUtils.isBlank(record.getLineSn())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String key = record.getSn() + "|" + record.getOprno() + "|" + record.getLineSn();
|
|
|
+ if (!updateByMap.containsKey(key)) {
|
|
|
+ updateByMap.put(key, mesProductArcWeldingService.findProductRecordUpdateBy(record));
|
|
|
+ }
|
|
|
+ String updateBy = updateByMap.get(key);
|
|
|
+ if (StringUtils.isNotBlank(updateBy)) {
|
|
|
+ record.setCreateBy(updateBy);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void fillOprnoTitle(List<MesProductArcWelding> list) {
|
|
|
if (ListUtils.isEmpty(list)) {
|
|
|
return;
|
|
|
@@ -194,6 +216,7 @@ public class MesProductArcWeldingController extends BaseController {
|
|
|
public void exportData(MesProductArcWelding mesProductArcWelding, HttpServletResponse response) {
|
|
|
List<MesProductArcWelding> list = mesProductArcWeldingService.findList(mesProductArcWelding);
|
|
|
fillOprnoTitle(list);
|
|
|
+ fillCreateByFromProductRecord(list);
|
|
|
String exportTitle = "arc".equals(mesProductArcWelding.getWeldingCategory()) ? "弧焊参数" : "点焊参数";
|
|
|
String fileName = exportTitle + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
try(ExcelExport ee = new ExcelExport(exportTitle, MesProductArcWelding.class)){
|