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

master
yangwl 3 years ago
parent ed5861ac3d
commit d2e9078a3e

@ -816,6 +816,10 @@
<if test="completeEndDateTime != null and completeEndDateTime != ''"> <if test="completeEndDateTime != null and completeEndDateTime != ''">
AND zsd.ACTUAL_COMPLETE_DATE &lt;= TO_DATE(#{completeEndDateTime}|| '15:59:59','YYYY-MM-DD HH24:MI:SS') AND zsd.ACTUAL_COMPLETE_DATE &lt;= TO_DATE(#{completeEndDateTime}|| '15:59:59','YYYY-MM-DD HH24:MI:SS')
</if> </if>
<if test="temporaryUser != null and temporaryUser != ''">
AND ZUR.TEMPORARY_USER= #{temporaryUser}
</if>
</where> </where>
</select> </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); 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); 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.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.CommonMethods;
import org.apache.commons.fileupload.FileItem; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -86,11 +88,18 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
private ProductionCalendarService productionCalendarService; private ProductionCalendarService productionCalendarService;
@Autowired @Autowired
private SfcDispatchEmployeeService sfcDispatchEmployeeService; private SfcDispatchEmployeeService sfcDispatchEmployeeService;
private Logger logger = LoggerFactory.getLogger(SfcDispatchServiceImpl.class);
@Override @Override
public List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId) { public List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId) {
return sfcDispatchMapper.findSfcDispatch(site, sfc, operation, 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 @Override
public List<SfcDispatchDto> findSfcDispatchList(Map paramMap) throws IOException { public List<SfcDispatchDto> findSfcDispatchList(Map paramMap) throws IOException {
List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(paramMap); List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(paramMap);
@ -153,6 +162,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
@Override @Override
public Boolean releaseDispatch(String site, String user, StringBuffer message, List<SfcDispatchDto> sfcDispatchList) { public Boolean releaseDispatch(String site, String user, StringBuffer message, List<SfcDispatchDto> sfcDispatchList) {
Boolean flag = this.sfcDispatch(site, user, DispatchStatusEnum.RELEASE.getCode(), message, sfcDispatchList); Boolean flag = this.sfcDispatch(site, user, DispatchStatusEnum.RELEASE.getCode(), message, sfcDispatchList);
if (flag) { 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)) { if (StringUtil.notBlank(employees)) {
//资源、计划时间必输 //资源、计划时间必输
@ -634,7 +649,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
continue; continue;
} }
} }
logger.info("工单号:"+sfcDispatchDto.getShopOrder()+"操作人员工号2"+employees+"操作人员名字2"+sfcDispatchDto.getEmployeeDescription());
sfcDispatch.setResrce(resource); sfcDispatch.setResrce(resource);
sfcDispatch.setEmployee(employees); sfcDispatch.setEmployee(employees);
sfcDispatch.setEmployeeDescription(sfcDispatchDto.getEmployeeDescription()); 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.common.constant.Constants; 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.enums.HandleEnum;
import com.foreverwin.mesnac.common.ftp.CappFtpClient; import com.foreverwin.mesnac.common.ftp.CappFtpClient;
import com.foreverwin.mesnac.common.util.ExceptionUtil; 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.BaseException;
import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices; 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.ReleaseShopOrderRequest;
import com.sap.me.demand.ReleaseShopOrderResponse; import com.sap.me.demand.ReleaseShopOrderResponse;
import com.sap.me.demand.ReleasedSfc; import com.sap.me.demand.ReleasedSfc;
@ -35,6 +37,7 @@ import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import static com.foreverwin.modular.core.meext.PapiServiceEnum.NCProductionService; import static com.foreverwin.modular.core.meext.PapiServiceEnum.NCProductionService;
@ -306,7 +309,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setDispatchNo(dispatchNo); sfcDispatchModel.setDispatchNo(dispatchNo);
sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW); sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW);
sfcDispatchModel.setDrawingsNo(""); sfcDispatchModel.setDrawingsNo("");
sfcDispatchModel.setDrawingsRevision(GetDrawingVersionUtil.GetDrawingVerson(itemBo, connect)); // sfcDispatchModel.setDrawingsRevision(GetDrawingVersionUtil.GetDrawingVerson(itemBo, connect));
// sfcDispatchModel.setDrawingsRevision(""); // sfcDispatchModel.setDrawingsRevision("");
sfcDispatchModel.setIsLock(Constants.STATUS_N); sfcDispatchModel.setIsLock(Constants.STATUS_N);
sfcDispatchModel.setRouterBo(routerBo); sfcDispatchModel.setRouterBo(routerBo);
@ -457,7 +460,24 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
List<SfcDispatch> addSfcDispatchList = new ArrayList<>(); List<SfcDispatch> addSfcDispatchList = new ArrayList<>();
List<SfcDispatch> updateSfcDispatchList = 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<>(); QueryWrapper<SfcDispatch> queryWrapper = new QueryWrapper<>();
SfcDispatch deleteSfcDispatch = new SfcDispatch(); SfcDispatch deleteSfcDispatch = new SfcDispatch();
deleteSfcDispatch.setSite(site); deleteSfcDispatch.setSite(site);
@ -504,7 +524,9 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//SFC+Operation+stepID是否已经存在派工数据 //SFC+Operation+stepID是否已经存在派工数据
List<SfcDispatch> list = sfcDispatchService.findSfcDispatch(site, 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) { if (list == null || list.size() <= 0) {
//工艺路线新增的工序,直接增加派工数据 //工艺路线新增的工序,直接增加派工数据
String dispatchNo = sfc + "-" + stepId; String dispatchNo = sfc + "-" + stepId;
@ -527,8 +549,13 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setDispatchQty(sfcModel.getQty()); sfcDispatchModel.setDispatchQty(sfcModel.getQty());
sfcDispatchModel.setProdHours(prodHours); sfcDispatchModel.setProdHours(prodHours);
sfcDispatchModel.setTurnOperation("false"); sfcDispatchModel.setTurnOperation("false");
//sfcDispatchModel.setPlannedStartDate(plannedStartDate); if (!dispatchDtoList.isEmpty()){
//sfcDispatchModel.setPlannedCompleteDate(plannedCompleteDate); 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.setSoReleasedDate(nowDate);
sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE); sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE);
sfcDispatchModel.setIsImport(Constants.BOOL_FALSE); sfcDispatchModel.setIsImport(Constants.BOOL_FALSE);
@ -540,7 +567,9 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setOther1("false"); sfcDispatchModel.setOther1("false");
addSfcDispatchList.add(sfcDispatchModel); addSfcDispatchList.add(sfcDispatchModel);
} else { } else {
//已经存在的更新 /**
*
*/
SfcDispatch sfcDispatchModel = list.get(0); SfcDispatch sfcDispatchModel = list.get(0);
sfcDispatchModel.setDispatchSeq((m + 1)+""); sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setModifyUser(user); sfcDispatchModel.setModifyUser(user);

@ -88,7 +88,14 @@
</select> </select>
<select id="selectList" resultMap="BaseResultMap"> <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> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -115,21 +122,33 @@
<if test="ew.entity.turnOperation!=null">AND TURN_OPERATION=#{ew.entity.turnOperation}</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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.prepositionStepId!=null">AND
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if> PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if> </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.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.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if> </if>
@ -144,7 +163,14 @@
</select> </select>
<select id="selectPage" resultMap="BaseResultMap"> <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> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -171,25 +197,38 @@
<if test="ew.entity.turnOperation!=null">AND TURN_OPERATION=#{ew.entity.turnOperation}</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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.prepositionStepId!=null">AND
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if> PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if> </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.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.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.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.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.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.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.other3!=null">AND OTHER_3=#{ew.entity.other3}</if>
@ -256,7 +295,8 @@
<if test="other3!=null">OTHER_3,</if> <if test="other3!=null">OTHER_3,</if>
<if test="other4!=null">OTHER_4,</if> <if test="other4!=null">OTHER_4,</if>
<if test="other5!=null">OTHER_5,</if> <if test="other5!=null">OTHER_5,</if>
</trim> VALUES </trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
#{handle}, #{handle},
<if test="site!=null">#{site},</if> <if test="site!=null">#{site},</if>
@ -312,7 +352,8 @@
INSERT INTO Z_SFC_DISPATCH INSERT INTO Z_SFC_DISPATCH
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
</trim> VALUES </trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
#{handle}, #{handle},
#{site}, #{site},
@ -366,7 +407,8 @@
<update id="updateById"> <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.site!=null">SITE=#{et.site},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if> <if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</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.other3!=null">OTHER_3=#{et.other3},</if>
<if test="et.other4!=null">OTHER_4=#{et.other4},</if> <if test="et.other4!=null">OTHER_4=#{et.other4},</if>
<if test="et.other5!=null">OTHER_5=#{et.other5},</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> </update>
@ -465,12 +513,18 @@
OTHER_3=#{et.other3}, OTHER_3=#{et.other3},
OTHER_4=#{et.other4}, OTHER_4=#{et.other4},
OTHER_5=#{et.other5}, 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>
<update id="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.site!=null">SITE=#{et.site},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if> <if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if> <if test="et.sfc!=null">SFC=#{et.sfc},</if>
@ -539,30 +593,45 @@
<if test="ew.entity.workCenter!=null">AND WORK_CENTER=#{ew.entity.workCenter}</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.resrce!=null">AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null">AND EMPLOYEE=#{ew.entity.employee}</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="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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.prepositionStepId!=null">AND
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if> PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if> </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.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.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.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.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.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.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.other3!=null">AND OTHER_3=#{ew.entity.other3}</if>
@ -621,29 +690,44 @@
<if test="ew.entity.workCenter!=null">AND WORK_CENTER=#{ew.entity.workCenter}</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.resrce!=null">AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null">AND EMPLOYEE=#{ew.entity.employee}</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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.prepositionStepId!=null">AND
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if> PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if> </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.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.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.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.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.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.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.other3!=null">AND OTHER_3=#{ew.entity.other3}</if>
@ -665,9 +749,14 @@
<foreach item="item" index="index" collection="coll" separator=",">#{item} <foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>) </foreach>)
</delete> </delete>
<resultMap id="findSfcDispatchResult" type="SfcDispatch">
<id column="HANDLE" property="handle"/>
</resultMap>
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
<select id="findSfcDispatch" resultMap="BaseResultMap"> <select id="findSfcDispatch" resultMap="findSfcDispatchResult">
SELECT <include refid="Base_Column_List" /> SELECT
<include refid="Base_Column_List"/>
FROM Z_SFC_DISPATCH FROM Z_SFC_DISPATCH
WHERE SITE = #{site} AND SFC = #{sfc} WHERE SITE = #{site} AND SFC = #{sfc}
<if test="operation != null and operation != ''"> <if test="operation != null and operation != ''">
@ -687,12 +776,19 @@
WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布' WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布'
END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE
FROM ( 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, SELECT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, SD.ROUTER_BO, C2.VALUE ITEM_NUMBER, C1.VALUE
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, WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC,
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.DISPATCH_STATUS,SD.DRAWINGS_REVISION,
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, SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE,
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, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION,
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 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 FROM Z_SFC_DISPATCH SD
INNER JOIN SFC SC ON SC.SITE = SD.SITE AND SC.SFC = SD.SFC 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 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 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 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 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 LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO
WHERE SD.SITE = #{site} WHERE SD.SITE = #{site}
<if test="workCenter != null and workCenter != ''"> <if test="workCenter != null and workCenter != ''">
@ -722,6 +819,9 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND SD.DISPATCH_STATUS IN ${status} AND SD.DISPATCH_STATUS IN ${status}
</if> </if>
<if test="userName != null and userName != ''">
AND SD.EMPLOYEE_DESCRIPTION = #{userName}
</if>
<if test="item != null and item != ''"> <if test="item != null and item != ''">
AND IM.ITEM = #{item} AND IM.ITEM = #{item}
</if> </if>
@ -761,6 +861,9 @@
<if test="blankingSize != null and blankingSize != ''"> <if test="blankingSize != null and blankingSize != ''">
AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%' AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%'
</if> </if>
<if test="step != null and step != ''">
AND SD.STEP_ID = #{step}
</if>
<if test="component != null and component != ''"> <if test="component != null and component != ''">
AND CP.ITEM = #{component} AND CP.ITEM = #{component}
</if> </if>
@ -785,14 +888,20 @@
<if test="completeToDate != null"> <if test="completeToDate != null">
AND SD.PLANNED_COMP_DATE &lt;= TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS') AND SD.PLANNED_COMP_DATE &lt;= TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if> </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, GROUP BY SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, SD.ROUTER_BO, C2.VALUE, C1.VALUE, IM.HANDLE,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION, IM.ITEM, IT.DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,SD.DRAWINGS_REVISION,
SD.DISPATCH_STATUS, SD.DISPATCH_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION, SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE, 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 CC.VALUE, SD.TURN_OPERATION,SD.IS_UPDATE_ZJH_COMPLETE, SD.BLANKING_SIZE, WR.WORK_CENTER ,SD.OTHER_2
) WIP ) 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 V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.ROUTER_BO = WIP.ROUTER_BO AND
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 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 ) WIP
<if test="isCompleted != null and isCompleted != ''"> <if test="isCompleted != null and isCompleted != ''">
WHERE WIP.IS_COMPLETED = #{isCompleted} WHERE WIP.IS_COMPLETED = #{isCompleted}
@ -801,7 +910,8 @@
</select> </select>
<update id="updateSfcDispatchStatus"> <update id="updateSfcDispatchStatus">
UPDATE Z_SFC_DISPATCH SET DISPATCH_STATUS = #{dispatchStatus}, MODIFY_USER = #{modifyUser}, MODIFIED_DATE_TIME = #{modifiedDateTime} UPDATE Z_SFC_DISPATCH SET DISPATCH_STATUS = #{dispatchStatus}, MODIFY_USER = #{modifyUser}, MODIFIED_DATE_TIME =
#{modifiedDateTime}
<if test="dispatchStatus== 'COMPLETE'"> <if test="dispatchStatus== 'COMPLETE'">
, ACTUAL_COMPLETE_DATE = #{modifiedDateTime} , ACTUAL_PROD_HOURS = #{workHour} , ACTUAL_COMPLETE_DATE = #{modifiedDateTime} , ACTUAL_PROD_HOURS = #{workHour}
</if> </if>
@ -834,10 +944,25 @@
<select id="findSplitSfcDispatch" resultMap="BaseResultMap"> <select id="findSplitSfcDispatch" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"> </include> SELECT
<include refid="Base_Column_List"></include>
FROM Z_SFC_DISPATCH FROM Z_SFC_DISPATCH
WHERE SITE = #{site} AND SFC = #{sfc} AND TO_NUMBER(STEP_ID) >= #{stepId} WHERE SITE = #{site} AND SFC = #{sfc} AND TO_NUMBER(STEP_ID) >= #{stepId}
</select> </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">

