物流周转模块、查看工艺卡片方法修改。

master
yangwl 3 years ago
parent 433537f8cf
commit 79b339893e

@ -912,6 +912,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_QUALITY", 1, null).get(0);
}else if("S".equals(type)){//设备异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_DEVICE", 1, null).get(0);
}else if ("T".equals(type)){
abnormalNo = nextNumberHelper.getNextNumber(site, "TRANSPORT", 1, null).get(0);
}
return abnormalNo;
}

@ -142,19 +142,33 @@ public class FileController {
throw new BaseException("获取图纸文件路径为:【" + path + "】的文件流失败!");
}
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int num = in.read(buffer);
while (num != -1) {
outStream.write(buffer, 0, num);
num = in.read(buffer);
byte[] buffer = new byte[1024*5];
int len = -1;
while((len = in.read(buffer)) != -1){
outStream.write(buffer, 0, len);
}
outStream.flush();
outStream.close();
in.close();
byte[] data = outStream.toByteArray();
out = response.getOutputStream();
out.write(data);
out.flush();
// ByteArrayOutputStream outStream = new ByteArrayOutputStream();
//
// byte[] buffer = new byte[1024];
// int num = in.read(buffer);
// while (num != -1) {
// outStream.write(buffer, 0, num);
// num = in.read(buffer);
// }
// outStream.flush();
//
// byte[] data = outStream.toByteArray();
// out = response.getOutputStream();
// out.write(data);
// out.flush();
/* byte[] buffer = new byte[1024];
int len = 0;
while ((len = in.read(buffer)) != -1) {
@ -207,15 +221,15 @@ public class FileController {
if (null == in) {
throw new BaseException("获取FTP文件路径为:【" + path + "】的文件流失败!");
}
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len = 0;
while ((len = in.read(buffer)) != -1) {
outStream.write(buffer, 0, len);
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[16384];
while ((nRead = in.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
byte[] data = outStream.toByteArray();
byte[] data2 = buffer.toByteArray();
out = response.getOutputStream();
out.write(data);
out.write(data2);
out.flush();
} catch (Exception e) {

@ -5,10 +5,7 @@
package com.foreverwin.mesnac.common.ftp;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPClientConfig;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.apache.commons.net.ftp.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
@ -77,11 +74,11 @@ public class WorkmanshipCardFtpClient {
FTPClientConfig conf = new FTPClientConfig( FTPClientConfig.SYST_UNIX);
ftp.configure(conf);
//ftp.setControlEncoding(localCharset); // 中文支持
ftp.setControlEncoding(localCharset); // 中文支持
//设置访问被动模式
ftp.setRemoteVerificationEnabled(false);
ftp.enterLocalPassiveMode();
ftp.setFileType(ftp.BINARY_FILE_TYPE);// 设置传输模式
ftp.setFileType(FTP.BINARY_FILE_TYPE);// 设置传输模式
return ftp;
}
catch (SocketException e) {

@ -52,4 +52,6 @@ public interface SfcDispatchCommonService {
* @return
*/
SfcDispatchDto findSfcDispatchBySfc(SfcDispatchDto sfcDispatch);
SfcDispatchDto findNewtistSfcDispatchBySfc(String sfc);
}

@ -70,4 +70,6 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
* @param splitQty
*/
void updateSfcDispatchQty(@Param("site") String site, @Param("sfc") String sfc, @Param("currentSeq") int currentSeq, @Param("splitQty") Float splitQty);
SfcDispatchDto findNewtistSfcDispatchBySfc(String sfc);
}

