2023-06-08-01-bug

master
喻忠伟 1 year ago
parent 5010af7261
commit 6884f17f83
  1. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/Hanger.java
  2. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/controller/HangerLocationController.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/IHangerLocationService.java
  4. 72
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java
  5. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/IHangerMakerService.java
  6. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/impl/HangerMakerServiceImpl.java

@ -58,4 +58,9 @@ public class Hanger implements Serializable {
@Excel(name = "衣架编号", width = 15) @Excel(name = "衣架编号", width = 15)
@ApiModelProperty(value = "衣架编号") @ApiModelProperty(value = "衣架编号")
private java.lang.String hangerCode; private java.lang.String hangerCode;
/**衣架状态*/
@Excel(name = "衣架状态", width = 15)
@ApiModelProperty(value = "衣架状态")
private java.lang.String status;
} }

@ -225,4 +225,20 @@ public class HangerLocationController extends JeecgController<HangerLocation, IH
return super.importExcel(request, response, HangerLocation.class); return super.importExcel(request, response, HangerLocation.class);
} }
/**
* 传感器记录
*
* @param id 衣架id
* @param code 传感器id
* @return
*/
@AutoLog(value = "传感器记录")
@ApiOperation(value="传感器记录", notes="传感器记录")
@PutMapping(value = "/records")
public Result<?> records(@RequestParam(name="code",required=true) String code,@RequestParam(name="id",required=true) String id) {
hangerLocationService.records(id, code);
return Result.ok("编辑成功!");
}
} }

@ -18,4 +18,6 @@ public interface IHangerLocationService extends IService<HangerLocation> {
//自动化生产传感器记录 //自动化生产传感器记录
void recordAuto(List<String> woList); void recordAuto(List<String> woList);
//记录传感器信息
void records(String id, String code);
} }

