逻辑删除+手持增加缓冲区接口+工艺车数

highway
zhaoxiaolin 1 year ago
parent d0c62cb2df
commit d394d2a1df

@ -5,13 +5,22 @@ import java.util.List;
public class WCSDataDTO { public class WCSDataDTO {
private String sku; // private String sku;
//
// private String loadNo;
//
// private List<WCSDataItemsDTO> unLoadItems;
private String loadNo; private String stationNo;
private int qty;
private List<WCSDataItemsDTO> unLoadItems; public int getQty() {
return qty;
}
private String stationNo; public void setQty(int qty) {
this.qty = qty;
}
public String getStationNo() { public String getStationNo() {
return stationNo; return stationNo;
@ -21,27 +30,27 @@ public class WCSDataDTO {
this.stationNo = stationNo; this.stationNo = stationNo;
} }
public String getSku() { // public String getSku() {
return sku; // return sku;
} // }
//
public void setSku(String sku) { // public void setSku(String sku) {
this.sku = sku; // this.sku = sku;
} // }
//
public String getLoadNo() { // public String getLoadNo() {
return loadNo; // return loadNo;
} // }
//
public void setLoadNo(String loadNo) { // public void setLoadNo(String loadNo) {
this.loadNo = loadNo; // this.loadNo = loadNo;
} // }
//
public List<WCSDataItemsDTO> getUnLoadItems() { // public List<WCSDataItemsDTO> getUnLoadItems() {
return unLoadItems; // return unLoadItems;
} // }
//
public void setUnLoadItems(List<WCSDataItemsDTO> unLoadItems) { // public void setUnLoadItems(List<WCSDataItemsDTO> unLoadItems) {
this.unLoadItems = unLoadItems; // this.unLoadItems = unLoadItems;
} // }
} }

@ -66,4 +66,6 @@ public interface ProRfidProcessDetailMapper {
public String getStationType(String equipmentCode); public String getStationType(String equipmentCode);
String getActuaEquips(ProRfidProcessDetail rfidInfo); String getActuaEquips(ProRfidProcessDetail rfidInfo);
Integer getEquipNum(String machineCode);
} }