@ -822,6 +822,11 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
return sfcDispatchMapper.findSfcDispatchBySfc(site,sfcDispatch);
}
@Override
public SfcDispatchDto findNewtistSfcDispatchBySfc(String sfc) {
return sfcDispatchMapper.findNewtistSfcDispatchBySfc(sfc);
}
public Map<String, Map<String, List<WorkCenterWorkTimeDTO>>> processWorkCenterWorkTimes(String site, Set<String> workCenterList, Date startDate, Date endDate) {
// 设备对应的工作中心

@ -810,6 +810,9 @@
SD.RESRCE
LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO
WHERE SD.SITE = #{site}
<if test="HANDLE != null and HANDLE != ''">
AND SD.HANDLE = #{HANDLE}
</if>
<if test="workCenter != null and workCenter != ''">
AND SD.OPERATION LIKE #{workCenter}||'%'
</if>
@ -963,6 +966,14 @@
AND ACTUAL_COMPLETE_DATE IS NOT NULL
AND ROWNUM=1 ORDER BY ACTUAL_COMPLETE_DATE DESC
</select>
<select id="findNewtistSfcDispatchBySfc" resultType="com.foreverwin.mesnac.common.dto.SfcDispatchDto">
SELECT
*
FROM
( SELECT STEP_ID FROM Z_SFC_DISPATCH WHERE SFC = '202110200000' AND ACTUAL_COMPLETE_DATE IS NOT NULL ORDER BY ACTUAL_COMPLETE_DATE DESC )
WHERE
ROWNUM = 1
</select>
<update id="updateSfcDispatchQty">

@ -1,9 +1,13 @@
package com.foreverwin.mesnac.meapi.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.model.LogisticsBill;
import com.foreverwin.mesnac.meapi.service.LogisticsBillService;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
@ -12,13 +16,16 @@ import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.LogisticsTurnoverService;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
*
* @author YANG.WL
* @since 2022-07-27
* @since 2022-08-04
*/
@RestController
@RequestMapping("/Z-LOGISTICS-TURNOVER")
@ -26,6 +33,8 @@ public class LogisticsTurnoverController {
@Autowired
public LogisticsTurnoverService logisticsTurnoverService;
@Autowired
public LogisticsBillService logisticsBillService;
/**
* id
@ -69,6 +78,7 @@ public class LogisticsTurnoverController {
return Optional.ofNullable(result)
.map(t -> JSONObject.toJSONString(t)).orElse("null");
}
/**
*
*
@ -94,6 +104,7 @@ public class LogisticsTurnoverController {
.or().like(LogisticsTurnover::getOther3, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getStorageLocation, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getTurnoverWorkCenter, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getIsReceive, frontPage.getGlobalQuery())
);
}
result = logisticsTurnoverService.page(frontPage.getPagePlus(), queryWrapper);
@ -141,4 +152,36 @@ public class LogisticsTurnoverController {
public R removeByIds(List<String> ids){
return R.ok(logisticsTurnoverService.removeByIds(ids));
}
/**
*
* @param list ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/UPDATE-STATUS")
public R updateStatusById(String list,String location,String transportno){
List<LogisticsDto> logisticsDtoList = JSONArray.parseArray(list,LogisticsDto.class);
List<LogisticsTurnover> logisticsTurnoverList=new ArrayList<>();
LogisticsTurnover logisticsTurnover=new LogisticsTurnover();
LogisticsBill logisticsBill=new LogisticsBill();
if (!list.isEmpty() && location!=null && transportno!=null){
for (LogisticsDto logisticsDto:logisticsDtoList) {
logisticsTurnover.setHandle(logisticsDto.getHandle());
logisticsTurnover.setStatus("COM");
logisticsTurnover.setStorageLocation(location);
logisticsTurnover.setComDateTime(LocalDateTime.now());
logisticsTurnover.setIsReceive("N");
logisticsTurnoverList.add(logisticsTurnover);
logisticsBill.setComTime(LocalDateTime.now());
logisticsBill.setLogisticsBillNo(transportno);
logisticsBill.setLogisticsBo(logisticsDto.getHandle());
logisticsBillService.save(logisticsBill);
}
return R.ok(logisticsTurnoverService.updateById(logisticsTurnover));
}else {
return R.failed();
}
}
}

@ -1,6 +1,16 @@
package com.foreverwin.mesnac.meapi.dto;
public class LogisticsDto {
private String handle;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
private String nextWorkCenter;
private String sfc;
private String workOrder;
@ -86,7 +96,8 @@ public class LogisticsDto {
@Override
public String toString() {
return "LogisticsDto{" +
"nextWorkCenter='" + nextWorkCenter + '\'' +
"handle='" + handle + '\'' +
", nextWorkCenter='" + nextWorkCenter + '\'' +
", sfc='" + sfc + '\'' +
", workOrder='" + workOrder + '\'' +
", itemDescription='" + itemDescription + '\'' +

@ -19,4 +19,6 @@ import java.util.List;
public interface LogisticsTurnoverMapper extends BaseMapper<LogisticsTurnover> {
List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto);
LogisticsTurnover queryNewtistTurnoverTask(String InspectionTaskNo);
}

@ -36,4 +36,5 @@ public interface SfcMapper extends BaseMapper<Sfc> {
String findSfcByResrce(@Param("site")String site,@Param("resource")String resource,@Param("sfc")Sfc sfc);
String findInspectionTask_sfcdispatch_no(String sfc);
}

@ -4,7 +4,6 @@ import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
@ -16,7 +15,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p>
*
* @author YANG.WL
* @since 2022-07-27
* @since 2022-08-04
*/
@TableName("Z_LOGISTICS_TURNOVER")
@ -28,7 +27,7 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
@TableField("HANDLE")
private String handle;
/**
*
@ -55,10 +54,19 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
*/
@TableField("USER_NAME")
private String userName;
/**
*
*/
@TableField("OTHER1")
private String other1;
/**
*
*/
@TableField("OTHER2")
private String other2;
/**
*
*/
@TableField("OTHER3")
private String other3;
/**
@ -71,6 +79,16 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
*/
@TableField("TURNOVER_WORK_CENTER")
private String turnoverWorkCenter;
/**
*
*/
@TableField("COM_DATE_TIME")
private LocalDateTime comDateTime;
/**
* Y/N/
*/
@TableField("IS_RECEIVE")
private String isReceive;
public String getHandle() {
@ -161,6 +179,22 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
this.turnoverWorkCenter = turnoverWorkCenter;
}
public LocalDateTime getComDateTime() {
return comDateTime;
}
public void setComDateTime(LocalDateTime comDateTime) {
this.comDateTime = comDateTime;
}
public String getIsReceive() {
return isReceive;
}
public void setIsReceive(String isReceive) {
this.isReceive = isReceive;
}
public static final String HANDLE = "HANDLE";
public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO";
@ -183,6 +217,10 @@ public static final String STORAGE_LOCATION = "STORAGE_LOCATION";
public static final String TURNOVER_WORK_CENTER = "TURNOVER_WORK_CENTER";
public static final String COM_DATE_TIME = "COM_DATE_TIME";
public static final String IS_RECEIVE = "IS_RECEIVE";
@Override
protected Serializable pkVal() {
@ -203,6 +241,8 @@ public static final String TURNOVER_WORK_CENTER = "TURNOVER_WORK_CENTER";
", other3 = " + other3 +
", storageLocation = " + storageLocation +
", turnoverWorkCenter = " + turnoverWorkCenter +
", comDateTime = " + comDateTime +
", isReceive = " + isReceive +
"}";
}
}

@ -28,4 +28,9 @@ public interface LogisticsTurnoverService extends IService<LogisticsTurnover> {
List<LogisticsTurnover> selectList(LogisticsTurnover logisticsTurnover);
List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto);
//根据派工单查最新的转运表数据
LogisticsTurnover queryNewtistTurnoverTask(String InspectionTaskNo);
}

