rev:深坑相关
This commit is contained in:
@@ -28,6 +28,8 @@ import org.nl.wms.product_manage.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.product_manage.sch.service.TaskService;
|
||||
import org.nl.wms.product_manage.sch.service.dto.TaskDto;
|
||||
import org.nl.wms.product_manage.sch.tasks.WashMachineryTask;
|
||||
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
|
||||
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
|
||||
import org.nl.wms.product_manage.service.workorder.IPdmProduceWorkorderService;
|
||||
import org.nl.wms.product_manage.service.workorder.dao.PdmProduceWorkorder;
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
@@ -60,6 +62,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
private CacheLineHandService cacheLineHandService;
|
||||
@Autowired
|
||||
private IPdmProduceWorkorderService workorderService;
|
||||
@Autowired
|
||||
private IPdmBiDeviceService deviceService;
|
||||
|
||||
|
||||
|
||||
@@ -139,7 +143,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
if (taskHandler!=null){
|
||||
taskHandler.updateTaskStatus(row,status);
|
||||
}
|
||||
//发布一个任务执行事件
|
||||
//发布一个任务执行事件:服务跟任务不一样,可以同事存在
|
||||
TaskEvent event = TaskEvent.builder()
|
||||
.task_id(task_id)
|
||||
.task_type(taskDto.getTask_type())
|
||||
@@ -261,8 +265,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
while (iterator.hasNext()){
|
||||
String deviceCode = (String)iterator.next();
|
||||
if (!StringUtils.isEmpty(deviceCode)){
|
||||
String qty = String.valueOf(param.get(deviceCode));
|
||||
deviceTab.update(MapOf.of("deviceinstor_qty",qty),"device_code = '"+deviceCode+"'");
|
||||
Map item = (Map)param.get(deviceCode);
|
||||
Object qty = item.get("qty");
|
||||
Object weight = item.get("weight");
|
||||
UpdateWrapper<PdmBiDevice> wrapper = new UpdateWrapper<>();
|
||||
wrapper.set("deviceinstor_qty",qty);
|
||||
if (weight!=null){
|
||||
wrapper.set("deviceinstor_weight",weight);
|
||||
}
|
||||
wrapper.eq("device_code",deviceCode);
|
||||
deviceService.update(wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -78,14 +79,17 @@ public class AgvInstService {
|
||||
Map query = MapOf.of("workprocedure_id", basePointService.getWorkprodureByCode(next.getId()).get("workprocedure_id")
|
||||
, "qty", quantity,"spec",workprodure.get("spec"));
|
||||
//判断缓存线是不是去深坑清洗:深坑区域15个点:判断空的物料坑位:
|
||||
List<Map<String,String>> collect = new ArrayList<>();
|
||||
if (next.getName().equals("深坑清洗")){
|
||||
query.put("material_id",task.getString("material_id"));
|
||||
// query.put("qty",quantity) 深坑物料需要转重量
|
||||
task.put("task_type",AcsTaskEnum.TASK_PRODUCT_WASH.getCode());
|
||||
task.put("task_name",AcsTaskEnum.TASK_PRODUCT_WASH.getDesc());
|
||||
|
||||
query.put("material_id",task.getString("material_id"));
|
||||
// query.put("qty",quantity) 深坑物料需要转重量
|
||||
collect = deviceService.workproceduceDevicesWeight(query);
|
||||
}else {
|
||||
collect = deviceService.workproceduceDevicesQty(query);
|
||||
}
|
||||
List<Map<String,String>> collect = deviceService.workproceduceDevices(query);
|
||||
|
||||
log.info("调度任务分配点位信息:", JSON.toJSONString(collect));
|
||||
List<Map<String, String>> list = collect.stream().filter(stringStringMap -> stringStringMap.get("tasks") == null || stringStringMap.get("materials").contains(task.getString("material_id"))).collect(Collectors.toList());
|
||||
task.put("acs_task_type",AcsTaskEnum.ACS_TASK_TYPE_NOBLE_SINGLE_TASK.getCode());
|
||||
|
||||
@@ -46,6 +46,7 @@ public class SpecialDeviceController {
|
||||
|
||||
@GetMapping("/query")
|
||||
@ApiOperation("查询生产设备")
|
||||
@Log("深坑物料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> query(DeviceQuery query,PageQuery page) {
|
||||
Page<Map<String, Object>> list = iDeviceService.pageMaps(page.build(PdmBiDevice.class), query.build());
|
||||
|
||||
@@ -202,7 +202,6 @@ public class SpeEmpTask extends AbstractAcsTask {
|
||||
if (!("fall_finish"+task.getTask_id()).equals(device.getRemark())){
|
||||
iDeviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||
.set("material_id", task.getMaterial_id())
|
||||
.set("deviceinstor_qty",device.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
||||
.set("remark","fall_finish"+task.getTask_id())
|
||||
.eq("device_code", task.getPoint_code2()));
|
||||
}
|
||||
|
||||
@@ -265,7 +265,6 @@ public class SpeFullTask extends AbstractAcsTask {
|
||||
if (!("fall_finish"+task.getTask_id()).equals(one.getRemark())){
|
||||
deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||
.set("material_id", task.getMaterial_id())
|
||||
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
||||
.set("remark","fall_finish"+task.getTask_id())
|
||||
.eq("device_code", task.getPoint_code2()));
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ public interface IPdmBiDeviceService extends IService<PdmBiDevice> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<Map> workproceduceDevices(Map<String,Object> param);
|
||||
List<Map> workproceduceDevicesQty(Map<String,Object> param);
|
||||
List<Map> workproceduceDevicesWeight(Map<String,Object> param);
|
||||
|
||||
/**
|
||||
* 根据点位查询对应设备
|
||||
|
||||
@@ -98,6 +98,7 @@ public class PdmBiDevice implements Serializable {
|
||||
* 设备实时来料仓数:用于数量校验
|
||||
*/
|
||||
private BigDecimal deviceinstor_qty;
|
||||
private BigDecimal deviceinstor_weight;
|
||||
|
||||
/**
|
||||
* 设备实时产品仓数
|
||||
|
||||
@@ -19,7 +19,9 @@ public interface PdmBiDeviceMapper extends BaseMapper<PdmBiDevice> {
|
||||
|
||||
List<Map> getNotWorkDevice(Map<String,Object> query);
|
||||
|
||||
List<Map> workproceduceDevices(Map<String,Object> query);
|
||||
List<Map> workproceduceDevicesQty(Map<String,Object> query);
|
||||
|
||||
List<Map> workproceduceDevicesWeight(Map<String,Object> query);
|
||||
|
||||
PdmBiDevice getDeviceByPoint(String pointCode);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
from PDM_produce_workOrder o
|
||||
where '5' > o.workorder_status and o.is_delete = '0' )
|
||||
</select>
|
||||
<select id="workproceduceDevices" resultType="java.util.Map">
|
||||
<select id="workproceduceDevicesQty" resultType="java.util.Map">
|
||||
select
|
||||
GROUP_CONCAT(sch_base_task.task_id) as tasks,GROUP_CONCAT(sch_base_task.material_id) as materials,
|
||||
pdm_bi_device.inupperlimit_qty - ifnull( sum( sch_base_task.material_qty ), 0 ) - pdm_bi_device.deviceinstor_qty AS currentQty,
|
||||
@@ -39,6 +39,30 @@
|
||||
GROUP BY pdm_bi_device.device_code
|
||||
HAVING currentQty > #{qty}
|
||||
</select>
|
||||
|
||||
<select id="workproceduceDevicesWeight" resultType="java.util.Map">
|
||||
select
|
||||
GROUP_CONCAT(sch_base_task.task_id) as tasks,GROUP_CONCAT(sch_base_task.material_id) as materials,pdm_bi_device.inupperlimit_qty,pdm_bi_device.deviceinstor_weight,
|
||||
pdm_bi_device.inupperlimit_qty - ifnull( sum( sch_base_task.material_qty*md_me_materialbase.net_weight), 0 ) - pdm_bi_device.deviceinstor_weight AS currentQty,
|
||||
pdm_bi_device.device_code,
|
||||
sch_base_point.point_code
|
||||
from sch_base_point
|
||||
left join pdm_bi_device on pdm_bi_device.device_code = sch_base_point.device_code
|
||||
left JOIN sch_base_task ON sch_base_point.point_code = point_code2 and '7' > task_status
|
||||
left join md_me_materialbase on sch_base_task.material_id = md_me_materialbase.material_id
|
||||
where
|
||||
sch_base_point.point_type = '4' and pdm_bi_device.is_used = true
|
||||
and workprocedure_id = #{workprocedure_id}
|
||||
<if test="material_id != null and material_id != ''">
|
||||
and (pdm_bi_device.material_id = #{material_id} or pdm_bi_device.material_id is null or pdm_bi_device.material_id = '')
|
||||
</if>
|
||||
<if test="spec != null and spec != ''">
|
||||
and (pdm_bi_device.spec = #{spec} or pdm_bi_device.spec is null)
|
||||
</if>
|
||||
GROUP BY pdm_bi_device.device_code
|
||||
HAVING currentQty > #{qty}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceByPoint" resultType="org.nl.wms.product_manage.service.device.dao.PdmBiDevice">
|
||||
select pdm_bi_device.* from pdm_bi_device
|
||||
left join sch_base_point on sch_base_point.device_code = pdm_bi_device.device_code
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package org.nl.wms.product_manage.service.device.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
|
||||
import org.nl.wms.product_manage.service.device.dao.mapper.PdmBiDeviceMapper;
|
||||
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -21,14 +26,27 @@ import java.util.Map;
|
||||
@Service
|
||||
public class PdmBiDeviceServiceImpl extends ServiceImpl<PdmBiDeviceMapper, PdmBiDevice> implements IPdmBiDeviceService {
|
||||
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
@Autowired
|
||||
protected IMdMeMaterialbaseService iMdMeMaterialbaseService; // 物料服务
|
||||
|
||||
@Override
|
||||
public List<Map> getNotWorkDeviceByWorkproceduceId(JSONObject param) {
|
||||
return this.baseMapper.getNotWorkDevice(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> workproceduceDevices(Map<String, Object> param) {
|
||||
return this.baseMapper.workproceduceDevices(param);
|
||||
public List<Map> workproceduceDevicesQty(Map<String, Object> param) {
|
||||
return this.baseMapper.workproceduceDevicesQty(param);
|
||||
}
|
||||
@Override
|
||||
public List<Map> workproceduceDevicesWeight(Map<String, Object> param) {
|
||||
//#{workprocedure_id} //material_id //#{qty}
|
||||
MdMeMaterialbase one = iMdMeMaterialbaseService.getOne(new QueryWrapper<MdMeMaterialbase>().eq("material_id", param.get("material_id")));
|
||||
param.put("qty",one.getNet_weight().doubleValue()*(int)param.get("qty"));
|
||||
return this.baseMapper.workproceduceDevicesWeight(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user