| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.entity.MdcPassRate; |
| | | import org.jeecg.modules.mdc.entity.MdcStandardProcessDuration; |
| | | import org.jeecg.modules.mdc.mapper.MdcPassRateMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcPassRateService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, mdcPassRates); |
| | | return mv; |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal findProcessQuantity(String equipmentId, String validDate) { |
| | | String startTime = DateUtils.format(DateUtils.toDate(validDate + "-01 00:00:00", DateUtils.STR_DATE_TIME_SMALL), DateUtils.STR_DATE_TIME_SMALL); |
| | | LocalDate localDate = LocalDate.of(Integer.parseInt(validDate.split("-")[0]), Integer.parseInt(validDate.split("-")[1]), Integer.parseInt("01")).plusMonths(1); |
| | | String endTime = DateUtils.format(DateUtils.toDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00", DateUtils.STR_DATE_TIME_SMALL), DateUtils.STR_DATE_TIME_SMALL); |
| | | Integer result = this.baseMapper.findProcessQuantity(equipmentId, startTime, endTime); |
| | | return result == null ? new BigDecimal("0") : new BigDecimal(result); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal findUnqualifiedQuantity(String equipmentId, String validDate) { |
| | | String startTime = DateUtils.format(DateUtils.toDate(validDate + "-01 00:00:00", DateUtils.STR_DATE_TIME_SMALL), DateUtils.STR_DATE_TIME_SMALL); |
| | | LocalDate localDate = LocalDate.of(Integer.parseInt(validDate.split("-")[0]), Integer.parseInt(validDate.split("-")[1]), Integer.parseInt("01")).plusMonths(1); |
| | | String endTime = DateUtils.format(DateUtils.toDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " 00:00:00", DateUtils.STR_DATE_TIME_SMALL), DateUtils.STR_DATE_TIME_SMALL); |
| | | Integer result = this.baseMapper.findUnqualifiedQuantity(equipmentId, startTime, endTime); |
| | | return result == null ? new BigDecimal("0") : new BigDecimal(result); |
| | | } |
| | | } |