@ -1,6 +1,7 @@
package org.jeecg.modules.hangerlocation.service.impl; package org.jeecg.modules.hangerlocation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.jeecg.common.util.XJobUtils; import org.jeecg.common.util.XJobUtils;
import org.jeecg.modules.demo.productrecord.entity.ProductRecord; import org.jeecg.modules.demo.productrecord.entity.ProductRecord;
import org.jeecg.modules.demo.productrecord.mapper.ProductRecordMapper; import org.jeecg.modules.demo.productrecord.mapper.ProductRecordMapper;
@ -8,6 +9,7 @@ import org.jeecg.modules.demo.sensor.entity.Sensor;
import org.jeecg.modules.demo.sensor.mapper.SensorMapper; import org.jeecg.modules.demo.sensor.mapper.SensorMapper;
import org.jeecg.modules.demo.sensorrecord.entity.SensorRecord; import org.jeecg.modules.demo.sensorrecord.entity.SensorRecord;
import org.jeecg.modules.demo.sensorrecord.mapper.SensorRecordMapper; import org.jeecg.modules.demo.sensorrecord.mapper.SensorRecordMapper;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.hanger.entity.HangRecord; import org.jeecg.modules.hanger.entity.HangRecord;
import org.jeecg.modules.hanger.mapper.HangRecordMapper; import org.jeecg.modules.hanger.mapper.HangRecordMapper;
import org.jeecg.modules.hangerlocation.entity.HangerLocation; import org.jeecg.modules.hangerlocation.entity.HangerLocation;
@ -45,7 +47,9 @@ import static org.jeecg.common.util.XJobUtils.dateToLong;
public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper, HangerLocation> implements IHangerLocationService { public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper, HangerLocation> implements IHangerLocationService {
@Autowired @Autowired
private HangerLocationMapper hangerLocationMapper; private HangerLocationMapper hangerLocationMapper;
//订单
@Autowired
private IZyOrdersService zyOrdersService;
//工单 //工单
@Autowired @Autowired
private WorkOrderMapper workOrderMapper; private WorkOrderMapper workOrderMapper;
@ -103,6 +107,9 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
SysDictItem dictItem2=sysDictItemService.getById(dictItem_id4); SysDictItem dictItem2=sysDictItemService.getById(dictItem_id4);
int time_s=Integer.parseInt(dictItem1.getItemValue()); int time_s=Integer.parseInt(dictItem1.getItemValue());
int time_e=Integer.parseInt(dictItem2.getItemValue()); int time_e=Integer.parseInt(dictItem2.getItemValue());
//查找有所传感器
QueryWrapper<Sensor> qws=new QueryWrapper<>();
List<Sensor> sensorList=sensorMapper.selectList(qws);
//1、读取工单,得到生产计划 //1、读取工单,得到生产计划
if(woList.size()<=0) if(woList.size()<=0)
{ {
@ -110,22 +117,22 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
} }
//得到所有工单 //得到所有工单
List<WorkOrder> workList=workOrderMapper.selectBatchIds(woList); List<WorkOrder> workList=workOrderMapper.selectBatchIds(woList);
// //#region2.遍历生产计划 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个)
List<String> workCodeList=new ArrayList<>(); for(WorkOrder wo:workList)
for(WorkOrder wk:workList)
{ {
workCodeList.add(wk.getProductCode()); //根据工单得到生产计划
}
QueryWrapper<ZyProductPlan> qwProduct=new QueryWrapper<>(); QueryWrapper<ZyProductPlan> qwProduct=new QueryWrapper<>();
qwProduct.in("product_code",workCodeList); qwProduct.eq("product_code",wo.getProductCode());
List<ZyProductPlan> productPlanList=zyProductPlanMapper.selectList(qwProduct); ZyProductPlan item=zyProductPlanMapper.selectOne(qwProduct);
//查找有所传感器
QueryWrapper<Sensor> qws=new QueryWrapper<>(); //生产计划成产中
List<Sensor> sensorList=sensorMapper.selectList(qws); item.setStatus(2);
zyProductPlanMapper.updateById(item);
//订单生产中
item.setStatus(2);
workOrderMapper.updateById(wo);
//#region2.遍历生产计划 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个)
for(ZyProductPlan item :productPlanList)
{
//3、每个生产计划对应工序,每一道工序对应工位 //3、每个生产计划对应工序,每一道工序对应工位
QueryWrapper<ZyPlanProcess> qwProcess=new QueryWrapper<>(); QueryWrapper<ZyPlanProcess> qwProcess=new QueryWrapper<>();
qwProcess.eq("plan_id",item.getId()); qwProcess.eq("plan_id",item.getId());
@ -144,6 +151,8 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
//#region每一道工序 //#region每一道工序
for(ZyPlanProcess process:listProcess) for(ZyPlanProcess process:listProcess)
{ {
process.setStatus(2);
zyPlanProcessMapper.updateById(process);
//传感器记录(每个)+生产记录(每个) //传感器记录(每个)+生产记录(每个)
//开始时间 //开始时间
Date str01= start_time; Date str01= start_time;
@ -254,7 +263,12 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
//#endregion //#endregion
//间隔时间 //间隔时间
start_time=XJobUtils.randomIntervaltime(str01,time_s,time_e); start_time=XJobUtils.randomIntervaltime(str01,time_s,time_e);
//工序完成
process.setStatus(3);
zyPlanProcessMapper.updateById(process);
} }
//#endregion //#endregion
//#region批量保存 //#region批量保存
@ -271,12 +285,40 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
// hangRecordMapper.insert(arr); // hangRecordMapper.insert(arr);
// } // }
//#endregion //#endregion
//#region修改工单、订单状态
//生产计划已完成
item.setStatus(3);
zyProductPlanMapper.updateById(item);
//订单已完成
item.setStatus(3);
workOrderMapper.updateById(wo);
//#endregion
} }
//#endregion //#endregion
//
//#region修改工单状态 //#region修改工单状态
//#endregion
}
/**
*
* @param id 衣架id
* @param code 传感器id
*/
@Override
public void records(String id, String code) {
//根据衣架查找工单
//根据传感器查找工位
} }

@ -14,5 +14,5 @@ import java.util.List;
public interface IHangerMakerService extends IService<HangerMaker> { public interface IHangerMakerService extends IService<HangerMaker> {
//自动衣架绑定工单 //自动衣架绑定工单
void doAutoHM(List<String> woList); Boolean doAutoHM(List<String> woList);
} }

@ -38,12 +38,14 @@ public class HangerMakerServiceImpl extends ServiceImpl<HangerMakerMapper, Hange
* @param woList * @param woList
*/ */
@Override @Override
public void doAutoHM(List<String> woList) { public Boolean doAutoHM(List<String> woList) {
Boolean flag=false;
if(woList.size()<=0) if(woList.size()<=0)
{ {
return; return flag;
} }
QueryWrapper<WorkOrder> qw=new QueryWrapper<>(); QueryWrapper<WorkOrder> qw=new QueryWrapper<>();
qw.in("id",woList); qw.in("id",woList);
List<WorkOrder> workList=workOrderMapper.selectList(qw); List<WorkOrder> workList=workOrderMapper.selectList(qw);
@ -73,9 +75,10 @@ public class HangerMakerServiceImpl extends ServiceImpl<HangerMakerMapper, Hange
model.setOrderCode(item.getProductCode()); model.setOrderCode(item.getProductCode());
baseMapper.insert(model); baseMapper.insert(model);
flag=true;
} }
return flag;
} }

Loading…
Cancel
Save