@ -56,4 +56,5 @@ public interface SfcService extends IService<Sfc> {
List<Sfc> findSfcByResrce(String resource,Sfc sfc);
String findInspectionTask_sfcdispatch_no(String sfc);
}

@ -48,5 +48,10 @@ public class LogisticsTurnoverServiceImpl extends ServiceImpl<LogisticsTurnoverM
return logisticsTurnoverMapper.queryLogisticsTurnoverList(logisticsDto);
}
@Override
public LogisticsTurnover queryNewtistTurnoverTask(String InspectionTaskNo) {
return logisticsTurnoverMapper.queryNewtistTurnoverTask(InspectionTaskNo);
}
}

@ -88,4 +88,9 @@ public class SfcServiceImpl extends ServiceImpl<SfcMapper, Sfc> implements SfcSe
sfcMapper.findSfcByResrce(site,resource,sfc);
return null;
}
@Override
public String findInspectionTask_sfcdispatch_no(String sfc) {
return sfcMapper.findInspectionTask_sfcdispatch_no(sfc);
}
}

@ -4,7 +4,7 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
<id column="HANDLE" property="handle" />
<result column="HANDLE" property="handle" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
<result column="STATUS" property="status" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
@ -15,22 +15,16 @@
<result column="OTHER3" property="other3" />
<result column="STORAGE_LOCATION" property="storageLocation" />
<result column="TURNOVER_WORK_CENTER" property="turnoverWorkCenter" />
</resultMap>
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.meapi.dto.LogisticsDto">
<result column="COM_DATE_TIME" property="comDateTime" />
<result column="IS_RECEIVE" property="isReceive" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SFC_DISPATCH_BO, STATUS, CREATED_DATE_TIME, USER, USER_NAME, OTHER1, OTHER2, OTHER3, STORAGE_LOCATION, TURNOVER_WORK_CENTER
HANDLE, SFC_DISPATCH_BO, STATUS, CREATED_DATE_TIME, USER, USER_NAME, OTHER1, OTHER2, OTHER3, STORAGE_LOCATION, TURNOVER_WORK_CENTER, COM_DATE_TIME, IS_RECEIVE
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
@ -46,12 +40,6 @@
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOGISTICS_TURNOVER
@ -69,6 +57,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</where>
</select>
@ -90,6 +80,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -119,6 +111,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -148,6 +142,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -177,6 +173,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -206,6 +204,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -235,6 +235,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -245,39 +247,6 @@
${ew.sqlSegment}
</if>
</select>
<select id="queryLogisticsTurnoverList" resultMap="FullResultMap">
SELECT
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
INSERT INTO Z_LOGISTICS_TURNOVER
@ -293,6 +262,8 @@
<if test="other3!=null">OTHER3,</if>
<if test="storageLocation!=null">STORAGE_LOCATION,</if>
<if test="turnoverWorkCenter!=null">TURNOVER_WORK_CENTER,</if>
<if test="comDateTime!=null">COM_DATE_TIME,</if>
<if test="isReceive!=null">IS_RECEIVE,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
@ -306,6 +277,8 @@
<if test="other3!=null">#{other3},</if>
<if test="storageLocation!=null">#{storageLocation},</if>
<if test="turnoverWorkCenter!=null">#{turnoverWorkCenter},</if>
<if test="comDateTime!=null">#{comDateTime},</if>
<if test="isReceive!=null">#{isReceive},</if>
</trim>
</insert>
@ -326,44 +299,19 @@
#{other3},
#{storageLocation},
#{turnoverWorkCenter},
#{comDateTime},
#{isReceive},
</trim>
</insert>
<update id="updateById">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.user!=null">USER=#{et.user},</if>
<if test="et.userName!=null">USER_NAME=#{et.userName},</if>
<if test="et.other1!=null">OTHER1=#{et.other1},</if>
<if test="et.other2!=null">OTHER2=#{et.other2},</if>
<if test="et.other3!=null">OTHER3=#{et.other3},</if>
<if test="et.storageLocation!=null">STORAGE_LOCATION=#{et.storageLocation},</if>
<if test="et.turnoverWorkCenter!=null">TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</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="updateAllColumnById">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
STATUS=#{et.status},
CREATED_DATE_TIME=#{et.createdDateTime},
USER=#{et.user},
USER_NAME=#{et.userName},
OTHER1=#{et.other1},
OTHER2=#{et.other2},
OTHER3=#{et.other3},
STORAGE_LOCATION=#{et.storageLocation},
TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},
</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_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -374,6 +322,8 @@
<if test="et.other3!=null">OTHER3=#{et.other3},</if>
<if test="et.storageLocation!=null">STORAGE_LOCATION=#{et.storageLocation},</if>
<if test="et.turnoverWorkCenter!=null">TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
<if test="et.comDateTime!=null">COM_DATE_TIME=#{et.comDateTime},</if>
<if test="et.isReceive!=null">IS_RECEIVE=#{et.isReceive},</if>
</trim>
<where>
<if test="ew!=null">
@ -389,6 +339,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -400,9 +352,6 @@
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_LOGISTICS_TURNOVER
@ -435,6 +384,8 @@
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -446,11 +397,54 @@
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="queryNewtistTurnoverTask" resultType="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
SELECT
ZLT.HANDLE,
WCT.DESCRIPTION TURNOVER_WORK_CENTER
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WC.HANDLE = WCT.WORK_CENTER_BO
WHERE
OTHER3=#{InspectionTaskNo}
</select>
<select id="queryLogisticsTurnoverList" resultType="com.foreverwin.mesnac.meapi.dto.LogisticsDto">
SELECT
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
WHERE ZLT.STATUS = 'NEW'
</select>
</mapper>

