Merge remote-tracking branch 'origin/master'

master
yangwl 3 years ago
commit ea28c1c9bf

@ -384,4 +384,17 @@ public class ReportController {
}
}
/**
*
* @param
* @return
*/
@GetMapping("/manufacturingPlanning")
public R manufacturingPlanning(String workCenter){
try {
return R.ok(reportService.manufacturingPlanning(workCenter));
} catch (Exception e) {
return R.failed(e.getMessage());
}
}
}

@ -158,4 +158,14 @@ public interface ReportMapper {
*/
List<Map<String, String>> capacityLoad(String workCenter);
Map<String, String> sixShopOrderQTY(String workCenter);
List<Map<String, String>> nearFifteenDayRate(String workCenter);
List<Map<String, String>> departmentForNonconformity(String workCenter);
List<Map<String, String>> workshopDeliveryRateList(String workCenter);
List<Map<String, String>> NCTop5RateList(String workCenter);
}

@ -173,4 +173,12 @@ public interface ReportService {
* @return
*/
Map<String, Object> capacityLoad(String workCenter);
/**
*
* @param workCenter
* @return
*/
Map<String, Object> manufacturingPlanning(String workCenter);
}

@ -519,7 +519,7 @@ public class ReportServiceImpl implements ReportService {
String site = CommonMethods.getSite();
paramMap.put("site", site);
paramMap.put("locale", LocaleContextHolder.getLocale().getLanguage());
if (!StringUtils.isBlank(String.valueOf(paramMap.get("week")))){
if (String.valueOf(paramMap.get("week")).equals("true")){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@ -720,7 +720,9 @@ public class ReportServiceImpl implements ReportService {
return "橡塑";
} else if (career.indexOf("非公路") != -1) {
return "非公路";
} else if (career.indexOf("塞班") != -1) {
}else if (career.indexOf("研究院") != -1) {
return "研究院";
}else if (career.indexOf("塞班") != -1) {
return "塞班";
} else {
return "外部";
@ -760,43 +762,139 @@ public class ReportServiceImpl implements ReportService {
*/
@Override
public Map<String, Object> capacityLoad(String workCenter) {
List<Map<String, String>> capacityLoadList = reportMapper.capacityLoad(workCenter);
HashMap<String, Object> result = new HashMap<>();
/*Map<String, List<Map<String, String>>> resourceListMap = capacityLoadList.stream().
collect(Collectors.groupingBy(e -> e.get("resourceDescription")));*/
//八个柱状图计划工时list、计划产能、未完成工时、设备描述
/*for (String resource : resourceListMap.keySet()) {
HashMap<String, Object> resourceMap = new HashMap<>();
//计划工时
ArrayList<String> planList = new ArrayList<>();
List<Map<String, String>> mapList = resourceListMap.get(resource);
mapList.forEach(e -> {
e.
});*/
capacityLoadList.forEach(e -> {
HashMap<String, Object> resourceMap = new HashMap<>();
//计划工时
ArrayList<String> planList = new ArrayList<>();
planList.add(e.get("planCapacity1"));
planList.add(e.get("planCapacity2"));
planList.add(e.get("planCapacity3"));
planList.add(e.get("planCapacity4"));
planList.add(e.get("planCapacity5"));
planList.add(e.get("planCapacity6"));
planList.add(e.get("planCapacity7"));
planList.add(e.get("planCapacity8"));
resourceMap.put("planCapacity",planList);
//计划产能
resourceMap.put("standardWeekCapacity",e.get("standardWeekCapacity"));
//未完成工时
resourceMap.put("tardinessWork",e.get("tardinessWork"));
//
});
List<Map<String, String>> capacityLoadList = null;
try {
capacityLoadList = reportMapper.capacityLoad(workCenter);
Float planCapacity = 0f;
Float standardCapacity = 0f;
ArrayList<HashMap<String, Object> > eightList = new ArrayList<>();
ArrayList<Float> planHoursList = new ArrayList<>();
ArrayList<Float> planUndoneHoursList = new ArrayList<>();
for (Map<String, String> map : capacityLoadList) {
HashMap<String, Object> resourceMap = new HashMap<>();
//计划工时
ArrayList<String> planList = new ArrayList<>();
planList.add(String.valueOf(map.get("planCapacity1")));
planList.add(String.valueOf(map.get("planCapacity2")));
planList.add(String.valueOf(map.get("planCapacity3")));
planList.add(String.valueOf(map.get("planCapacity4")));
planList.add(String.valueOf(map.get("planCapacity5")));
planList.add(String.valueOf(map.get("planCapacity6")));
planList.add(String.valueOf(map.get("planCapacity7")));
planList.add(String.valueOf(map.get("planCapacity8")));
resourceMap.put("planCapacityList",planList);
//标准产能
resourceMap.put("standardWeekCapacity",map.get("standardWeekCapacity"));
//未完成工时
//resourceMap.put("tardinessWork",map.get("tardinessWork"));
//设备描述
resourceMap.put("resourceDescription",map.get("resourceDescription"));
//总标准产能、总计划产能
for (String et : planList) {
planCapacity += Float.parseFloat(et);
}
standardCapacity += Float.valueOf(String.valueOf(map.get("standardWeekCapacity")));
//比率 计划工时 / 标准产能 * 100
ArrayList<String> rateList = new ArrayList<>();
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity1"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity2"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity3"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity4"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity5"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity6"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity7"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
rateList.add(String.valueOf(Float.valueOf(String.valueOf(map.get("planCapacity8"))) / Float.valueOf(String.valueOf(Float.valueOf(map.get("standardWeekCapacity")))) * 100));
resourceMap.put("planCapacityRateList",rateList);
planHoursList.add(Float.valueOf(String.valueOf(map.get("planHours"))));
planUndoneHoursList.add(Float.valueOf(String.valueOf(map.get("planUndoneHours"))));
eightList.add(resourceMap);
}
result.put("planCapacity",String.format("%.2f", planCapacity));
result.put("standardCapacity",String.format("%.2f", standardCapacity));
//八个柱状图
result.put("eightList",eightList);
//中心 计划工时、未完成工时List
result.put("planHoursList",planHoursList);
result.put("planUndoneHoursList",planUndoneHoursList);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
return null;
/**
*
* @param workCenter
* @return
*/
@Override
public Map<String, Object> manufacturingPlanning(String workCenter) {
HashMap<String, Object> result = new HashMap<>();
Map<String, String> sixMap = reportMapper.sixShopOrderQTY(workCenter);
ArrayList<Integer> sixList = new ArrayList<>();
for (String key : sixMap.keySet()) {
sixList.add(Integer.valueOf(String.valueOf(sixMap.get(key))));
}
result.put("sixList",sixList);
List<Map<String, String>> nearRateList = reportMapper.nearFifteenDayRate(workCenter);
ArrayList<Float> rateList = new ArrayList<>();
ArrayList<Float> itemsList = new ArrayList<>();
for (Map<String, String> nearRateMap : nearRateList) {
rateList.add(Float.parseFloat(String.valueOf(nearRateMap.get("qualifiedRate"))));
itemsList.add(Float.parseFloat(String.valueOf(nearRateMap.get("ItemsQTY"))));
}
result.put("rateList",rateList);
result.put("itemsList",itemsList);
//不合格责任部门分布
List<Map<String, String>> departmentList = reportMapper.departmentForNonconformity(workCenter);
List<String> monthOldList = departmentList.stream().map(e -> { return e.get("month"); })
.distinct().sorted().collect(Collectors.toList());
ArrayList<String> monthList = new ArrayList<>();
monthList.addAll(monthOldList);
Map<String, List<Map<String, String>>> descriptionMap = departmentList.stream().
collect(Collectors.groupingBy(e -> e.get("description")));
ArrayList<HashMap<String, Object>> descriptionValueList = new ArrayList<>();
for (String description : descriptionMap.keySet()) {
List<Map<String, String>> maps = descriptionMap.get(description);
HashMap<String, Object> map = new HashMap<>();
ArrayList<String> QTYList = new ArrayList<>();
maps.forEach(e -> {
QTYList.add(String.valueOf(e.get("QTY")));
});
map.put("name",description);
map.put("value",QTYList);
descriptionValueList.add(map);
}
result.put("monthList",monthList);
result.put("descriptionValueList",descriptionValueList);
//一次性交付合格率
List<Map<String, String>> deliveryRateList = reportMapper.workshopDeliveryRateList(workCenter);
HashMap<String, List<String>> deliveryRateMap = new HashMap<>();
ArrayList<String> xDataNameList = new ArrayList<>();
ArrayList<String> yDataList = new ArrayList<>();
for (Map<String, String> map : deliveryRateList) {
xDataNameList.add(String.valueOf(map.get("month")));
yDataList.add(String.valueOf(map.get("rate")));
}
deliveryRateMap.put("xDataName",xDataNameList);
deliveryRateMap.put("yData",yDataList);
result.put("deliveryRate",deliveryRateMap);
//不合格TOP5比例图
List<Map<String, String>> ncTop5RateOldList = reportMapper.NCTop5RateList(workCenter).subList(0,5);
ArrayList<Map<String, Object>> ncTop5RateList = new ArrayList<>();
ncTop5RateOldList.forEach(e -> {
HashMap<String, Object> ncMap = new HashMap<>();
ncMap.put("name",String.valueOf(e.get("description")));
ncMap.put("y",Integer.valueOf(String.valueOf(e.get("QTY"))));
ncMap.put("h",Integer.valueOf(String.valueOf(e.get("QTY"))));
ncTop5RateList.add(ncMap);
});
result.put("ncTop5Rate",ncTop5RateList);
return result;
}
/**
@ -834,7 +932,6 @@ public class ReportServiceImpl implements ReportService {
List<Map<String, String>> dutyCauseTypeDescription = reportMapper.dutyCauseTypeDescription();
List<String> descriptionList = dutyCauseTypeDescription.stream().map(e -> e.get("DESCRIPTION")).collect(Collectors.toList());
List<String> numbersList = new LinkedList<>();
List<String> dutyCauseType = reportMapper.dutyCauseType(user);
for (String type : dutyCauseType) {

@ -1296,9 +1296,9 @@
</if>
AND ZSD.CREATED_DATE_TIME >= add_months(SYSDATE, -6)
GROUP BY ZSD.SFC))
SELECT COUNT(zab.NC_QTY) "abnormalQualityNumber",
SELECT SUM(zab.NC_QTY) "abnormalQualityNumber",
DECODE(MAX(acc.QTY), NULL, 0, MAX(acc.QTY)) "orderedTotalNumber",
DECODE(MAX(acc.QTY), NULL, 0.00, TO_CHAR(100 - COUNT(zab.NC_QTY) / MAX(acc.QTY) * 100, '99990.99')) || '%' "rate"
DECODE(MAX(acc.QTY), NULL, 0.00, TO_CHAR(100 - SUM(zab.NC_QTY) / MAX(acc.QTY) * 100, '99990.99')) || '%' "rate"
FROM Z_ABNORMAL_BILL zab
CROSS JOIN acc
WHERE zab.STATUS != 'Q'
@ -1750,11 +1750,11 @@
r.DESCRIPTION RESRCE_DESCRIPTION,
SUM(zsd.DISPATCH_QTY) SUM_QTY,
SUM(CASE
WHEN zsd.DISPATCH_STATUS = 'COMPLETE' AND SYSDATE > zsd.ACTUAL_COMPLETE_DATE THEN zsd.DISPATCH_QTY
WHEN zsd.DISPATCH_STATUS = 'COMPLETE' AND zsd.PLANNED_COMP_DATE > zsd.ACTUAL_COMPLETE_DATE THEN zsd.DISPATCH_QTY
ELSE 0 END) SUM_DONE_QTY,
SUM(zsd.PROD_HOURS) SUM_HOURS,
SUM(CASE
WHEN zsd.DISPATCH_STATUS = 'COMPLETE' AND SYSDATE > zsd.ACTUAL_COMPLETE_DATE THEN zsd.PROD_HOURS
WHEN zsd.DISPATCH_STATUS = 'COMPLETE' AND zsd.PLANNED_COMP_DATE > zsd.ACTUAL_COMPLETE_DATE THEN zsd.PROD_HOURS
ELSE 0 END) SUM_DONE_HOURS
FROM Z_SFC_DISPATCH zsd
LEFT JOIN WORK_CENTER wc ON zsd.WORK_CENTER = wc.WORK_CENTER
@ -1794,7 +1794,7 @@
it.DESCRIPTION "itemDescription",--物料描述
MIN(zsd.ACTUAL_START_DATE) "actualStartDate",--最小实际开始时间
MAX(zsd.ACTUAL_COMPLETE_DATE) "actualCompeteDate",--最大实际完成时间
TO_CHAR(MAX(zsd.ACTUAL_COMPLETE_DATE) - MIN(zsd.ACTUAL_START_DATE), '99990.99') "productProgress"
TO_CHAR(MAX(zsd.ACTUAL_COMPLETE_DATE) - MIN(zsd.ACTUAL_START_DATE), '99990.99') "productPmonthDeliveryRateReportrogress"
FROM Z_SFC_DISPATCH zsd
LEFT JOIN SFC s ON s.SFC = zsd.SFC AND s.SITE = zsd.SITE
LEFT JOIN SHOP_ORDER so ON so.SHOP_ORDER = zsd.SHOP_ORDER AND so.SITE = zsd.SITE
@ -1882,13 +1882,14 @@
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
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",
SELECT wct.DESCRIPTION "descripion",
rt.RESOURCE_TYPE "resourceType",
rt.DESCRIPTION "resourceDescription",
SUM(CASE
WHEN SYSDATE > ZSD.PLANNED_COMP_DATE THEN ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
WHEN SYSDATE > ZSD.PLANNED_COMP_DATE 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)
@ -1922,6 +1923,14 @@
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
@ -1935,7 +1944,6 @@
LEFT JOIN CUSTOM_FIELDS CF2 ON CF2.ATTRIBUTE = 'MONTH_CAPACITY'
AND CF2.HANDLE = 'OperationBO:1000,' || o.OPERATION || ',1.0'
WHERE zsd.DISPATCH_STATUS != 'CANCEL'
AND zsd.DISPATCH_STATUS != 'COMPLETE'
AND CF.VALUE IS NOT NULL
AND CF2.VALUE IS NOT NULL
<if test="workCenter != null and workCenter != ''">
@ -1945,4 +1953,99 @@
ORDER BY "planCapacity1" DESC ) WIP
WHERE 8 >= ROWNUM
</select>
<select id="sixShopOrderQTY" resultType="java.util.Map">
SELECT COUNT(WIP.SHOP_ORDER) "shopOrderQTY",
DECODE(SUM(WIP.SHOP_QTY),NULL,0,SUM(WIP.SHOP_QTY)) "sumQTY",
DECODE(SUM(WIP.ITEM_QTY),NULL,0,SUM(WIP.ITEM_QTY)) "sumItemQTY",
DECODE(SUM(WIP.WAIT_SHOP_QTY),NULL,0,SUM(WIP.WAIT_SHOP_QTY)) "waitShopQTY",
DECODE(SUM(WIP.WAIT_QTY),NULL,0,SUM(WIP.WAIT_QTY)) "waitQTY",
DECODE(SUM(WIP.IS_DONE_SHOP),NULL,0,SUM(WIP.IS_DONE_SHOP)) "doneShopQTY"
FROM (
SELECT ZT.SHOP_ORDER SHOP_ORDER,
SUM(S.QTY) SHOP_QTY,
COUNT(ROWNUM) ITEM_QTY,
SUM(CASE WHEN ZT.STATUS = 'NEW' THEN 1 ELSE 0 END ) WAIT_SHOP_QTY,
SUM(CASE WHEN ZT.STATUS = 'NEW' THEN S.QTY ELSE 0 END ) WAIT_QTY,
MAX(CASE WHEN ZT.STATUS = 'COMPLETE' THEN 1 ELSE 0 END ) IS_DONE_SHOP
FROM Z_INSPECTION_TASK ZT
INNER JOIN SFC S ON S.SFC = ZT.SFC AND S.SITE = ZT.SITE
WHERE TO_CHAR(SYSDATE, 'yyyy-MM-dd') = TO_CHAR(ZT.CREATED_DATE_TIME, 'yyyy-MM-dd')
GROUP BY ZT.SHOP_ORDER) WIP
</select>
<select id="nearFifteenDayRate" resultType="java.util.Map">
--近15天合格率
WITH FIRST_DATE AS (
SELECT TO_CHAR(SYSDATE + ROWNUM - 15, 'yyyy-MM-dd') DAY
FROM DUAL
CONNECT BY 15 >= ROWNUM
)
SELECT FIRST_DATE.DAY,
SUM(CASE WHEN ZT.HANDLE IS NOT NULL THEN 1 ELSE 0 END ) "ItemsQTY",
TO_CHAR(DECODE(SUM(CASE WHEN ZT.RESULT IS NOT NULL THEN 1 ELSE 0 END), 0, 0,
SUM(CASE WHEN ZT.RESULT = 'OK' THEN 1 ELSE 0 END) /
SUM(CASE WHEN ZT.RESULT IS NOT NULL THEN 1 ELSE 0 END))
* 100, '99990.99') "qualifiedRate"
FROM FIRST_DATE
LEFT JOIN Z_INSPECTION_TASK ZT ON FIRST_DATE.DAY = TO_CHAR(ZT.CREATED_DATE_TIME, 'yyyy-MM-dd')
GROUP BY FIRST_DATE.DAY
ORDER BY FIRST_DATE.DAY
</select>
<select id="departmentForNonconformity" resultType="java.util.Map">
-- 不合格责任部门分布
SELECT ZWIP.MONTH "month", WCT.DESCRIPTION "description",
SUM(CASE WHEN ZIT.SHOP_ORDER IS NOT NULL THEN 1 ELSE 0 END ) "QTY"
FROM (WITH MMONTH AS (
SELECT TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE), + ROWNUM - 12), 'yyyy-MM') MONTH
FROM DUAL
CONNECT BY 12 >= ROWNUM)
SELECT MMONTH.MONTH MONTH, ZT.WORK_CENTER ZWIP_CENTER
FROM Z_INSPECTION_TASK ZT
CROSS JOIN MMONTH
WHERE ZT.RESULT = 'NG'
GROUP BY MMONTH.MONTH, ZT.WORK_CENTER) ZWIP
LEFT JOIN (SELECT ZT.SHOP_ORDER,
ZT.WORK_CENTER,
MAX(TO_CHAR(TO_DATE(ZT.MODIFIED_DATE_TIME), 'yyyy-MM')) DATE_TIME
FROM Z_INSPECTION_TASK ZT
WHERE ZT.RESULT = 'NG'
GROUP BY ZT.SHOP_ORDER, ZT.WORK_CENTER) ZIT
ON ZIT.WORK_CENTER = ZWIP.ZWIP_CENTER AND ZIT.DATE_TIME = ZWIP.MONTH
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZWIP.ZWIP_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
WHERE WCT.DESCRIPTION IS NOT NULL
GROUP BY ZWIP.MONTH,WCT.DESCRIPTION
ORDER BY ZWIP.MONTH
</select>
<select id="workshopDeliveryRateList" resultType="java.util.Map">
-- 一次性交付合格率
WITH MMONTH AS (
SELECT TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE), + ROWNUM - 12), 'yyyy-MM') MONTH
FROM DUAL
CONNECT BY 12 >= ROWNUM)
SELECT MMONTH.MONTH "month",
TO_CHAR( SUM(CASE WHEN ZT.RESULT = 'OK' THEN S.QTY ELSE 0 END ) /
DECODE(SUM(CASE WHEN S.QTY IS NOT NULL THEN S.QTY ELSE 0 END),0,1,
SUM(CASE WHEN S.QTY IS NOT NULL THEN S.QTY ELSE 0 END)) * 100,'99990.99') "rate"
FROM MMONTH
LEFT JOIN Z_INSPECTION_TASK ZT ON MMONTH.MONTH = TO_CHAR(TO_DATE(ZT.MODIFIED_DATE_TIME), 'yyyy-MM')
LEFT JOIN SFC S ON S.SFC = ZT.SFC AND s.SITE = ZT.SITE
GROUP BY MMONTH.MONTH
ORDER BY MMONTH.MONTH
</select>
<select id="NCTop5RateList" resultType="java.util.Map">
SELECT WIP.DESCRIPTION "description",SUM(WIP.QTY) "QTY" FROM (
SELECT NG.DESCRIPTION DESCRIPTION,SUM(CASE WHEN NG.DESCRIPTION IS NOT NULL THEN 1 ELSE 0 END) QTY
FROM Z_INSPECTION_TASK zit
JOIN Z_ABNORMAL_BILL ZAB
ON zit.SFC = ZAB.SFC AND zit.SITE = ZAB.SITE AND zit.STEP_ID = ZAB.STEP_ID AND zab."TYPE" = 'Z'
LEFT JOIN Z_ABNORMAL_NC_CODE ZANC ON ZANC.ABNORMAL_BILL_BO = ZAB.HANDLE
LEFT JOIN NC_GROUP NG ON NG.NC_GROUP = ZANC.NC_CODE_GROUP
WHERE zit.RESULT = 'NG'
AND NG.DESCRIPTION IS NOT NULL
AND zit.MODIFIED_DATE_TIME > ADD_MONTHS(SYSDATE,-12)
GROUP BY zit.SFC,NG.DESCRIPTION) WIP
GROUP BY WIP.DESCRIPTION
ORDER BY "QTY" DESC
</select>
</mapper>

@ -229,7 +229,7 @@ public class ResrceController {
/**
*
*
*
* @param paramMap
* @return
*/
@ -246,7 +246,7 @@ public class ResrceController {
customFields.setValue(hashMap.get("weekCapacity"));
CustomFieldsList.add(customFields);
}
} else {
} else if (paramMap.get("capacity").equals("monthCapacity")){
for (HashMap<String, String> hashMap : resultList) {
CustomFields customFields = new CustomFields();
customFields.setHandle(HandleEnum.OPERATION.getHandle(CommonMethods.getSite(), hashMap.get("operation"),"1.0"));
@ -254,6 +254,14 @@ public class ResrceController {
customFields.setValue(hashMap.get("monthCapacity"));
CustomFieldsList.add(customFields);
}
}else if (paramMap.get("capacity").equals("dayCapacity")){
for (HashMap<String, String> hashMap : resultList) {
CustomFields customFields = new CustomFields();
customFields.setHandle(HandleEnum.OPERATION.getHandle(CommonMethods.getSite(), hashMap.get("operation"),"1.0"));
customFields.setAttribute("DAY_CAPACITY");
customFields.setValue(hashMap.get("dayCapacity"));
CustomFieldsList.add(customFields);
}
}
customFieldsService.saveOrUpdateCustomFields(CustomFieldsList);
return R.ok("保存成功");

Loading…
Cancel
Save