操作者加工完成报表加用工属性(正式/临时)、派工增加完成查询方法、PDA主界面增加

master
yangwl
parent ed5861ac3d
commit d2e9078a3e

@ -816,6 +816,10 @@
<if test="completeEndDateTime != null and completeEndDateTime != ''">
AND zsd.ACTUAL_COMPLETE_DATE &lt;= TO_DATE(#{completeEndDateTime}|| '15:59:59','YYYY-MM-DD HH24:MI:SS')
</if>
<if test="temporaryUser != null and temporaryUser != ''">
AND ZUR.TEMPORARY_USER= #{temporaryUser}
</if>
</where>
</select>

@ -24,6 +24,8 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
List<SfcDispatch> findSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId);
SfcDispatch findsfcComplete(@Param("site") String site, @Param("stepId") String stepId, @Param("shopOrder") String shopOrder);
/**
*
*

@ -31,6 +31,17 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
*/
List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId);
/**
*
* @param site
* @param stepId
* @param shopOrder
* @return
*/
SfcDispatch findsfcComplete(String site,String stepId, String shopOrder);
/**
*
*

@ -28,7 +28,9 @@ import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.net.ftp.FTPClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -86,11 +88,18 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
private ProductionCalendarService productionCalendarService;
@Autowired
private SfcDispatchEmployeeService sfcDispatchEmployeeService;
private Logger logger = LoggerFactory.getLogger(SfcDispatchServiceImpl.class);
@Override
public List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId) {
return sfcDispatchMapper.findSfcDispatch(site, sfc, operation, stepId);
}
@Override
public SfcDispatch findsfcComplete(String site, String stepId, String shopOrder) {
return sfcDispatchMapper.findsfcComplete(site,stepId,shopOrder);
}
@Override
public List<SfcDispatchDto> findSfcDispatchList(Map paramMap) throws IOException {
List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(paramMap);
@ -153,6 +162,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
@Override
public Boolean releaseDispatch(String site, String user, StringBuffer message, List<SfcDispatchDto> sfcDispatchList) {
Boolean flag = this.sfcDispatch(site, user, DispatchStatusEnum.RELEASE.getCode(), message, sfcDispatchList);
if (flag) {
@ -591,6 +602,10 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
}
if (employees==null){
logger.info("工单号:"+sfcDispatchDto.getShopOrder()+"操作人员工号:"+employees+"操作人员名字:"+sfcDispatchDto.getEmployeeDescription());
}
//校验操作者与资源是否匹配
if (StringUtil.notBlank(employees)) {
//资源、计划时间必输
@ -634,7 +649,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
continue;
}
}
logger.info("工单号:"+sfcDispatchDto.getShopOrder()+"操作人员工号2"+employees+"操作人员名字2"+sfcDispatchDto.getEmployeeDescription());
sfcDispatch.setResrce(resource);
sfcDispatch.setEmployee(employees);
sfcDispatch.setEmployeeDescription(sfcDispatchDto.getEmployeeDescription());

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.dispatch.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.ftp.CappFtpClient;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
@ -20,6 +21,7 @@ import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.sap.me.demand.ReleaseShopOrderRequest;
import com.sap.me.demand.ReleaseShopOrderResponse;
import com.sap.me.demand.ReleasedSfc;
@ -35,6 +37,7 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import static com.foreverwin.modular.core.meext.PapiServiceEnum.NCProductionService;
@ -306,7 +309,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setDispatchNo(dispatchNo);
sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW);
sfcDispatchModel.setDrawingsNo("");
sfcDispatchModel.setDrawingsRevision(GetDrawingVersionUtil.GetDrawingVerson(itemBo, connect));
// sfcDispatchModel.setDrawingsRevision(GetDrawingVersionUtil.GetDrawingVerson(itemBo, connect));
// sfcDispatchModel.setDrawingsRevision("");
sfcDispatchModel.setIsLock(Constants.STATUS_N);
sfcDispatchModel.setRouterBo(routerBo);
@ -457,7 +460,24 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
List<SfcDispatch> addSfcDispatchList = new ArrayList<>();
List<SfcDispatch> updateSfcDispatchList = new ArrayList<>();
//先删除所有新建状态的派工单
// //先删除所有新建状态的派工单
/**
* 1.SfcDispatch list
* 2.
*/
Map paramMap=new HashMap();
paramMap.put("site", CommonMethods.getSite());
paramMap.put("sfc",sfc);
paramMap.put("dispatchStatus",Constants.STATUS_NEW);
List<SfcDispatchDto> sfcDispatchDtoList=new ArrayList<>();
try {
sfcDispatchDtoList=sfcDispatchService.findSfcDispatchList(paramMap);
}catch (Exception e){
throw BusinessException.build("查询新建派工单错误");
}
QueryWrapper<SfcDispatch> queryWrapper = new QueryWrapper<>();
SfcDispatch deleteSfcDispatch = new SfcDispatch();
deleteSfcDispatch.setSite(site);
@ -504,7 +524,9 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//SFC+Operation+stepID是否已经存在派工数据
List<SfcDispatch> list = sfcDispatchService.findSfcDispatch(site, sfc, operation, stepId);
List<SfcDispatchDto> dispatchDtoList = sfcDispatchDtoList.stream().filter(s -> routerDTO.getStepId().equals(s.getStepId())&&routerDTO.getOperation().equals(s.getOperation())).collect(Collectors.toList());
if (list == null || list.size() <= 0) {
//工艺路线新增的工序,直接增加派工数据
String dispatchNo = sfc + "-" + stepId;
@ -527,8 +549,13 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setDispatchQty(sfcModel.getQty());
sfcDispatchModel.setProdHours(prodHours);
sfcDispatchModel.setTurnOperation("false");
//sfcDispatchModel.setPlannedStartDate(plannedStartDate);
//sfcDispatchModel.setPlannedCompleteDate(plannedCompleteDate);
if (!dispatchDtoList.isEmpty()){
sfcDispatchModel.setPlannedStartDate(dispatchDtoList.get(0).getPlannedStartDate());
sfcDispatchModel.setPlannedCompDate(dispatchDtoList.get(0).getPlannedCompDate());
sfcDispatchModel.setEmployee(dispatchDtoList.get(0).getEmployee());
sfcDispatchModel.setEmployeeDescription(dispatchDtoList.get(0).getEmployeeDescription());
sfcDispatchModel.setResrce(dispatchDtoList.get(0).getResrce());
}
sfcDispatchModel.setSoReleasedDate(nowDate);
sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE);
sfcDispatchModel.setIsImport(Constants.BOOL_FALSE);
@ -540,7 +567,9 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setOther1("false");
addSfcDispatchList.add(sfcDispatchModel);
} else {
//已经存在的更新
/**
*
*/
SfcDispatch sfcDispatchModel = list.get(0);
sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setModifyUser(user);

@ -4,76 +4,76 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.SfcDispatch">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="SFC" property="sfc" />
<result column="BLANKING_SIZE" property="blankingSize" />
<result column="DISPATCH_SEQ" property="dispatchSeq" />
<result column="DISPATCH_NO" property="dispatchNo" />
<result column="DISPATCH_STATUS" property="dispatchStatus" />
<result column="DRAWINGS_NO" property="drawingsNo" />
<result column="DRAWINGS_REVISION" property="drawingsRevision" />
<result column="IS_LOCK" property="isLock" />
<result column="ROUTER_BO" property="routerBo" />
<result column="STEP_ID" property="stepId" />
<result column="OPERATION" property="operation" />
<result column="RESOURCE_TYPE" property="resourceType" />
<result column="WORK_CENTER" property="workCenter" />
<result column="RESRCE" property="resrce" />
<result column="EMPLOYEE" property="employee" />
<result column="EMPLOYEE_DESCRIPTION" property="employeeDescription" />
<result column="TURN_OPERATION" property="turnOperation" />
<result column="DISPATCH_QTY" property="dispatchQty" />
<result column="PROD_HOURS" property="prodHours" />
<result column="PLANNED_START_DATE" property="plannedStartDate" />
<result column="PLANNED_COMP_DATE" property="plannedCompDate" />
<result column="EARLIEST_START_DATE" property="earliestStartDate" />
<result column="LATEST_END_DATE" property="latestEndDate" />
<result column="SO_RELEASED_DATE" property="soReleasedDate" />
<result column="SFC_RELEASED_DATE" property="sfcReleasedDate" />
<result column="RELEASED_COMPLETE_DATE" property="releasedCompleteDate" />
<result column="ACTUAL_START_DATE" property="actualStartDate" />
<result column="ACTUAL_COMPLETE_DATE" property="actualCompleteDate" />
<result column="IS_UPDATE_ZJH_COMPLETE" property="isUpdateZJHComplete" />
<result column="IS_DISPATCH" property="isDispatch" />
<result column="IS_IMPORT" property="isImport" />
<result column="REMARK" property="remark" />
<result column="PREPOSITION_STEP_ID" property="prepositionStepId" />
<result column="PREPOSITION_OPERATION" property="prepositionOperation" />
<result column="IS_FIRST_OPERATION" property="isFirstOperation" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="OTHER_1" property="other1" />
<result column="OTHER_2" property="other2" />
<result column="OTHER_3" property="other3" />
<result column="OTHER_4" property="other4" />
<result column="OTHER_5" property="other5" />
<id column="HANDLE" property="handle"/>
<result column="SITE" property="site"/>
<result column="SHOP_ORDER" property="shopOrder"/>
<result column="SFC" property="sfc"/>
<result column="BLANKING_SIZE" property="blankingSize"/>
<result column="DISPATCH_SEQ" property="dispatchSeq"/>
<result column="DISPATCH_NO" property="dispatchNo"/>
<result column="DISPATCH_STATUS" property="dispatchStatus"/>
<result column="DRAWINGS_NO" property="drawingsNo"/>
<result column="DRAWINGS_REVISION" property="drawingsRevision"/>
<result column="IS_LOCK" property="isLock"/>
<result column="ROUTER_BO" property="routerBo"/>
<result column="STEP_ID" property="stepId"/>
<result column="OPERATION" property="operation"/>
<result column="RESOURCE_TYPE" property="resourceType"/>
<result column="WORK_CENTER" property="workCenter"/>
<result column="RESRCE" property="resrce"/>
<result column="EMPLOYEE" property="employee"/>
<result column="EMPLOYEE_DESCRIPTION" property="employeeDescription"/>
<result column="TURN_OPERATION" property="turnOperation"/>
<result column="DISPATCH_QTY" property="dispatchQty"/>
<result column="PROD_HOURS" property="prodHours"/>
<result column="PLANNED_START_DATE" property="plannedStartDate"/>
<result column="PLANNED_COMP_DATE" property="plannedCompDate"/>
<result column="EARLIEST_START_DATE" property="earliestStartDate"/>
<result column="LATEST_END_DATE" property="latestEndDate"/>
<result column="SO_RELEASED_DATE" property="soReleasedDate"/>
<result column="SFC_RELEASED_DATE" property="sfcReleasedDate"/>
<result column="RELEASED_COMPLETE_DATE" property="releasedCompleteDate"/>
<result column="ACTUAL_START_DATE" property="actualStartDate"/>
<result column="ACTUAL_COMPLETE_DATE" property="actualCompleteDate"/>
<result column="IS_UPDATE_ZJH_COMPLETE" property="isUpdateZJHComplete"/>
<result column="IS_DISPATCH" property="isDispatch"/>
<result column="IS_IMPORT" property="isImport"/>
<result column="REMARK" property="remark"/>
<result column="PREPOSITION_STEP_ID" property="prepositionStepId"/>
<result column="PREPOSITION_OPERATION" property="prepositionOperation"/>
<result column="IS_FIRST_OPERATION" property="isFirstOperation"/>
<result column="CREATE_USER" property="createUser"/>
<result column="CREATED_DATE_TIME" property="createdDateTime"/>
<result column="MODIFY_USER" property="modifyUser"/>
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime"/>
<result column="OTHER_1" property="other1"/>
<result column="OTHER_2" property="other2"/>
<result column="OTHER_3" property="other3"/>
<result column="OTHER_4" property="other4"/>
<result column="OTHER_5" property="other5"/>
</resultMap>
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.common.dto.SfcDispatchDto">
<result column="USER" property="user" />
<result column="ROLE" property="role" />
<result column="IS_COMPLETED" property="isCompleted" />
<result column="ITEM_BO" property="itemBo" />
<result column="ITEM" property="item" />
<result column="STATUS_NAME" property="statusName" />
<result column="IS_MAJOR" property="isMajor" />
<result column="COMMENTS" property="comments" />
<result column="WORK_ORDER" property="workOrder" />
<result column="SHOP_ORDER_TYPE" property="shopOrderType" />
<result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="COMPONENT" property="component" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
<result column="TEXTURE" property="texture" />
<result column="MAT_SPEC" property="matSpec" />
<result column="COMPLETED_QTY" property="completedQty" />
<result column="RESOURCE_DESCRIPTION" property="resourceDescription" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
<result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="RESOURCE_WORK_CENTER" property="resourceWorkCenter" />
<result column="USER" property="user"/>
<result column="ROLE" property="role"/>
<result column="IS_COMPLETED" property="isCompleted"/>
<result column="ITEM_BO" property="itemBo"/>
<result column="ITEM" property="item"/>
<result column="STATUS_NAME" property="statusName"/>
<result column="IS_MAJOR" property="isMajor"/>
<result column="COMMENTS" property="comments"/>
<result column="WORK_ORDER" property="workOrder"/>
<result column="SHOP_ORDER_TYPE" property="shopOrderType"/>
<result column="ITEM_DESCRIPTION" property="itemDescription"/>
<result column="COMPONENT" property="component"/>
<result column="COMPONENT_DESCRIPTION" property="componentDescription"/>
<result column="TEXTURE" property="texture"/>
<result column="MAT_SPEC" property="matSpec"/>
<result column="COMPLETED_QTY" property="completedQty"/>
<result column="RESOURCE_DESCRIPTION" property="resourceDescription"/>
<result column="COMPONENT_DESCRIPTION" property="componentDescription"/>
<result column="OPERATION_DESCRIPTION" property="operationDescription"/>
<result column="RESOURCE_WORK_CENTER" property="resourceWorkCenter"/>
</resultMap>
@ -88,50 +88,69 @@
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_SFC_DISPATCH
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null">AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null">AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null">AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null">AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null">AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null">AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null">AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null">AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null">AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null">AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null">AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null">AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null">AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null">AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null">AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null">AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null">AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null">AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null">AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null">AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
</if>
<if test="ew.entity.plannedCompDate!=null">AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null">AND
EARLIEST_START_DATE=#{ew.entity.earliestStartDate}
</if>
<if test="ew.entity.latestEndDate!=null">AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null">AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null">AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null">AND
RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
</if>
<if test="ew.entity.actualStartDate!=null">AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null">AND
ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
</if>
<if test="ew.entity.isDispatch!=null">AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null">AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null">AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null">AND
PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
</if>
<if test="ew.entity.prepositionOperation!=null">AND
PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}
</if>
<if test="ew.entity.isFirstOperation!=null">AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
</if>
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
AND ${ew.sqlSegment}
@ -144,57 +163,77 @@
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
SELECT
<choose>
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
FROM Z_SFC_DISPATCH
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null">AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null">AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null">AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null">AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null">AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null">AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null">AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null">AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null">AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null">AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null">AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null">AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null">AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null">AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null">AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null">AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null">AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null">AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null">AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null">AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
</if>
<if test="ew.entity.plannedCompDate!=null">AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null">AND
EARLIEST_START_DATE=#{ew.entity.earliestStartDate}
</if>
<if test="ew.entity.latestEndDate!=null">AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null">AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null">AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null">AND
RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
</if>
<if test="ew.entity.actualStartDate!=null">AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null">AND
ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
</if>
<if test="ew.entity.isDispatch!=null">AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null">AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null">AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null">AND
PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
</if>
<if test="ew.entity.prepositionOperation!=null">AND
PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}
</if>
<if test="ew.entity.isFirstOperation!=null">AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
</if>
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
<if test="ew.entity.other1!=null">AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null">AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null">AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null">AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null">AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
and ${ew.sqlSegment}
@ -256,7 +295,8 @@
<if test="other3!=null">OTHER_3,</if>
<if test="other4!=null">OTHER_4,</if>
<if test="other5!=null">OTHER_5,</if>
</trim> VALUES
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
@ -312,7 +352,8 @@
INSERT INTO Z_SFC_DISPATCH
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
@ -366,7 +407,8 @@
<update id="updateById">
UPDATE Z_SFC_DISPATCH <trim prefix="SET" suffixOverrides=",">
UPDATE Z_SFC_DISPATCH
<trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
@ -413,7 +455,13 @@
<if test="et.other3!=null">OTHER_3=#{et.other3},</if>
<if test="et.other4!=null">OTHER_4=#{et.other4},</if>
<if test="et.other5!=null">OTHER_5=#{et.other5},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</trim>
WHERE HANDLE=#{et.handle}
<if test="et instanceof java.util.Map">
<if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and
${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
</if>
</if>
</update>
@ -465,12 +513,18 @@
OTHER_3=#{et.other3},
OTHER_4=#{et.other4},
OTHER_5=#{et.other5},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</trim> WHERE HANDLE=#{et.handle}
<if test="et instanceof java.util.Map">
<if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and
${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}
</if>
</if>
</update>
<update id="update">
UPDATE Z_SFC_DISPATCH <trim prefix="SET" suffixOverrides=",">
UPDATE Z_SFC_DISPATCH
<trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
@ -522,52 +576,67 @@
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="et.entity.employeeDescription!=null">EMPLOYEE_DESCRIPTION=#{et.entity.employeeDescription},</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null">AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null">AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null">AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null">AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null">AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null">AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null">AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null">AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null">AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null">AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null">AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null">AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null">AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null">AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null">AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null">AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="et.entity.employeeDescription!=null">
EMPLOYEE_DESCRIPTION=#{et.entity.employeeDescription},
</if>
<if test="ew.entity.turnOperation!=null">AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null">AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null">AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null">AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
</if>
<if test="ew.entity.plannedCompDate!=null">AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null">AND
EARLIEST_START_DATE=#{ew.entity.earliestStartDate}
</if>
<if test="ew.entity.latestEndDate!=null">AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null">AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null">AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null">AND
RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
</if>
<if test="ew.entity.actualStartDate!=null">AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null">AND
ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
</if>
<if test="ew.isUpdateZJHComplete!=null">AND IS_UPDATE_ZJH_COMPLETE=#{ew.isUpdateZJHComplete},</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
<if test="ew.entity.isDispatch!=null">AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null">AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null">AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null">AND
PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
</if>
<if test="ew.entity.prepositionOperation!=null">AND
PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}
</if>
<if test="ew.entity.isFirstOperation!=null">AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
</if>
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
<if test="ew.entity.other1!=null">AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null">AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null">AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null">AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null">AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -604,51 +673,66 @@
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.employeeDescription!=null">EMPLOYEE_DESCRIPTION=#{et.entity.employeeDescription},</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null">AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null">AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null">AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null">AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null">AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null">AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null">AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null">AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null">AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null">AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null">AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null">AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null">AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null">AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null">AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null">AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.employeeDescription!=null">
EMPLOYEE_DESCRIPTION=#{et.entity.employeeDescription},
</if>
<if test="ew.entity.turnOperation!=null">AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null">AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null">AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null">AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}
</if>
<if test="ew.entity.plannedCompDate!=null">AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null">AND
EARLIEST_START_DATE=#{ew.entity.earliestStartDate}
</if>
<if test="ew.entity.latestEndDate!=null">AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null">AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null">AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null">AND
RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}
</if>
<if test="ew.entity.actualStartDate!=null">AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null">AND
ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}
</if>
<if test="ew.entity.isDispatch!=null">AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null">AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null">AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null">AND
PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
</if>
<if test="ew.entity.prepositionOperation!=null">AND
PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}
</if>
<if test="ew.entity.isFirstOperation!=null">AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}
</if>
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
</if>
<if test="ew.entity.other1!=null">AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null">AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null">AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null">AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null">AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -665,9 +749,14 @@
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<resultMap id="findSfcDispatchResult" type="SfcDispatch">
<id column="HANDLE" property="handle"/>
</resultMap>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="findSfcDispatch" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
<select id="findSfcDispatch" resultMap="findSfcDispatchResult">
SELECT
<include refid="Base_Column_List"/>
FROM Z_SFC_DISPATCH
WHERE SITE = #{site} AND SFC = #{sfc}
<if test="operation != null and operation != ''">
@ -687,12 +776,19 @@
WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布'
END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE
FROM (
SELECT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, SD.ROUTER_BO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,SD.DRAWINGS_REVISION,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION,
CASE WHEN SD.DISPATCH_STATUS = 'COMPLETE' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
CASE WHEN CC.VALUE = '9' THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.IS_UPDATE_ZJH_COMPLETE, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO,
WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION, MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC ,SD.OTHER_2
SELECT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, SD.ROUTER_BO, C2.VALUE ITEM_NUMBER, C1.VALUE
WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC,
SD.DISPATCH_STATUS,SD.DRAWINGS_REVISION,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE,
SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION,
CASE WHEN SD.DISPATCH_STATUS = 'COMPLETE' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE,
SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ,
SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
CASE WHEN CC.VALUE = '9' THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE
N'否' END TURN_OPERATION, SD.IS_UPDATE_ZJH_COMPLETE, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO,
WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION,
MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC ,SD.OTHER_2
FROM Z_SFC_DISPATCH SD
INNER JOIN SFC SC ON SC.SITE = SD.SITE AND SC.SFC = SD.SFC
LEFT JOIN RESRCE RS ON SD.SITE = RS.SITE AND SD.RESRCE = RS.RESRCE
@ -710,7 +806,8 @@
LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh'
LEFT JOIN CUSTOM_FIELDS C3 ON C3.HANDLE = CP.HANDLE AND C3.ATTRIBUTE = 'TEXTTURE'
LEFT JOIN CUSTOM_FIELDS C4 ON C4.HANDLE = CP.HANDLE AND C4.ATTRIBUTE = 'MAT_SPEC'
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = 'ResourceBO:' || SD.SITE || ',' || SD.RESRCE
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = 'ResourceBO:' || SD.SITE || ',' ||
SD.RESRCE
LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO
WHERE SD.SITE = #{site}
<if test="workCenter != null and workCenter != ''">
@ -722,6 +819,9 @@
<if test="status != null and status != ''">
AND SD.DISPATCH_STATUS IN ${status}
</if>
<if test="userName != null and userName != ''">
AND SD.EMPLOYEE_DESCRIPTION = #{userName}
</if>
<if test="item != null and item != ''">
AND IM.ITEM = #{item}
</if>
@ -761,6 +861,9 @@
<if test="blankingSize != null and blankingSize != ''">
AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%'
</if>
<if test="step != null and step != ''">
AND SD.STEP_ID = #{step}
</if>
<if test="component != null and component != ''">
AND CP.ITEM = #{component}
</if>
@ -785,14 +888,20 @@
<if test="completeToDate != null">
AND SD.PLANNED_COMP_DATE &lt;= TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
GROUP BY SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, SD.ROUTER_BO, C2.VALUE, C1.VALUE, IM.HANDLE, IM.ITEM, IT.DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,SD.DRAWINGS_REVISION,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION,
SD.DISPATCH_STATUS, SD.DISPATCH_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
GROUP BY SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, SD.ROUTER_BO, C2.VALUE, C1.VALUE, IM.HANDLE,
IM.ITEM, IT.DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,SD.DRAWINGS_REVISION,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE,
SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION,
SD.DISPATCH_STATUS, SD.DISPATCH_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER,
SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.EARLIEST_START_DATE,
SD.LATEST_END_DATE,
CC.VALUE, SD.TURN_OPERATION,SD.IS_UPDATE_ZJH_COMPLETE, SD.BLANKING_SIZE, WR.WORK_CENTER ,SD.OTHER_2
) WIP
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.ROUTER_BO = WIP.ROUTER_BO AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.ROUTER_BO = WIP.ROUTER_BO AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.ROUTER_BO = WIP.ROUTER_BO AND
V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.ROUTER_BO = WIP.ROUTER_BO AND
V2.DISPATCH_SEQ = WIP.AFTER_SEQ
) WIP
<if test="isCompleted != null and isCompleted != ''">
WHERE WIP.IS_COMPLETED = #{isCompleted}
@ -800,8 +909,9 @@
ORDER BY WIP.SHOP_ORDER,WIP.SFC,WIP.STEP_ID,TO_NUMBER(WIP.DISPATCH_SEQ)
</select>
<update id="updateSfcDispatchStatus" >
UPDATE Z_SFC_DISPATCH SET DISPATCH_STATUS = #{dispatchStatus}, MODIFY_USER = #{modifyUser}, MODIFIED_DATE_TIME = #{modifiedDateTime}
<update id="updateSfcDispatchStatus">
UPDATE Z_SFC_DISPATCH SET DISPATCH_STATUS = #{dispatchStatus}, MODIFY_USER = #{modifyUser}, MODIFIED_DATE_TIME =
#{modifiedDateTime}
<if test="dispatchStatus== 'COMPLETE'">
, ACTUAL_COMPLETE_DATE = #{modifiedDateTime} , ACTUAL_PROD_HOURS = #{workHour}
</if>
@ -825,22 +935,37 @@
<select id="findSfcDispatchBySfc" resultType="com.foreverwin.mesnac.common.dto.SfcDispatchDto">
SELECT *
FROM Z_SFC_DISPATCH zsd where site=#{site}
<if test="dto.sfc!=null"> AND SFC=#{dto.sfc}</if>
<if test="dto.stepId!=null"> AND STEP_ID=#{dto.stepId}</if>
<if test="dto.operation!=null"> AND OPERATION=#{dto.operation}</if>
<if test="dto.resrce!=null"> AND RESRCE=#{dto.resrce}</if>
<if test="dto.handle!=null"> AND HANDLE=#{dto.handle}</if>
<if test="dto.sfc!=null">AND SFC=#{dto.sfc}</if>
<if test="dto.stepId!=null">AND STEP_ID=#{dto.stepId}</if>
<if test="dto.operation!=null">AND OPERATION=#{dto.operation}</if>
<if test="dto.resrce!=null">AND RESRCE=#{dto.resrce}</if>
<if test="dto.handle!=null">AND HANDLE=#{dto.handle}</if>
</select>
<select id="findSplitSfcDispatch" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"> </include>
SELECT
<include refid="Base_Column_List"></include>
FROM Z_SFC_DISPATCH
WHERE SITE = #{site} AND SFC = #{sfc} AND TO_NUMBER(STEP_ID) >= #{stepId}
</select>
<select id="findsfcComplete" resultType="com.foreverwin.mesnac.dispatch.model.SfcDispatch">
SELECT
<include refid="Base_Column_List"/>
FROM Z_SFC_DISPATCH
WHERE SITE = #{site}
<if test="shopOrder != null and shopOrder != ''">
AND SHOP_ORDER = #{shopOrder}
</if>
<if test="stepId != null and stepId != ''">
AND STEP_ID = #{stepId}
</if>
AND ACTUAL_COMPLETE_DATE IS NOT NULL
AND ROWNUM=1 ORDER BY ACTUAL_COMPLETE_DATE DESC
</select>
<update id="updateSfcDispatchQty" >
<update id="updateSfcDispatchQty">
UPDATE Z_SFC_DISPATCH SET DISPATCH_QTY = DISPATCH_QTY - #{splitQty}
WHERE SITE = #{site} AND SFC = #{sfc} AND DISPATCH_SEQ >= #{currentSeq}
</update>

