报表的开发

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

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

@ -1,8 +1,5 @@
package com.foreverwin.mesnac.anomaly.mapper; 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.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -17,9 +14,9 @@ import java.util.Map;
@Repository @Repository
public interface ReportMapper { 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, List<Map<String,Object>> surplusReturnTable(@Param("site")String site, @Param("locale")String locale,
@Param("item")String item, @Param("itemDescription")String itemDescription); @Param("item")String item, @Param("itemDescription")String itemDescription);

@ -1,9 +1,5 @@
package com.foreverwin.mesnac.anomaly.service; 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.List;
import java.util.Map; import java.util.Map;
@ -13,9 +9,9 @@ import java.util.Map;
* @Since 2021-08-23 * @Since 2021-08-23
*/ */
public interface ReportService { 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); List<Map<String, Object>> surplusReturnTable(String item, String itemDescription);

@ -1,9 +1,7 @@
package com.foreverwin.mesnac.anomaly.service.impl; 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.mapper.ReportMapper;
import com.foreverwin.mesnac.anomaly.service.ReportService; 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.NcCode;
import com.foreverwin.mesnac.meapi.model.NwaUser; import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NcCodeService; import com.foreverwin.mesnac.meapi.service.NcCodeService;
@ -42,22 +40,20 @@ public class ReportServiceImpl implements ReportService {
* @return * @return
*/ */
@Override @Override
public List<Map<String,Object>> findIntegrationLog(IntegrationLog integration) { public List<Map<String,Object>> findIntegrationLog(Map<String, Object> map) {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
integration.setSite(site); return reportMapper.findIntegrationLog(site,map);
return reportMapper.findIntegrationLog(integration);
} }
/** /**
* *
* @param partsManufacturing
* @return * @return
*/ */
@Override @Override
public List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing) { public List<Map<String, Object>> partsManufacturing(Map<String,Object> map) {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
String locale = LocaleContextHolder.getLocale().getLanguage(); 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 SELECT INTEGRATION_TYPE, CATEGORY, INTEGRATION_WAY,STATUS,REQUEST_DATE_TIME,TO_CHAR(RESULT_MESSAGE) RESULT_MESSAGE,TO_CHAR(PARAM) PARAM
FROM Z_INTEGRATION_LOG FROM Z_INTEGRATION_LOG
<where> <where>
SITE = #{integration.site} SITE = #{site}
<if test="integration.integrationType != null and integration.integrationType != ''"> <if test="param.integrationType != null and param.integrationType != ''">
AND INTEGRATION_TYPE = #{integration.integrationType} AND INTEGRATION_TYPE = #{param.integrationType}
</if> </if>
<if test="integration.integrationWay != null and integration.integrationWay != ''"> <if test="param.integrationWay != null and param.integrationWay != ''">
AND INTEGRATION_WAY = #{integration.integrationWay} AND INTEGRATION_WAY = #{param.integrationWay}
</if> </if>
<if test="integration.status != null and integration.status != ''"> <if test="param.status != null and param.status != ''">
AND STATUS = #{integration.status} AND STATUS = #{param.status}
</if> </if>
<if test="integration.startDateTime != null"> <if test="param.startDateTime != null">
AND REQUEST_DATE_TIME &gt;= #{integration.startDateTime} AND REQUEST_DATE_TIME &gt;= TO_DATE(#{param.startDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
<if test="integration.endDateTime != null"> <if test="param.endDateTime != null">
AND REQUEST_DATE_TIME &lt;= #{integration.endDateTime} AND REQUEST_DATE_TIME &lt;= TO_DATE(#{param.endDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
<if test="integration.param != null and integration.param != ''"> <if test="param.param != null and param.param != ''">
AND PARAM LIKE '%${integration.param}%' AND PARAM LIKE '%${param.param}%'
</if> </if>
</where> </where>
ORDER BY REQUEST_DATE_TIME DESC ORDER BY REQUEST_DATE_TIME DESC
</select> </select>
<select id="partsManufacturing" resultType="Map"> <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 , 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.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 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' LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = S.SHOP_ORDER_BO AND CF."ATTRIBUTE" = 'ITEM_NUMBER'
<where> <where>
S.SITE = #{site} S.SITE = #{site}
<if test="partsManufacturing != null"> <if test="param != null">
<if test="partsManufacturing.itemNumber != null and partsManufacturing.itemNumber != ''"> <if test="param.itemNumber != null and partparamsManufacturing.itemNumber != ''">
AND CF.VALUE LIKE '%${partsManufacturing.itemNumber}%' AND CF.VALUE LIKE '%${param.itemNumber}%'
</if> </if>
<if test="partsManufacturing.shopOrder != null and partsManufacturing.shopOrder != ''"> <if test="param.shopOrder != null and param.shopOrder != ''">
AND ZSD.SHOP_ORDER LIKE '%${partsManufacturing.shopOrder}%' AND ZSD.SHOP_ORDER LIKE '%${param.shopOrder}%'
</if> </if>
<if test="partsManufacturing.item != null and partsManufacturing.item != ''"> <if test="param.item != null and param.item != ''">
AND I.ITEM LIKE '%${partsManufacturing.item}%' AND I.ITEM LIKE '%${param.item}%'
</if> </if>
<if test="partsManufacturing.itemDescription != null and partsManufacturing.itemDescription != ''"> <if test="param.itemDescription != null and param.itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${partsManufacturing.itemDescription}%' AND IT.DESCRIPTION LIKE '%${param.itemDescription}%'
</if> </if>
<if test="partsManufacturing.startDateTime != null"> <if test="param.startDateTime != null">
AND ZSD.ACTUAL_START_DATE &gt;= #{partsManufacturing.startDateTime} AND ZSD.ACTUAL_START_DATE &gt;= TO_DATE(#{param.startDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
<if test="partsManufacturing.endDateTime != null"> <if test="param.endDateTime != null">
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= #{partsManufacturing.endDateTime} AND ZSD.ACTUAL_COMPLETE_DATE &lt;= TO_DATE(#{param.endDateTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
</if> </if>
</where> </where>
@ -73,7 +74,7 @@
<select id="surplusReturnTable" resultType="map"> <select id="surplusReturnTable" resultType="map">
SELECT ZSR.INVENTORY INVENTORY,ZSR.ITEM_BO ITEM_BO,IT.DESCRIPTION ITEM_DESCRIPTION,ZSR.LENGHT LENGHT, 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 FROM
Z_SURPLUS_RETURN ZSR Z_SURPLUS_RETURN ZSR
INNER JOIN ITEM I ON I.HANDLE = ZSR.ITEM_BO INNER JOIN ITEM I ON I.HANDLE = ZSR.ITEM_BO
@ -100,7 +101,7 @@
END WORK_CENTER_DESCRIPTION, END WORK_CENTER_DESCRIPTION,
ZRRT.RESOURCE_NO,R.DESCRIPTION RESOURCE_DESCRIPTION,ZRRT.NC_CODE_NO, /*不良代码描述,维修人员*/ ZRRT.RESOURCE_NO,R.DESCRIPTION RESOURCE_DESCRIPTION,ZRRT.NC_CODE_NO, /*不良代码描述,维修人员*/
ZRRT.PRELIMINARY_REASON ,ZRRT.DEAL_WAY ,ZRRT.DEAL_WAY_DESCRIPTION , 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 CASE WHEN ZRITS.ITEM_BO != 'NULL' THEN IT.DESCRIPTION
ELSE ZRITS.DESCRIPTION ELSE ZRITS.DESCRIPTION
END ITEM_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 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 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 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 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' LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = ZRITS.ITEM_BO AND CF."ATTRIBUTE" = 'MAT_SPEC'

Loading…
Cancel
Save