零件加工进度表

master
赵嘉伟 3 years ago
parent 928b12de7f
commit eafc1225a5

@ -1,16 +1,13 @@
package com.foreverwin.mesnac.dispatch.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.model.SfcDispatch;
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;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
@ -303,4 +300,13 @@ 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());
}
}
}

@ -0,0 +1,65 @@
package com.foreverwin.mesnac.dispatch.dto;
import java.time.LocalDateTime;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-08-23
*/
public class PartsManufacturing {
private String itemNumber;
private String shopOrder;
private String item;
private String itemDescription;
private LocalDateTime startDateTime;
private LocalDateTime endDateTime;
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getItemDescription() {
return itemDescription;
}
public void setItemDescription(String itemDescription) {
this.itemDescription = itemDescription;
}
public LocalDateTime getStartDateTime() {
return startDateTime;
}
public void setStartDateTime(LocalDateTime startDateTime) {
this.startDateTime = startDateTime;
}
public LocalDateTime getEndDateTime() {
return endDateTime;
}
public void setEndDateTime(LocalDateTime endDateTime) {
this.endDateTime = endDateTime;
}
}

@ -1,13 +1,15 @@
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 com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -48,4 +50,6 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
SfcDispatchDto findResrceBySfc(@Param("sfcDispatch")SfcDispatchDto sfcDispatch, @Param("site") String site, @Param("array") String[] array);
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);
}

@ -1,9 +1,9 @@
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 com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -110,4 +110,7 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
* @return
*/
Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto);
List<Map<String, Object>> partsManufacturing(PartsManufacturing partsManufacturing);
}

@ -13,6 +13,7 @@ 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;
@ -30,6 +31,7 @@ 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;
@ -769,4 +771,11 @@ 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);
}
}

@ -800,4 +800,47 @@
<if test="dto.resrce!=null"> AND RESRCE=#{dto.resrce}</if>
<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