|
|
|
@ -9,6 +9,7 @@ import java.util.*;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.system.api.domain.quality.ChartDTO;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
@ -75,7 +76,7 @@ public class QcStaticTableController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("quality:gcTableProduce:list")
|
|
|
|
|
@GetMapping("/getProduceChartData")
|
|
|
|
|
public QcStaticTable getProduceList(QcStaticTable qcStaticTable) {
|
|
|
|
|
public QcStaticTable getProduceChartData(QcStaticTable qcStaticTable) {
|
|
|
|
|
QcStaticTable resultdto = new QcStaticTable();
|
|
|
|
|
//默认时间范围T 00:00:00~T+1 00:00:00
|
|
|
|
|
if(StringUtils.isEmpty(qcStaticTable.getYmArrayStart())){
|
|
|
|
@ -88,18 +89,22 @@ public class QcStaticTableController extends BaseController {
|
|
|
|
|
//xAxis;
|
|
|
|
|
if(qcStaticTable.getYmArrayStart().equals(qcStaticTable.getYmArrayEnd())){
|
|
|
|
|
/**月内每日**/
|
|
|
|
|
List<String> days = this.getXNames(qcStaticTable.getYmArrayStart(),qcStaticTable.getYmArrayEnd(),"ymd");
|
|
|
|
|
List<String> days = this.getXNames(qcStaticTable.getYmArrayStart()+"-01",
|
|
|
|
|
qcStaticTable.getYmArrayEnd()+"-01","ymd");
|
|
|
|
|
resultdto.setxAxis(days);
|
|
|
|
|
}else{
|
|
|
|
|
/**年内各月**/
|
|
|
|
|
List<String> months = this.getXNames(qcStaticTable.getYmArrayStart(),qcStaticTable.getYmArrayEnd(),"ym");
|
|
|
|
|
resultdto.setxAxis(months);
|
|
|
|
|
}
|
|
|
|
|
//series;//legend.data
|
|
|
|
|
List<QcStaticTable> seriesdtos= qcStaticTableService.getProduceChartData(qcStaticTable);
|
|
|
|
|
ChartDTO chartDTO = new ChartDTO();
|
|
|
|
|
for(QcStaticTable seriesdto:seriesdtos){
|
|
|
|
|
chartDTO.setName(seriesdto.getMaterialName());
|
|
|
|
|
chartDTO.setType("line");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<QcStaticTable> seriesdto= qcStaticTableService.selectQcStaticTableList(qcStaticTable);
|
|
|
|
|
//legend.data
|
|
|
|
|
|
|
|
|
|
//series;
|
|
|
|
|
resultdto.setSeries(null);
|
|
|
|
|
|
|
|
|
|
return resultdto;
|
|
|
|
@ -110,30 +115,32 @@ public class QcStaticTableController extends BaseController {
|
|
|
|
|
List<String> days = new ArrayList<String>();
|
|
|
|
|
DateFormat dateFormat = null;
|
|
|
|
|
try {
|
|
|
|
|
Calendar tempStart = null;
|
|
|
|
|
Calendar tempEnd = null;
|
|
|
|
|
if("ymd".equals(type)){
|
|
|
|
|
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
Date start = dateFormat.parse(startMonth);//开始
|
|
|
|
|
Date end = dateFormat.parse(endMonth);//结束
|
|
|
|
|
|
|
|
|
|
tempStart = Calendar.getInstance();
|
|
|
|
|
tempStart.setTime(start);
|
|
|
|
|
|
|
|
|
|
tempEnd = Calendar.getInstance();
|
|
|
|
|
tempEnd.setTime(end);
|
|
|
|
|
tempEnd.add(Calendar.MONTH, 1);
|
|
|
|
|
}else{
|
|
|
|
|
dateFormat = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
}
|
|
|
|
|
Date start = dateFormat.parse(startMonth);//开始
|
|
|
|
|
Date end = dateFormat.parse(endMonth);//结束
|
|
|
|
|
|
|
|
|
|
Date start = dateFormat.parse(startMonth);//开始
|
|
|
|
|
Date end = dateFormat.parse(endMonth);//结束
|
|
|
|
|
tempStart = Calendar.getInstance();
|
|
|
|
|
tempStart.setTime(start);
|
|
|
|
|
|
|
|
|
|
String endTimeStr1 = endMonth;
|
|
|
|
|
String[] endTime2 = endTimeStr1.split(" ");
|
|
|
|
|
String endTime3 = endTime2[1].split(":")[1];
|
|
|
|
|
if(Integer.parseInt(endTime3)!=0){
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
calendar.setTime(end);
|
|
|
|
|
calendar.add(Calendar.MONTH, 1);
|
|
|
|
|
end = calendar.getTime();
|
|
|
|
|
tempEnd = Calendar.getInstance();
|
|
|
|
|
tempEnd.setTime(end);
|
|
|
|
|
tempEnd.add(Calendar.MONTH, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Calendar tempStart = Calendar.getInstance();
|
|
|
|
|
tempStart.setTime(start);
|
|
|
|
|
|
|
|
|
|
Calendar tempEnd = Calendar.getInstance();
|
|
|
|
|
tempEnd.setTime(end);
|
|
|
|
|
while (tempStart.before(tempEnd)) {
|
|
|
|
|
days.add(dateFormat.format(tempStart.getTime()));
|
|
|
|
|
if("ymd".equals(type)) {
|
|
|
|
|