From dfde288e87efedc77b076cd78dc929748b54197d Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 24 Mar 2025 09:17:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E7=94=9F=E4=BA=A7=E6=95=88=E7=8E=87?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/utils/poi/ExcelMesDayEffMapUtil.java | 164 +++++ .../MesLineAssistantQtyController.java | 220 ++++++ .../controller/MesReportWorksController.java | 2 +- .../com/op/mes/domain/MesLineAssistant.java | 278 ++++++++ .../op/mes/domain/MesLineAssistantQty.java | 181 +++++ .../com/op/mes/domain/MesLineProduct.java | 30 + .../mes/domain/vo/MesDailyEfficiencyVo.java | 636 ++++++++++++++++++ .../mes/domain/vo/MesLineAssistantQtyVo.java | 278 ++++++++ .../mes/mapper/MesLineAssistantQtyMapper.java | 87 +++ .../service/IMesLineAssistantQtyService.java | 69 ++ .../impl/MesLineAssistantQtyServiceImpl.java | 439 ++++++++++++ .../mapper/mes/MesLineAssistantQtyMapper.xml | 337 ++++++++++ .../impl/QcCheckTaskInventoryServiceImpl.java | 8 +- 13 files changed, 2724 insertions(+), 5 deletions(-) create mode 100644 op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelMesDayEffMapUtil.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistant.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistantQty.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesLineAssistantQtyVo.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineAssistantQtyMapper.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineAssistantQtyService.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java create mode 100644 op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelMesDayEffMapUtil.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelMesDayEffMapUtil.java new file mode 100644 index 00000000..16d6ba9e --- /dev/null +++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/poi/ExcelMesDayEffMapUtil.java @@ -0,0 +1,164 @@ +package com.op.common.core.utils.poi; + +import com.alibaba.fastjson2.JSONObject; +import com.op.common.core.domain.ExcelCol; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.Iterator; +import java.util.List; + +/** + * Excel相关处理 + * + * @author OP + */ +public class ExcelMesDayEffMapUtil { + //下载 + public static SXSSFWorkbook initWorkbook(String sheetName, String title, List excelCol, List data) { + SXSSFWorkbook workbook = new SXSSFWorkbook(); + int colSize = excelCol.size(); + + //创建Sheet(工作簿) + Sheet sheet = null; + if (!StringUtils.hasText(sheetName)) { + sheet = workbook.createSheet(); + } else { + sheet = workbook.createSheet(sheetName); + } + + Row sheetHeadRow0 = sheet.createRow(0); + Row sheetHeadRow1 = sheet.createRow(1); + Row sheetHeadRow2 = sheet.createRow(2); + //遍历表头名称,创建表头单元格 + + //遍历表头名称,创建表头单元格 + for (int i = 0; i < colSize; i++) { + sheet.setColumnWidth(i, (excelCol.get(i).getWidth()) * 256);//宽度单位是字符的256分之一 + Cell headCell = sheetHeadRow1.createCell(i); + headCell.setCellValue(excelCol.get(i).getTitle());//传值 + headCell.setCellStyle(getHeaderFont(sheet.getWorkbook()));//设置样式 + } + mergeAndStyleCells2(sheet, sheetHeadRow0, new CellRangeAddress(4, 5, 0, 1), "产品名称", true, true, IndexedColors.GREY_25_PERCENT); + + + //将data中的值填充到excel + int rowNum = sheet.getLastRowNum() + 1; + if (!CollectionUtils.isEmpty(data)) { + Iterator iterator = data.iterator(); + //遍历数据 + for (; iterator.hasNext(); ) { + Row dataRow = sheet.createRow(rowNum);//创建行 + T obj = iterator.next();//获取当前行对应的数据 + JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj)); + for (int i = 0; i < colSize; i++) { + Cell dataCell = dataRow.createCell(i); + dataCell.setCellStyle(getDataFont(workbook)); + if (title != null) {//定量分析 + dataCell.setCellValue(getValue(jsonObject.get(excelCol.get(i).getField()))); + } else { + if (i >= 2) { + dataCell.setCellValue(getValueNum(jsonObject.get(excelCol.get(i).getField()))); + } else { + dataCell.setCellValue(getValue(jsonObject.get(excelCol.get(i).getField()))); + } + } + } + iterator.remove(); + rowNum++; + } + } + + return workbook; + } + + //标题样式 + public static CellStyle getHeaderFont(Workbook workbook) { + Font font = workbook.createFont(); + font.setFontHeightInPoints((short) 15);//字体大小 + font.setBold(true);//加粗 + CellStyle cellStyle = workbook.createCellStyle(); + cellStyle.setFont(font); + cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中 + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中 + // 设置上边框 + cellStyle.setBorderTop(BorderStyle.THIN); + // 设置下边框 + cellStyle.setBorderBottom(BorderStyle.THIN); + // 设置左边框 + cellStyle.setBorderLeft(BorderStyle.THIN); + // 设置右边框 + cellStyle.setBorderRight(BorderStyle.THIN); + cellStyle.setFillBackgroundColor(IndexedColors.AQUA.getIndex()); + + return cellStyle; + } + + //内容样式 + public static CellStyle getDataFont(Workbook workbook) { + Font font = workbook.createFont(); + font.setFontHeightInPoints((short) 12);//字体大小 + font.setBold(false);//不加粗 + CellStyle cellStyle = workbook.createCellStyle(); + cellStyle.setFont(font); + cellStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);//设置水平居中 + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//设置垂直居中 + cellStyle.setWrapText(true);//设置单元格内容自动换行 + return cellStyle; + } + + //处理数据 + public static String getValue(Object object) { + if (object == null) { + return ""; + } else { + return object.toString(); + } + } + + //处理数据 + public static Integer getValueNum(Object object) { + if (object == null) { + return 0; + } else { + return Integer.parseInt(object.toString()); + } + } + + private static void mergeAndStyleCells2(Sheet sheet, Row row, CellRangeAddress cellRangeAddress, String cellValue, boolean centered, boolean hasBackground, IndexedColors backgroundColor) { + // 合并单元格 + sheet.addMergedRegion(cellRangeAddress); + + // 创建一个单元格样式 + CellStyle style = sheet.getWorkbook().createCellStyle(); + + // 设置字体居中 + if (centered) { + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + } + + // 设置背景颜色(如果有) + if (hasBackground && backgroundColor != null) { + style.setFillForegroundColor(backgroundColor.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + } + + // 设置边框线 + style.setBorderBottom(BorderStyle.THIN); + style.setBorderLeft(BorderStyle.THIN); + style.setBorderRight(BorderStyle.THIN); + style.setBorderTop(BorderStyle.THIN); + + // 获取合并后的单元格的第一个单元格,并设置值 + Cell cell = row.getCell(cellRangeAddress.getFirstColumn()); + if (cell == null) { + cell = row.createCell(cellRangeAddress.getFirstColumn()); + } + cell.setCellValue(cellValue); // 设置单元格的值 + cell.setCellStyle(style); // 应用样式到单元格 + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java new file mode 100644 index 00000000..7192afed --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesLineAssistantQtyController.java @@ -0,0 +1,220 @@ +package com.op.mes.controller; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; + +import com.op.common.core.domain.ExcelCol; +import com.op.common.core.utils.poi.ExcelMapUtil; +import com.op.common.core.utils.poi.ExcelMesDayEffMapUtil; +import com.op.mes.domain.MesLineAssistant; +import com.op.mes.domain.vo.DynamicColumnVo; +import com.op.mes.domain.vo.MesDailyEfficiencyVo; +import com.op.mes.domain.vo.MesLineAssistantQtyVo; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +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.MesLineAssistantQty; +import com.op.mes.service.IMesLineAssistantQtyService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 辅助工时摊分Controller + * + * @author Open Platform + * @date 2025-03-21 + */ +@RestController +@RequestMapping("/reportWorks/assistqty") +public class MesLineAssistantQtyController extends BaseController { + @Autowired + private IMesLineAssistantQtyService mesLineAssistantQtyService; + + /** + * 查询辅助工时摊分列表 + */ + @GetMapping("/list") + public TableDataInfo list(MesLineAssistantQty mesLineAssistantQty) { + startPage(); + List list = mesLineAssistantQtyService.selectMesLineAssistantQtyList(mesLineAssistantQty); + return getDataTable(list); + } + + /** + * 导出辅助工时摊分列表 + */ + @Log(title = "辅助工时摊分", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, MesLineAssistantQty mesLineAssistantQty) { + List list = mesLineAssistantQtyService.selectMesLineAssistantQtyList(mesLineAssistantQty); + ExcelUtil util = new ExcelUtil(MesLineAssistantQty. class); + util.exportExcel(response, list, "辅助工时摊分数据"); + } + + /** + * 获取辅助工时摊分详细信息 + */ + + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(mesLineAssistantQtyService.selectMesLineAssistantQtyById(id)); + } + + /** + * 新增辅助工时摊分 + */ + + @Log(title = "辅助工时摊分", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MesLineAssistantQty mesLineAssistantQty) { + return toAjax(mesLineAssistantQtyService.insertMesLineAssistantQty(mesLineAssistantQty)); + } + + /** + * 修改辅助工时摊分 + */ + + @Log(title = "辅助工时摊分", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody MesLineAssistantQty mesLineAssistantQty) { + return toAjax(mesLineAssistantQtyService.updateMesLineAssistantQty(mesLineAssistantQty)); + } + + /** + * 删除辅助工时摊分 + */ + + @Log(title = "辅助工时摊分", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(mesLineAssistantQtyService.deleteMesLineAssistantQtyByIds(ids)); + } + + @Log(title = "辅助工时摊分报表查询", businessType = BusinessType.QUERY) + @GetMapping("/listAssistHour") + public List listAssistHour(MesLineAssistant mesLineAssistant) { + List list = mesLineAssistantQtyService.selectEfficiencyHourList(mesLineAssistant); + return list; + } + @Log(title = "辅助工时摊分导出", businessType = BusinessType.EXPORT) + @PostMapping("/listAssistHourExport") + public void listAssistHourExport(HttpServletResponse response, MesLineAssistant mesLineAssistant) { + List list = mesLineAssistantQtyService.selectEfficiencyHourList(mesLineAssistant); + ExcelUtil util = new ExcelUtil(MesLineAssistantQtyVo. class); + util.exportExcel(response, list, "辅助工时摊分数据"); + } + + @Log(title = "生产日效率报表查询", businessType = BusinessType.QUERY) + @GetMapping("/listEfficiencyDayList") + public List listEfficiencyHourList(MesLineAssistant mesLineAssistant) { + List list = mesLineAssistantQtyService.selectEfficiencyDayList(mesLineAssistant); + return list; + } + @Log(title = "生产日效率报表导出", businessType = BusinessType.EXPORT) + @PostMapping("/listEfficiencyDayExport") + public void listEfficiencyHourExport(HttpServletResponse response, MesLineAssistant mesLineAssistant) { + List list = mesLineAssistantQtyService.selectEfficiencyDayList(mesLineAssistant); + +// List> list = mesReportWorksService.getHFProductionList(dto); +// +// ArrayList excelCols = new ArrayList<>(); +// excelCols.add(new ExcelCol("日期","productDate",20)); +// excelCols.add(new ExcelCol("工厂","factoryCode",20)); +// excelCols.add(new ExcelCol("车间","totalQuantity",20)); +// excelCols.add(new ExcelCol("产线编码","totalQuantity",20)); +// excelCols.add(new ExcelCol("品类","productDate",20)); +// excelCols.add(new ExcelCol("产品名称","factoryCode",20)); +// excelCols.add(new ExcelCol("规格","totalQuantity",20)); +// excelCols.add(new ExcelCol("单位","totalQuantity",20)); +// excelCols.add(new ExcelCol("计划产量(件/PC)","productDate",20)); +// excelCols.add(new ExcelCol("实际产量(件)","factoryCode",20)); +// excelCols.add(new ExcelCol("实际产量(PC)","totalQuantity",20)); +// excelCols.add(new ExcelCol("产量达成率","totalQuantity",20)); +// excelCols.add(new ExcelCol("标准工艺效率(PC/H)","productDate",20)); +// excelCols.add(new ExcelCol("标准用人","factoryCode",20)); +// excelCols.add(new ExcelCol("实际用人","totalQuantity",20)); +// excelCols.add(new ExcelCol("产品标准工时","totalQuantity",20)); +// excelCols.add(new ExcelCol("产品实际工时","factoryCode",20)); +// excelCols.add(new ExcelCol("一线工时合计","totalQuantity",20)); +// excelCols.add(new ExcelCol("一线标准效率","totalQuantity",20)); +// excelCols.add(new ExcelCol("一线实际效率","productDate",20)); +// excelCols.add(new ExcelCol("效率达成率","factoryCode",20)); +// +// excelCols.add(new ExcelCol("辅助用人合计","totalQuantity",20)); +// excelCols.add(new ExcelCol("班长","totalQuantity",20)); +// excelCols.add(new ExcelCol("组长","totalQuantity",20)); +// excelCols.add(new ExcelCol("机操工","totalQuantity",20)); +// excelCols.add(new ExcelCol("物料员","totalQuantity",20)); +// excelCols.add(new ExcelCol("配料员","totalQuantity",20)); +// excelCols.add(new ExcelCol("配药员","totalQuantity",20)); +// excelCols.add(new ExcelCol("药管员","totalQuantity",20)); +// excelCols.add(new ExcelCol("锅炉工","totalQuantity",20)); +// excelCols.add(new ExcelCol("石油气看管员","totalQuantity",20)); +// excelCols.add(new ExcelCol("库区管理员","totalQuantity",20)); +// excelCols.add(new ExcelCol("机修工","totalQuantity",20)); +// excelCols.add(new ExcelCol("清洁工","totalQuantity",20)); +// +// excelCols.add(new ExcelCol("辅助工时合计","totalQuantity",20)); +// excelCols.add(new ExcelCol("班长","totalQuantity",20)); +// excelCols.add(new ExcelCol("组长","totalQuantity",20)); +// excelCols.add(new ExcelCol("机操工","totalQuantity",20)); +// excelCols.add(new ExcelCol("物料员","totalQuantity",20)); +// excelCols.add(new ExcelCol("配料员","totalQuantity",20)); +// excelCols.add(new ExcelCol("配药员","totalQuantity",20)); +// excelCols.add(new ExcelCol("药管员","totalQuantity",20)); +// excelCols.add(new ExcelCol("锅炉工","totalQuantity",20)); +// excelCols.add(new ExcelCol("石油气看管员","totalQuantity",20)); +// excelCols.add(new ExcelCol("库区管理员","totalQuantity",20)); +// excelCols.add(new ExcelCol("机修工","totalQuantity",20)); +// excelCols.add(new ExcelCol("清洁工","totalQuantity",20)); +// +// excelCols.add(new ExcelCol("总工时","totalQuantity",20)); +// excelCols.add(new ExcelCol("效率提升基数","totalQuantity",20)); +// excelCols.add(new ExcelCol("提升目标","totalQuantity",20)); +// excelCols.add(new ExcelCol("目标效率","totalQuantity",20)); +// excelCols.add(new ExcelCol("实际效率","totalQuantity",20)); +// excelCols.add(new ExcelCol("效率提升率","totalQuantity",20)); +// +// excelCols.add(new ExcelCol("原因分析","totalQuantity",20)); +// +// String titleName = "日生产效率统计报表"; +// SXSSFWorkbook workbook = null; +// +// try { +// //设置响应头 +// response.setHeader("Content-disposition", +// "attachment; filename="+ titleName); +// response.setContentType("application/octet-stream;charset=UTF-8"); +// ServletOutputStream outputStream = response.getOutputStream(); +// //调用工具类 +// workbook = ExcelMesDayEffMapUtil.initWorkbook(titleName, null, excelCols, list); +// workbook.write(outputStream); +// } catch (IOException e) { +// e.printStackTrace(); +// }finally { +// if (workbook!=null){ +// workbook.dispose(); +// } +// } + ExcelUtil util = new ExcelUtil(MesDailyEfficiencyVo. class); + util.exportExcel(response, list, "生产日效率报表"); + } + + +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java index 67c7120c..4ef3d761 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorksController.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; import static com.op.common.core.utils.PageUtils.startPage; - +/**mes综合分析报表**/ @RestController @RequestMapping("/reportWorks") public class MesReportWorksController extends BaseController { diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistant.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistant.java new file mode 100644 index 00000000..dd1edddb --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistant.java @@ -0,0 +1,278 @@ +package com.op.mes.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 辅助工时摊分对象 mes_line_assistant_qty + * + * @author Open Platform + * @date 2025-03-21 + */ +public class MesLineAssistant extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 主键 */ + private String id; + + /** 工厂 */ + @Excel(name = "工厂") + private String factoryCode; + + @Excel(name = "车间") + private String carCode; + + @Excel(name = "线体") + private String lineCode; + + @Excel(name = "产品编码") + private String productCode; + + @Excel(name = "产品名称") + private String productName; + + @Excel(name = "产品工时") + private String productHour; + + @Excel(name = "工时占比") + private String hourRatio; + + @Excel(name = "辅助工时合计") + private String assistHourSum; + + @Excel(name = "班长工时") + private String monitorHour; + + @Excel(name = "组长工时") + private String groupLeaderHour; + + @Excel(name = "物料员工时") + private String materialHour; + + @Excel(name = "药管员工时") + private String pillMgrHour; + + @Excel(name = "配药员工时") + private String pillDisHour; + + + /** 生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + private String productDateStr; + + /** 班长人数 */ + @Excel(name = "班长人数") + private Long monitorQty; + + /** 组长人数 */ + @Excel(name = "组长人数") + private Long groupleaderQty; + + /** 物料员人数 */ + @Excel(name = "物料员人数") + private Long materialQty; + + /** 药管员人数 */ + @Excel(name = "药管员人数") + private Long pillMgrQty; + + /** 配药员人数 */ + @Excel(name = "配药员人数") + private Long pillDisQty; + //班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155 + private String postId; + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setProductDate(Date productDate){ + this.productDate = productDate; + } + + public Date getProductDate(){ + return productDate; + } + public void setMonitorQty(Long monitorQty){ + this.monitorQty = monitorQty; + } + + public Long getMonitorQty(){ + return monitorQty; + } + public void setGroupleaderQty(Long groupleaderQty){ + this.groupleaderQty = groupleaderQty; + } + + public Long getGroupleaderQty(){ + return groupleaderQty; + } + public void setMaterialQty(Long materialQty){ + this.materialQty = materialQty; + } + + public Long getMaterialQty(){ + return materialQty; + } + public void setPillMgrQty(Long pillMgrQty){ + this.pillMgrQty = pillMgrQty; + } + + public Long getPillMgrQty(){ + return pillMgrQty; + } + public void setPillDisQty(Long pillDisQty){ + this.pillDisQty = pillDisQty; + } + + public Long getPillDisQty(){ + return pillDisQty; + } + + public String getCarCode() { + return carCode; + } + + public void setCarCode(String carCode) { + this.carCode = carCode; + } + + public String getLineCode() { + return lineCode; + } + + public void setLineCode(String lineCode) { + this.lineCode = lineCode; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductHour() { + return productHour; + } + + public void setProductHour(String productHour) { + this.productHour = productHour; + } + + public String getHourRatio() { + return hourRatio; + } + + public void setHourRatio(String hourRatio) { + this.hourRatio = hourRatio; + } + + public String getAssistHourSum() { + return assistHourSum; + } + + public void setAssistHourSum(String assistHourSum) { + this.assistHourSum = assistHourSum; + } + + public String getMonitorHour() { + return monitorHour; + } + + public void setMonitorHour(String monitorHour) { + this.monitorHour = monitorHour; + } + + public String getGroupLeaderHour() { + return groupLeaderHour; + } + + public void setGroupLeaderHour(String groupLeaderHour) { + this.groupLeaderHour = groupLeaderHour; + } + + public String getMaterialHour() { + return materialHour; + } + + public void setMaterialHour(String materialHour) { + this.materialHour = materialHour; + } + + public String getPillMgrHour() { + return pillMgrHour; + } + + public void setPillMgrHour(String pillMgrHour) { + this.pillMgrHour = pillMgrHour; + } + + public String getPillDisHour() { + return pillDisHour; + } + + public void setPillDisHour(String pillDisHour) { + this.pillDisHour = pillDisHour; + } + + public String getProductDateStr() { + return productDateStr; + } + + public void setProductDateStr(String productDateStr) { + this.productDateStr = productDateStr; + } + + @Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("factoryCode",getFactoryCode()) + .append("productDate",getProductDate()) + .append("monitorQty",getMonitorQty()) + .append("groupleaderQty",getGroupleaderQty()) + .append("materialQty",getMaterialQty()) + .append("pillMgrQty",getPillMgrQty()) + .append("pillDisQty",getPillDisQty()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistantQty.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistantQty.java new file mode 100644 index 00000000..ee38e887 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineAssistantQty.java @@ -0,0 +1,181 @@ +package com.op.mes.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 辅助工时摊分对象 mes_line_assistant_qty + * + * @author Open Platform + * @date 2025-03-21 + */ +public class MesLineAssistantQty extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 主键 */ + private String id; + + /** 工厂 */ + @Excel(name = "工厂") + private String factoryCode; + + /** 生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + private String productDateStr; + /** 班长人数 */ + @Excel(name = "班长人数") + private Long monitorQty; + + /** 组长人数 */ + @Excel(name = "组长人数") + private Long groupleaderQty; + + /** 物料员人数 */ + @Excel(name = "物料员人数") + private Long materialQty; + + /** 药管员人数 */ + @Excel(name = "药管员人数") + private Long pillMgrQty; + + /** 配药员人数 */ + @Excel(name = "配药员人数") + private Long pillDisQty; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private String attr4; + + public String getProductDateStr() { + return productDateStr; + } + + public void setProductDateStr(String productDateStr) { + this.productDateStr = productDateStr; + } + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setProductDate(Date productDate){ + this.productDate = productDate; + } + + public Date getProductDate(){ + return productDate; + } + public void setMonitorQty(Long monitorQty){ + this.monitorQty = monitorQty; + } + + public Long getMonitorQty(){ + return monitorQty; + } + public void setGroupleaderQty(Long groupleaderQty){ + this.groupleaderQty = groupleaderQty; + } + + public Long getGroupleaderQty(){ + return groupleaderQty; + } + public void setMaterialQty(Long materialQty){ + this.materialQty = materialQty; + } + + public Long getMaterialQty(){ + return materialQty; + } + public void setPillMgrQty(Long pillMgrQty){ + this.pillMgrQty = pillMgrQty; + } + + public Long getPillMgrQty(){ + return pillMgrQty; + } + public void setPillDisQty(Long pillDisQty){ + this.pillDisQty = pillDisQty; + } + + public Long getPillDisQty(){ + return pillDisQty; + } + public void setAttr1(String attr1){ + this.attr1 = attr1; + } + + public String getAttr1(){ + return attr1; + } + public void setAttr2(String attr2){ + this.attr2 = attr2; + } + + public String getAttr2(){ + return attr2; + } + public void setAttr3(String attr3){ + this.attr3 = attr3; + } + + public String getAttr3(){ + return attr3; + } + public void setAttr4(String attr4){ + this.attr4 = attr4; + } + + public String getAttr4(){ + return attr4; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("factoryCode",getFactoryCode()) + .append("productDate",getProductDate()) + .append("monitorQty",getMonitorQty()) + .append("groupleaderQty",getGroupleaderQty()) + .append("materialQty",getMaterialQty()) + .append("pillMgrQty",getPillMgrQty()) + .append("pillDisQty",getPillDisQty()) + .append("attr1",getAttr1()) + .append("attr2",getAttr2()) + .append("attr3",getAttr3()) + .append("attr4",getAttr4()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProduct.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProduct.java index aa71949e..f9fb96dc 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProduct.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesLineProduct.java @@ -2,6 +2,8 @@ package com.op.mes.domain; import com.op.common.core.web.domain.BaseEntity; +import java.math.BigDecimal; + public class MesLineProduct extends BaseEntity { private static final long serialVersionUID = 1L; @@ -21,6 +23,34 @@ public class MesLineProduct extends BaseEntity { private String attr2; + private String lineCode; + private BigDecimal hourEfficiency; + private BigDecimal useMan; + + public BigDecimal getHourEfficiency() { + return hourEfficiency; + } + + public void setHourEfficiency(BigDecimal hourEfficiency) { + this.hourEfficiency = hourEfficiency; + } + + public BigDecimal getUseMan() { + return useMan; + } + + public void setUseMan(BigDecimal useMan) { + this.useMan = useMan; + } + + public String getLineCode() { + return lineCode; + } + + public void setLineCode(String lineCode) { + this.lineCode = lineCode; + } + public String getProductCode() { return productCode; } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java new file mode 100644 index 00000000..48e147bd --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesDailyEfficiencyVo.java @@ -0,0 +1,636 @@ +package com.op.mes.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 生产效率日报表 + * + * @author Open Platform + * @date 2025-03-21 + */ +public class MesDailyEfficiencyVo extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 主键 */ + private String id; + + /** 生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + + /** 工厂 */ + @Excel(name = "工厂") + private String factoryCode; + + @Excel(name = "车间") + private String carCode; + + @Excel(name = "SAP线体编码") + private String lineCode; + + private String productCode; + @Excel(name = "品类") + private String category; + + @Excel(name = "产品名称") + private String productName; + + @Excel(name = "规格") + private String spec; + + @Excel(name = "单位") + private String unit; + + @Excel(name = "计划产量(件/PC)") + private String planQty; + + @Excel(name = "实际产量(件/PC)") + private String actQty; + + @Excel(name = "实际产量(PC)") + private String actQtySon; + + @Excel(name = "产量达成率") + private String completeRate; + //一线 + @Excel(name = "标准工艺效率(PC/H)") + private String standEff; + @Excel(name = "标准用人") + private String standMan; + @Excel(name = "实际用人") + private String actMan; + @Excel(name = "产品标准工时") + private String standHour; + @Excel(name = "产品实际工时") + private String actHour; + @Excel(name = "一线工时合计") + private String oneHourSum; + @Excel(name = "一线标准效率") + private String oneStandEff; + @Excel(name = "一线实际效率") + private String oneActEff; + @Excel(name = "效率达成率") + private String effRate; + //辅助 + ////辅助用人数 + @Excel(name = "辅助用人合计") + private String assisManSum; + @Excel(name = "班长人数") + private String monitorQty; + @Excel(name = "组长人数") + private String groupleaderQty; + @Excel(name = "机操工人数") + private String operateMachineQty; + @Excel(name = "物料员人数") + private String materialQty; + @Excel(name = "配料员人数") + private String materialDisQty; + @Excel(name = "配药员人数") + private String pillDisQty; + @Excel(name = "药管员人数") + private String pillMgrQty; + @Excel(name = "锅炉工人数") + private String boilerQty; + @Excel(name = "石油气看管员人数") + private String oilQty; + @Excel(name = "库区管理员人数") + private String wareMgrQty; + @Excel(name = "机修工人数") + private String repairQty; + @Excel(name = "清洁工人数") + private String cleanerQty; + ////辅助工时数 + @Excel(name = "辅助工时合计") + private String assisHourSum; + @Excel(name = "班长工时") + private String monitorHour; + @Excel(name = "组长工时") + private String groupleaderHour; + @Excel(name = "机操工工时") + private String operateMachineHour; + @Excel(name = "物料员工时") + private String materialHour; + @Excel(name = "配料员工时") + private String materialDisHour; + @Excel(name = "配药员工时") + private String pillDisHour; + @Excel(name = "药管员工时") + private String pillMgrHour; + @Excel(name = "锅炉工工时") + private String boilerHour; + @Excel(name = "石油气看管员工时") + private String oilHour; + @Excel(name = "库区管理员工时") + private String wareMgrHour; + @Excel(name = "机修工工时") + private String repairHour; + @Excel(name = "清洁工工时") + private String cleanerHour; + //一线+辅助 + @Excel(name = "总工时") + private String hourSum; + @Excel(name = "效率提升基数") + private String effUpBase; + @Excel(name = "提升目标") + private String upGoal; + @Excel(name = "目标效率") + private String goalRate; + @Excel(name = "实际效率") + private String actRate; + @Excel(name = "效率提升率") + private String effUpRate; + @Excel(name = "原因分析") + private String reasonAnalysis; + + private String workorderCode; + + //班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155 + private String postId; + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setProductDate(Date productDate){ + this.productDate = productDate; + } + + public Date getProductDate(){ + return productDate; + } + + public String getMonitorQty() { + return monitorQty; + } + + public void setMonitorQty(String monitorQty) { + this.monitorQty = monitorQty; + } + + public String getGroupleaderQty() { + return groupleaderQty; + } + + public void setGroupleaderQty(String groupleaderQty) { + this.groupleaderQty = groupleaderQty; + } + + public String getMaterialQty() { + return materialQty; + } + + public void setMaterialQty(String materialQty) { + this.materialQty = materialQty; + } + + public String getPillMgrQty() { + return pillMgrQty; + } + + public void setPillMgrQty(String pillMgrQty) { + this.pillMgrQty = pillMgrQty; + } + + public String getPillDisQty() { + return pillDisQty; + } + + public void setPillDisQty(String pillDisQty) { + this.pillDisQty = pillDisQty; + } + + public String getCarCode() { + return carCode; + } + + public void setCarCode(String carCode) { + this.carCode = carCode; + } + + public String getLineCode() { + return lineCode; + } + + public void setLineCode(String lineCode) { + this.lineCode = lineCode; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getMonitorHour() { + return monitorHour; + } + + public void setMonitorHour(String monitorHour) { + this.monitorHour = monitorHour; + } + + public String getMaterialHour() { + return materialHour; + } + + public void setMaterialHour(String materialHour) { + this.materialHour = materialHour; + } + + public String getPillMgrHour() { + return pillMgrHour; + } + + public void setPillMgrHour(String pillMgrHour) { + this.pillMgrHour = pillMgrHour; + } + + public String getPillDisHour() { + return pillDisHour; + } + + public void setPillDisHour(String pillDisHour) { + this.pillDisHour = pillDisHour; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getPlanQty() { + return planQty; + } + + public void setPlanQty(String planQty) { + this.planQty = planQty; + } + + public String getActQty() { + return actQty; + } + + public void setActQty(String actQty) { + this.actQty = actQty; + } + + public String getActQtySon() { + return actQtySon; + } + + public void setActQtySon(String actQtySon) { + this.actQtySon = actQtySon; + } + + public String getCompleteRate() { + return completeRate; + } + + public void setCompleteRate(String completeRate) { + this.completeRate = completeRate; + } + + public String getStandEff() { + return standEff; + } + + public void setStandEff(String standEff) { + this.standEff = standEff; + } + + public String getStandMan() { + return standMan; + } + + public void setStandMan(String standMan) { + this.standMan = standMan; + } + + public String getActMan() { + return actMan; + } + + public void setActMan(String actMan) { + this.actMan = actMan; + } + + public String getStandHour() { + return standHour; + } + + public void setStandHour(String standHour) { + this.standHour = standHour; + } + + public String getActHour() { + return actHour; + } + + public void setActHour(String actHour) { + this.actHour = actHour; + } + + public String getOneHourSum() { + return oneHourSum; + } + + public void setOneHourSum(String oneHourSum) { + this.oneHourSum = oneHourSum; + } + + public String getOneStandEff() { + return oneStandEff; + } + + public void setOneStandEff(String oneStandEff) { + this.oneStandEff = oneStandEff; + } + + public String getOneActEff() { + return oneActEff; + } + + public void setOneActEff(String oneActEff) { + this.oneActEff = oneActEff; + } + + public String getEffRate() { + return effRate; + } + + public void setEffRate(String effRate) { + this.effRate = effRate; + } + + public String getAssisManSum() { + return assisManSum; + } + + public void setAssisManSum(String assisManSum) { + this.assisManSum = assisManSum; + } + + public String getOperateMachineQty() { + return operateMachineQty; + } + + public void setOperateMachineQty(String operateMachineQty) { + this.operateMachineQty = operateMachineQty; + } + + public String getMaterialDisQty() { + return materialDisQty; + } + + public void setMaterialDisQty(String materialDisQty) { + this.materialDisQty = materialDisQty; + } + + public String getBoilerQty() { + return boilerQty; + } + + public void setBoilerQty(String boilerQty) { + this.boilerQty = boilerQty; + } + + public String getOilQty() { + return oilQty; + } + + public void setOilQty(String oilQty) { + this.oilQty = oilQty; + } + + public String getWareMgrQty() { + return wareMgrQty; + } + + public void setWareMgrQty(String wareMgrQty) { + this.wareMgrQty = wareMgrQty; + } + + public String getRepairQty() { + return repairQty; + } + + public void setRepairQty(String repairQty) { + this.repairQty = repairQty; + } + + public String getCleanerQty() { + return cleanerQty; + } + + public void setCleanerQty(String cleanerQty) { + this.cleanerQty = cleanerQty; + } + + public String getAssisHourSum() { + return assisHourSum; + } + + public void setAssisHourSum(String assisHourSum) { + this.assisHourSum = assisHourSum; + } + + public String getGroupleaderHour() { + return groupleaderHour; + } + + public void setGroupleaderHour(String groupleaderHour) { + this.groupleaderHour = groupleaderHour; + } + + public String getOperateMachineHour() { + return operateMachineHour; + } + + public void setOperateMachineHour(String operateMachineHour) { + this.operateMachineHour = operateMachineHour; + } + + public String getMaterialDisHour() { + return materialDisHour; + } + + public void setMaterialDisHour(String materialDisHour) { + this.materialDisHour = materialDisHour; + } + + public String getBoilerHour() { + return boilerHour; + } + + public void setBoilerHour(String boilerHour) { + this.boilerHour = boilerHour; + } + + public String getOilHour() { + return oilHour; + } + + public void setOilHour(String oilHour) { + this.oilHour = oilHour; + } + + public String getWareMgrHour() { + return wareMgrHour; + } + + public void setWareMgrHour(String wareMgrHour) { + this.wareMgrHour = wareMgrHour; + } + + public String getRepairHour() { + return repairHour; + } + + public void setRepairHour(String repairHour) { + this.repairHour = repairHour; + } + + public String getCleanerHour() { + return cleanerHour; + } + + public void setCleanerHour(String cleanerHour) { + this.cleanerHour = cleanerHour; + } + + public String getHourSum() { + return hourSum; + } + + public void setHourSum(String hourSum) { + this.hourSum = hourSum; + } + + public String getEffUpBase() { + return effUpBase; + } + + public void setEffUpBase(String effUpBase) { + this.effUpBase = effUpBase; + } + + public String getUpGoal() { + return upGoal; + } + + public void setUpGoal(String upGoal) { + this.upGoal = upGoal; + } + + public String getGoalRate() { + return goalRate; + } + + public void setGoalRate(String goalRate) { + this.goalRate = goalRate; + } + + public String getActRate() { + return actRate; + } + + public void setActRate(String actRate) { + this.actRate = actRate; + } + + public String getEffUpRate() { + return effUpRate; + } + + public void setEffUpRate(String effUpRate) { + this.effUpRate = effUpRate; + } + + public String getReasonAnalysis() { + return reasonAnalysis; + } + + public void setReasonAnalysis(String reasonAnalysis) { + this.reasonAnalysis = reasonAnalysis; + } + + @Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("factoryCode",getFactoryCode()) + .append("productDate",getProductDate()) + .append("monitorQty",getMonitorQty()) + .append("groupleaderQty",getGroupleaderQty()) + .append("materialQty",getMaterialQty()) + .append("pillMgrQty",getPillMgrQty()) + .append("pillDisQty",getPillDisQty()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesLineAssistantQtyVo.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesLineAssistantQtyVo.java new file mode 100644 index 00000000..1b769a27 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/vo/MesLineAssistantQtyVo.java @@ -0,0 +1,278 @@ +package com.op.mes.domain.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 辅助工时摊分对象 mes_line_assistant_qty + * + * @author Open Platform + * @date 2025-03-21 + */ +public class MesLineAssistantQtyVo extends BaseEntity { +private static final long serialVersionUID=1L; + + /** 主键 */ + private String id; + + /** 生产日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date productDate; + + /** 工厂 */ + @Excel(name = "工厂") + private String factoryCode; + + @Excel(name = "车间") + private String carCode; + + @Excel(name = "SAP线体编码") + private String lineCode; + + private String productCode; + + @Excel(name = "产品名称") + private String productName; + + @Excel(name = "产品工时") + private String productHour; + + @Excel(name = "工时占比") + private String hourRatio; + + @Excel(name = "辅助工时合计") + private String assistHourSum; + + @Excel(name = "班长人数") + private String monitorQty; + + @Excel(name = "班长工时") + private String monitorHour; + + @Excel(name = "组长人数") + private String groupleaderQty; + + @Excel(name = "组长工时") + private String groupLeaderHour; + + @Excel(name = "物料员人数") + private String materialQty; + + @Excel(name = "物料员工时") + private String materialHour; + + @Excel(name = "药管员人数") + private String pillMgrQty; + + @Excel(name = "药管员工时") + private String pillMgrHour; + + @Excel(name = "配药员人数") + private String pillDisQty; + + @Excel(name = "配药员工时") + private String pillDisHour; + + private String workorderCode; + + //班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155 + private String postId; + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setProductDate(Date productDate){ + this.productDate = productDate; + } + + public Date getProductDate(){ + return productDate; + } + + public String getMonitorQty() { + return monitorQty; + } + + public void setMonitorQty(String monitorQty) { + this.monitorQty = monitorQty; + } + + public String getGroupleaderQty() { + return groupleaderQty; + } + + public void setGroupleaderQty(String groupleaderQty) { + this.groupleaderQty = groupleaderQty; + } + + public String getMaterialQty() { + return materialQty; + } + + public void setMaterialQty(String materialQty) { + this.materialQty = materialQty; + } + + public String getPillMgrQty() { + return pillMgrQty; + } + + public void setPillMgrQty(String pillMgrQty) { + this.pillMgrQty = pillMgrQty; + } + + public String getPillDisQty() { + return pillDisQty; + } + + public void setPillDisQty(String pillDisQty) { + this.pillDisQty = pillDisQty; + } + + public String getCarCode() { + return carCode; + } + + public void setCarCode(String carCode) { + this.carCode = carCode; + } + + public String getLineCode() { + return lineCode; + } + + public void setLineCode(String lineCode) { + this.lineCode = lineCode; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductHour() { + return productHour; + } + + public void setProductHour(String productHour) { + this.productHour = productHour; + } + + public String getHourRatio() { + return hourRatio; + } + + public void setHourRatio(String hourRatio) { + this.hourRatio = hourRatio; + } + + public String getAssistHourSum() { + return assistHourSum; + } + + public void setAssistHourSum(String assistHourSum) { + this.assistHourSum = assistHourSum; + } + + public String getMonitorHour() { + return monitorHour; + } + + public void setMonitorHour(String monitorHour) { + this.monitorHour = monitorHour; + } + + public String getGroupLeaderHour() { + return groupLeaderHour; + } + + public void setGroupLeaderHour(String groupLeaderHour) { + this.groupLeaderHour = groupLeaderHour; + } + + public String getMaterialHour() { + return materialHour; + } + + public void setMaterialHour(String materialHour) { + this.materialHour = materialHour; + } + + public String getPillMgrHour() { + return pillMgrHour; + } + + public void setPillMgrHour(String pillMgrHour) { + this.pillMgrHour = pillMgrHour; + } + + public String getPillDisHour() { + return pillDisHour; + } + + public void setPillDisHour(String pillDisHour) { + this.pillDisHour = pillDisHour; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + @Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("factoryCode",getFactoryCode()) + .append("productDate",getProductDate()) + .append("monitorQty",getMonitorQty()) + .append("groupleaderQty",getGroupleaderQty()) + .append("materialQty",getMaterialQty()) + .append("pillMgrQty",getPillMgrQty()) + .append("pillDisQty",getPillDisQty()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .toString(); + } +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineAssistantQtyMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineAssistantQtyMapper.java new file mode 100644 index 00000000..a3cd9835 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesLineAssistantQtyMapper.java @@ -0,0 +1,87 @@ +package com.op.mes.mapper; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +import com.op.mes.domain.MesLineAssistant; +import com.op.mes.domain.MesLineAssistantQty; +import com.op.mes.domain.MesLineProduct; +import com.op.mes.domain.MesReportWork; +import com.op.mes.domain.vo.MesDailyEfficiencyVo; +import com.op.mes.domain.vo.MesLineAssistantQtyVo; +import org.apache.ibatis.annotations.MapKey; + +/** + * 辅助工时摊分Mapper接口 + * + * @author Open Platform + * @date 2025-03-21 + */ +public interface MesLineAssistantQtyMapper { + /** + * 查询辅助工时摊分 + * + * @param id 辅助工时摊分主键 + * @return 辅助工时摊分 + */ + public MesLineAssistantQty selectMesLineAssistantQtyById(String id); + + /** + * 查询辅助工时摊分列表 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 辅助工时摊分集合 + */ + public List selectMesLineAssistantQtyList(MesLineAssistantQty mesLineAssistantQty); + + /** + * 新增辅助工时摊分 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 结果 + */ + public int insertMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty); + + /** + * 修改辅助工时摊分 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 结果 + */ + public int updateMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty); + + /** + * 删除辅助工时摊分 + * + * @param id 辅助工时摊分主键 + * @return 结果 + */ + public int deleteMesLineAssistantQtyById(String id); + + /** + * 批量删除辅助工时摊分 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMesLineAssistantQtyByIds(String[] ids); + + String getHasdate(MesLineAssistantQty mesLineAssistantQty); + + public List selectEfficiencyHourList(MesLineAssistant mesLineAssistant); + BigDecimal getHoursByOrderCode(String workorderCode); + @MapKey("productDateStr") + Map getAssistMaps(MesLineAssistant mesLineAssistant); + BigDecimal getKqHourMaps(MesLineAssistant mesLineAssistant); + + public List selectEfficiencyDayList(MesLineAssistant mesLineAssistant); + + BigDecimal getPlanQtyByOrderCode(String workorderCode); + + BigDecimal getActQtyByOrderCode(String workorderCode); + + MesLineProduct getStandarInfo(MesDailyEfficiencyVo effdto); + + MesReportWork getSonActManByOrderCode(String workorderCode); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineAssistantQtyService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineAssistantQtyService.java new file mode 100644 index 00000000..018d6c4f --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesLineAssistantQtyService.java @@ -0,0 +1,69 @@ +package com.op.mes.service; + +import java.util.List; + +import com.op.mes.domain.MesLineAssistant; +import com.op.mes.domain.MesLineAssistantQty; +import com.op.mes.domain.vo.MesDailyEfficiencyVo; +import com.op.mes.domain.vo.MesLineAssistantQtyVo; + +/** + * 辅助工时摊分Service接口 + * + * @author Open Platform + * @date 2025-03-21 + */ +public interface IMesLineAssistantQtyService { + /** + * 查询辅助工时摊分 + * + * @param id 辅助工时摊分主键 + * @return 辅助工时摊分 + */ + public MesLineAssistantQty selectMesLineAssistantQtyById(String id); + + /** + * 查询辅助工时摊分列表 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 辅助工时摊分集合 + */ + public List selectMesLineAssistantQtyList(MesLineAssistantQty mesLineAssistantQty); + + /** + * 新增辅助工时摊分 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 结果 + */ + public int insertMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty); + + /** + * 修改辅助工时摊分 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 结果 + */ + public int updateMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty); + + /** + * 批量删除辅助工时摊分 + * + * @param ids 需要删除的辅助工时摊分主键集合 + * @return 结果 + */ + public int deleteMesLineAssistantQtyByIds(String[] ids); + + /** + * 删除辅助工时摊分信息 + * + * @param id 辅助工时摊分主键 + * @return 结果 + */ + public int deleteMesLineAssistantQtyById(String id); + + public List selectEfficiencyHourList(MesLineAssistant mesLineAssistant); + + + public List selectEfficiencyDayList(MesLineAssistant mesLineAssistant); +} diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java new file mode 100644 index 00000000..9994afd4 --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesLineAssistantQtyServiceImpl.java @@ -0,0 +1,439 @@ +package com.op.mes.service.impl; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +import com.alibaba.nacos.common.utils.CollectionUtils; +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.mes.domain.MesLineAssistant; +import com.op.mes.domain.MesLineProduct; +import com.op.mes.domain.MesReportWork; +import com.op.mes.domain.vo.MesDailyEfficiencyVo; +import com.op.mes.domain.vo.MesLineAssistantQtyVo; +import com.op.system.api.domain.mes.ProOrderWorkorderDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.mes.mapper.MesLineAssistantQtyMapper; +import com.op.mes.domain.MesLineAssistantQty; +import com.op.mes.service.IMesLineAssistantQtyService; + + +/** + * 辅助工时摊分Service业务层处理 + * + * @author Open Platform + * @date 2025-03-21 + */ +@Service +public class MesLineAssistantQtyServiceImpl implements IMesLineAssistantQtyService { + @Autowired + private MesLineAssistantQtyMapper mesLineAssistantQtyMapper; + + /** + * 查询辅助工时摊分 + * + * @param id 辅助工时摊分主键 + * @return 辅助工时摊分 + */ + @Override + @DS("#header.poolName") + public MesLineAssistantQty selectMesLineAssistantQtyById(String id) { + return mesLineAssistantQtyMapper.selectMesLineAssistantQtyById(id); + } + + /** + * 查询辅助工时摊分列表 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 辅助工时摊分 + */ + @Override + @DS("#header.poolName") + public List selectMesLineAssistantQtyList(MesLineAssistantQty mesLineAssistantQty) { + return mesLineAssistantQtyMapper.selectMesLineAssistantQtyList(mesLineAssistantQty); + } + + /** + * 新增辅助工时摊分 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty) { + mesLineAssistantQty.setCreateTime(DateUtils.getNowDate()); + mesLineAssistantQty.setId(IdUtils.fastSimpleUUID()); + mesLineAssistantQty.setCreateBy(SecurityContextHolder.getUserName()); + //一个日期只能存一条 + String dateStr = mesLineAssistantQtyMapper.getHasdate(mesLineAssistantQty); + if(StringUtils.isNotBlank(dateStr)){ + return 0; + } +// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); +// String key = "#header.poolName"; +// mesLineAssistantQty.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", "")); + return mesLineAssistantQtyMapper.insertMesLineAssistantQty(mesLineAssistantQty); + } + + /** + * 修改辅助工时摊分 + * + * @param mesLineAssistantQty 辅助工时摊分 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateMesLineAssistantQty(MesLineAssistantQty mesLineAssistantQty) { + mesLineAssistantQty.setUpdateTime(DateUtils.getNowDate()); + return mesLineAssistantQtyMapper.updateMesLineAssistantQty(mesLineAssistantQty); + } + + /** + * 批量删除辅助工时摊分 + * + * @param ids 需要删除的辅助工时摊分主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesLineAssistantQtyByIds(String[] ids) { + return mesLineAssistantQtyMapper.deleteMesLineAssistantQtyByIds(ids); + } + + /** + * 删除辅助工时摊分信息 + * + * @param id 辅助工时摊分主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteMesLineAssistantQtyById(String id) { + return mesLineAssistantQtyMapper.deleteMesLineAssistantQtyById(id); + } + + /**辅助工时摊分方式**/ + @Override + @DS("#header.poolName") + public List selectEfficiencyHourList(MesLineAssistant mesLineAssistant) { + List dtos = mesLineAssistantQtyMapper.selectEfficiencyHourList(mesLineAssistant); + if(CollectionUtils.isEmpty(dtos)){ + return null; + } + Map assistMaps = mesLineAssistantQtyMapper.getAssistMaps(mesLineAssistant); + if(assistMaps.isEmpty()){ + return dtos; + } + //班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155 + mesLineAssistant.setPostId("10000150"); + BigDecimal monitorHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000168"); + BigDecimal groupleadeHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000478"); + BigDecimal materialHour= mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000271"); + BigDecimal pillMgrHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000155"); + BigDecimal pillDisHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + BigDecimal allProHours = BigDecimal.ZERO; + for(MesLineAssistantQtyVo assistdto:dtos){ + //产品工时(用母单的) + BigDecimal hours = mesLineAssistantQtyMapper.getHoursByOrderCode(assistdto.getWorkorderCode()); + hours = hours==null?BigDecimal.ZERO:hours; + assistdto.setProductHour(hours.toString()); + allProHours = allProHours.add(hours); + if(!assistMaps.isEmpty()){ + MesLineAssistantQty manQty = assistMaps.get(mesLineAssistant.getProductDateStr()); + if(manQty!=null){ + //班长用人=当日人数/线体数 + assistdto.setMonitorQty(new BigDecimal(manQty.getMonitorQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + //班长工时=当日考勤小时数/线体数 + assistdto.setMonitorHour( + monitorHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + //组长用人=当日人数/线体数 + assistdto.setGroupleaderQty(new BigDecimal(manQty.getGroupleaderQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + //组长工时=当日考勤小时数/线体数 + assistdto.setGroupLeaderHour( + groupleadeHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + //物料员用人=当日人数/线体数 + assistdto.setMaterialQty(new BigDecimal(manQty.getMaterialQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + //物料员工时=当日考勤小时数/线体数 + assistdto.setMaterialHour( + materialHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + //药管员用人=当日人数/线体数 + assistdto.setPillMgrQty(new BigDecimal(manQty.getPillMgrQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + //药管员工时=当日考勤小时数/线体数 + assistdto.setPillMgrHour( + pillMgrHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + //配药员用人=当日人数/线体数 + assistdto.setPillDisQty(new BigDecimal(manQty.getPillDisQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + //配药员工时=当日考勤小时数/线体数 + assistdto.setPillDisHour( + pillDisHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + } + } + } + for(MesLineAssistantQtyVo assistdto:dtos){ + //工时占比 + assistdto.setHourRatio(new BigDecimal(assistdto.getProductHour()) + .multiply(new BigDecimal("100.00")) + .divide(allProHours,2,BigDecimal.ROUND_HALF_UP) + .toString()+"%" + ); + //辅助工时合计 + assistdto.setMonitorHour(StringUtils.isEmpty(assistdto.getMonitorHour())?"0":assistdto.getMonitorHour()); + assistdto.setGroupLeaderHour(StringUtils.isEmpty(assistdto.getGroupLeaderHour())?"0":assistdto.getGroupLeaderHour()); + assistdto.setMaterialHour(StringUtils.isEmpty(assistdto.getMaterialHour())?"0":assistdto.getMaterialHour()); + assistdto.setPillMgrHour(StringUtils.isEmpty(assistdto.getPillMgrHour())?"0":assistdto.getPillMgrHour()); + assistdto.setPillDisHour(StringUtils.isEmpty(assistdto.getPillDisHour())?"0":assistdto.getPillDisHour()); + assistdto.setAssistHourSum( + new BigDecimal(assistdto.getMonitorHour()) + .add(new BigDecimal(assistdto.getGroupLeaderHour())) + .add(new BigDecimal(assistdto.getMaterialHour())) + .add(new BigDecimal(assistdto.getPillMgrHour())) + .add(new BigDecimal(assistdto.getPillDisHour())) + .toString() + ); + } + + MesLineAssistantQtyVo assistdto0 = new MesLineAssistantQtyVo(); + //assistdto0.setProductDate(dtos.get(0).getProductDate()); + //assistdto0.setFactoryCode(dtos.get(0).getFactoryCode()); + //assistdto0.setCarCode(dtos.get(0).getCarCode()); + assistdto0.setLineCode(dtos.size()+""); + assistdto0.setProductName(dtos.size()+""); + assistdto0.setProductHour(allProHours.toString()); + assistdto0.setHourRatio("100%"); + assistdto0.setAssistHourSum( + monitorHour.add(groupleadeHour).add(materialHour).add(pillMgrHour).add(pillDisHour).toString() + ); + MesLineAssistantQty manQty = assistMaps.get(mesLineAssistant.getProductDateStr()); + assistdto0.setMonitorQty(manQty.getMonitorQty().toString()); + assistdto0.setMonitorHour(monitorHour.toString()); + assistdto0.setGroupleaderQty(manQty.getGroupleaderQty().toString()); + assistdto0.setGroupLeaderHour(groupleadeHour.toString()); + assistdto0.setMaterialQty(manQty.getMaterialQty().toString()); + assistdto0.setMaterialHour(materialHour.toString()); + assistdto0.setPillMgrQty(manQty.getPillMgrQty().toString()); + assistdto0.setPillMgrHour(pillMgrHour.toString()); + assistdto0.setPillDisQty(manQty.getPillDisQty().toString()); + assistdto0.setPillDisHour(pillDisHour.toString()); + dtos.add(assistdto0); + return dtos; + } + /**生产日效率报表**/ + @Override + @DS("#header.poolName") + public List selectEfficiencyDayList(MesLineAssistant mesLineAssistant) { + List dtos = mesLineAssistantQtyMapper.selectEfficiencyDayList(mesLineAssistant); + if (CollectionUtils.isEmpty(dtos)) { + return null; + } + Map assistMaps = mesLineAssistantQtyMapper.getAssistMaps(mesLineAssistant); + if (assistMaps.isEmpty()) { + return dtos; + } + for(MesDailyEfficiencyVo effdto:dtos) { + //计划产量(件/PC)(用母单的) + BigDecimal planQty = mesLineAssistantQtyMapper.getPlanQtyByOrderCode(effdto.getWorkorderCode()); + effdto.setPlanQty(planQty.toString()); + //实际产量(件) + BigDecimal actQty = mesLineAssistantQtyMapper.getActQtyByOrderCode(effdto.getWorkorderCode()); + actQty = actQty==null?BigDecimal.ZERO:actQty; + effdto.setActQty(actQty.toString()); + //实际产量(PC)=规格*实际产量(件) + effdto.setActQtySon(actQty.multiply(new BigDecimal(effdto.getSpec())).toString()); + //产量达成率 = 实际产量(件)/计划产量(件/PC) + effdto.setCompleteRate( + actQty.multiply(new BigDecimal("100")) + .divide(planQty,2,BigDecimal.ROUND_HALF_UP).toString()); + //标准效率、标准用人、标准工时 + MesLineProduct mesStandar = mesLineAssistantQtyMapper.getStandarInfo(effdto); + if(mesStandar != null){ + /****************一线****************/ + //一线标准效率(PC/H) + effdto.setStandEff(mesStandar.getHourEfficiency().toString()); + //一线标准用人 + effdto.setStandMan(mesStandar.getUseMan().toString()); + //一线标准工时=实际产量(PC)/标准工艺效率(PC/H) + effdto.setStandHour( + new BigDecimal(effdto.getActQtySon()) + .divide(mesStandar.getHourEfficiency(),2,BigDecimal.ROUND_HALF_UP).toString() + ); + //一线实际用人(子单) + MesReportWork actManSon = mesLineAssistantQtyMapper.getSonActManByOrderCode(effdto.getWorkorderCode()); + if(actManSon != null){ + effdto.setActMan(actManSon.getUseMan().toString()); + //一线实际工时(子单) + effdto.setActHour(actManSon.getWorkTime().toString()); + //一线工时合计=实际用人*产品实际工时 + effdto.setOneHourSum( + new BigDecimal(actManSon.getUseMan()) + .multiply(actManSon.getWorkTime()).toString() + ); + } + //一线标准效率=实际产量(件)/标准用人/产品标准工时 + if(new BigDecimal(effdto.getStandMan()).compareTo(BigDecimal.ZERO)!=0 + &&new BigDecimal(effdto.getStandHour()).compareTo(BigDecimal.ZERO)!=0){ + effdto.setOneStandEff(actQty + .divide(new BigDecimal(effdto.getStandMan()),4,BigDecimal.ROUND_HALF_UP) + .divide(new BigDecimal(effdto.getStandHour()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + }else{ + effdto.setOneStandEff("0"); + } + + //一线实际效率=实际产量(件)/一线工时合计 + if(StringUtils.isNotBlank(effdto.getOneHourSum())&& + new BigDecimal(effdto.getOneHourSum()).compareTo(BigDecimal.ZERO) !=0){ + effdto.setOneActEff(actQty.divide(new BigDecimal(effdto.getOneHourSum()),2,BigDecimal.ROUND_HALF_UP).toString()); + }else{ + effdto.setOneActEff("0"); + } + //效率达成率=一线实际效率/一线标准效率 + if(new BigDecimal(effdto.getOneStandEff().replace("%","")).compareTo(BigDecimal.ZERO)!=0){ + effdto.setEffRate( + (new BigDecimal(effdto.getOneActEff().replace("%",""))) + .multiply(new BigDecimal("100")) + .divide(new BigDecimal(effdto.getOneStandEff().replace("%","")),2,BigDecimal.ROUND_HALF_UP) + +"%" + ); + }else{ + effdto.setEffRate("0"); + } + } + } + /****************辅助****************/ + //班长10000150 车间组长10000168 物料员10000478 药管员10000271 配药员10000155 + mesLineAssistant.setPostId("10000150"); + BigDecimal monitorHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000168"); + BigDecimal groupleadeHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000478"); + BigDecimal materialHour= mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000271"); + BigDecimal pillMgrHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + mesLineAssistant.setPostId("10000155"); + BigDecimal pillDisHour = mesLineAssistantQtyMapper.getKqHourMaps(mesLineAssistant); + //辅助用人合计 + BigDecimal assisManSum = BigDecimal.ZERO; + //辅助工时合计 + BigDecimal assisHourSum = BigDecimal.ZERO; + + for(MesDailyEfficiencyVo effdto:dtos){ + //产品工时(用母单的) + if(!assistMaps.isEmpty()){ + MesLineAssistantQty manQty = assistMaps.get(mesLineAssistant.getProductDateStr()); + if(manQty!=null){ + //班长用人=当日人数/线体数 + effdto.setMonitorQty(new BigDecimal(manQty.getMonitorQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + assisManSum = assisManSum.add(new BigDecimal(effdto.getMonitorQty()));//DOSUM; + //班长工时=当日考勤小时数/线体数 + effdto.setMonitorHour( + monitorHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + assisHourSum = assisHourSum.add(new BigDecimal(effdto.getMonitorHour()));//DOSUM; + //组长用人=当日人数/线体数 + effdto.setGroupleaderQty(new BigDecimal(manQty.getGroupleaderQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + assisManSum = assisManSum.add(new BigDecimal(effdto.getGroupleaderQty()));//DOSUM; + //组长工时=当日考勤小时数/线体数 + effdto.setGroupleaderHour( + groupleadeHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + assisHourSum = assisHourSum.add(new BigDecimal(effdto.getGroupleaderHour()));//DOSUM; + //物料员用人=当日人数/线体数 + effdto.setMaterialQty(new BigDecimal(manQty.getMaterialQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + assisManSum = assisManSum.add(new BigDecimal(effdto.getMaterialQty()));//DOSUM; + //物料员工时=当日考勤小时数/线体数 + effdto.setMaterialHour( + materialHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + assisHourSum = assisHourSum.add(new BigDecimal(effdto.getMaterialHour()));//DOSUM; + //药管员用人=当日人数/线体数 + effdto.setPillMgrQty(new BigDecimal(manQty.getPillMgrQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + assisManSum = assisManSum.add(new BigDecimal(effdto.getPillMgrQty()));//DOSUM; + //药管员工时=当日考勤小时数/线体数 + effdto.setPillMgrHour( + pillMgrHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + assisHourSum = assisHourSum.add(new BigDecimal(effdto.getPillMgrHour()));//DOSUM; + //配药员用人=当日人数/线体数 + effdto.setPillDisQty(new BigDecimal(manQty.getPillDisQty()) + .divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP) + .toString() + ); + assisManSum = assisManSum.add(new BigDecimal(effdto.getPillDisQty()));//DOSUM; + //配药员工时=当日考勤小时数/线体数 + effdto.setPillDisHour( + pillDisHour.divide(new BigDecimal(dtos.size()),2,BigDecimal.ROUND_HALF_UP).toString()); + assisHourSum = assisHourSum.add(new BigDecimal(effdto.getPillDisHour()));//DOSUM; + //辅助用人合计 + effdto.setAssisManSum(assisManSum.toString()); + //辅助工时合计 + effdto.setAssisHourSum(assisHourSum.toString()); + /******************一线+辅助******************/ + //总工时=一线合计工时+辅助工时合计 + effdto.setOneHourSum(StringUtils.isEmpty(effdto.getOneHourSum())?"0":effdto.getOneHourSum()); + effdto.setAssisHourSum(StringUtils.isEmpty(effdto.getAssisHourSum())?"0":effdto.getAssisHourSum()); + effdto.setHourSum(new BigDecimal(effdto.getOneHourSum()).add(new BigDecimal(effdto.getAssisHourSum())).toString()); + //目标效率=效率提升基数*(提升目标+1) + effdto.setEffUpBase(StringUtils.isEmpty(effdto.getEffUpBase())?"0":effdto.getEffUpBase()); + effdto.setUpGoal(StringUtils.isEmpty(effdto.getUpGoal())?"0":effdto.getUpGoal()); + effdto.setGoalRate(new BigDecimal(effdto.getEffUpBase()) + .multiply(new BigDecimal(effdto.getUpGoal()).add(new BigDecimal("1"))).toString()); + //实际效率=实际产量(件)/总工时 + if(new BigDecimal(effdto.getHourSum()).compareTo(BigDecimal.ZERO)!=0){ + effdto.setActRate(new BigDecimal(effdto.getActQty()) + .divide(new BigDecimal(effdto.getHourSum()),2,BigDecimal.ROUND_HALF_UP).toString()); + }else{ + effdto.setActRate("0"); + } + + //效率提升率=实际效率/效率提升基数-1 + if(StringUtils.isNotBlank(effdto.getEffUpBase())&& + new BigDecimal(effdto.getEffUpBase()).compareTo(BigDecimal.ZERO)!=0 + ){ + effdto.setEffUpRate( + new BigDecimal(effdto.getActRate()) + .multiply(new BigDecimal("100")) + .divide(new BigDecimal(effdto.getEffUpBase()),2,BigDecimal.ROUND_HALF_UP) + .subtract(new BigDecimal("100"))+"%" + ); + } + } + + } + } + return dtos; + } +} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml new file mode 100644 index 00000000..ce049510 --- /dev/null +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesLineAssistantQtyMapper.xml @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, factory_code, product_date, monitor_qty, groupLeader_qty, + material_qty, pill_mgr_qty, pill_dis_qty, attr1, attr2, attr3, attr4, create_by, + create_time, update_by, update_time + from mes_line_assistant_qty + + + + + + + + + + + + + + + + + + insert into mes_line_assistant_qty + + id, + + factory_code, + + product_date, + + monitor_qty, + + groupLeader_qty, + + material_qty, + + pill_mgr_qty, + + pill_dis_qty, + + attr1, + + attr2, + + attr3, + + attr4, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{id}, + + #{factoryCode}, + + #{productDate}, + + #{monitorQty}, + + #{groupleaderQty}, + + #{materialQty}, + + #{pillMgrQty}, + + #{pillDisQty}, + + #{attr1}, + + #{attr2}, + + #{attr3}, + + #{attr4}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update mes_line_assistant_qty + + factory_code = + #{factoryCode}, + + product_date = + #{productDate}, + + monitor_qty = + #{monitorQty}, + + groupLeader_qty = + #{groupleaderQty}, + + material_qty = + #{materialQty}, + + pill_mgr_qty = + #{pillMgrQty}, + + pill_dis_qty = + #{pillDisQty}, + + attr1 = + #{attr1}, + + attr2 = + #{attr2}, + + attr3 = + #{attr3}, + + attr4 = + #{attr4}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete from mes_line_assistant_qty where id = #{id} + + + + delete from mes_line_assistant_qty where id in + + #{id} + + + diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskInventoryServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskInventoryServiceImpl.java index 5543b31d..a71dfd99 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskInventoryServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskInventoryServiceImpl.java @@ -130,7 +130,7 @@ public class QcCheckTaskInventoryServiceImpl implements IQcCheckTaskInventorySer @Override @DS("#header.poolName") public int insertQcCheckTaskInventory(QcCheckTaskInventory qcCheckTaskInventory) { - logger.info("库存检验任务创建参数:"+JSONObject.toJSONString(qcCheckTaskInventory)); + //logger.info("库存检验任务创建参数:"+JSONObject.toJSONString(qcCheckTaskInventory)); String factoryCode = ""; if (StringUtils.isNotBlank(qcCheckTaskInventory.getFactoryCode())) { DynamicDataSourceContextHolder.push("ds_" + qcCheckTaskInventory.getFactoryCode()); @@ -433,7 +433,7 @@ public class QcCheckTaskInventoryServiceImpl implements IQcCheckTaskInventorySer dto.setCreateBy(dto.getApplicant());//创建人 qcCheckTaskInventoryMapper.insertQcCheckOaTask(dto); - logger.info("++++++++++++oa发起仓库检验任务生成" + m + "++++++++++++++"); + //logger.info("++++++++++++oa发起仓库检验任务生成" + m + "++++++++++++++"); return success(); } @@ -449,9 +449,9 @@ public class QcCheckTaskInventoryServiceImpl implements IQcCheckTaskInventorySer ccTask.setCheckType("checkTypeCC");//库存检验 ccTask.setFactoryCode(poolName.replace("ds_","")); int m = insertQcCheckTaskInventory(ccTask); - logger.info("++++++++++++仓库检验任务生成" + m + "++++++++++++++"); + //logger.info("++++++++++++仓库检验任务生成" + m + "++++++++++++++"); } - logger.info("++++++++++++" + poolName + "++++仓库检验任务结束++++++++++"); + //logger.info("++++++++++++" + poolName + "++++仓库检验任务结束++++++++++"); } }