change - 首页接口

master
yinq 11 months ago
parent 3dc308e913
commit b2dcd36613

@ -38,6 +38,14 @@ public class BoardReportController extends BaseController {
}
/**
*
* @param paramMap
* @return
*/
@PostMapping("/homePageInterface")
public AjaxResult homePageInterface(@RequestBody HashMap<String, String> paramMap) {
return AjaxResult.success(boardReportService.homePageInterface(paramMap));
}
}

@ -21,6 +21,31 @@ public interface BoardReportMapper {
List<LinkedHashMap<String, Object>> generalInterfaceList(HashMap paramMap);
/**
*
* @param paramMap
* @return
*/
List<HashMap<String, Object>> homePageInterface(HashMap<String, String> paramMap);
/**
*
* @param paramMap
* @return
*/
List<HashMap<String, Object>> homeColumnarInterface(HashMap<String, String> paramMap);
/**
* 线
* @param paramMap
* @return
*/
List<HashMap<String, Object>> homeLineInterface(HashMap<String, String> paramMap);
/**
*
* @param paramMap
* @return
*/
List<HashMap<String, Object>> homePieChartInterface(HashMap<String, String> paramMap);
}

@ -21,6 +21,11 @@ public interface IBoardReportService {
List<LinkedHashMap<String, Object>> generalInterfaceList(HashMap paramMap);
/**
*
* @param paramMap
* @return
*/
HashMap<String, Object> homePageInterface(HashMap<String, String> paramMap);
}

@ -24,6 +24,7 @@ public class BoardReportServiceImpl implements IBoardReportService {
/**
* List
*
* @param paramMap
* @return
*/
@ -32,9 +33,49 @@ public class BoardReportServiceImpl implements IBoardReportService {
return boardReportMapper.generalInterfaceList(paramMap);
}
/**
*
*
* @param paramMap
* @return
*/
@Override
public HashMap<String, Object> homePageInterface(HashMap<String, String> paramMap) {
HashMap<String, Object> result = new HashMap<>();
List<HashMap<String, Object>> todayOrderList = boardReportMapper.homePageInterface(paramMap);
result.put("todayOrderList", todayOrderList);
if (todayOrderList.size() > 0) {
Long planOrderSum = 0L;
Long prodOrderSum = 0L;
Long planProductSum = 0L;
Long compProductSum = 0L;
for (HashMap<String, Object> map : todayOrderList) {
planOrderSum++;
if (Integer.parseInt(String.valueOf(map.get("COMPLETE_AMOUNT"))) > 0) {
prodOrderSum++;
}
Long orderAmount = Long.parseLong(String.valueOf(map.get("ORDER_AMOUNT")));
planProductSum += orderAmount;
Long completeAmount = Long.parseLong(String.valueOf(map.get("COMPLETE_AMOUNT")));
compProductSum += completeAmount;
}
result.put("planOrderSum", planOrderSum);
result.put("prodOrderSum", prodOrderSum);
result.put("planProductSum", planProductSum);
result.put("compProductSum", compProductSum);
}
List<HashMap<String, Object>> columnarList = boardReportMapper.homeColumnarInterface(paramMap);
result.put("columnarList", columnarList);
List<HashMap<String, Object>> lineList = boardReportMapper.homeLineInterface(paramMap);
result.put("lineList", lineList);
List<HashMap<String, Object>> pieList = boardReportMapper.homePieChartInterface(paramMap);
result.put("pieList", pieList);
return result;
}
}

@ -9,6 +9,49 @@
SELECT * FROM TABLE (${method})
</select>
<select id="homePageInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
select ROWNUM ROWSEQ,
boi.FACTORY_CODE,
bi.PRODUCT_LINE_NAME,
boi.ORDER_CODE,
boi.SALEORDER_CODE,
boi.MATERIAL_CODE,
boi.MATERIAL_NAME,
boi.ORDER_AMOUNT,
boi.COMPLETE_AMOUNT,
ROUND(boi.COMPLETE_AMOUNT / boi.ORDER_AMOUNT * 100, 0) || '%' RATE
from BASE_ORDERINFO boi
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
left join BASE_PRODUCTLINE bi ON bi.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
ORDER BY RATE
</select>
<select id="homeColumnarInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
SUM(boi.COMPLETE_AMOUNT) COMPLETE_AMOUNT,
ROUND(SUM(boi.COMPLETE_AMOUNT) / SUM(boi.ORDER_AMOUNT) * 100, 0) RATE
FROM BASE_ORDERINFO boi
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN TO_CHAR(SYSDATE - 2, 'YYYY-MM-DD') AND TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')
ORDER BY BEGIN_DATE
</select>
<select id="homeLineInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
ROUND(SUM(CASE WHEN boi.COMPLETE_AMOUNT = boi.ORDER_AMOUNT THEN 1 ELSE 0 END) / COUNT(*) * 100,
2) COMPLETE_AMOUNT
FROM BASE_ORDERINFO boi
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN TO_CHAR(SYSDATE - 2, 'YYYY-MM-DD') AND TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')
ORDER BY BEGIN_DATE
</select>
<select id="homePieChartInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT QUALITY_DEFECT_NAME,COUNT(*) SUM FROM
REPORT_QUALITY_INSPECTION
WHERE QUALITY_DEFECT_NAME IS NOT NULL
GROUP BY QUALITY_DEFECT_NAME
</select>
</mapper>

Loading…
Cancel
Save