From bb90cf6a5db45d914e35d5e66c42b230248c7992 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Wed, 25 Aug 2021 10:29:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BD=A6=E9=97=B4=E8=BD=AC=E5=85=A5?= =?UTF-8?q?=E8=BD=AC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionItemController.java | 8 +- .../resources/mapper/InspectionItemMapper.xml | 2 +- .../WorkShopTransferController.java | 67 ++- .../production/dto/WorkShopTransferDto.java | 32 +- .../mapper/WorkShopTransferMapper.java | 10 +- .../production/model/WorkShopTransfer.java | 260 ++++++++--- .../service/WorkShopTransferService.java | 12 +- .../impl/WorkShopTransferServiceImpl.java | 169 ++++--- .../mapper/WorkShopTransferMapper.xml | 415 ++++++++++++++---- 9 files changed, 724 insertions(+), 251 deletions(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/InspectionItemController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/InspectionItemController.java index 0de2ac79..f4650d38 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/InspectionItemController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/InspectionItemController.java @@ -115,21 +115,17 @@ public class InspectionItemController { public R page(FrontPage frontPage, InspectionItem inspectionItem){ IPage result; QueryWrapper queryWrapper = new QueryWrapper<>(); + inspectionItem.setSite(CommonMethods.getSite()); queryWrapper.setEntity(inspectionItem); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { //TODO modify global query queryWrapper.lambda().and(wrapper -> wrapper - .like(InspectionItem::getHandle, frontPage.getGlobalQuery()) - .or().like(InspectionItem::getSite, frontPage.getGlobalQuery()) - .or().like(InspectionItem::getInspectionItemNo, frontPage.getGlobalQuery()) + .like(InspectionItem::getInspectionItemNo, frontPage.getGlobalQuery()) .or().like(InspectionItem::getInspectionType, frontPage.getGlobalQuery()) .or().like(InspectionItem::getRevision, frontPage.getGlobalQuery()) .or().like(InspectionItem::getCurrentRevision, frontPage.getGlobalQuery()) .or().like(InspectionItem::getDescription, frontPage.getGlobalQuery()) .or().like(InspectionItem::getStatus, frontPage.getGlobalQuery()) - .or().like(InspectionItem::getCreateUser, frontPage.getGlobalQuery()) - .or().like(InspectionItem::getModifyUser, frontPage.getGlobalQuery()) - .or().like(InspectionItem::getCategory, frontPage.getGlobalQuery()) ); } result = inspectionItemService.page(frontPage.getPagePlus(), queryWrapper); diff --git a/common/src/main/resources/mapper/InspectionItemMapper.xml b/common/src/main/resources/mapper/InspectionItemMapper.xml index fc7bf9ee..ac19108f 100644 --- a/common/src/main/resources/mapper/InspectionItemMapper.xml +++ b/common/src/main/resources/mapper/InspectionItemMapper.xml @@ -217,7 +217,7 @@ AND CATEGORY=#{ew.entity.category} - ${ew.sqlSegment} + and ${ew.sqlSegment} diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/WorkShopTransferController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/WorkShopTransferController.java index 706f738d..2a60573c 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/WorkShopTransferController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/WorkShopTransferController.java @@ -2,8 +2,10 @@ package com.foreverwin.mesnac.production.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.production.dto.WorkShopTransferDto; import com.foreverwin.mesnac.production.model.WorkShopTransfer; import com.foreverwin.mesnac.production.service.WorkShopTransferService; +import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; @@ -14,7 +16,7 @@ import java.util.List; /** * * @author Philip - * @since 2021-08-02 + * @since 2021-08-23 */ @RestController @RequestMapping("/Z-WORK-SHOP-TRANSFER") @@ -23,18 +25,54 @@ public class WorkShopTransferController { @Autowired public WorkShopTransferService workShopTransferService; + /** + * 查询转出数据 + * + * @return + */ @ResponseBody - @GetMapping("/sfcEnter") - public R sfcEnter(WorkShopTransfer workShopTransfer) { - return R.ok(workShopTransferService.sfcEnter(workShopTransfer)); + @GetMapping("getOutList") + public R getOutList(WorkShopTransferDto workShopTransferDto){ + List result; + result = workShopTransferService.getOutList(workShopTransferDto); + return R.ok(result); } + + /** + * 查询转入数据 + * + * @return + */ @ResponseBody - @GetMapping("/transfer") - public R transfer(WorkShopTransfer workShopTransfer) { - return R.ok(workShopTransferService.transfer(workShopTransfer)); + @GetMapping("getInList") + public R getInList(WorkShopTransferDto workShopTransferDto){ + List result; + result = workShopTransferService.getInList(workShopTransferDto); + return R.ok(result); + } + /** + * 转出 + * + * @return + */ + @ResponseBody + @GetMapping("/transferOut") + public R getList(String sfcs){ + return R.ok( workShopTransferService.transferOut(sfcs)); } + /** + * 转入 + * + * @return + */ + @ResponseBody + @PostMapping("/transferIn") + public R transferIn(@RequestBody List handleList){ + workShopTransferService.transferIn(handleList); + return R.ok(); + } /** * 根据id查询 * @@ -73,23 +111,12 @@ public class WorkShopTransferController { public R page(FrontPage frontPage, WorkShopTransfer workShopTransfer){ IPage result; QueryWrapper queryWrapper = new QueryWrapper<>(); + workShopTransfer.setSite(CommonMethods.getSite()); queryWrapper.setEntity(workShopTransfer); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { //TODO modify global query queryWrapper.lambda().and(wrapper -> wrapper - .like(WorkShopTransfer::getHandle, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getSite, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getWorkCenter, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getSfc, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getShopOrder, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getItem, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getLastOperation, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getStepId, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getOperation, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getType, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getIsOutSource, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getComments, frontPage.getGlobalQuery()) - .or().like(WorkShopTransfer::getCreateUser, frontPage.getGlobalQuery()) + .like(WorkShopTransfer::getTransferNo, frontPage.getGlobalQuery()) ); } result = workShopTransferService.page(frontPage.getPagePlus(), queryWrapper); diff --git a/production/src/main/java/com/foreverwin/mesnac/production/dto/WorkShopTransferDto.java b/production/src/main/java/com/foreverwin/mesnac/production/dto/WorkShopTransferDto.java index 5b3c5c9a..9fd6287b 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/dto/WorkShopTransferDto.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/dto/WorkShopTransferDto.java @@ -2,21 +2,28 @@ package com.foreverwin.mesnac.production.dto; import com.foreverwin.mesnac.production.model.WorkShopTransfer; -import java.math.BigDecimal; - public class WorkShopTransferDto extends WorkShopTransfer { private String lastOperation; private String lastOperationDesc; - private String map; + private String blankingSize; private String workOrder; private String itemDesc; private String itemNumber; private String operationDesc; - private BigDecimal qty; private String status; private String dispatchNo; private String resrce; private String workCenterDesc; + private String employeeDescription; + + + public String getEmployeeDescription() { + return employeeDescription; + } + + public void setEmployeeDescription(String employeeDescription) { + this.employeeDescription = employeeDescription; + } public String getWorkCenterDesc() { return workCenterDesc; @@ -60,12 +67,12 @@ public class WorkShopTransferDto extends WorkShopTransfer { this.lastOperationDesc = lastOperationDesc; } - public String getMap() { - return map; + public String getBlankingSize() { + return blankingSize; } - public void setMap(String map) { - this.map = map; + public void setBlankingSize(String blankingSize) { + this.blankingSize = blankingSize; } public String getWorkOrder() { @@ -100,15 +107,6 @@ public class WorkShopTransferDto extends WorkShopTransfer { this.operationDesc = operationDesc; } - @Override - public BigDecimal getQty() { - return qty; - } - - public void setQty(BigDecimal qty) { - this.qty = qty; - } - public String getStatus() { return status; } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/mapper/WorkShopTransferMapper.java b/production/src/main/java/com/foreverwin/mesnac/production/mapper/WorkShopTransferMapper.java index 54869e04..9b9e5e63 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/mapper/WorkShopTransferMapper.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/mapper/WorkShopTransferMapper.java @@ -6,16 +6,24 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 车间转移记录 Mapper 接口 *

* * @author Philip - * @since 2021-07-30 + * @since 2021-08-23 */ @Repository public interface WorkShopTransferMapper extends BaseMapper { + List getOutList(@Param("site") String site, @Param("workCenter") String workCenter, @Param("transferWorkCenter") String transferWorkCenter, @Param("operation") String operation, @Param("status") String status, @Param("sfc") String sfc, @Param("stepId")String stepId); + WorkShopTransferDto getSfcData(@Param("site") String site,@Param("sfc") String sfc); + + List getInList(@Param("site") String site, @Param("workCenter") String workCenter,@Param("transferWorkCenter") String transferWorkCenter, @Param("transferNo") String transferNo, @Param("status") String status,@Param("sfc") String sfc); + + } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/model/WorkShopTransfer.java b/production/src/main/java/com/foreverwin/mesnac/production/model/WorkShopTransfer.java index 2edda834..0cb6897b 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/model/WorkShopTransfer.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/model/WorkShopTransfer.java @@ -16,7 +16,7 @@ import java.time.LocalDateTime; *

* * @author Philip - * @since 2021-08-02 + * @since 2021-08-24 */ @TableName("Z_WORK_SHOP_TRANSFER") @@ -30,16 +30,31 @@ public class WorkShopTransfer extends Model { */ @TableId(value = "HANDLE", type = IdType.INPUT) private String handle; + /** + * 派工单 + */ + @TableField("SFC_DISPATCH_BO") + private String sfcDispatchBo; /** * 站点 */ @TableField("SITE") private String site; + /** + * 转出单号 + */ + @TableField("TRANSFER_NO") + private String transferNo; /** * 车间 */ @TableField("WORK_CENTER") private String workCenter; + /** + * 转入转出车间 + */ + @TableField("TRANSFER_WORK_CENTER") + private String transferWorkCenter; /** * 产品条码 */ @@ -50,16 +65,6 @@ public class WorkShopTransfer extends Model { */ @TableField("SHOP_ORDER") private String shopOrder; - /** - * 物料 - */ - @TableField("ITEM") - private String item; - /** - * 上工序 - */ - @TableField("LAST_OPERATION") - private String lastOperation; /** * 步骤 */ @@ -70,26 +75,36 @@ public class WorkShopTransfer extends Model { */ @TableField("OPERATION") private String operation; + /** + * 上工序 + */ + @TableField("LAST_OPERATION") + private String lastOperation; + /** + * 下工序 + */ + @TableField("NEXT_OPERATION") + private String nextOperation; /** * 数量 */ @TableField("QTY") private BigDecimal qty; /** - * 类型:转入转出 + * 转出 */ - @TableField("TYPE") - private String type; + @TableField("IS_OUT") + private String isOut; + /** + * 转入 + */ + @TableField("IS_IN") + private String isIn; /** * 是否外协工序 */ @TableField("IS_OUT_SOURCE") private String isOutSource; - /** - * 备注 - */ - @TableField("COMMENTS") - private String comments; /** * 创建人 */ @@ -100,6 +115,36 @@ public class WorkShopTransfer extends Model { */ @TableField("CREATED_DATE_TIME") private LocalDateTime createdDateTime; + /** + * 修改人员 + */ + @TableField("MODIFY_USER") + private String modifyUser; + /** + * 修改时间 + */ + @TableField("MODIFIED_DATE_TIME") + private LocalDateTime modifiedDateTime; + /** + * 转入人员 + */ + @TableField("TRANSFER_IN_USER") + private String transferInUser; + /** + * 转入时间 + */ + @TableField("TRANSFER_IN_TIME") + private LocalDateTime transferInTime; + /** + * 转出人员 + */ + @TableField("TRANSFER_OUT_USER") + private String transferOutUser; + /** + * 转出时间 + */ + @TableField("TRANSFER_OUT_TIME") + private LocalDateTime transferOutTime; public String getHandle() { @@ -110,6 +155,14 @@ public class WorkShopTransfer extends Model { this.handle = handle; } + public String getSfcDispatchBo() { + return sfcDispatchBo; + } + + public void setSfcDispatchBo(String sfcDispatchBo) { + this.sfcDispatchBo = sfcDispatchBo; + } + public String getSite() { return site; } @@ -118,6 +171,14 @@ public class WorkShopTransfer extends Model { this.site = site; } + public String getTransferNo() { + return transferNo; + } + + public void setTransferNo(String transferNo) { + this.transferNo = transferNo; + } + public String getWorkCenter() { return workCenter; } @@ -126,6 +187,14 @@ public class WorkShopTransfer extends Model { this.workCenter = workCenter; } + public String getTransferWorkCenter() { + return transferWorkCenter; + } + + public void setTransferWorkCenter(String transferWorkCenter) { + this.transferWorkCenter = transferWorkCenter; + } + public String getSfc() { return sfc; } @@ -142,22 +211,6 @@ public class WorkShopTransfer extends Model { this.shopOrder = shopOrder; } - public String getItem() { - return item; - } - - public void setItem(String item) { - this.item = item; - } - - public String getLastOperation() { - return lastOperation; - } - - public void setLastOperation(String lastOperation) { - this.lastOperation = lastOperation; - } - public String getStepId() { return stepId; } @@ -174,6 +227,22 @@ public class WorkShopTransfer extends Model { this.operation = operation; } + public String getLastOperation() { + return lastOperation; + } + + public void setLastOperation(String lastOperation) { + this.lastOperation = lastOperation; + } + + public String getNextOperation() { + return nextOperation; + } + + public void setNextOperation(String nextOperation) { + this.nextOperation = nextOperation; + } + public BigDecimal getQty() { return qty; } @@ -182,28 +251,28 @@ public class WorkShopTransfer extends Model { this.qty = qty; } - public String getType() { - return type; + public String getIsOut() { + return isOut; } - public void setType(String type) { - this.type = type; + public void setIsOut(String isOut) { + this.isOut = isOut; } - public String getIsOutSource() { - return isOutSource; + public String getIsIn() { + return isIn; } - public void setIsOutSource(String isOutSource) { - this.isOutSource = isOutSource; + public void setIsIn(String isIn) { + this.isIn = isIn; } - public String getComments() { - return comments; + public String getIsOutSource() { + return isOutSource; } - public void setComments(String comments) { - this.comments = comments; + public void setIsOutSource(String isOutSource) { + this.isOutSource = isOutSource; } public String getCreateUser() { @@ -222,36 +291,102 @@ public class WorkShopTransfer extends Model { this.createdDateTime = createdDateTime; } + public String getModifyUser() { + return modifyUser; + } + + public void setModifyUser(String modifyUser) { + this.modifyUser = modifyUser; + } + + public LocalDateTime getModifiedDateTime() { + return modifiedDateTime; + } + + public void setModifiedDateTime(LocalDateTime modifiedDateTime) { + this.modifiedDateTime = modifiedDateTime; + } + + public String getTransferInUser() { + return transferInUser; + } + + public void setTransferInUser(String transferInUser) { + this.transferInUser = transferInUser; + } + + public LocalDateTime getTransferInTime() { + return transferInTime; + } + + public void setTransferInTime(LocalDateTime transferInTime) { + this.transferInTime = transferInTime; + } + + public String getTransferOutUser() { + return transferOutUser; + } + + public void setTransferOutUser(String transferOutUser) { + this.transferOutUser = transferOutUser; + } + + public LocalDateTime getTransferOutTime() { + return transferOutTime; + } + + public void setTransferOutTime(LocalDateTime transferOutTime) { + this.transferOutTime = transferOutTime; + } + public static final String HANDLE = "HANDLE"; +public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO"; + public static final String SITE = "SITE"; +public static final String TRANSFER_NO = "TRANSFER_NO"; + public static final String WORK_CENTER = "WORK_CENTER"; +public static final String TRANSFER_WORK_CENTER = "TRANSFER_WORK_CENTER"; + public static final String SFC = "SFC"; public static final String SHOP_ORDER = "SHOP_ORDER"; -public static final String ITEM = "ITEM"; - -public static final String LAST_OPERATION = "LAST_OPERATION"; - public static final String STEP_ID = "STEP_ID"; public static final String OPERATION = "OPERATION"; +public static final String LAST_OPERATION = "LAST_OPERATION"; + +public static final String NEXT_OPERATION = "NEXT_OPERATION"; + public static final String QTY = "QTY"; -public static final String TYPE = "TYPE"; +public static final String IS_OUT = "IS_OUT"; -public static final String IS_OUT_SOURCE = "IS_OUT_SOURCE"; +public static final String IS_IN = "IS_IN"; -public static final String COMMENTS = "COMMENTS"; +public static final String IS_OUT_SOURCE = "IS_OUT_SOURCE"; public static final String CREATE_USER = "CREATE_USER"; public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; +public static final String MODIFY_USER = "MODIFY_USER"; + +public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; + +public static final String TRANSFER_IN_USER = "TRANSFER_IN_USER"; + +public static final String TRANSFER_IN_TIME = "TRANSFER_IN_TIME"; + +public static final String TRANSFER_OUT_USER = "TRANSFER_OUT_USER"; + +public static final String TRANSFER_OUT_TIME = "TRANSFER_OUT_TIME"; + @Override protected Serializable pkVal() { @@ -262,20 +397,29 @@ public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; public String toString() { return "WorkShopTransfer{" + "handle = " + handle + + ", sfcDispatchBo = " + sfcDispatchBo + ", site = " + site + + ", transferNo = " + transferNo + ", workCenter = " + workCenter + + ", transferWorkCenter = " + transferWorkCenter + ", sfc = " + sfc + ", shopOrder = " + shopOrder + - ", item = " + item + - ", lastOperation = " + lastOperation + ", stepId = " + stepId + ", operation = " + operation + + ", lastOperation = " + lastOperation + + ", nextOperation = " + nextOperation + ", qty = " + qty + - ", type = " + type + + ", isOut = " + isOut + + ", isIn = " + isIn + ", isOutSource = " + isOutSource + - ", comments = " + comments + ", createUser = " + createUser + ", createdDateTime = " + createdDateTime + + ", modifyUser = " + modifyUser + + ", modifiedDateTime = " + modifiedDateTime + + ", transferInUser = " + transferInUser + + ", transferInTime = " + transferInTime + + ", transferOutUser = " + transferOutUser + + ", transferOutTime = " + transferOutTime + "}"; } } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/WorkShopTransferService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/WorkShopTransferService.java index 73918e73..02e42d9a 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/WorkShopTransferService.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/WorkShopTransferService.java @@ -1,6 +1,7 @@ package com.foreverwin.mesnac.production.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.production.dto.WorkShopTransferDto; import com.foreverwin.mesnac.production.model.WorkShopTransfer; import com.baomidou.mybatisplus.extension.service.IService; import com.foreverwin.modular.core.util.FrontPage; @@ -26,7 +27,14 @@ public interface WorkShopTransferService extends IService { List selectList(WorkShopTransfer workShopTransfer); - WorkShopTransfer sfcEnter(WorkShopTransfer workShopTransfer); + WorkShopTransfer sfcEnter(String sfc,String type); + + List getOutList(WorkShopTransferDto workShopTransferDto); + + List getInList(WorkShopTransferDto workShopTransferDto); + + List transferOut(String sfcs); + + void transferIn(List handleList); - Object transfer(WorkShopTransfer workShopTransfer); } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/WorkShopTransferServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/WorkShopTransferServiceImpl.java index 7728efce..eee5765c 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/WorkShopTransferServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/WorkShopTransferServiceImpl.java @@ -1,5 +1,4 @@ package com.foreverwin.mesnac.production.service.impl; - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -11,7 +10,6 @@ import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.mapper.WorkCenterMapper; import com.foreverwin.mesnac.meapi.model.Operation; import com.foreverwin.mesnac.meapi.model.Router; -import com.foreverwin.mesnac.meapi.model.WorkCenter; import com.foreverwin.mesnac.meapi.service.OperationService; import com.foreverwin.mesnac.meapi.service.RouterService; import com.foreverwin.mesnac.production.dto.WorkShopTransferDto; @@ -30,7 +28,10 @@ import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.text.SimpleDateFormat; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.UUID; @@ -76,15 +77,13 @@ public class WorkShopTransferServiceImpl extends ServiceImpl transferOut(String handleList) { String site = CommonMethods.getSite(); String user = CommonMethods.getUser(); - WorkShopTransferDto dto = sfcEnter(workShopTransfer); - String isOutSource = dto.getIsOutSource(); - String sfcBO = HandleEnum.SFC.getHandle(site, workShopTransfer.getSfc()); - if (StringUtil.notBlank(isOutSource) && isOutSource.equals("Y")) { - //转出开始 - try { - Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, dto.getOperation()); - if (workShopTransfer.getType().equals("OUT")) { + Date date = new Date(System.currentTimeMillis()); + SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss"); + String taskNo = dateFormat1.format(date); + List returnList=new ArrayList<>(); + String[] split = handleList.split(","); + for (String sfc:split){ + WorkShopTransferDto dto = sfcEnter(sfc,"OUT"); + String stepId = dto.getStepId(); + String isOutSource = dto.getIsOutSource(); + String sfcBO = HandleEnum.SFC.getHandle(site, sfc); + if (StringUtil.notBlank(isOutSource) && isOutSource.equals("Y")) { + try { + Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, dto.getOperation()); sfcCrossService.startAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty()); //更改派工单状态 sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.START.getCode()); - } else { - //查询是否有转出记录 - QueryWrapper queryWrapper=new QueryWrapper<>(); - queryWrapper.eq(WorkShopTransfer.SFC,workShopTransfer.getSfc()); - queryWrapper.eq(WorkShopTransfer.STEP_ID,dto.getStepId()); - queryWrapper.eq(WorkShopTransfer.TYPE,"OUT"); - List list = list(queryWrapper); - if (list.isEmpty()){ - throw BusinessException.build("没有转出记录"); - } + + } catch (Exception e) { + ExceptionUtil.throwException(e); + } + } + List list = workShopTransferMapper.getOutList(site, null, null, null, null, sfc,stepId); + WorkShopTransferDto transferDto = list.get(0); + WorkShopTransfer transferLog = new WorkShopTransfer(); + transferLog.setHandle(UUID.randomUUID().toString()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(WorkShopTransfer.SFC_DISPATCH_BO, dto.getSfcDispatchBo()); + List workShopTransfers = list(queryWrapper); + if (!workShopTransfers.isEmpty()) { + throw BusinessException.build("产品已转出"); + } + transferLog.setSfcDispatchBo(dto.getSfcDispatchBo()); + transferLog.setSite(site); + transferLog.setTransferNo(taskNo); + transferLog.setWorkCenter(transferDto.getWorkCenter()); + transferLog.setTransferWorkCenter(null); + transferLog.setSfc(sfc); + transferLog.setShopOrder(transferDto.getShopOrder()); + transferLog.setStepId(dto.getStepId()); + transferLog.setOperation(dto.getOperation()); + transferLog.setLastOperation(transferDto.getLastOperation()); + transferLog.setQty(dto.getQty()); + transferLog.setIsOut("Y"); + transferLog.setIsOutSource(dto.getIsOutSource()); + transferLog.setCreateUser(user); + transferLog.setCreatedDateTime(LocalDateTime.now()); + transferLog.setModifyUser(user); + transferLog.setModifiedDateTime(LocalDateTime.now()); + transferLog.setTransferOutUser(user); + transferLog.setTransferOutTime(LocalDateTime.now()); + save(transferLog); + dto.setWorkCenter(transferDto.getWorkCenterDesc()); + dto.setBlankingSize(transferDto.getBlankingSize()); + dto.setTransferNo(taskNo); + dto.setEmployeeDescription(transferDto.getEmployeeDescription()); + returnList.add(dto); + } + return returnList; + } + + @Override + public void transferIn(List handleList) { + String site = CommonMethods.getSite(); + String user = CommonMethods.getUser(); + for (String sfc:handleList) { + WorkShopTransferDto dto = sfcEnter(sfc, "IN"); + String isOutSource = dto.getIsOutSource(); + String sfcBO = HandleEnum.SFC.getHandle(site, sfc); + Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, dto.getOperation()); + //查询是否有转出记录 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(WorkShopTransfer.SFC, sfc); + queryWrapper.eq(WorkShopTransfer.STEP_ID, dto.getStepId()); + queryWrapper.eq(WorkShopTransfer.IS_OUT, "Y"); + List list = list(queryWrapper); + if (list.isEmpty()) { + throw BusinessException.build("没有转出记录"); + } + if (StringUtil.notBlank(isOutSource) && isOutSource.equals("Y")) { + //转出开始 + try { //转入完成 - sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty()); + sfcCrossService.completeAction(site, currentRevisionRef.getHandle(), dto.getResrce(), sfcBO, dto.getQty()); //更改派工单状态 sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dto.getDispatchNo(), DispatchStatusEnum.COMPLETE.getCode()); + + } catch (Exception e) { + ExceptionUtil.throwException(e); } - } catch (Exception e) { - ExceptionUtil.throwException(e); } + WorkShopTransfer transfer = list.get(0); + if (StringUtil.notBlank(transfer.getIsIn())){ + throw BusinessException.build(sfc+"已转入"); + } + LocalDateTime now = LocalDateTime.now(); + transfer.setTransferInTime(now); + transfer.setTransferInUser(user); + transfer.setModifiedDateTime(now); + transfer.setModifyUser(user); + transfer.setIsIn("Y"); + updateById(transfer); } + } - WorkShopTransfer transferLog = new WorkShopTransfer(); - transferLog.setHandle(UUID.randomUUID().toString()); - transferLog.setSite(site); - transferLog.setWorkCenter(dto.getWorkCenter()); - transferLog.setSfc(dto.getSfc()); - transferLog.setShopOrder(dto.getShopOrder()); - transferLog.setItem(dto.getItem()); - transferLog.setLastOperation(dto.getLastOperation()); - transferLog.setStepId(dto.getStepId()); - transferLog.setOperation(dto.getOperation()); - transferLog.setQty(dto.getQty()); - transferLog.setType(workShopTransfer.getType()); - transferLog.setIsOutSource(isOutSource); - transferLog.setComments(workShopTransfer.getComments()); - transferLog.setCreateUser(user); - transferLog.setCreatedDateTime(LocalDateTime.now()); - save(transferLog); - return null; + @Override + public List getOutList(WorkShopTransferDto workShopTransferDto) { + String site = CommonMethods.getSite(); + String workCenter = workShopTransferDto.getWorkCenter(); + String transferWorkCenter = workShopTransferDto.getTransferWorkCenter(); + String operation = workShopTransferDto.getOperation(); + String status = workShopTransferDto.getStatus(); + return workShopTransferMapper.getOutList(site,workCenter,transferWorkCenter,operation,status,null, null); } + @Override + public List getInList(WorkShopTransferDto workShopTransferDto) { + String site = CommonMethods.getSite(); + String workCenter = workShopTransferDto.getWorkCenter(); + String transferWorkCenter = workShopTransferDto.getTransferWorkCenter(); + String transferNo = workShopTransferDto.getTransferNo(); + String status = workShopTransferDto.getStatus(); + return workShopTransferMapper.getInList(site,workCenter,transferWorkCenter,transferNo,status,null); + } + } \ No newline at end of file diff --git a/production/src/main/resources/mapper/WorkShopTransferMapper.xml b/production/src/main/resources/mapper/WorkShopTransferMapper.xml index e4a76d85..bd4d0424 100644 --- a/production/src/main/resources/mapper/WorkShopTransferMapper.xml +++ b/production/src/main/resources/mapper/WorkShopTransferMapper.xml @@ -5,35 +5,34 @@ + + + - - + + - + + - + + + + + + - - - - - - - - - - - + - HANDLE, SITE, WORK_CENTER, SFC, SHOP_ORDER, ITEM, LAST_OPERATION, STEP_ID, OPERATION, QTY, TYPE, IS_OUT_SOURCE, COMMENTS, CREATE_USER, CREATED_DATE_TIME + HANDLE, SFC_DISPATCH_BO, SITE, TRANSFER_NO, WORK_CENTER, TRANSFER_WORK_CENTER, SFC, SHOP_ORDER, STEP_ID, OPERATION, LAST_OPERATION, NEXT_OPERATION, QTY, IS_OUT, IS_IN, IS_OUT_SOURCE, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, TRANSFER_IN_USER, TRANSFER_IN_TIME, TRANSFER_OUT_USER, TRANSFER_OUT_TIME @@ -66,22 +65,31 @@ SELECT FROM Z_WORK_SHOP_TRANSFER - HANDLE=#{ew.handle} + HANDLE=#{ew.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} @@ -90,23 +98,32 @@ - - HANDLE=#{ew.entity.handle} - - AND SITE=#{ew.entity.site} - AND WORK_CENTER=#{ew.entity.workCenter} - AND SFC=#{ew.entity.sfc} - AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} - AND STEP_ID=#{ew.entity.stepId} - AND OPERATION=#{ew.entity.operation} - AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} - AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} - AND CREATE_USER=#{ew.entity.createUser} - AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + + HANDLE=#{ew.entity.handle} + + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} + AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} + AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} + AND SFC=#{ew.entity.sfc} + AND SHOP_ORDER=#{ew.entity.shopOrder} + AND STEP_ID=#{ew.entity.stepId} + AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} + AND QTY=#{ew.entity.qty} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} + AND IS_OUT_SOURCE=#{ew.entity.isOutSource} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -126,20 +143,29 @@ HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -159,20 +185,29 @@ HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -192,20 +227,29 @@ HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -225,23 +269,32 @@ HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} - ${ew.sqlSegment} + AND ${ew.sqlSegment} @@ -258,20 +311,29 @@ HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -287,37 +349,55 @@ INSERT INTO Z_WORK_SHOP_TRANSFER HANDLE, + SFC_DISPATCH_BO, SITE, + TRANSFER_NO, WORK_CENTER, + TRANSFER_WORK_CENTER, SFC, SHOP_ORDER, - ITEM, - LAST_OPERATION, STEP_ID, OPERATION, + LAST_OPERATION, + NEXT_OPERATION, QTY, - TYPE, + IS_OUT, + IS_IN, IS_OUT_SOURCE, - COMMENTS, CREATE_USER, CREATED_DATE_TIME, + MODIFY_USER, + MODIFIED_DATE_TIME, + TRANSFER_IN_USER, + TRANSFER_IN_TIME, + TRANSFER_OUT_USER, + TRANSFER_OUT_TIME, VALUES #{handle}, + #{sfcDispatchBo}, #{site}, + #{transferNo}, #{workCenter}, + #{transferWorkCenter}, #{sfc}, #{shopOrder}, - #{item}, - #{lastOperation}, #{stepId}, #{operation}, + #{lastOperation}, + #{nextOperation}, #{qty}, - #{type}, + #{isOut}, + #{isIn}, #{isOutSource}, - #{comments}, #{createUser}, #{createdDateTime}, + #{modifyUser}, + #{modifiedDateTime}, + #{transferInUser}, + #{transferInTime}, + #{transferOutUser}, + #{transferOutTime}, @@ -328,99 +408,144 @@ VALUES #{handle}, + #{sfcDispatchBo}, #{site}, + #{transferNo}, #{workCenter}, + #{transferWorkCenter}, #{sfc}, #{shopOrder}, - #{item}, - #{lastOperation}, #{stepId}, #{operation}, + #{lastOperation}, + #{nextOperation}, #{qty}, - #{type}, + #{isOut}, + #{isIn}, #{isOutSource}, - #{comments}, #{createUser}, #{createdDateTime}, + #{modifyUser}, + #{modifiedDateTime}, + #{transferInUser}, + #{transferInTime}, + #{transferOutUser}, + #{transferOutTime}, UPDATE Z_WORK_SHOP_TRANSFER + SFC_DISPATCH_BO=#{et.sfcDispatchBo}, SITE=#{et.site}, + TRANSFER_NO=#{et.transferNo}, WORK_CENTER=#{et.workCenter}, + TRANSFER_WORK_CENTER=#{et.transferWorkCenter}, SFC=#{et.sfc}, SHOP_ORDER=#{et.shopOrder}, - ITEM=#{et.item}, - LAST_OPERATION=#{et.lastOperation}, STEP_ID=#{et.stepId}, OPERATION=#{et.operation}, + LAST_OPERATION=#{et.lastOperation}, + NEXT_OPERATION=#{et.nextOperation}, QTY=#{et.qty}, - TYPE=#{et.type}, + IS_OUT=#{et.isOut}, + IS_IN=#{et.isIn}, IS_OUT_SOURCE=#{et.isOutSource}, - COMMENTS=#{et.comments}, CREATE_USER=#{et.createUser}, CREATED_DATE_TIME=#{et.createdDateTime}, - WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + TRANSFER_IN_USER=#{et.transferInUser}, + TRANSFER_IN_TIME=#{et.transferInTime}, + TRANSFER_OUT_USER=#{et.transferOutUser}, + TRANSFER_OUT_TIME=#{et.transferOutTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} UPDATE Z_WORK_SHOP_TRANSFER + SFC_DISPATCH_BO=#{et.sfcDispatchBo}, SITE=#{et.site}, + TRANSFER_NO=#{et.transferNo}, WORK_CENTER=#{et.workCenter}, + TRANSFER_WORK_CENTER=#{et.transferWorkCenter}, SFC=#{et.sfc}, SHOP_ORDER=#{et.shopOrder}, - ITEM=#{et.item}, - LAST_OPERATION=#{et.lastOperation}, STEP_ID=#{et.stepId}, OPERATION=#{et.operation}, + LAST_OPERATION=#{et.lastOperation}, + NEXT_OPERATION=#{et.nextOperation}, QTY=#{et.qty}, - TYPE=#{et.type}, + IS_OUT=#{et.isOut}, + IS_IN=#{et.isIn}, IS_OUT_SOURCE=#{et.isOutSource}, - COMMENTS=#{et.comments}, CREATE_USER=#{et.createUser}, CREATED_DATE_TIME=#{et.createdDateTime}, - WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + TRANSFER_IN_USER=#{et.transferInUser}, + TRANSFER_IN_TIME=#{et.transferInTime}, + TRANSFER_OUT_USER=#{et.transferOutUser}, + TRANSFER_OUT_TIME=#{et.transferOutTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} UPDATE Z_WORK_SHOP_TRANSFER + SFC_DISPATCH_BO=#{et.sfcDispatchBo}, SITE=#{et.site}, + TRANSFER_NO=#{et.transferNo}, WORK_CENTER=#{et.workCenter}, + TRANSFER_WORK_CENTER=#{et.transferWorkCenter}, SFC=#{et.sfc}, SHOP_ORDER=#{et.shopOrder}, - ITEM=#{et.item}, - LAST_OPERATION=#{et.lastOperation}, STEP_ID=#{et.stepId}, OPERATION=#{et.operation}, + LAST_OPERATION=#{et.lastOperation}, + NEXT_OPERATION=#{et.nextOperation}, QTY=#{et.qty}, - TYPE=#{et.type}, + IS_OUT=#{et.isOut}, + IS_IN=#{et.isIn}, IS_OUT_SOURCE=#{et.isOutSource}, - COMMENTS=#{et.comments}, CREATE_USER=#{et.createUser}, CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFY_USER=#{et.modifyUser}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + TRANSFER_IN_USER=#{et.transferInUser}, + TRANSFER_IN_TIME=#{et.transferInTime}, + TRANSFER_OUT_USER=#{et.transferOutUser}, + TRANSFER_OUT_TIME=#{et.transferOutTime}, HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -457,20 +582,29 @@ HANDLE=#{ew.entity.handle} + AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo} AND SITE=#{ew.entity.site} + AND TRANSFER_NO=#{ew.entity.transferNo} AND WORK_CENTER=#{ew.entity.workCenter} + AND TRANSFER_WORK_CENTER=#{ew.entity.transferWorkCenter} AND SFC=#{ew.entity.sfc} AND SHOP_ORDER=#{ew.entity.shopOrder} - AND ITEM=#{ew.entity.item} - AND LAST_OPERATION=#{ew.entity.lastOperation} AND STEP_ID=#{ew.entity.stepId} AND OPERATION=#{ew.entity.operation} + AND LAST_OPERATION=#{ew.entity.lastOperation} + AND NEXT_OPERATION=#{ew.entity.nextOperation} AND QTY=#{ew.entity.qty} - AND TYPE=#{ew.entity.type} + AND IS_OUT=#{ew.entity.isOut} + AND IS_IN=#{ew.entity.isIn} AND IS_OUT_SOURCE=#{ew.entity.isOutSource} - AND COMMENTS=#{ew.entity.comments} AND CREATE_USER=#{ew.entity.createUser} AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFY_USER=#{ew.entity.modifyUser} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND TRANSFER_IN_USER=#{ew.entity.transferInUser} + AND TRANSFER_IN_TIME=#{ew.entity.transferInTime} + AND TRANSFER_OUT_USER=#{ew.entity.transferOutUser} + AND TRANSFER_OUT_TIME=#{ew.entity.transferOutTime} ${ew.sqlSegment} @@ -488,12 +622,58 @@ ) - + SELECT zsd.handle SFC_DISPATCH_BO,zsd.sfc, PREZSD.OPERATION LAST_OPERATION,PREZSD.WORK_CENTER TRANSFER_WORK_CENTER,zsd.WORK_CENTER,WCT.DESCRIPTION WORK_CENTER_DESC,zsd.SHOP_ORDER,c1.VALUE WORK_ORDER,IT.DESCRIPTION ITEM_DESC,ZSD.BLANKING_SIZE,SFC.QTY,PREOT.DESCRIPTION LAST_OPERATION_DESC,PREZSD.EMPLOYEE_DESCRIPTION,OT.DESCRIPTION OPERATION_DESC, + CASE WHEN ZWST.IS_IN='Y' THEN '已接收' WHEN ZWST.IS_OUT='Y' THEN '转序中' ELSE '待转出' END STATUS + FROM Z_SFC_DISPATCH zsd + JOIN sfc sfc ON sfc.sfc=zsd.sfc AND zsd.site=sfc.site + INNER JOIN SFC_ROUTING SG ON SG.SFC_BO = sfc.HANDLE + INNER JOIN SFC_ROUTER SR ON SR.SFC_ROUTING_BO = SG.HANDLE AND SR.IN_USE = 'true' + left JOIN SFC_STEP SP ON SP.SFC_ROUTER_BO = SR.HANDLE and sp.step_Id=zsd.STEP_ID + JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZSD.WORK_CENTER AND WC.SITE = zsd.SITE + LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE AND WCT.LOCALE = 'zh' + LEFT JOIN Z_SFC_DISPATCH PREZSD ON zsd.SFC=PREZSD.SFC AND PREZSD.DISPATCH_SEQ=TO_NUMBER(zsd.DISPATCH_SEQ)-1 + LEFT JOIN Z_WORK_SHOP_TRANSFER ZWST ON zsd.HANDLE=zwst.SFC_DISPATCH_BO + INNER JOIN SHOP_ORDER SO ON SO.SITE = zsd.SITE AND SO.SHOP_ORDER = zsd.SHOP_ORDER + JOIN OPERATION OP ON OP.OPERATION = zsd.OPERATION AND OP.SITE = ZSD.SITE AND OP.CURRENT_REVISION = 'true' + JOIN OPERATION_T OT ON OT.OPERATION_BO = OP.HANDLE AND OT.LOCALE ='zh' + LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER' + INNER JOIN SFC SFC ON SFC.SITE = zsd.SITE AND SFC.SFC = zsd.SFC + INNER JOIN ITEM IM ON IM.HANDLE = SFC.ITEM_BO + LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh' + LEFT JOIN OPERATION PREOP ON PREOP.OPERATION = zsd.PREPOSITION_OPERATION AND PREOP.SITE = ZSD.SITE AND PREOP.CURRENT_REVISION = 'true' + LEFT JOIN OPERATION_T PREOT ON PREOT.OPERATION_BO = PREOP.HANDLE AND PREOT.LOCALE ='zh' + WHERE ZSD.SITE=#{site} AND zsd.DISPATCH_STATUS!='COMPLETE' AND zsd.DISPATCH_STATUS!='CANCEL' + + AND zsd.STEP_ID=#{stepId} + + + AND PREZSD.WORK_CENTER=#{workCenter} + + + AND ZSD.WORK_CENTER=#{transferWorkCenter} + + + AND ZSD.OPERATION=#{operation} + + + AND ZSD.sfc=#{sfc} + + + AND ZWST.IS_IN='Y' AND ZWST.IS_OUT='Y' + + + AND ZWST.IS_OUT='Y' AND ZWST.IS_IN IS NULL AND (SP.QTY_IN_QUEUE > 0 OR SP.QTY_IN_WORK > 0) + + + AND ZWST.IS_OUT IS NULL AND ZWST.IS_IN IS NULL AND (SP.QTY_IN_QUEUE > 0 OR SP.QTY_IN_WORK > 0) + + + + + + From d0666401f17ec0de2b56cd38c4e2fa39e725a051 Mon Sep 17 00:00:00 2001 From: Leon <3066758958@qq.com> Date: Wed, 25 Aug 2021 10:39:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=AB=E6=96=99=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=E8=A3=85=E9=85=8D=E5=8F=AA=E5=8F=AB=E8=BE=85=E6=96=99?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BA9=E7=9A=84=EF=BC=8C=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=8F=AB=E5=8E=9F=E6=9D=90=E6=96=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dispatch/src/main/resources/mapper/CallItemMapper.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index c187ec91..11d56627 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -612,13 +612,17 @@ SC.QTY*BC.QTY ISSUE_QTY, SC.QTY*BC.QTY-NVL(ZCI.REQUIRED_QTY,0) REQUIRED_QTY, ZSD.PLANNED_START_DATE REQUIRED_DATE_TIME, ZCI.HANDLE, ZCI.CALL_TYPE FROM Z_SFC_DISPATCH ZSD INNER JOIN SFC SC ON SC.SITE = ZSD.SITE AND SC.SFC = ZSD.SFC + INNER JOIN SHOP_ORDER SO ON SO.HANDLE = SC.SHOP_ORDER_BO + INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'FACTORY' INNER JOIN SFC_BOM SB ON SB.SFC_BO = SC.HANDLE INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO + LEFT JOIN CUSTOM_FIELDS CS ON CS.HANDLE = CP.HANDLE AND CS.ATTRIBUTE = 'ACCESSORY_TYPE' INNER JOIN BOM_OPERATION BO ON BO.BOM_COMPONENT_BO = BC.HANDLE AND BO.OPERATION_BO = 'OperationBO:'||SC.SITE||','||ZSD.OPERATION||',#' INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = ZSD.STEP_ID LEFT JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE AND ZCI.COMPONENT_BO = CP.HANDLE AND ZCI.STEP_ID = ZSD.STEP_ID - WHERE ZSD.HANDLE IN + WHERE ( (CF.VALUE ='6100' AND CS.VALUE = '9') OR (CF.VALUE = '6106' OR CP.MATERIAL_TYPE='ROH') ) + AND ZSD.HANDLE IN #{item.handle}