@ -4,6 +4,18 @@ import com.foreverwin.mesnac.meapi.model.Sfc;
public class SfcDto extends Sfc {
private String handle;
@Override
public String getHandle() {
return handle;
}
@Override
public void setHandle(String handle) {
this.handle = handle;
}
private String shopOrder;
private String status;
private String item;

@ -67,7 +67,7 @@
<dependency>
<groupId>com.foreverwin.modular</groupId>
<artifactId>modular-core</artifactId>
<version>1.1.4-SNAPSHOT.standlone-hana</version>
<version>1.0-SNAPSHOT.standlone-hana</version>
</dependency>
<dependency>
@ -97,31 +97,31 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.26</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.logging.log4j</groupId>-->
<!-- <artifactId>log4j-slf4j-impl</artifactId>-->
<!-- <version>2.17.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.logging.log4j</groupId>-->
<!-- <artifactId>log4j-api</artifactId>-->
<!-- <version>2.17.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.logging.log4j</groupId>-->
<!-- <artifactId>log4j-core</artifactId>-->
<!-- <version>2.17.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>jul-to-slf4j</artifactId>-->
<!-- <version>1.7.26</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>jcl-over-slf4j</artifactId>-->
<!-- <version>1.7.26</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.activemq</groupId>

@ -71,6 +71,7 @@ public class PodTemplateController {
sfcDtoList = mapper.convertValue(sfcDtoList, new TypeReference<List<SfcDto>>() {
});
String resrce = (String) map.get("resrce");
String shoporder = (String) map.get("shopOrder");
if (sfcDtoList == null || sfcDtoList.size() < 1) {
throw new BaseException("作业列表不能为空");
}
@ -80,7 +81,7 @@ public class PodTemplateController {
ArrayList<String> sfcList = new ArrayList<>();
try {
for (SfcDto sfcDto : sfcDtoList) {
String completeSfc = podTemplateService.sfcComplete(sfcDto, resrce);
String completeSfc = podTemplateService.sfcComplete(sfcDto, resrce,shoporder);
sfcList.add(completeSfc);
}
}catch (Exception e){

@ -16,7 +16,7 @@ public interface PodTemplateService {
void sfcStart(Map<String, Object> map);
String sfcComplete(SfcDto sfcDto, String resrce);
String sfcComplete(SfcDto sfcDto, String resrce,String shoporder);
void sendErp(String sfc, String stepId, BigDecimal qty, BigDecimal scrapQty, BigDecimal workHour);

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.production.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.foreverwin.mesnac.common.constant.Constants;
@ -23,7 +24,9 @@ import com.foreverwin.mesnac.common.util.ERPAPI;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchService;
import com.foreverwin.mesnac.dispatch.service.UserResourceService;
import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.mesnac.meapi.dto.BomComponentDto;
@ -44,6 +47,7 @@ import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.R;
import com.sap.me.production.AssembleComponentsRequest;
import com.sap.me.production.AssemblyComponent;
import com.sap.me.production.AssemblyDataField;
@ -57,9 +61,12 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
@Service
@ -107,6 +114,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private ResrceMapper resrceMapper;
@Autowired
private SfcDispatchService sfcDispatchService;
@Autowired
private UserResourceService userResourceService;
@Override
@ -165,9 +175,34 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (resultMap == null) {
throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!");
}
if(resultMap.get("EMPLOYEE_DESCRIPTION")==null||resultMap.get("EMPLOYEE_DESCRIPTION").equals("")||resultMap.get("EMPLOYEE")==null||resultMap.get("EMPLOYEE").equals("")){
if(resultMap.get("EMPLOYEE_DESCRIPTION")==null||resultMap.get("EMPLOYEE_DESCRIPTION").equals("")){
throw new BaseException("产品条码[" + sfc + "]的操作人员为空!请联系调度人员维护!");
}
/**
*
*/
if(resultMap.get("EMPLOYEE")==null||resultMap.get("EMPLOYEE").equals("")){
//获取操作者
String EMPLOYEE_DESCRIPTION = resultMap.get("EMPLOYEE_DESCRIPTION").toString();
//员工资源对应关系
List<UserResource> userResourceList = userResourceService.findEnableList(site, sfcDto.getResrce(), null);
Map<String, List<UserResource>> usMap = userResourceList.stream().collect(Collectors.groupingBy(UserResource::getUserDescription));
List<UserResource> singleUserResourceList = usMap.get(EMPLOYEE_DESCRIPTION);
if ( CollectionUtils.isNotEmpty(singleUserResourceList)){
//更新派工单的操作员编号
SfcDispatch sfcDispatch = new SfcDispatch();
sfcDispatch.setHandle(resultMap.get("SFC_DISPATCH_DETAIL_BO").toString());
sfcDispatch.setEmployee(singleUserResourceList.get(0).getUserId());
sfcDispatchService.updateById(sfcDispatch);
}
}
//List<Map<String, Object>> substepList = sfcCrossMapper.querySfcStep(site, sfc, operationBySfcBo.getOperation());
List<Map<String, Object>> substepList = new ArrayList<>();
resultMap.put("SFC_STEP_LIST", substepList);
@ -270,7 +305,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
@Override
public String sfcComplete(SfcDto sfcDto, String resrce) {
public String sfcComplete(SfcDto sfcDto, String resrce,String shoporder) {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
@ -309,6 +344,22 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
}
}
//相同工序不同SFC相同工单号不能在一分钟之内点完成拆单重复吸收原材料
/**
* 1.
* 2.
*/
SfcDispatch sfcDispatchDto = sfcDispatchService.findsfcComplete(site,sfcDto.getStepId(),shoporder);
if (sfcDispatchDto!=null){
LocalDateTime now = LocalDateTime.now();
Duration duration = Duration.between(sfcDispatchDto.getActualCompleteDate(),now);
long minutes = duration.toMinutes();//相差的分钟数
if (minutes<1){
throw new BaseException("拆单后同一工序不能一分钟内点两次完成!");
}
}
//物料消耗
materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce);
//专检创建
@ -498,10 +549,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
struIn.setIsm06(workHour);
ins[0] = struIn;
TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins);
//返回对象
ZprodordconfStruOut[] outs = new ZprodordconfStruOut[1];
ZprodordconfStruOut struOut = new ZprodordconfStruOut();
struOut.setAufnr(ins[0].getAufnr());
struOut.setVornr(ins[0].getVornr());

@ -94,7 +94,7 @@
CASE WHEN ST.STATUS='403' AND SS.QTY_IN_QUEUE > 0 THEN N'402' ELSE ST.STATUS END STATUS,
OP.OPERATION, OT.DESCRIPTION OPERATION_DESC,OP.OPERATION||'/'||RS.STEP_ID OPERATION_STEP,
RO_CF2.VALUE TOOL ,SOD.HANDLE SFC_DISPATCH_DETAIL_BO,SOD.WORK_CENTER,SOD.PROD_HOURS,
S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO,SOD.EMPLOYEE_DESCRIPTION,SOD.EMPLOYEE,
S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO,SOD.EMPLOYEE_DESCRIPTION,SOD.EMPLOYEE,SOD.BLANKING_SIZE,
TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss')START_DATE,
TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE,
TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE,
@ -117,13 +117,13 @@
INNER JOIN ITEM I ON I.HANDLE = S.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE =#{locale}
INNER JOIN (
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO,SD.WORK_CENTER,SD.PROD_HOURS,SD.EMPLOYEE_DESCRIPTION,SD.EMPLOYEE
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO,SD.WORK_CENTER,SD.PROD_HOURS,SD.EMPLOYEE_DESCRIPTION,SD.EMPLOYEE,SD.BLANKING_SIZE
FROM Z_PROD_READY_TASK RB
INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO
WHERE RB.SITE =#{site} AND RB.STATUS = 'FINISH' AND RB."RESULT"='OK'
) SOD ON SOD.RESRCE =#{dto.resrce} AND SOD.SFC= S.SFC AND SOD.OPERATION = OP.OPERATION and SS.STEP_ID=SOD.STEP_ID
WHERE S.SITE = #{site} AND S.SFC = #{dto.sfc} AND ROWNUM=1
GROUP BY SO.SHOP_ORDER, SO_CF.VALUE , I.ITEM, IT.DESCRIPTION ,SOD.WORK_CENTER,SO_CF2.VALUE,SOD.PROD_HOURS,SOD.EMPLOYEE_DESCRIPTION,SOD.EMPLOYEE,
GROUP BY SO.SHOP_ORDER, SO_CF.VALUE , I.ITEM, IT.DESCRIPTION ,SOD.WORK_CENTER,SO_CF2.VALUE,SOD.PROD_HOURS,SOD.EMPLOYEE_DESCRIPTION,SOD.EMPLOYEE,SOD.BLANKING_SIZE,
CASE WHEN ST.STATUS='403' AND SS.QTY_IN_QUEUE > 0 THEN N'402' ELSE ST.STATUS END,
OP.OPERATION, OT.DESCRIPTION ,OP.OPERATION||'/'||RS.STEP_ID ,RO_CF2.VALUE,
S.SFC,S.QTY ,RS.STEP_ID,SOD.DISPATCH_NO , SOD.HANDLE ,

Loading…
Cancel
Save