@ -726,5 +726,15 @@
<select id="findSfcByResrce" resultMap="BaseResultMap">
</select>
<select id="findInspectionTask_sfcdispatch_no" resultType="java.lang.String">
SELECT
SFC_DISPATCH_BO
FROM
( SELECT * FROM Z_INSPECTION_TASK WHERE 1 = 1 AND SFC = #{sfc} AND RESULT = 'OK' AND STATUS = 'COMPLETE' ORDER BY MODIFIED_DATE_TIME DESC )
WHERE
ROWNUM = 1
</select>
</mapper>

@ -1,11 +1,18 @@
package com.foreverwin.mesnac.production.controller;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.enums.HandleEnum;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.mesnac.production.service.PodTemplateService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.R;
@ -13,9 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
@Controller
@RequestMapping("/sfcDataMains")
@ -23,6 +28,8 @@ public class PodTemplateController {
@Autowired
public PodTemplateService podTemplateService;
@Autowired
private RouterService routerService;
/**
*
@ -53,11 +60,20 @@ public class PodTemplateController {
*/
@ResponseBody
@GetMapping("/Androidsfc")
public R Androidsfc(@RequestParam("sfc") String sfc,@RequestParam("site")String site) {
SfcDto sfcDto=new SfcDto();
sfcDto.setSfc(sfc);
sfcDto.setSite(site);
return R.ok(podTemplateService.sfcEnter(sfcDto));
public String Androidsfc(@RequestParam("sfc") String sfc, @RequestParam("site")String site) {
//通过SFC+StepID获取检验信息
LogisticsDto result;
Map paramMap=new HashMap();
paramMap.put("site",site);
paramMap.put("sfc",sfc);
result=podTemplateService.Scansfc(paramMap);
return Optional.ofNullable(result)
.map(t -> JSONObject.toJSONString(t)).orElse("null");
}

@ -1,10 +1,13 @@
package com.foreverwin.mesnac.production.service;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Sfc;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface PodTemplateService {
@ -12,6 +15,7 @@ public interface PodTemplateService {
Map<String, Object> sfcEnter(SfcDto workCenterDto);
Object getSfcInfo(SfcDto sfcDto);
void sfcStart(Map<String, Object> map);
@ -22,4 +26,7 @@ public interface PodTemplateService {
SfcDto getInfoBySfc(Sfc sfc);
LogisticsDto Scansfc(Map paramMap);
// Map<String, Object> Scansfc(SfcDto sfcDto);
}

@ -21,15 +21,13 @@ import com.foreverwin.mesnac.common.service.*;
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.mapper.SfcDispatchMapper;
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.meapi.dto.BomComponentDto;
import com.foreverwin.mesnac.meapi.dto.RouterStepDto;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.meapi.dto.*;
import com.foreverwin.mesnac.meapi.mapper.ResrceMapper;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
@ -117,6 +115,12 @@ public class PodTemplateServiceImpl implements PodTemplateService {
@Autowired
private RouterStepService routerStepService;
@Autowired
private SfcDispatchMapper sfcDispatchMapper;
@Autowired
public LogisticsTurnoverService logisticsTurnoverService;
@Override
@ -673,4 +677,44 @@ public class PodTemplateServiceImpl implements PodTemplateService {
sfc.setSite(site);
return sfcCrossMapper.getInfoBySfc(sfc);
}
@Override
public LogisticsDto Scansfc(Map paramMap) {
String sfc = (String) paramMap.get("sfc");
String site = (String) paramMap.get("site");
//校验产品条码是否存在
Sfc sfcById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
if (sfcById == null) {
throw new BaseException("产品条码" + sfc + "不存在");
}
//当前工序
SfcDispatchDto dispatchDto=sfcDispatchCommonService.findNewtistSfcDispatchBySfc(sfc);
Operation operationBySfcBo = commonService.getOperationBySfcBo(sfcById.getHandle());
QueryWrapper<InspectionTask> queryWrapper = new QueryWrapper<>();
InspectionTask inspectionTask=new InspectionTask();
inspectionTask.setSfc(sfc);
inspectionTask.setStepId(dispatchDto.getStepId());
queryWrapper.setEntity(inspectionTask);
InspectionTask inspectionTaskServiceOne=inspectionTaskService.getOne(queryWrapper);
paramMap.put("HANDLE",inspectionTaskServiceOne.getSfcDispatchBo());
LogisticsDto logisticsDto=new LogisticsDto();
List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(paramMap);
LogisticsTurnover logisticsTurnover=logisticsTurnoverService.queryNewtistTurnoverTask(inspectionTaskServiceOne.getHandle());
if (!list.isEmpty()){
logisticsDto.setHandle(logisticsTurnover.getHandle());
logisticsDto.setItemDescription(list.get(0).getItemDescription());
logisticsDto.setSfc(sfc);
logisticsDto.setNextWorkCenter(logisticsTurnover.getTurnoverWorkCenter());
}
//转运任务
return logisticsDto;
}
}

@ -213,6 +213,7 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
* 2
* 3
*/
SfcDispatch sfcDispatchById = sfcDispatchService.getById(inspectionTaskManage.getSfcdispatchBo());
QueryWrapper<SfcDispatch> queryWrapper = new QueryWrapper<>();
@ -226,10 +227,12 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
//生成周转任务的同时发送消息提示到手持设备
LogisticsTurnover logisticsTurnover=new LogisticsTurnover();
logisticsTurnover.setHandle("LogisticsBO:1000"+","+UUID.randomUUID().toString());
logisticsTurnover.setSfcDispatchBo(sfcDispatchById.getHandle());
logisticsTurnover.setSfcDispatchBo(inspectionTaskModel.getSfcDispatchBo());
logisticsTurnover.setStatus(Constants.LOGISTICS_NEW);
logisticsTurnover.setCreatedDateTime(LocalDateTime.now());
logisticsTurnover.setOther1(sfcDispatch.getOperation());
logisticsTurnover.setOther2(inspectionTaskModel.getStepId());
logisticsTurnover.setOther3(inspectionTaskModel.getHandle());
logisticsTurnover.setTurnoverWorkCenter(sfcDispatch.getWorkCenter());
logisticsTurnoverService.save(logisticsTurnover);

Loading…
Cancel
Save