|
@ -1,10 +1,21 @@ |
|
|
package com.kms.site.service; |
|
|
package com.kms.site.service; |
|
|
|
|
|
|
|
|
|
|
|
import com.jianwei.common.core.domain.AjaxResult; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import com.jianwei.common.core.service.BaseService; |
|
|
import com.jianwei.common.core.service.BaseService; |
|
|
import com.kms.site.mapper.BsSgcEquipmentMonitoringMapper; |
|
|
import com.kms.site.mapper.BsSgcEquipmentMonitoringMapper; |
|
|
import com.kms.site.domain.BsSgcEquipmentMonitoring; |
|
|
import com.kms.site.domain.BsSgcEquipmentMonitoring; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
import java.time.LocalTime; |
|
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 生产物料监控Service接口 |
|
|
* 生产物料监控Service接口 |
|
|
* |
|
|
* |
|
@ -14,4 +25,32 @@ import com.kms.site.domain.BsSgcEquipmentMonitoring; |
|
|
@Service |
|
|
@Service |
|
|
public class BsSgcEquipmentMonitoringService extends BaseService<BsSgcEquipmentMonitoringMapper, BsSgcEquipmentMonitoring>{ |
|
|
public class BsSgcEquipmentMonitoringService extends BaseService<BsSgcEquipmentMonitoringMapper, BsSgcEquipmentMonitoring>{ |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
BsSgcEquipmentMonitoringMapper bsSgcEquipmentMonitoringMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<HashMap> getMaterialOutputStatistics(String proNo, String timeType) { |
|
|
|
|
|
LocalDateTime start = null; |
|
|
|
|
|
LocalDateTime now = LocalDate.now().atStartOfDay(); |
|
|
|
|
|
if(timeType.equals("1")){ //年
|
|
|
|
|
|
start = LocalDate.now().withDayOfYear(1).atStartOfDay(); |
|
|
|
|
|
timeType = "M"; |
|
|
|
|
|
}else if(timeType.equals("2")){ //月
|
|
|
|
|
|
start = LocalDate.now().withDayOfMonth(1).atStartOfDay(); |
|
|
|
|
|
timeType = "d"; |
|
|
|
|
|
}else if(timeType.equals("3")){ //日
|
|
|
|
|
|
LocalDate today = LocalDate.now(); |
|
|
|
|
|
// 当天的00:00:00
|
|
|
|
|
|
start = today.atStartOfDay(); |
|
|
|
|
|
// 当天的23:59:59
|
|
|
|
|
|
now = today.atTime(LocalTime.MAX); |
|
|
|
|
|
timeType = "HH"; |
|
|
|
|
|
} |
|
|
|
|
|
Date dstart = Date.from(start.atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
Date dnow = Date.from(now.atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
return bsSgcEquipmentMonitoringMapper.getMaterialOutputStatisticsForTimeType(proNo,timeType,dstart,dnow); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|