@ -79,49 +79,59 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
*/ */
@Override @Override
public WCSDTO requestDestinationStations(WCSDTO wcsdto) { public WCSDTO requestDestinationStations(WCSDTO wcsdto) {
DynamicDataSourceContextHolder.push("ds_"+wcsdto.getFactory());
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
WCSDTO dto = new WCSDTO();//最终结果 WCSDTO dto = new WCSDTO();//最终结果
BeanUtils.copyBeanProp(dto,wcsdto); try {
//根据rfid跟工单绑定成型机跟工单绑定获取对应工艺。 BeanUtils.copyBeanProp(dto, wcsdto);
ProRfidProcessDetail rfidInfo = proRfidProcessDetailMapper.getRfidInfo(wcsdto.getRfidNo()); //根据rfid跟工单绑定成型机跟工单绑定获取对应工艺。
//获取设备类型 ProRfidProcessDetail rfidInfo = proRfidProcessDetailMapper.getRfidInfo(wcsdto.getRfidNo());
if(rfidInfo!=null && StringUtils.isNotBlank(rfidInfo.getMachineCode())){ //获取设备类型
//设备-工艺路线的设备大范围 if (rfidInfo != null && StringUtils.isNotBlank(rfidInfo.getMachineCode())) {
String[] machineCodes0 = rfidInfo.getMachineCode().split(","); //设备-工艺路线的设备大范围
String stationType = proRfidProcessDetailMapper.getStationType(machineCodes0[0]); String[] machineCodes0 = rfidInfo.getMachineCode().split(",");
if(StringUtils.isNotBlank(stationType)){ String stationType = proRfidProcessDetailMapper.getStationType(machineCodes0[0]);
dto.setStationType(stationType); if (StringUtils.isNotBlank(stationType)) {
} dto.setStationType(stationType);
//设备-根据工单获取实际规划设备路线 }
String machinecode = rfidInfo.getProdLineCode();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo); //设备-根据工单获取实际规划设备路线
JSONArray codeArray = JSONArray.parseArray(machinecode); String machinecode = rfidInfo.getProdLineCode();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo);
List<String> list2 = new ArrayList<>(); JSONArray codeArray = JSONArray.parseArray(machinecode);
for(int c1=0;c1<codeArray.size();c1++){ List<String> list2 = new ArrayList<>();
String equipCode0 = codeArray.getJSONArray(c1).getString(1); for (int c1 = 0; c1 < codeArray.size(); c1++) {
list2.add(equipCode0); String equipCode0 = codeArray.getJSONArray(c1).getString(1);
} list2.add(equipCode0);
}
//取交集 //取交集
List<String> list1 = Arrays.asList(machineCodes0); List<String> list1 = Arrays.asList(machineCodes0);
List<String> machineArray = list1.stream() List<String> machineArray = list1.stream()
.filter(u1-> list2.contains(u1)) .filter(u1 -> list2.contains(u1))
.collect(Collectors.toList()); .collect(Collectors.toList());
dto.setSku(rfidInfo.getProductCode()); dto.setSku(rfidInfo.getProductCode());
dto.setSpec(rfidInfo.getProductModel()); dto.setSpec(rfidInfo.getProductModel());
dto.setProductionState(rfidInfo.getNowProcessId()); dto.setProductionState(rfidInfo.getNowProcessId());
List<WCSDataDTO> stationNos = new ArrayList<>(); List<WCSDataDTO> stationNos = new ArrayList<>();
WCSDataDTO wCSDataDTO = null; WCSDataDTO wCSDataDTO = null;
for(String machineCode:machineArray){ for (String machineCode : machineArray) {
wCSDataDTO = new WCSDataDTO(); wCSDataDTO = new WCSDataDTO();
if(StringUtils.isNotBlank(machineCode)){ if (StringUtils.isNotBlank(machineCode)) {
wCSDataDTO.setStationNo(machineCode); wCSDataDTO.setStationNo(machineCode);
stationNos.add(wCSDataDTO); if ("2".equals(stationType)) {
Integer qty = proRfidProcessDetailMapper.getEquipNum(machineCode);
wCSDataDTO.setQty(qty == null ? 0 : qty);
}
stationNos.add(wCSDataDTO);
}
} }
dto.setStationNos(stationNos);
dto.setCode("0");
} }
dto.setStationNos(stationNos); }catch (Exception e){
dto.setCode("1");
dto.setMessage("MES管理系统接口调用失败");
} }
return dto; return dto;
} }
public static void main(String args[]){ public static void main(String args[]){

@ -1,96 +0,0 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesPrepareValidateMapper;
import com.op.mes.domain.MesPrepareValidate;
import com.op.mes.service.IMesPrepareValidateService;
/**
* Service
*
* @author Open Platform
* @date 2023-08-04
*/
@Service
public class MesPrepareValidateServiceImpl implements IMesPrepareValidateService {
@Autowired
private MesPrepareValidateMapper mesPrepareValidateMapper;
/**
*
*
* @param validateId
* @return
*/
@Override
@DS("#header.poolName")
public MesPrepareValidate selectMesPrepareValidateByValidateId(String validateId) {
return mesPrepareValidateMapper.selectMesPrepareValidateByValidateId(validateId);
}
/**
*
*
* @param mesPrepareValidate
* @return
*/
@Override
@DS("#header.poolName")
public List<MesPrepareValidate> selectMesPrepareValidateList(MesPrepareValidate mesPrepareValidate) {
return mesPrepareValidateMapper.selectMesPrepareValidateList(mesPrepareValidate);
}
/**
*
*
* @param mesPrepareValidate
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesPrepareValidate(MesPrepareValidate mesPrepareValidate) {
mesPrepareValidate.setCreateTime(DateUtils.getNowDate());
return mesPrepareValidateMapper.insertMesPrepareValidate(mesPrepareValidate);
}
/**
*
*
* @param mesPrepareValidate
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesPrepareValidate(MesPrepareValidate mesPrepareValidate) {
mesPrepareValidate.setUpdateTime(DateUtils.getNowDate());
return mesPrepareValidateMapper.updateMesPrepareValidate(mesPrepareValidate);
}
/**
*
*
* @param validateIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesPrepareValidateByValidateIds(String[] validateIds) {
return mesPrepareValidateMapper.deleteMesPrepareValidateByValidateIds(validateIds);
}
/**
*
*
* @param validateId
* @return
*/
@Override
public int deleteMesPrepareValidateByValidateId(String validateId) {
return mesPrepareValidateMapper.deleteMesPrepareValidateByValidateId(validateId);
}
}

@ -92,6 +92,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from pro_order_workorder from pro_order_workorder
where workorder_code = #{workorderCode} where workorder_code = #{workorderCode}
</select> </select>
<select id="getEquipNum" resultType="java.lang.Integer">
select isvalue from base_equipment_attached
where property = 'dollyNumber'
and device_code = #{machineCode}
</select>
<insert id="insertProRfidProcessDetail" parameterType="ProRfidProcessDetail"> <insert id="insertProRfidProcessDetail" parameterType="ProRfidProcessDetail">
insert into pro_rfid_process_detail insert into pro_rfid_process_detail

@ -54,12 +54,21 @@ public class ProRoute extends BaseEntity
private String attr4; private String attr4;
private String fileList; private String fileList;
//每车的bp数
private Integer carNumUnit;
private List<String> idList; private List<String> idList;
private String routeVersion; private String routeVersion;
public Integer getCarNumUnit() {
return carNumUnit;
}
public void setCarNumUnit(Integer carNumUnit) {
this.carNumUnit = carNumUnit;
}
public List<String> getIdList() { public List<String> getIdList() {
return idList; return idList;
} }

@ -21,11 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="routeVersion" column="route_version" /> <result property="routeVersion" column="route_version" />
<result property="needCheck" column="need_check" /> <result property="needCheck" column="need_check" />
<result property="carNumUnit" column="car_num_unit" />
</resultMap> </resultMap>
<select id="selectRouteByItemCode" resultMap="ProRouteResult"> <select id="selectRouteByItemCode" resultMap="ProRouteResult">
select pr.route_code,pr.route_name select pr.route_code,pr.route_name,pr.car_num_unit
from pro_route pr from pro_route pr
INNER JOIN pro_route_product prp ON pr.route_id = prp.route_id INNER JOIN pro_route_product prp ON pr.route_id = prp.route_id
where prp.item_code = #{itemCode} and pr.enable_flag = 'Y' where prp.item_code = #{itemCode} and pr.enable_flag = 'Y'

@ -64,6 +64,8 @@ public class ProRoute extends BaseEntity
/** 其他 */ /** 其他 */
private String tecOther; private String tecOther;
/**每车bp数**/
private Integer carNumUnit;
private String fileList; private String fileList;
private List<BaseFile> files; private List<BaseFile> files;
@ -72,6 +74,14 @@ public class ProRoute extends BaseEntity
private String routeVersion; private String routeVersion;
public Integer getCarNumUnit() {
return carNumUnit;
}
public void setCarNumUnit(Integer carNumUnit) {
this.carNumUnit = carNumUnit;
}
public List<String> getIdList() { public List<String> getIdList() {
return idList; return idList;
} }

@ -26,12 +26,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tecMachine" column="tec_machine" /> <result property="tecMachine" column="tec_machine" />
<result property="tecOther" column="tec_other" /> <result property="tecOther" column="tec_other" />
<result property="tecDepreciation" column="tec_depreciation" /> <result property="tecDepreciation" column="tec_depreciation" />
<result property="carNumUnit" column="car_num_unit" />
</resultMap> </resultMap>
<sql id="selectProRouteVo"> <sql id="selectProRouteVo">
select route_id, route_code, route_name, route_desc, enable_flag, remark, select route_id, route_code, route_name, route_desc, enable_flag, remark,
attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time,
route_version,need_check,tec_man,tec_machine,tec_other,tec_depreciation route_version,need_check,tec_man,tec_machine,tec_other,tec_depreciation,car_num_unit
from pro_route from pro_route
</sql> </sql>
@ -63,7 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkRouteCodeUnique" parameterType="ProRoute" resultMap="ProRouteResult"> <select id="checkRouteCodeUnique" parameterType="ProRoute" resultMap="ProRouteResult">
select top 1 route_id, route_code, route_name, route_desc, select top 1 route_id, route_code, route_name, route_desc,
enable_flag, remark, attr1, attr2, attr3, attr4, enable_flag, remark, attr1, attr2, attr3, attr4,
create_by, create_time, update_by, update_time,need_check,tec_man,tec_machine,tec_other,tec_depreciation create_by, create_time, update_by, update_time,need_check,tec_man,tec_machine,tec_other,tec_depreciation,
car_num_unit
from pro_route from pro_route
where route_code = #{routeCode} where route_code = #{routeCode}
</select> </select>
@ -98,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tecMachine != null">tec_machine,</if> <if test="tecMachine != null">tec_machine,</if>
<if test="tecOther != null">tec_other,</if> <if test="tecOther != null">tec_other,</if>
<if test="tecDepreciation != null">tec_depreciation,</if> <if test="tecDepreciation != null">tec_depreciation,</if>
<if test="carNumUnit != null">car_num_unit,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeId != null and routeId != ''">#{routeId},</if> <if test="routeId != null and routeId != ''">#{routeId},</if>
@ -121,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tecMachine != null">#{tecMachine},</if> <if test="tecMachine != null">#{tecMachine},</if>
<if test="tecOther != null">#{tecOther},</if> <if test="tecOther != null">#{tecOther},</if>
<if test="tecDepreciation != null">#{tecDepreciation},</if> <if test="tecDepreciation != null">#{tecDepreciation},</if>
<if test="carNumUnit != null">#{carNumUnit},</if>
</trim> </trim>
</insert> </insert>
@ -147,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tecMachine != null">tec_machine = #{tecMachine},</if> <if test="tecMachine != null">tec_machine = #{tecMachine},</if>
<if test="tecOther != null">tec_other = #{tecOther},</if> <if test="tecOther != null">tec_other = #{tecOther},</if>
<if test="tecDepreciation != null">tec_depreciation=#{tecDepreciation},</if> <if test="tecDepreciation != null">tec_depreciation=#{tecDepreciation},</if>
<if test="carNumUnit != null">car_num_unit= #{carNumUnit},</if>
</trim> </trim>
where route_id = #{routeId} where route_id = #{routeId}
</update> </update>

Loading…
Cancel
Save