@ -4,6 +4,18 @@ import com.foreverwin.mesnac.meapi.model.Sfc;
public class SfcDto extends 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 shopOrder;
private String status; private String status;
private String item; private String item;

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

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

@ -16,7 +16,7 @@ public interface PodTemplateService {
void sfcStart(Map<String, Object> map); 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); 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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.foreverwin.mesnac.common.constant.Constants; 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.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch; 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.SfcDispatchService;
import com.foreverwin.mesnac.dispatch.service.UserResourceService;
import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.model.IntegrationLog;
import com.foreverwin.mesnac.integration.service.IntegrationLogService; import com.foreverwin.mesnac.integration.service.IntegrationLogService;
import com.foreverwin.mesnac.meapi.dto.BomComponentDto; 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.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices; import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods; 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.AssembleComponentsRequest;
import com.sap.me.production.AssemblyComponent; import com.sap.me.production.AssemblyComponent;
import com.sap.me.production.AssemblyDataField; import com.sap.me.production.AssemblyDataField;
@ -57,9 +61,12 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Service @Service
@ -107,6 +114,9 @@ public class PodTemplateServiceImpl implements PodTemplateService {
private ResrceMapper resrceMapper; private ResrceMapper resrceMapper;
@Autowired @Autowired
private SfcDispatchService sfcDispatchService; private SfcDispatchService sfcDispatchService;
@Autowired
private UserResourceService userResourceService;
@Override @Override
@ -165,9 +175,34 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (resultMap == null) { if (resultMap == null) {
throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!"); 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 + "]的操作人员为空!请联系调度人员维护!"); 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 = sfcCrossMapper.querySfcStep(site, sfc, operationBySfcBo.getOperation());
List<Map<String, Object>> substepList = new ArrayList<>(); List<Map<String, Object>> substepList = new ArrayList<>();
resultMap.put("SFC_STEP_LIST", substepList); resultMap.put("SFC_STEP_LIST", substepList);
@ -270,7 +305,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
} }
@Override @Override
public String sfcComplete(SfcDto sfcDto, String resrce) { public String sfcComplete(SfcDto sfcDto, String resrce,String shoporder) {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
String operation = sfcDto.getOperation(); String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation); 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); materialConsumption(site, operation, HandleEnum.SFC.getHandle(site, sfc), stepId, resrce);
//专检创建 //专检创建
@ -498,10 +549,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
struIn.setIsm06(workHour); struIn.setIsm06(workHour);
ins[0] = struIn; ins[0] = struIn;
TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins); TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins);
//返回对象 //返回对象
ZprodordconfStruOut[] outs = new ZprodordconfStruOut[1]; ZprodordconfStruOut[] outs = new ZprodordconfStruOut[1];
ZprodordconfStruOut struOut = new ZprodordconfStruOut(); ZprodordconfStruOut struOut = new ZprodordconfStruOut();
struOut.setAufnr(ins[0].getAufnr()); struOut.setAufnr(ins[0].getAufnr());
struOut.setVornr(ins[0].getVornr()); 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, 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, 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, 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_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 + 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, 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 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} LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE =#{locale}
INNER JOIN ( 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 FROM Z_PROD_READY_TASK RB
INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO 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' 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 ) 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 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, 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, OP.OPERATION, OT.DESCRIPTION ,OP.OPERATION||'/'||RS.STEP_ID ,RO_CF2.VALUE,
S.SFC,S.QTY ,RS.STEP_ID,SOD.DISPATCH_NO , SOD.HANDLE , S.SFC,S.QTY ,RS.STEP_ID,SOD.DISPATCH_NO , SOD.HANDLE ,

Loading…
Cancel
Save