零件加工报表

master
赵嘉伟 3 years ago
parent f522d7d7db
commit 74c629c0ca

@ -30,4 +30,13 @@ public class Report {
return R.failed(e.getMessage());
}
}
@PostMapping("/partsManufacturing")
public R partsManufacturing(@RequestBody PartsManufacturing PartsManufacturing){
try{
return R.ok(reportService.partsManufacturing(PartsManufacturing));
}catch(Exception e){
return R.failed(e.getMessage());
}
}
}

@ -1,4 +1,4 @@
package com.foreverwin.mesnac.dispatch.dto;
package com.foreverwin.mesnac.anomaly.dto;
import java.time.LocalDateTime;

@ -16,4 +16,6 @@ import java.util.Map;
public interface ReportMapper {
List<Map<String,Object>> findIntegrationLog(@Param("integration") IntegrationLog integration);
List<Map<String, Object>> partsManufacturing(@Param("site")String site,@Param("locale")String locale, @Param("partsManufacturing") PartsManufacturing partsManufacturing);
}

@ -12,4 +12,6 @@ import java.util.Map;
*/
public interface ReportService {
List<Map<String,Object>> findIntegrationLog(IntegrationLog integration);
List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing);
}

@ -5,6 +5,7 @@ import com.foreverwin.mesnac.anomaly.service.ReportService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -23,10 +24,27 @@ public class ReportServiceImpl implements ReportService {
@Autowired
private ReportMapper reportMapper;
/**
*
* @param integration
* @return
*/
@Override
public List<Map<String,Object>> findIntegrationLog(IntegrationLog integration) {
String site = CommonMethods.getSite();
integration.setSite(site);
return reportMapper.findIntegrationLog(integration);
}
/**
*
* @param partsManufacturing
* @return
*/
@Override
public List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing) {
String site = CommonMethods.getSite();
String locale = LocaleContextHolder.getLocale().getLanguage();
return reportMapper.partsManufacturing(site,locale,partsManufacturing);
}
}

@ -28,4 +28,46 @@
</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,
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
FROM SFC S
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = S.SHOP_ORDER_BO
INNER JOIN ITEM I ON I.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale}
INNER JOIN Z_SFC_DISPATCH ZSD ON S.SFC = ZSD.SFC AND S.SITE = ZSD.SITE
AND ZSD.DISPATCH_SEQ = (
SELECT MAX(ZSD2.DISPATCH_SEQ) FROM Z_SFC_DISPATCH ZSD2 WHERE S.SFC = ZSD2.SFC AND S.SITE = ZSD2.SITE
)
INNER JOIN OPERATION O ON O.OPERATION = ZSD.OPERATION AND O.SITE = S.SITE AND O.CURRENT_REVISION = 'true'
INNER JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = #{locale}
INNER JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZSD.EMPLOYEE
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>
<if test="partsManufacturing.shopOrder != null and partsManufacturing.shopOrder != ''">
AND ZSD.SHOP_ORDER LIKE '%${partsManufacturing.shopOrder}%'
</if>
<if test="partsManufacturing.item != null and partsManufacturing.item != ''">
AND I.ITEM LIKE '%${partsManufacturing.item}%'
</if>
<if test="partsManufacturing.itemDescription != null and partsManufacturing.itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${partsManufacturing.itemDescription}%'
</if>
<if test="partsManufacturing.startDateTime != null">
AND ZSD.ACTUAL_START_DATE &gt;= #{partsManufacturing.startDateTime}
</if>
<if test="partsManufacturing.endDateTime != null">
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= #{partsManufacturing.endDateTime}
</if>
</if>
</where>
</select>
</mapper>

@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.dto.PartsManufacturing;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
@ -301,12 +300,5 @@ public class SfcDispatchController {
return R.ok(result);
}
@PostMapping("/partsManufacturing")
public R partsManufacturing(@RequestBody PartsManufacturing PartsManufacturing){
try{
return R.ok(sfcDispatchService.partsManufacturing(PartsManufacturing));
}catch(Exception e){
return R.failed(e.getMessage());
}
}
}

@ -2,14 +2,12 @@ package com.foreverwin.mesnac.dispatch.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.dto.PartsManufacturing;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -51,5 +49,4 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
SfcDispatchDto findSfcDispatchBySfc(@Param("site")String site, @Param("dto")SfcDispatchDto sfcDispatch);
List<Map<String, Object>> partsManufacturing(@Param("site")String site,@Param("locale")String locale, @Param("partsManufacturing")PartsManufacturing partsManufacturing);
}

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.dispatch.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.dto.PartsManufacturing;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import org.springframework.web.multipart.MultipartFile;
@ -112,5 +111,4 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto);
List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing);
}

@ -13,7 +13,6 @@ import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.mesnac.common.util.DateUtil;
import com.foreverwin.mesnac.common.util.ExcelUtils;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.dto.PartsManufacturing;
import com.foreverwin.mesnac.dispatch.dto.RouterDTO;
import com.foreverwin.mesnac.dispatch.dto.WorkCenterWorkTimeDTO;
import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchMapper;
@ -31,7 +30,6 @@ import com.foreverwin.modular.core.util.CommonMethods;
import org.apache.commons.fileupload.FileItem;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@ -772,10 +770,5 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
return result;
}
@Override
public List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing) {
String site = CommonMethods.getSite();
String locale = LocaleContextHolder.getLocale().getLanguage();
return sfcDispatchMapper.partsManufacturing(site,locale,partsManufacturing);
}
}

@ -801,46 +801,4 @@
<if test="dto.handle!=null"> AND HANDLE=#{dto.handle}</if>
</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,
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
FROM SFC S
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = S.SHOP_ORDER_BO
INNER JOIN ITEM I ON I.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE = #{locale}
INNER JOIN Z_SFC_DISPATCH ZSD ON S.SFC = ZSD.SFC AND S.SITE = ZSD.SITE
AND ZSD.DISPATCH_SEQ = (
SELECT MAX(ZSD2.DISPATCH_SEQ) FROM Z_SFC_DISPATCH ZSD2 WHERE S.SFC = ZSD2.SFC AND S.SITE = ZSD2.SITE
)
INNER JOIN OPERATION O ON O.OPERATION = ZSD.OPERATION AND O.SITE = S.SITE AND O.CURRENT_REVISION = 'true'
INNER JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = #{locale}
INNER JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZSD.EMPLOYEE
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>
<if test="partsManufacturing.shopOrder != null and partsManufacturing.shopOrder != ''">
AND ZSD.SHOP_ORDER LIKE '%${partsManufacturing.shopOrder}%'
</if>
<if test="partsManufacturing.item != null and partsManufacturing.item != ''">
AND I.ITEM LIKE '%${partsManufacturing.item}%'
</if>
<if test="partsManufacturing.itemDescription != null and partsManufacturing.itemDescription != ''">
AND IT.DESCRIPTION LIKE '%${partsManufacturing.itemDescription}%'
</if>
<if test="partsManufacturing.startDateTime != null">
AND ZSD.ACTUAL_START_DATE &gt;= #{partsManufacturing.startDateTime}
</if>
<if test="partsManufacturing.endDateTime != null">
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= #{partsManufacturing.endDateTime}
</if>
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save