diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java index 21209cd4..da1b54a1 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java @@ -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()); + } + } } \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/dto/PartsManufacturing.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/dto/PartsManufacturing.java new file mode 100644 index 00000000..93656911 --- /dev/null +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/dto/PartsManufacturing.java @@ -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; + } +} diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java index b8e37b8c..41c109d5 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java @@ -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; /** *

@@ -48,4 +50,6 @@ public interface SfcDispatchMapper extends BaseMapper { 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> partsManufacturing(@Param("site")String site,@Param("locale")String locale, @Param("partsManufacturing")PartsManufacturing partsManufacturing); } \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java index 5da332d7..ecb479fd 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/SfcDispatchService.java @@ -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 { * @return */ Map ganttList(String site, SfcDispatchDto sfcDispatchDto); + + + List> partsManufacturing(PartsManufacturing partsManufacturing); } \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java index 873aa34f..daad57c8 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java @@ -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> partsManufacturing(PartsManufacturing partsManufacturing) { + String site = CommonMethods.getSite(); + String locale = LocaleContextHolder.getLocale().getLanguage(); + return sfcDispatchMapper.partsManufacturing(site,locale,partsManufacturing); + } } \ No newline at end of file diff --git a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml index fd5957d6..ea7fa80b 100644 --- a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml +++ b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml @@ -800,4 +800,47 @@ AND RESRCE=#{dto.resrce} AND HANDLE=#{dto.handle} + + +