临时任务统计报表v3

master
yinq 2 years ago
parent 42955f81d4
commit 49fd4cfa68

@ -67,12 +67,13 @@ public class TemporaryFixController {
.like(!StringUtil.isBlank(String.valueOf(paramMap.get("mapNo"))),"MAP_NO",String.valueOf(paramMap.get("mapNo")))
.like(!StringUtil.isBlank(String.valueOf(paramMap.get("operator"))),"OPERATOR",String.valueOf(paramMap.get("operator")))
.like(!StringUtil.isBlank(String.valueOf(paramMap.get("useDevice"))),"USE_DEVICE",String.valueOf(paramMap.get("useDevice")))
.like(!StringUtil.isBlank(String.valueOf(paramMap.get("entrustDate"))),"ENTRUST_DATE",String.valueOf(paramMap.get("entrustDate")))
.eq(!StringUtil.isBlank(String.valueOf(paramMap.get("uploadCenter"))),"UPLOAD_CENTER",String.valueOf(paramMap.get("uploadCenter")))
.ge(!StringUtil.isBlank(startDate),"ENTRUST_DATE", DateReportUtils.stringToDate(startDate + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(endDate),"ENTRUST_DATE",DateReportUtils.stringToDate(endDate + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.ge(!StringUtil.isBlank(createdTimeNew),"ENTRUST_DATE",DateReportUtils.stringToDate(createdTimeNew + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(createdTimeNew),"ENTRUST_DATE",DateReportUtils.stringToDate(createdTimeNew + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.orderByDesc("ENTRUST_DATE");
.ge(!StringUtil.isBlank(startDate),"CREATED_TIME", DateReportUtils.stringToDate(startDate + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(endDate),"CREATED_TIME",DateReportUtils.stringToDate(endDate + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.ge(!StringUtil.isBlank(createdTimeNew),"CREATED_TIME",DateReportUtils.stringToDate(createdTimeNew + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(createdTimeNew),"CREATED_TIME",DateReportUtils.stringToDate(createdTimeNew + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.orderByDesc("CREATED_TIME");
result = temporaryFixService.list(queryWrapper);
return R.ok(result);
@ -99,12 +100,13 @@ public class TemporaryFixController {
.like(!StringUtil.isBlank(temporaryFix.getMapNo()),"MAP_NO",temporaryFix.getMapNo())
.like(!StringUtil.isBlank(temporaryFix.getOperator()),"OPERATOR",temporaryFix.getOperator())
.like(!StringUtil.isBlank(temporaryFix.getUseDevice()),"USE_DEVICE",temporaryFix.getUseDevice())
.like(!StringUtil.isBlank(temporaryFix.getEntrustDate()),"ENTRUST_DATE",temporaryFix.getEntrustDate())
.eq(!StringUtil.isBlank(temporaryFix.getUploadCenter()),"UPLOAD_CENTER",temporaryFix.getUploadCenter())
.ge(!StringUtil.isBlank(startDate),"ENTRUST_DATE", DateReportUtils.stringToDate(startDate + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(endDate),"ENTRUST_DATE",DateReportUtils.stringToDate(endDate + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.ge(!StringUtil.isBlank(createdTimeNew),"ENTRUST_DATE",DateReportUtils.stringToDate(createdTimeNew + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(createdTimeNew),"ENTRUST_DATE",DateReportUtils.stringToDate(createdTimeNew + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.orderByDesc("ENTRUST_DATE");
.ge(!StringUtil.isBlank(startDate),"CREATED_TIME", DateReportUtils.stringToDate(startDate + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(endDate),"CREATED_TIME",DateReportUtils.stringToDate(endDate + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.ge(!StringUtil.isBlank(createdTimeNew),"CREATED_TIME",DateReportUtils.stringToDate(createdTimeNew + " 00:00:00","yyyy-MM-dd HH:mm:ss"))
.le(!StringUtil.isBlank(createdTimeNew),"CREATED_TIME",DateReportUtils.stringToDate(createdTimeNew + " 23:59:59","yyyy-MM-dd HH:mm:ss"))
.orderByDesc("CREATED_TIME");
result = temporaryFixService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
@ -141,7 +143,7 @@ public class TemporaryFixController {
String user = CommonMethods.getUser();
temporaryFix.setUpdatedBy(user);
temporaryFix.setUpdatedTime(now);
if (temporaryFix.getAmount() != null && temporaryFix.getSingleWorkHours() != null && temporaryFix.getAmount() != null && temporaryFix.getSingleWorkHours() != null){
if (temporaryFix.getAmount() != null && temporaryFix.getSingleWorkHours() != null && temporaryFix.getAmount() != "" && temporaryFix.getSingleWorkHours() != ""){
temporaryFix.setTotalWorkHours(String.valueOf(Float.valueOf(temporaryFix.getAmount()) * Float.valueOf(temporaryFix.getSingleWorkHours())));
}

@ -46,7 +46,7 @@ public class TemporaryFix extends Model<TemporaryFix> {
@TableField("ENTRUST_DATE")
@ExcelColumn(value = "委托日期")
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime entrustDate;
private String entrustDate;
/**
* /
*/

@ -615,14 +615,7 @@ public class ReportServiceImpl implements ReportService {
Float unWorkHours6 = 0.00f;
Float unWorkHours7 = 0.00f;
Float unWorkHours8 = 0.00f;
Float weekRate1 = 0.00f;
Float weekRate2 = 0.00f;
Float weekRate3 = 0.00f;
Float weekRate4 = 0.00f;
Float weekRate5 = 0.00f;
Float weekRate6 = 0.00f;
Float weekRate7 = 0.00f;
Float weekRate8 = 0.00f;
for (Map<String, String> map : resultList) {
tardinessWork += Float.valueOf(String.valueOf(map.get("tardinessWork")));
if (!StringUtils.isBlank(map.get("weekCapacity"))){
@ -636,14 +629,7 @@ public class ReportServiceImpl implements ReportService {
unWorkHours6 += Float.valueOf(String.valueOf(map.get("unWorkHours6")));
unWorkHours7 += Float.valueOf(String.valueOf(map.get("unWorkHours7")));
unWorkHours8 += Float.valueOf(String.valueOf(map.get("unWorkHours8")));
weekRate1 += Float.valueOf(String.valueOf(map.get("weekRate1")).replace("%",""));
weekRate2 += Float.valueOf(String.valueOf(map.get("weekRate2")).replace("%",""));
weekRate3 += Float.valueOf(String.valueOf(map.get("weekRate3")).replace("%",""));
weekRate4 += Float.valueOf(String.valueOf(map.get("weekRate4")).replace("%",""));
weekRate5 += Float.valueOf(String.valueOf(map.get("weekRate5")).replace("%",""));
weekRate6 += Float.valueOf(String.valueOf(map.get("weekRate6")).replace("%",""));
weekRate7 += Float.valueOf(String.valueOf(map.get("weekRate7")).replace("%",""));
weekRate8 += Float.valueOf(String.valueOf(map.get("weekRate8")).replace("%",""));
}
countMap.put("tardinessWork",String.format("%.2f",tardinessWork));
countMap.put("weekCapacity",String.format("%.2f",weekCapacity));
@ -655,14 +641,14 @@ public class ReportServiceImpl implements ReportService {
countMap.put("unWorkHours6",String.format("%.2f",unWorkHours6));
countMap.put("unWorkHours7",String.format("%.2f",unWorkHours7));
countMap.put("unWorkHours8",String.format("%.2f",unWorkHours8));
countMap.put("weekRate1",String.format("%.2f",weekRate1 / resultList.size()) + "%");
countMap.put("weekRate2",String.format("%.2f",weekRate2 / resultList.size()) + "%");
countMap.put("weekRate3",String.format("%.2f",weekRate3 / resultList.size()) + "%");
countMap.put("weekRate4",String.format("%.2f",weekRate4 / resultList.size()) + "%");
countMap.put("weekRate5",String.format("%.2f",weekRate5 / resultList.size()) + "%");
countMap.put("weekRate6",String.format("%.2f",weekRate6 / resultList.size()) + "%");
countMap.put("weekRate7",String.format("%.2f",weekRate7 / resultList.size()) + "%");
countMap.put("weekRate8",String.format("%.2f",weekRate8 / resultList.size()) + "%");
countMap.put("weekRate1",String.format("%.2f",unWorkHours1 / weekCapacity * 100 ) + "%");
countMap.put("weekRate2",String.format("%.2f",unWorkHours2 / weekCapacity * 100 ) + "%");
countMap.put("weekRate3",String.format("%.2f",unWorkHours3 / weekCapacity * 100 ) + "%");
countMap.put("weekRate4",String.format("%.2f",unWorkHours4 / weekCapacity * 100 ) + "%");
countMap.put("weekRate5",String.format("%.2f",unWorkHours5 / weekCapacity * 100 ) + "%");
countMap.put("weekRate6",String.format("%.2f",unWorkHours6 / weekCapacity * 100 ) + "%");
countMap.put("weekRate7",String.format("%.2f",unWorkHours7 / weekCapacity * 100 ) + "%");
countMap.put("weekRate8",String.format("%.2f",unWorkHours8 / weekCapacity * 100 ) + "%");
resultList.add(countMap);
return resultList;
@ -709,18 +695,6 @@ public class ReportServiceImpl implements ReportService {
Float workHours10 = 0.00f;
Float workHours11= 0.00f;
Float workHours12 = 0.00f;
Float monthRate1 = 0.00f;
Float monthRate2 = 0.00f;
Float monthRate3 = 0.00f;
Float monthRate4 = 0.00f;
Float monthRate5 = 0.00f;
Float monthRate6 = 0.00f;
Float monthRate7 = 0.00f;
Float monthRate8 = 0.00f;
Float monthRate9 = 0.00f;
Float monthRate10 = 0.00f;
Float monthRate11 = 0.00f;
Float monthRate12 = 0.00f;
for (Map<String, String> map : result) {
tardinessWork += Float.valueOf(String.valueOf(map.get("tardinessWork")));
if (!StringUtils.isBlank(map.get("monthCapacity"))){
@ -738,18 +712,6 @@ public class ReportServiceImpl implements ReportService {
workHours10 += Float.valueOf(String.valueOf(map.get("workHours10")));
workHours11 += Float.valueOf(String.valueOf(map.get("workHours11")));
workHours12 += Float.valueOf(String.valueOf(map.get("workHours12")));
monthRate1 += Float.valueOf(String.valueOf(map.get("monthRate1")).replace("%",""));
monthRate2 += Float.valueOf(String.valueOf(map.get("monthRate2")).replace("%",""));
monthRate3 += Float.valueOf(String.valueOf(map.get("monthRate3")).replace("%",""));
monthRate4 += Float.valueOf(String.valueOf(map.get("monthRate4")).replace("%",""));
monthRate5 += Float.valueOf(String.valueOf(map.get("monthRate5")).replace("%",""));
monthRate6 += Float.valueOf(String.valueOf(map.get("monthRate6")).replace("%",""));
monthRate7 += Float.valueOf(String.valueOf(map.get("monthRate7")).replace("%",""));
monthRate8 += Float.valueOf(String.valueOf(map.get("monthRate8")).replace("%",""));
monthRate9 += Float.valueOf(String.valueOf(map.get("monthRate9")).replace("%",""));
monthRate10 += Float.valueOf(String.valueOf(map.get("monthRate10")).replace("%",""));
monthRate11 += Float.valueOf(String.valueOf(map.get("monthRate11")).replace("%",""));
monthRate12 += Float.valueOf(String.valueOf(map.get("monthRate12")).replace("%",""));
}
countMap.put("tardinessWork",String.format("%.2f",tardinessWork));
countMap.put("monthCapacity",String.format("%.2f",monthCapacity));
@ -765,18 +727,18 @@ public class ReportServiceImpl implements ReportService {
countMap.put("workHours10",String.format("%.2f",workHours10));
countMap.put("workHours11",String.format("%.2f",workHours11));
countMap.put("workHours12",String.format("%.2f",workHours12));
countMap.put("monthRate1",String.format("%.2f",monthRate1 / result.size()) + "%");
countMap.put("monthRate2",String.format("%.2f",monthRate2 / result.size()) + "%");
countMap.put("monthRate3",String.format("%.2f",monthRate3 / result.size()) + "%");
countMap.put("monthRate4",String.format("%.2f",monthRate4 / result.size()) + "%");
countMap.put("monthRate5",String.format("%.2f",monthRate5 / result.size()) + "%");
countMap.put("monthRate6",String.format("%.2f",monthRate6 / result.size()) + "%");
countMap.put("monthRate7",String.format("%.2f",monthRate7 / result.size()) + "%");
countMap.put("monthRate8",String.format("%.2f",monthRate8 / result.size()) + "%");
countMap.put("monthRate9",String.format("%.2f",monthRate9 / result.size()) + "%");
countMap.put("monthRate10",String.format("%.2f",monthRate10 / result.size()) + "%");
countMap.put("monthRate11",String.format("%.2f",monthRate11 / result.size()) + "%");
countMap.put("monthRate12",String.format("%.2f",monthRate12 / result.size()) + "%");
countMap.put("monthRate1",String.format("%.2f",workHours1 / monthCapacity * 100 )+ "%");
countMap.put("monthRate2",String.format("%.2f",workHours2 / monthCapacity * 100 )+ "%");
countMap.put("monthRate3",String.format("%.2f",workHours3 / monthCapacity * 100 )+ "%");
countMap.put("monthRate4",String.format("%.2f",workHours4 / monthCapacity * 100 )+ "%");
countMap.put("monthRate5",String.format("%.2f",workHours5 / monthCapacity * 100 )+ "%");
countMap.put("monthRate6",String.format("%.2f",workHours6 / monthCapacity * 100 )+ "%");
countMap.put("monthRate7",String.format("%.2f",workHours7 / monthCapacity * 100 )+ "%");
countMap.put("monthRate8",String.format("%.2f",workHours8 / monthCapacity * 100 )+ "%");
countMap.put("monthRate9",String.format("%.2f",workHours9 / monthCapacity * 100 )+ "%");
countMap.put("monthRate10",String.format("%.2f",workHours10 / monthCapacity * 100 ) + "%");
countMap.put("monthRate11",String.format("%.2f",workHours11 / monthCapacity * 100 ) + "%");
countMap.put("monthRate12",String.format("%.2f",workHours12 / monthCapacity * 100 ) + "%");
result.add(countMap);
return result;
}
@ -886,13 +848,11 @@ public class ReportServiceImpl implements ReportService {
}
countMap.put("sumQTY",String.format("%.2f",sumQTY));
countMap.put("sumDoneQTY",String.format("%.2f",sumDoneQTY));
countMap.put("QTYrate",String.format("%.2f",QTYrate / resultList.size()) + "%");
countMap.put("QTYrate",String.format("%.2f",sumDoneQTY / sumQTY * 100) + "%");
countMap.put("sumHours",String.format("%.2f",sumHours));
countMap.put("sumDoneHours",String.format("%.2f",sumDoneHours));
countMap.put("HOURSrate",String.format("%.2f",HOURSrate / resultList.size()) + "%");
countMap.put("HOURSrate",String.format("%.2f",sumDoneHours / sumHours * 100) + "%");
resultList.add(countMap);
return resultList;
}
@ -927,10 +887,10 @@ public class ReportServiceImpl implements ReportService {
}
countMap.put("sumQTY",String.format("%.2f",sumQTY));
countMap.put("sumDoneQTY",String.format("%.2f",sumDoneQTY));
countMap.put("QTYrate",String.format("%.2f",QTYrate / resultList.size()) + "%");
countMap.put("QTYrate",String.format("%.2f",sumDoneQTY / sumQTY * 100) + "%");
countMap.put("sumHours",String.format("%.2f",sumHours));
countMap.put("sumDoneHours",String.format("%.2f",sumDoneHours));
countMap.put("HOURSrate",String.format("%.2f",HOURSrate / resultList.size()) + "%");
countMap.put("HOURSrate",String.format("%.2f",sumDoneHours / sumHours * 100) + "%");
resultList.add(countMap);
return resultList;

@ -75,7 +75,7 @@ public class TemporaryFixServiceImpl extends ServiceImpl<TemporaryFixMapper, Tem
temporaryFix.setCreatedBy(user);
temporaryFix.setUpdatedBy(user);
temporaryFix.setUpdatedTime(now);
if (temporaryFix.getAmount() != null && temporaryFix.getSingleWorkHours() != null && temporaryFix.getAmount() != null && temporaryFix.getSingleWorkHours() != null){
if (temporaryFix.getAmount() != null && temporaryFix.getSingleWorkHours() != null && temporaryFix.getAmount() != "" && temporaryFix.getSingleWorkHours() != ""){
temporaryFix.setTotalWorkHours(String.valueOf(Float.valueOf(temporaryFix.getAmount()) * Float.valueOf(temporaryFix.getSingleWorkHours())));
}
}
@ -100,10 +100,10 @@ public class TemporaryFixServiceImpl extends ServiceImpl<TemporaryFixMapper, Tem
try {
CommonsMultipartFile multipartFile = new CommonsMultipartFile(fileItem);
List<TemporaryFix> temporaryFixList = ExcelUtils.readExcel(fileType, TemporaryFix.class, multipartFile, null);
temporaryFixList = this.temporaryFixImportFile(temporaryFixList);
if (temporaryFixList.size() == 0){
return R.failed("导出数据失败0条数据");
}
temporaryFixList = this.temporaryFixImportFile(temporaryFixList);
boolean result = this.saveBatch(temporaryFixList);
return R.ok(result);
} catch (Exception e) {

@ -1248,7 +1248,7 @@
AND WIP.SFC like '%${SFC}%'
</if>
</where>
ORDER BY endPlanTime DESC
ORDER BY WIP.item,WIP.workOrder,WIP.rate
</select>
<select id="selectCurrentPlanTime" parameterType="java.util.HashMap" resultType="java.util.Map">
@ -1966,107 +1966,12 @@
</select>
<select id="capacityLoad" resultType="java.util.Map">
--设备产能负荷看板看板接口
SELECT WIP.*
FROM (WITH WEEK AS (
SELECT TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') WEEK0,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 1 WEEK1,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 2 WEEK2,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 3 WEEK3,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 4 WEEK4,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 5 WEEK5,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 6 WEEK6,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 7 WEEK7,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 8 WEEK8,
TO_DATE(TO_CHAR(sysdate - 30, 'yyyy-MM-dd'), 'yyyy-MM-dd') MONTH_AGO
FROM DUAL)
SELECT wct.DESCRIPTION "descripion",
rt.RESOURCE_TYPE "resourceType",
rt.DESCRIPTION "resourceDescription",
row_number() over(ORDER BY case
when rt.RESOURCE_TYPE = 'HJ_6106HJH1' then 1
when rt.RESOURCE_TYPE = 'JJ_6106SLJ2' then 2
when rt.RESOURCE_TYPE = 'JJ_6106SXJ4' then 3
when rt.RESOURCE_TYPE = 'JJ_6106SLJ2' then 4
when rt.RESOURCE_TYPE = 'JJ_6106SXJ1' then 5
when rt.RESOURCE_TYPE = 'JJ_6106LJJ2' then 6
when rt.RESOURCE_TYPE = 'JJ_6106LTJ1' then 7
when rt.RESOURCE_TYPE = 'RC_6202PQF' then 8
ELSE 9 END ASC) ROWW,
SUM(CASE
WHEN TO_DATE(TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW')) >
(ZSD.PLANNED_COMP_DATE + 8 / 24) AND ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND ZSD.DISPATCH_STATUS != 'COMPLETE'
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "tardinessWork",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK0) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK1)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity1",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK1) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK2)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity2",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK2) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK3)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity3",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK3) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK4)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity4",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK4) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK5)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity5",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK5) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK6)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity6",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK6) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK7)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity7",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(WEEK.WEEK7) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(WEEK.WEEK8)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planCapacity8",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(MONTH_AGO) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(sysdate)
THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planHours",
SUM(CASE
WHEN ZSD.PLANNED_COMP_DATE >= TO_DATE(MONTH_AGO) AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(sysdate)
AND zsd.DISPATCH_STATUS != 'COMPLETE' THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END) "planUndoneHours",
MAX(CF.VALUE) "standardWeekCapacity",
MAX(CF2.VALUE) "standardMonthCapacity"
FROM Z_SFC_DISPATCH ZSD
LEFT JOIN WORK_CENTER wc ON zsd.WORK_CENTER = wc.WORK_CENTER
LEFT JOIN WORK_CENTER_T wct ON wc.HANDLE = wct.WORK_CENTER_BO
LEFT JOIN RESOURCE_TYPE rt ON rt.RESOURCE_TYPE = ZSD.RESOURCE_TYPE
CROSS JOIN WEEK
LEFT JOIN OPERATION O ON O.RESOURCE_TYPE_BO = rt.HANDLE AND O.SITE = rt.SITE
LEFT JOIN CUSTOM_FIELDS CF ON CF.ATTRIBUTE = 'WEEK_CAPACITY'
AND CF.HANDLE = o.HANDLE
LEFT JOIN CUSTOM_FIELDS CF2 ON CF2.ATTRIBUTE = 'MONTH_CAPACITY'
AND CF2.HANDLE = o.HANDLE
WHERE zsd.DISPATCH_STATUS != 'CANCEL'
AND (rt.RESOURCE_TYPE = 'HJ_6106HJH1'
OR rt.RESOURCE_TYPE = 'RC_6202PQF'
OR rt.RESOURCE_TYPE = 'JJ_6106SXJ4'
OR rt.RESOURCE_TYPE = 'JJ_6106SXJ2'
OR rt.RESOURCE_TYPE = 'JJ_6106SXJ1'
OR rt.RESOURCE_TYPE = 'JJ_6106SLJ2'
OR rt.RESOURCE_TYPE = 'JJ_6106LTJ1'
OR rt.RESOURCE_TYPE = 'JJ_6106LJJ2')
AND CF.VALUE IS NOT NULL
AND CF2.VALUE IS NOT NULL
SELECT *
FROM capacityLoad_board_View V
WHERE 1=1
<if test="workCenter != null and workCenter != ''">
AND wc.WORK_CENTER = #{workCenter}
AND V."descripion" = #{workCenter}
</if>
GROUP BY wct.DESCRIPTION, rt.RESOURCE_TYPE, rt.DESCRIPTION
) WIP
WHERE 8 >= ROWNUM
ORDER BY ROWW
</select>
<select id="sixShopOrderQTY" resultType="java.util.LinkedHashMap">
SELECT COUNT(WIP.SHOP_ORDER) "shopOrderQTY",

@ -38,7 +38,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ENTRUST_DATE, ENTRUST_UNIT, DUTY_PERSON, DUTY_REASON, PROJECT_NUMBER, QUALITY_REVIEW_NUMBER, WORK_CONTACT_NUMBER, MATERIAL_CODE, MATERIAL_NAME, MAP_NO, AMOUNT, SINGLE_WORK_HOURS, TOTAL_WORK_HOURS, MACHINE_HOURS, OPERATOR, USE_DEVICE, DEVICE_TYPE, COST_CENTER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, UPLOAD_CENTER, UPLOAD_USER, CLASSIFY, DUTY_CLASSIFY, EMPLOY_PROPERTY, CENTER_CODE,row_number() over (ORDER BY ENTRUST_DATE DESC ) SEQ
HANDLE, SITE, ENTRUST_DATE, ENTRUST_UNIT, DUTY_PERSON, DUTY_REASON, PROJECT_NUMBER, QUALITY_REVIEW_NUMBER, WORK_CONTACT_NUMBER, MATERIAL_CODE, MATERIAL_NAME, MAP_NO, AMOUNT, SINGLE_WORK_HOURS, TOTAL_WORK_HOURS, MACHINE_HOURS, OPERATOR, USE_DEVICE, DEVICE_TYPE, COST_CENTER, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, UPLOAD_CENTER, UPLOAD_USER, CLASSIFY, DUTY_CLASSIFY, EMPLOY_PROPERTY, CENTER_CODE,row_number() over (ORDER BY CREATED_TIME DESC ) SEQ
</sql>
<!-- BaseMapper标准查询/修改/删除 -->

Loading…
Cancel
Save