|
|
|
@ -1,8 +1,11 @@ |
|
|
|
|
package org.jeecg.modules.hangerlocation.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import org.jeecg.modules.hangerlocation.entity.HangerLocation; |
|
|
|
|
import org.jeecg.modules.hangerlocation.mapper.HangerLocationMapper; |
|
|
|
|
import org.jeecg.modules.hangerlocation.service.IHangerLocationService; |
|
|
|
|
import org.jeecg.modules.hangermaker.entity.HangerMaker; |
|
|
|
|
import org.jeecg.modules.hangermaker.mapper.HangerMakerMapper; |
|
|
|
|
import org.jeecg.modules.productplan.entity.ZyPlanProcess; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -24,6 +27,11 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper, |
|
|
|
|
@Autowired |
|
|
|
|
private HangerLocationMapper hangerLocationMapper; |
|
|
|
|
|
|
|
|
|
//衣架工单绑定
|
|
|
|
|
@Autowired |
|
|
|
|
private HangerMakerMapper hangerMakerMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HangerLocation queryByNew() { |
|
|
|
|
return hangerLocationMapper.queryByNew(); |
|
|
|
@ -49,28 +57,32 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper, |
|
|
|
|
long timeMillis = System.currentTimeMillis(); |
|
|
|
|
//将获取时间转为日期类型
|
|
|
|
|
Date start_time=longToDate(timeMillis); |
|
|
|
|
QueryWrapper<HangerMaker> qwhm=new QueryWrapper(); |
|
|
|
|
qwhm.eq("order_code",entry.getKey()); |
|
|
|
|
HangerMaker hm=hangerMakerMapper.selectOne(qwhm); |
|
|
|
|
for(ZyPlanProcess process:entry.getValue()) |
|
|
|
|
{ |
|
|
|
|
HangerLocation model=new HangerLocation(); |
|
|
|
|
|
|
|
|
|
/**衣架编码*/ |
|
|
|
|
String HangerCode="00087896"+randInt(10,99); |
|
|
|
|
model.setHangerCode(HangerCode); |
|
|
|
|
//String HangerCode="00087896"+randInt(10,99);
|
|
|
|
|
model.setHangerCode(hm.getHangerCode()); |
|
|
|
|
/**工位ID*/ |
|
|
|
|
model.setStationId(""); |
|
|
|
|
model.setStationId(process.getStationId()); |
|
|
|
|
/**工位编码*/ |
|
|
|
|
model.setStationCode(randInt(2,32)+""); |
|
|
|
|
model.setStationCode(process.getStationName()); |
|
|
|
|
/**设备ID*/ |
|
|
|
|
model.setEquipmentId("1459695008524345346"); |
|
|
|
|
model.setEquipmentId(process.getMachineIds()); |
|
|
|
|
/**设备名称*/ |
|
|
|
|
model.setEquipmentName("20211114"); |
|
|
|
|
model.setEquipmentName(process.getMachineNames()); |
|
|
|
|
/**工序ID*/ |
|
|
|
|
model.setProcedureId(process.getProcessId()); |
|
|
|
|
/**工序名称*/ |
|
|
|
|
model.setProcedureName(process.getProcessName()); |
|
|
|
|
/**工人ID*/ |
|
|
|
|
model.setWorkerId("20191923"); |
|
|
|
|
model.setWorkerId(process.getUserIds()); |
|
|
|
|
/**工人名称*/ |
|
|
|
|
model.setWorkerName("曾磊"); |
|
|
|
|
model.setWorkerName(process.getUserNames()); |
|
|
|
|
/**到达时间*/ |
|
|
|
|
model.setArrivalTime(start_time); |
|
|
|
|
/**离开时间*/ |
|
|
|
@ -141,6 +153,8 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper, |
|
|
|
|
return randomNum; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//将long转为日期
|
|
|
|
|
private Date longToDate(long lo) |
|
|
|
|
{ |
|
|
|
|