From da7a9054d5db692b5593ab9ddb5d68bf0d3987c8 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Fri, 21 Jun 2024 17:51:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E5=BA=A6=E6=8A=A5=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E6=A0=87=E5=87=86=E6=95=88=E7=8E=87=E8=AE=A1=E7=AE=97=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/common/core/utils/StringUtils.java | 2 +- .../op-file/src/main/resources/bootstrap.yml | 12 +++--- .../controller/MesReportWorkController.java | 38 ++++++++++++++++++- .../op/mes/domain/vo/MesMonthReportVo.java | 20 ++++++++++ .../op/mes/mapper/MesReportWorkMapper.java | 3 ++ .../op/mes/service/IMesReportWorkService.java | 3 ++ .../impl/MesReportWorkServiceImpl.java | 21 +++++----- .../main/resources/mapper/mes/MesMapper.xml | 3 +- .../mapper/mes/MesReportWorkMapper.xml | 6 ++- 9 files changed, 89 insertions(+), 19 deletions(-) create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesMonthReportVo.java diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java index 9d8b0a38..a74a28af 100644 --- a/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java +++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java @@ -476,7 +476,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { * @param factoryCode 工厂代码 * @param lineCode 产线编码 * @param productDate 生产日期 - * @param version 版本号最后一位 + * @param version 订单生产版本号最后一位 * @param productStatus 产出状态:正常是A * @param content 内容物 (根据产品,一般为0) * @return diff --git a/op-modules/op-file/src/main/resources/bootstrap.yml b/op-modules/op-file/src/main/resources/bootstrap.yml index 87f14b59..f1c1d493 100644 --- a/op-modules/op-file/src/main/resources/bootstrap.yml +++ b/op-modules/op-file/src/main/resources/bootstrap.yml @@ -13,16 +13,16 @@ spring: nacos: discovery: # 服务注册地址 - namespace: lanju-op - group: zxl + namespace: lanju-op-test + group: test # 服务注册地址 - server-addr: 175.27.215.92:8848 + server-addr: 192.168.202.20:8848 config: # 配置中心地址 - namespace: lanju-op - group: zxl + namespace: lanju-op-test + group: test # 服务注册地址 - server-addr: 175.27.215.92:8848 + server-addr: 192.168.202.20:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index 19a81ad6..eb501f4d 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -27,6 +27,7 @@ import com.op.mes.domain.dto.LineChartDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.DynamicColumnVo; import com.op.mes.domain.vo.MesDailyReportVo; +import com.op.mes.domain.vo.MesMonthReportVo; import com.op.system.api.domain.DataSourcePropertyDTO; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; @@ -266,7 +267,6 @@ public class MesReportWorkController extends BaseController { String end = mesDailyReportVo.getProductDateEnd(); ExcelUtil util = new ExcelUtil<>(MesDailyReportVo.class); util.exportExcel(response, list, start+"至"+end+"生产日报表"); - } @@ -599,6 +599,42 @@ public class MesReportWorkController extends BaseController { return AjaxResult.error("报工失败:"+r.getMsg()); } } + + /** + * 黑蚊香车间每日生产报表 + */ + @RequiresPermissions("mes:dailyProductionSut:list") + @GetMapping("/getdailyProductionSut") + public AjaxResult getdailyProductionSut(MesDailyReportVo mesDailyReportVo) { + + List list = mesReportWorkService.getDailyReportNew(mesDailyReportVo); + return success(); + } + + /** + * 黑蚊香车间月度汇总表 + */ + @RequiresPermissions("mes:monthProductionSut:list") + @GetMapping("/getmonthProductionSut") + public AjaxResult getmonthProductionSut(MesMonthReportVo mesMonthReportVo) { + SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd"); + Date today = mesMonthReportVo.getMonthValue(); + // 设置日历到本月1号 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(today); + calendar.set(Calendar.DAY_OF_MONTH, 1); + String beginTime = simpleDateFormat.format(mesMonthReportVo.getMonthValue()); + // 设置日历到下个月1号 + calendar.add(Calendar.MONTH, 1); + String endTime = simpleDateFormat.format(calendar.getTime()); + Map parammap =new HashMap(); + parammap.put("beginTime",beginTime); + parammap.put("endTime",endTime); + mesMonthReportVo.setParams(parammap); + List mapList = mesReportWorkService.getmonthProductionSut(mesMonthReportVo); + return success(mapList); + } + } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesMonthReportVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesMonthReportVo.java new file mode 100644 index 00000000..d1dc40c6 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesMonthReportVo.java @@ -0,0 +1,20 @@ +package com.op.mes.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.web.domain.BaseEntity; + +import javax.xml.crypto.Data; +import java.util.Date; + +public class MesMonthReportVo extends BaseEntity { + @JsonFormat(pattern = "yyyy-MM") + private Date monthValue; + + public Date getMonthValue() { + return monthValue; + } + + public void setMonthValue(Date monthValue) { + this.monthValue = monthValue; + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index 794c561e..d11ffc30 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -9,6 +9,7 @@ import com.op.mes.domain.dto.LineChartSeriesDto; import com.op.mes.domain.dto.QuantityDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.MesDailyReportVo; +import com.op.mes.domain.vo.MesMonthReportVo; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; @@ -180,4 +181,6 @@ public interface MesReportWorkMapper { QuantityDto getRealQuantity(QuantityDto quantityDto); List getSumQuantity(QuantityDto quantityDto); + + List getmonthProductionSut(MesMonthReportVo mesMonthReportVo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java index 70b4984e..0cd7e5b5 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java @@ -12,6 +12,7 @@ import com.op.mes.domain.dto.LineChartSeriesDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.DynamicColumnVo; import com.op.mes.domain.vo.MesDailyReportVo; +import com.op.mes.domain.vo.MesMonthReportVo; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.device.EquEquipmentDTO; import com.op.system.api.domain.dto.MesPrepareDetailDTO; @@ -135,4 +136,6 @@ public interface IMesReportWorkService { R preReportRow(MesReportWork mesReportWork); List getDailyReportNew(MesDailyReportVo mesDailyReportVo); + + List getmonthProductionSut(MesMonthReportVo mesMonthReportVo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 0d8a4856..60b10a77 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -25,6 +25,7 @@ import com.op.mes.domain.dto.QuantityDto; import com.op.mes.domain.dto.SysFactoryDto; import com.op.mes.domain.vo.DynamicColumnVo; import com.op.mes.domain.vo.MesDailyReportVo; +import com.op.mes.domain.vo.MesMonthReportVo; import com.op.mes.service.IWCSInterfaceService; import com.op.system.api.RemoteSapService; import com.op.system.api.domain.SysUser; @@ -488,6 +489,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return dtos; } + @Override @DS("#header.poolName") public String getTitleName(MesDailyReport mesDailyReport) { @@ -835,16 +837,17 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return dtos; } + @Override + @DS("#header.poolName") + public List getmonthProductionSut(MesMonthReportVo mesMonthReportVo) { + List mapList=new ArrayList<>(); + try { + mapList = mesReportWorkMapper.getmonthProductionSut(mesMonthReportVo); - public static void main(String[] args) { - Calendar calendar = Calendar.getInstance(); - Date now = calendar.getTime(); - calendar.set(Calendar.DAY_OF_MONTH, 1); - Date firstDayOfMonth = calendar.getTime(); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String formattedDate = format.format(firstDayOfMonth); - System.out.println("当前日期: " + format.format(now)); - System.out.println("当月的第一天: " + formattedDate); + }catch (Exception e){ + e.printStackTrace(); + } + return mapList; } } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml index d884293e..136eab91 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml @@ -450,7 +450,7 @@ diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 7ec2dc64..1f46a3f5 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -927,7 +927,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where ow.del_flag='0' and equ.del_flag='0' - + + + insert into mes_report_work id,