报表的开发

master
赵嘉伟 3 years ago
parent 13fbc7e94e
commit 17d393ba57

@ -6,9 +6,7 @@ package com.foreverwin.mesnac.anomaly.controller;
* @Since 2021-08-23
*/
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.anomaly.service.ReportService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,18 +23,18 @@ public class ReportController {
public ReportService reportService;
@PostMapping("/findIntegrationLog")
public R findIntegrationLog(@RequestBody IntegrationLog integration){
public R findIntegrationLog(@RequestBody(required = false)Map<String, Object> map){
try{
return R.ok(reportService.findIntegrationLog(integration));
return R.ok(reportService.findIntegrationLog(map));
}catch(Exception e){
return R.failed(e.getMessage());
}
}
@PostMapping("/partsManufacturing")
public R partsManufacturing(@RequestBody PartsManufacturing PartsManufacturing){
public R partsManufacturing(@RequestBody(required = false)Map<String, Object> map){
try{
return R.ok(reportService.partsManufacturing(PartsManufacturing));
return R.ok(reportService.partsManufacturing(map));
}catch(Exception e){
return R.failed(e.getMessage());
}
@ -57,7 +55,7 @@ public class ReportController {
* @return
*/
@PostMapping("/resourceRepair")
public R resourceRepair(@RequestBody(required = false)Map<String, Object> map){
public R resourceRepair(@RequestBody(required = false)Map map){
try{
return R.ok(reportService.resourceRepair(map));
}catch (Exception e){
@ -81,6 +79,4 @@ public class ReportController {
return R.failed(e.getMessage());
}
}
}

@ -1,8 +1,5 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -17,9 +14,9 @@ import java.util.Map;
@Repository
public interface ReportMapper {
List<Map<String,Object>> findIntegrationLog(@Param("integration") IntegrationLog integration);
List<Map<String,Object>> findIntegrationLog(@Param("site")String site,@Param("param") Map<String,Object> map);
List<Map<String, Object>> partsManufacturing(@Param("site")String site,@Param("locale")String locale, @Param("partsManufacturing") PartsManufacturing partsManufacturing);
List<Map<String, Object>> partsManufacturing(@Param("site")String site,@Param("locale")String locale, @Param("param") Map<String,Object> map);
List<Map<String,Object>> surplusReturnTable(@Param("site")String site, @Param("locale")String locale,
@Param("item")String item, @Param("itemDescription")String itemDescription);

@ -1,9 +1,5 @@
package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import java.util.List;
import java.util.Map;
@ -13,9 +9,9 @@ import java.util.Map;
* @Since 2021-08-23
*/
public interface ReportService {
List<Map<String,Object>> findIntegrationLog(IntegrationLog integration);
List<Map<String,Object>> findIntegrationLog(Map<String,Object> map);
List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing);
List<Map<String, Object>> partsManufacturing(Map<String,Object> map);
List<Map<String, Object>> surplusReturnTable(String item, String itemDescription);

@ -1,9 +1,7 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import com.foreverwin.mesnac.anomaly.dto.PartsManufacturing;
import com.foreverwin.mesnac.anomaly.mapper.ReportMapper;
import com.foreverwin.mesnac.anomaly.service.ReportService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.meapi.model.NcCode;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NcCodeService;
@ -42,22 +40,20 @@ public class ReportServiceImpl implements ReportService {
* @return
*/
@Override
public List<Map<String,Object>> findIntegrationLog(IntegrationLog integration) {
public List<Map<String,Object>> findIntegrationLog(Map<String, Object> map) {
String site = CommonMethods.getSite();
integration.setSite(site);
return reportMapper.findIntegrationLog(integration);
return reportMapper.findIntegrationLog(site,map);
}
/**
*
* @param partsManufacturing
* @return
*/
@Override
public List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing) {
public List<Map<String, Object>> partsManufacturing(Map<String,Object> map) {
String site = CommonMethods.getSite();
String locale = LocaleContextHolder.getLocale().getLanguage();
return reportMapper.partsManufacturing(site,locale,partsManufacturing);
return reportMapper.partsManufacturing(site,locale,map);
}
/**

@ -6,31 +6,32 @@
SELECT INTEGRATION_TYPE, CATEGORY, INTEGRATION_WAY,STATUS,REQUEST_DATE_TIME,TO_CHAR(RESULT_MESSAGE) RESULT_MESSAGE,TO_CHAR(PARAM) PARAM
FROM Z_INTEGRATION_LOG
<where>
SITE = #{integration.site}
<if test="integration.integrationType != null and integration.integrationType != ''">
AND INTEGRATION_TYPE = #{integration.integrationType}
SITE = #{site}
<if test="param.integrationType != null and param.integrationType != ''">
AND INTEGRATION_TYPE = #{param.integrationType}
</if>
<if test="integration.integrationWay != null and integration.integrationWay != ''">
AND INTEGRATION_WAY = #{integration.integrationWay}
<if test="param.integrationWay != null and param.integrationWay != ''">
AND INTEGRATION_WAY = #{param.integrationWay}
</if>
<if test="integration.status != null and integration.status != ''">
AND STATUS = #{integration.status}
<if test="param.status != null and param.status != ''">
AND STATUS = #{param.status}
</if>
<if test="integration.startDateTime != null">
AND REQUEST_DATE_TIME &gt;= #{integration.startDateTime}
<if test="param.startDateTime != null">
AND REQUEST_DATE_TIME &gt;= TO_DATE(#{param.startDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="integration.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{integration.endDateTime}
<if test="param.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= TO_DATE(#{param.endDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="integration.param != null and integration.param != ''">
AND PARAM LIKE '%${integration.param}%'
<if test="param.param != null and param.param != ''">
AND PARAM LIKE '%${param.param}%'
</if>
</where>
ORDER BY REQUEST_DATE_TIME DESC
</select>
<select id="partsManufacturing" resultType="Map">
SELECT CF.VALUE ITEM_NUMBER,ZSD.SHOP_ORDER SHOP_ORDER,I.ITEM ITEM,IT.DESCRIPTION ITEM_DESCRIPTION,SO.QTY_TO_BUILD SHOP_ORDER_QTY , ZSD.OPERATION ,OT.DESCRIPTION OPERATION_DESCRIPTION,
SELECT CF.VALUE ITEM_NUMBER,ZSD.SHOP_ORDER SHOP_ORDER,I.ITEM ITEM,IT.DESCRIPTION ITEM_DESCRIPTION,
SO.QTY_TO_BUILD SHOP_ORDER_QTY , ZSD.OPERATION ,OT.DESCRIPTION OPERATION_DESCRIPTION,
ZNU.FULL_NAME OPERATION_USER,ZSD.SFC SFC,ZSD.DISPATCH_STATUS ,
ZSD.EARLIEST_START_DATE EARLIEST_START_DATE,ZSD.LATEST_END_DATE LATEST_END_DATE,
ZSD.ACTUAL_START_DATE ACTUAL_START_DATE,ZSD.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE
@ -48,24 +49,24 @@
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = S.SHOP_ORDER_BO AND CF."ATTRIBUTE" = 'ITEM_NUMBER'
<where>
S.SITE = #{site}
<if test="partsManufacturing != null">
<if test="partsManufacturing.itemNumber != null and partsManufacturing.itemNumber != ''">
AND CF.VALUE LIKE '%${partsManufacturing.itemNumber}%'
<if test="param != null">
<if test="param.itemNumber != null and partparamsManufacturing.itemNumber != ''">
AND CF.VALUE LIKE '%${param.itemNumber}%'
</if>
<if test="partsManufacturing.shopOrder != null and partsManufacturing.shopOrder != ''">
AND ZSD.SHOP_ORDER LIKE '%${partsManufacturing.shopOrder}%'
<if test="param.shopOrder != null and param.shopOrder != ''">
AND ZSD.SHOP_ORDER LIKE '%${param.shopOrder}%'
</if>
<if test="partsManufacturing.item != null and partsManufacturing.item != ''">
AND I.ITEM LIKE '%${partsManufacturing.item}%'
<if test="param.item != null and param.item != ''">
AND I.ITEM LIKE '%${param.item}%'
</if>
<if test="partsManufacturing.itemDescription != null and partsManufacturing.itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${partsManufacturing.itemDescription}%'
<if test="param.itemDescription != null and param.itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${param.itemDescription}%'
</if>
<if test="partsManufacturing.startDateTime != null">
AND ZSD.ACTUAL_START_DATE &gt;= #{partsManufacturing.startDateTime}
<if test="param.startDateTime != null">
AND ZSD.ACTUAL_START_DATE &gt;= TO_DATE(#{param.startDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="partsManufacturing.endDateTime != null">
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= #{partsManufacturing.endDateTime}
<if test="param.endDateTime != null">
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= TO_DATE(#{param.endDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
</if>
</where>
@ -73,7 +74,7 @@
<select id="surplusReturnTable" resultType="map">
SELECT ZSR.INVENTORY INVENTORY,ZSR.ITEM_BO ITEM_BO,IT.DESCRIPTION ITEM_DESCRIPTION,ZSR.LENGHT LENGHT,
ZSR.WIDTH WIDTH,ZSR.NUMBERS NUMBERS,ZSR.QTY QTY,ZSR.CREATED_DATE_TIME CREATED_DATE_TIME
ZSR.WIDTH WIDTH,ZSR.NUMBERS NUMBERS,ZSR.QTY QTY,ZSR.CREATED_DATE_TIME CREATED_DATE_TIME,I.ITEM ITEM
FROM
Z_SURPLUS_RETURN ZSR
INNER JOIN ITEM I ON I.HANDLE = ZSR.ITEM_BO
@ -100,7 +101,7 @@
END WORK_CENTER_DESCRIPTION,
ZRRT.RESOURCE_NO,R.DESCRIPTION RESOURCE_DESCRIPTION,ZRRT.NC_CODE_NO, /*不良代码描述,维修人员*/
ZRRT.PRELIMINARY_REASON ,ZRRT.DEAL_WAY ,ZRRT.DEAL_WAY_DESCRIPTION ,
ZRITS.ITEM_BO ITEM_BO,
I.ITEM ITEM,
CASE WHEN ZRITS.ITEM_BO != 'NULL' THEN IT.DESCRIPTION
ELSE ZRITS.DESCRIPTION
END ITEM_DESCRIPTION,
@ -123,6 +124,7 @@
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE AND WCT.LOCALE = #{locale}
LEFT JOIN WORK_CENTER_T WCT2 ON WCT2.WORK_CENTER_BO = WC2.HANDLE AND WCT2.LOCALE = #{locale}
LEFT JOIN Z_RESOURCE_INSPECT_TASK_SPARE ZRITS ON ZRITS.RESOURCE_INSPECT_TASK_BO = ZRRT.HANDLE
LEFT JOIN ITEM I ON I.HANDLE = ZRITS.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = ZRITS.ITEM_BO AND IT.LOCALE = #{locale}
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = ZRITS.ITEM_BO AND CF."ATTRIBUTE" = 'MAT_SPEC'

Loading…
Cancel
Save