Browse Source

opt: 优化任务优先级,组盘管理的页面显示

master
yanps 2 months ago
parent
commit
9d5d22a122
  1. 2
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java
  2. 2
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCreateInst.java
  3. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java
  4. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java
  5. 36
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  6. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/sorting/service/impl/SortingServiceImpl.java
  7. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java
  8. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java
  9. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java
  10. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.java
  11. 26
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.xml
  12. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  13. 29
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java
  14. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java
  15. 30
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml
  16. 18
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  17. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java
  18. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java
  19. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java
  20. 2
      lms/nladmin-ui/src/views/wms/produceScreen/index.vue
  21. 33
      lms/nladmin-ui/src/views/wms/sch/group/index.vue

2
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java

@ -118,7 +118,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
(byte) 0X00, (byte) 0X01, (byte) 0X00, (byte) 0X01,
(byte) 0X00, (byte) 0X71, (byte) 0X00, (byte) 0X71,
(byte) 0X00, (byte) 0X10, (byte) 0X00, (byte) 0X10,
(byte) 0X01, (byte) 0X80, (byte) 0X01, (byte) prioritylow,
(byte) 0X00, (byte) 0X01, (byte) 0X00, (byte) 0X01,
(byte) ikeyhigh, (byte) ikeylow, (byte) ikeyhigh, (byte) ikeylow,
(byte) ikeyhigh, (byte) ikeylow, (byte) ikeyhigh, (byte) ikeylow,

2
acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCreateInst.java

@ -42,7 +42,7 @@ public class AutoCreateInst {
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
ISysParamService acsConfigService = SpringContextHolder.getBean(ISysParamService.class); ISysParamService acsConfigService = SpringContextHolder.getBean(ISysParamService.class);
List<TaskDto> list = taskserver.queryByStauts("0"); List<TaskDto> list = taskserver.queryByStauts("0");
list = list.stream().sorted(Comparator.comparing(TaskDto::getPriority)).collect(Collectors.toList()); list = list.stream().sorted(Comparator.comparing(TaskDto::getPriority).reversed()).collect(Collectors.toList());
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
TaskDto acsTask = list.get(i); TaskDto acsTask = list.get(i);

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java

@ -135,4 +135,11 @@ public class HandheldController {
} }
@GetMapping("/selectPointByRegion")
@Log("根据工序查询设备点位")
public ResponseEntity<Object> selectPointByRegion(String regionCode) {
return new ResponseEntity<>(handheldService.selectPointByRegion(regionCode),HttpStatus.OK);
}
} }

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java

@ -107,4 +107,10 @@ public interface HandheldService {
* @return * @return
*/ */
boolean isLock(); boolean isLock();
/**
* 根据工序获取所有设备点位
* @return
*/
List<JSONObject> selectPointByRegion(String regionCode);
} }

36
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java

@ -38,6 +38,7 @@ import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.task.TaskFactory; import org.nl.wms.sch.task_manage.task.TaskFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
@ -394,29 +395,39 @@ public class HandheldServiceImpl implements HandheldService {
@Override @Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public String pointLock(JSONObject param) { public String pointLock(JSONObject param) {
Assert.noNullElements(new Object[]{param.getString("region_code"), param.getString("status")}, "参数不能为空!"); Assert.noNullElements(new Object[]{param.getString("region_code"), param.getString("status")}, "参数不能为空!");
JSONArray region_code = param.getJSONArray("region_code"); String region_code = param.getString("region_code");
String status = param.getString("status"); String status = param.getString("status");
region_code.stream().forEach(region -> {
String s = StrUtil.toString(region);
SchBaseRegion schBaseRegion = iSchBaseRegionService.getOne(Wrappers.lambdaQuery(SchBaseRegion.class) SchBaseRegion schBaseRegion = iSchBaseRegionService.getOne(Wrappers.lambdaQuery(SchBaseRegion.class)
.eq(SchBaseRegion::getRegion_code, s)); .eq(SchBaseRegion::getRegion_code, region_code));
if (ObjectUtil.isEmpty(schBaseRegion)) throw new BadRequestException("该区域不存在!"); if (ObjectUtil.isEmpty(schBaseRegion)) throw new BadRequestException("该区域不存在!");
List<String> pointCodes = iSchBasePointService.getByRegionCode(s); List<String> pointCodes = iSchBasePointService.getByRegionCode(region_code);
if (StrUtil.equals(status, "0")) { if (StrUtil.equals(status, "0")) {
iSchBasePointService.releasePoint(s);
iSchBaseTaskService.updateTaskStatusByPointCode(pointCodes); iSchBaseTaskService.updateTaskStatusByPointCode(pointCodes);
if (param.getJSONArray("pointCodes").size() > 0) {
param.getJSONArray("pointCodes").stream().forEach(pointCode -> {
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(pointCode);
iSchBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, jsonObject.get("vehicle_code")));
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, jsonObject.get("point_code"))
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, null));
});
}
iSchBasePointService.updatePointLock(region_code, false);
} else if (StrUtil.equals(status, "1")) { } else if (StrUtil.equals(status, "1")) {
boolean is_executing = iSchBaseTaskService.selectByPointCodeAndStatus(pointCodes); boolean is_executing = iSchBaseTaskService.selectByPointCodeAndStatus(pointCodes);
if (is_executing) { if (is_executing) {
throw new BadRequestException("该区域有任务正在执行,请等待任务执行完成再锁定!"); throw new BadRequestException("该区域有任务正在执行,请等待任务执行完成再锁定!");
} }
iSchBaseTaskService.selectByPointCodeAndTaskStatus(pointCodes); iSchBaseTaskService.selectByPointCodeAndTaskStatus(pointCodes);
iSchBasePointService.lockPoint(s); iSchBasePointService.updatePointLock(region_code, true);
} }
}); return "succeed";
return "操作成功";
} }
@Override @Override
@ -625,4 +636,11 @@ public class HandheldServiceImpl implements HandheldService {
} }
@Override
public List<JSONObject> selectPointByRegion(String regionCode) {
Assert.notNull(regionCode, "参数不能为空!");
return iSchBasePointService.selectPointByRegion(regionCode);
}
} }

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/sorting/service/impl/SortingServiceImpl.java

@ -132,7 +132,7 @@ public class SortingServiceImpl implements SortingService {
//TODO:呼叫两个空笼框 //TODO:呼叫两个空笼框
if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) { if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) {
taskParam.put("device_code", pointCode + "_01"); taskParam.put("device_code", pointCode + "_01");
taskParam.put("task_seq", "1"); taskParam.put("task_seq", "2");
taskParam.put("config_code", "SortingTwoCNTTask"); taskParam.put("config_code", "SortingTwoCNTTask");
taskParam.put("task_code", task_code + "A"); taskParam.put("task_code", task_code + "A");
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
@ -141,7 +141,7 @@ public class SortingServiceImpl implements SortingService {
.set("remark", task_code) .set("remark", task_code)
.eq("point_code", pointCode + "_01")); .eq("point_code", pointCode + "_01"));
taskParam.put("device_code", pointCode + "_02"); taskParam.put("device_code", pointCode + "_02");
taskParam.put("task_seq", "2"); taskParam.put("task_seq", "1");
taskParam.put("task_code", task_code + "B"); taskParam.put("task_code", task_code + "B");
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
@ -164,7 +164,7 @@ public class SortingServiceImpl implements SortingService {
} }
taskParam.put("config_code", "SortingSMTTask"); taskParam.put("config_code", "SortingSMTTask");
taskParam.put("vehicle_code", vehicle_code); taskParam.put("vehicle_code", vehicle_code);
taskParam.put("task_seq", "2"); taskParam.put("task_seq", "1");
taskParam.put("device_code", pointCode + "_01"); taskParam.put("device_code", pointCode + "_01");
taskParam.put("task_code", task_code + "A"); taskParam.put("task_code", task_code + "A");
connectorTask.apply(taskParam); connectorTask.apply(taskParam);
@ -176,7 +176,7 @@ public class SortingServiceImpl implements SortingService {
taskParam = new JSONObject(MapOf.of("task_code", task_code, "job_name", jobname, "device_code", pointCode, "requestNo" taskParam = new JSONObject(MapOf.of("task_code", task_code, "job_name", jobname, "device_code", pointCode, "requestNo"
, "sorting_" + IdUtil.getStringId(), "ext_data", jsonObject, "vehicle_code", vehicle_code, "ext_data", jsonObject)); , "sorting_" + IdUtil.getStringId(), "ext_data", jsonObject, "vehicle_code", vehicle_code, "ext_data", jsonObject));
taskParam.put("config_code", "SortingSMTTask"); taskParam.put("config_code", "SortingSMTTask");
taskParam.put("task_seq", "1"); taskParam.put("task_seq", "2");
taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2")); taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2"));
taskParam.put("device_code", pointCode + "_02"); taskParam.put("device_code", pointCode + "_02");
taskParam.put("task_code", task_code + "B"); taskParam.put("task_code", task_code + "B");

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java

@ -72,4 +72,12 @@ public class SchBaseVehiclematerialgroupController {
public ResponseEntity<Object> getGroup(@RequestBody JSONObject entity){ public ResponseEntity<Object> getGroup(@RequestBody JSONObject entity){
return new ResponseEntity<>(schBaseVehiclematerialgroupService.getGroup(entity), HttpStatus.OK); return new ResponseEntity<>(schBaseVehiclematerialgroupService.getGroup(entity), HttpStatus.OK);
} }
@PostMapping("/selectByVehicleCode")
@Log("根据载具号获取阻盘信息")
@ApiOperation("根据载具号获取阻盘信息")
public ResponseEntity<Object> selectByVehicleCode(@RequestBody JSONObject entity){
return new ResponseEntity<>(schBaseVehiclematerialgroupService.selectByVehicleCode(entity), HttpStatus.OK);
}
} }

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java

@ -80,4 +80,11 @@ public interface ISchBaseVehiclematerialgroupService extends IService<SchBaseVeh
* @return * @return
*/ */
List<Map> selectMaterialByVehicleCode(String vehicle_code); List<Map> selectMaterialByVehicleCode(String vehicle_code);
/**
* 根据载具号查找物料信息
* @param entity
* @return
*/
List<SchBaseVehiclematerialgroup> selectByVehicleCode(JSONObject entity);
} }

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java

@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* @author lyd * @author lyd
@ -162,6 +163,12 @@ public class SchBaseVehiclematerialgroup implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String material_name; private String material_name;
@TableField(exist = false) @TableField(exist = false)
private String theLocation;
@TableField(exist = false)
private boolean hasChildren;
@TableField(exist = false)
private List<SchBaseVehiclematerialgroup> children;
@TableField(exist = false)
private String material_code; private String material_code;
@TableField(exist = false) @TableField(exist = false)
private String material_spec; private String material_spec;

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.group.service.dto.SchBaseVehiclematerialgroupQuery; import org.nl.wms.sch.group.service.dto.SchBaseVehiclematerialgroupQuery;
@ -12,9 +13,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @author lyd * @author lyd
* @date 2023-05-16 * @date 2023-05-16
**/ **/
public interface SchBaseVehiclematerialgroupMapper extends BaseMapper<SchBaseVehiclematerialgroup> { public interface SchBaseVehiclematerialgroupMapper extends BaseMapper<SchBaseVehiclematerialgroup> {
IPage<SchBaseVehiclematerialgroup> selectPageLeftJoin(IPage<SchBaseVehiclematerialgroup> pages, SchBaseVehiclematerialgroupQuery query); IPage<SchBaseVehiclematerialgroup> selectPageLeftJoin(IPage<SchBaseVehiclematerialgroup> pages, SchBaseVehiclematerialgroupQuery query);
@ -24,4 +25,6 @@ public interface SchBaseVehiclematerialgroupMapper extends BaseMapper<SchBaseVeh
List<String> selectOrders(@Param("list") List<String> vehicleCodes); List<String> selectOrders(@Param("list") List<String> vehicleCodes);
List<Map> selectMaterialByVehicleCode(String vehicle_code); List<Map> selectMaterialByVehicleCode(String vehicle_code);
IPage<SchBaseVehiclematerialgroup> selectAllByPage(IPage<SchBaseVehiclematerialgroup> page, @Param("query") SchBaseVehiclematerialgroupQuery query);
} }

26
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/mapper/SchBaseVehiclematerialgroupMapper.xml

@ -71,5 +71,29 @@
GROUP BY GROUP BY
sbv.order_code sbv.order_code
</select> </select>
<select id="selectAllByPage" resultType="org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup">
WITH RankedVehicles AS (
SELECT
vg.*,
ROW_NUMBER() OVER (PARTITION BY vg.vehicle_code ORDER BY vg.due_date) AS rn
FROM
sch_base_vehiclematerialgroup vg
where 1=1
<if test="query.vehicle_code != null">
AND vg.vehicle_code = #{query.vehicle_code}
</if>
<if test="query.workshop_code != null">
AND vg.workshop_code = #{query.workshop_code}
</if>
<if test="query.job_name != null">
AND vg.job_name = #{query.job_name}
</if>
<if test="query.region_code != null">
AND vg.region_code = #{query.region_code}
</if>
)
SELECT *
FROM RankedVehicles
WHERE rn = 1
</select>
</mapper> </mapper>

37
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -27,6 +27,7 @@ import org.nl.wms.sch.group.service.dto.SchBaseVehiclematerialgroupQuery;
import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.process_flow.service.ProcessFlowService; import org.nl.wms.sch.process_flow.service.ProcessFlowService;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -49,19 +50,13 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
private IMdBaseMaterialService iMdBaseMaterialService; private IMdBaseMaterialService iMdBaseMaterialService;
@Autowired @Autowired
private ProcessFlowService processFlowService; private ProcessFlowService processFlowService;
@Autowired @Autowired
private ISchBasePointService pointService; private ISchBasePointService pointService;
@Override @Override
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) { public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) {
IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize()); IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize());
IPage<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroupIPage = vehiclematerialgroupMapper.selectPage(pages, Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) IPage<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroupIPage = vehiclematerialgroupMapper.selectAllByPage(pages, whereJson);
.eq(StrUtil.isNotBlank(whereJson.getVehicle_code()), SchBaseVehiclematerialgroup::getVehicle_code, whereJson.getVehicle_code())
.eq(StrUtil.isNotBlank(whereJson.getWorkshop_code()), SchBaseVehiclematerialgroup::getWorkshop_code, whereJson.getWorkshop_code())
.eq(StrUtil.isNotBlank(whereJson.getJob_name()), SchBaseVehiclematerialgroup::getJob_name, whereJson.getJob_name())
.eq(StrUtil.isNotBlank(whereJson.getRegion_code()), SchBaseVehiclematerialgroup::getRegion_code, whereJson.getRegion_code()));
schBaseVehiclematerialgroupIPage.getRecords().forEach(item -> { schBaseVehiclematerialgroupIPage.getRecords().forEach(item -> {
if (StrUtil.isNotBlank(item.getMaterial_id())) { if (StrUtil.isNotBlank(item.getMaterial_id())) {
MdBaseMaterial mdBaseMaterial = iMdBaseMaterialService.getOne(Wrappers.lambdaQuery(MdBaseMaterial.class) MdBaseMaterial mdBaseMaterial = iMdBaseMaterialService.getOne(Wrappers.lambdaQuery(MdBaseMaterial.class)
@ -73,11 +68,23 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
} }
} }
if (StrUtil.isNotBlank(item.getRegion_code())) { if (StrUtil.isNotBlank(item.getRegion_code())) {
// item.setRegion_name(pointService.list(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, item.getRegion_code())).get(0).getRegion_name());
item.setRegion_name(item.getRegion_code()); item.setRegion_name(item.getRegion_code());
} else {
item.setRegion_name("未知");
}
SchBasePoint one = pointService.getOne(Wrappers.lambdaQuery(SchBasePoint.class)
.eq(SchBasePoint::getVehicle_code, item.getVehicle_code()));
if (ObjectUtil.isNotEmpty(one)) {
item.setTheLocation(one.getPoint_name());
}
List<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroups = vehiclematerialgroupMapper.selectList(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, item.getVehicle_code())
.ne(SchBaseVehiclematerialgroup::getGroup_id, item.getGroup_id()));
if (CollUtil.isNotEmpty(schBaseVehiclematerialgroups)) {
item.setHasChildren(true);
item.setChildren(schBaseVehiclematerialgroups);
} }
}); });
// pages = vehiclematerialgroupMapper.selectPageLeftJoin(pages, whereJson);
return schBaseVehiclematerialgroupIPage; return schBaseVehiclematerialgroupIPage;
} }
@ -158,7 +165,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
} }
}); });
maps = maps.stream().sorted(Comparator.comparingLong(order -> { maps = maps.stream().sorted(Comparator.comparingLong(order -> {
if(ObjectUtil.isNotEmpty(order.get("due_date"))){ if (ObjectUtil.isNotEmpty(order.get("due_date"))) {
return getTime(StrUtil.toString(order.get("due_date"))); return getTime(StrUtil.toString(order.get("due_date")));
} }
return 0; return 0;
@ -166,7 +173,15 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
return maps; return maps;
} }
private Long getTime(String dateString){ @Override
public List<SchBaseVehiclematerialgroup> selectByVehicleCode(JSONObject entity) {
List<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroups = vehiclematerialgroupMapper.selectList(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, entity.getString("vehicle_code"))
.ne(SchBaseVehiclematerialgroup::getGroup_id, entity.getString("group_id")));
return schBaseVehiclematerialgroups;
}
private Long getTime(String dateString) {
String pattern = "yyyy-MM-dd HH:mm:ss"; String pattern = "yyyy-MM-dd HH:mm:ss";
java.util.Date date = DateUtil.parse(dateString, pattern); java.util.Date date = DateUtil.parse(dateString, pattern);
long timestamp = date.getTime(); long timestamp = date.getTime();

29
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java

@ -92,7 +92,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* *
* @param region_code * @param region_code
*/ */
SchBasePoint selectByRegionCode(String region_code, String vehicleCode,String point_type); SchBasePoint selectByRegionCode(String region_code, String vehicleCode, String point_type);
/** /**
* 根据工序查询区域空载具 * 根据工序查询区域空载具
@ -158,37 +158,35 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* @param vehicle_type * @param vehicle_type
* @return * @return
*/ */
SchBasePoint selectByGroundPoint(String region_code,String pointStatus, String vehicle_type, int seq); SchBasePoint selectByGroundPoint(String region_code, String pointStatus, String vehicle_type, int seq);
/** /**
* 呼叫空料笼 * 呼叫空料笼
*
* @param region_code * @param region_code
* @param vehicle_type * @param vehicle_type
* @return * @return
*/ */
SchBasePoint selectByEmptyCage(String region_code,String vehicle_type,String pointStatus ,boolean isVehicle,SchBaseTask task); SchBasePoint selectByEmptyCage(String region_code, String vehicle_type, String pointStatus, boolean isVehicle, SchBaseTask task);
/**
* 释放点位
* @param region_code
*/
void releasePoint(String region_code);
/** /**
* 锁定点位 * 修改点位锁状态
*
* @param region_code * @param region_code
*/ */
void lockPoint(String region_code); void updatePointLock(String region_code, Boolean lock);
/** /**
* 根据区域编码查找点位名称 * 根据区域编码查找点位名称
*
* @return * @return
*/ */
List<String> getByRegionCode(String region_code); List<String> getByRegionCode(String region_code);
/** /**
* 查找地面区域的空点位 * 查找地面区域的空点位
*
* @param targetRegionCode * @param targetRegionCode
* @param value * @param value
*/ */
@ -201,8 +199,17 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
/** /**
* 根据工序查询订单 * 根据工序查询订单
*
* @param regionCode * @param regionCode
* @return * @return
*/ */
List<OrderMater> selectOrder(String regionCode); List<OrderMater> selectOrder(String regionCode);
/**
* 根据工序查找设备点位
*
* @param regionCode
* @return
*/
List<JSONObject> selectPointByRegion(String regionCode);
} }

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.java

@ -1,5 +1,6 @@
package org.nl.wms.sch.point.service.dao.mapper; package org.nl.wms.sch.point.service.dao.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.nl.wms.ext.fab.service.dto.OrderMater; import org.nl.wms.ext.fab.service.dto.OrderMater;
@ -29,4 +30,11 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
List<String> selectByRegionCode(@Param("region_code") String region_code); List<String> selectByRegionCode(@Param("region_code") String region_code);
List<Map> selectJobDevice(); List<Map> selectJobDevice();
/**
* 根据工序查询设备点位
* @param regionCode
* @return
*/
List<JSONObject> selectPointByRegion(String regionCode);
} }

30
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml

@ -13,10 +13,8 @@
</where> </where>
</update> </update>
<select id="selectByIdLock" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint"> <select id="selectByIdLock" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
SELECT SELECT p.*
p.* FROM `sch_base_point` p
FROM
`sch_base_point` p
WHERE p.point_code = #{id} WHERE p.point_code = #{id}
FOR UPDATE FOR UPDATE
</select> </select>
@ -32,7 +30,8 @@
sch_base_vehiclematerialgroup.has_work sch_base_vehiclematerialgroup.has_work
FROM FROM
sch_base_point sch_base_point
inner JOIN sch_base_vehiclematerialgroup ON sch_base_point.vehicle_code = sch_base_vehiclematerialgroup.vehicle_code inner JOIN sch_base_vehiclematerialgroup ON sch_base_point.vehicle_code =
sch_base_vehiclematerialgroup.vehicle_code
WHERE WHERE
is_lock = FALSE is_lock = FALSE
AND sch_base_point.vehicle_code IS NOT NULL AND sch_base_point.vehicle_code IS NOT NULL
@ -47,14 +46,21 @@
</select> </select>
<select id="selectByRegionCode" resultType="java.lang.String"> <select id="selectByRegionCode" resultType="java.lang.String">
select select sbp.point_code
sbp.point_code from sch_base_point sbp
from where sbp.region_code = #{region_code}
sch_base_point sbp
where
sbp.region_code = #{region_code}
</select> </select>
<select id="selectJobDevice" resultType="java.util.Map"> <select id="selectJobDevice" resultType="java.util.Map">
select sbp.point_code,sbp.point_name from sch_base_point sbp where is_lock = true and region_code = 'GZQ' and region_points is not null select sbp.point_code, sbp.point_name
from sch_base_point sbp
where is_lock = true
and region_code = 'GZQ'
and region_points is not null
</select>
<select id="selectPointByRegion" resultType="com.alibaba.fastjson.JSONObject"
parameterType="java.lang.String">
select point_code, point_name
from sch_base_point
where region_code = #{regionCode}
</select> </select>
</mapper> </mapper>

18
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -467,13 +467,10 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
} }
@Override @Override
public void releasePoint(String region_code) { public void updatePointLock(String region_code, Boolean lock) {
update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code).set(SchBasePoint::getIs_lock, false)); update(Wrappers.lambdaUpdate(SchBasePoint.class)
} .eq(SchBasePoint::getRegion_code, region_code)
.set(SchBasePoint::getIs_lock, lock));
@Override
public void lockPoint(String region_code) {
update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code).set(SchBasePoint::getIs_lock, true));
} }
@Override @Override
@ -519,6 +516,11 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
return collect; return collect;
} }
@Override
public List<JSONObject> selectPointByRegion(String regionCode) {
return pointMapper.selectPointByRegion(regionCode);
}
@Override @Override
public List<OrderMater> getStructList(String region_code, String vehicle_type) { public List<OrderMater> getStructList(String region_code, String vehicle_type) {
//1.查询的结果一个托盘有多个800,PC需要怎么展示? //1.查询的结果一个托盘有多个800,PC需要怎么展示?
@ -543,7 +545,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
return collect; return collect;
} }
private Long getTime(String dateString){ private Long getTime(String dateString) {
String pattern = "yyyy-MM-dd HH:mm:ss"; String pattern = "yyyy-MM-dd HH:mm:ss";
java.util.Date date = DateUtil.parse(dateString, pattern); java.util.Date date = DateUtil.parse(dateString, pattern);
long timestamp = date.getTime(); long timestamp = date.getTime();

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -26,6 +26,8 @@ import org.nl.wms.sch.task_manage.task.TaskFactory;
import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java

@ -67,7 +67,7 @@ public class CNTTask extends AbstractTask {
// 找起点 // 找起点
SchBasePoint schBasePoint = null; SchBasePoint schBasePoint = null;
if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) { if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(),"1"); schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(), "1");
}/* else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) { }/* else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByReassign(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code()); schBasePoint = schBasePointService.selectByReassign(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code());
}*/ }*/
@ -85,6 +85,9 @@ public class CNTTask extends AbstractTask {
task.setVehicle_type(schBasePoint.getCan_vehicle_type()); task.setVehicle_type(schBasePoint.getCan_vehicle_type());
task.setRemark(""); task.setRemark("");
task.setTask_status(TaskStatus.CREATED.getCode()); task.setTask_status(TaskStatus.CREATED.getCode());
if (task.getPoint_code1().endsWith("2")) {
task.setAcs_trace_id("4");
}
taskService.updateById(task); taskService.updateById(task);
schBasePoint.setIng_task_code(task.getTask_code()); schBasePoint.setIng_task_code(task.getTask_code());

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java

@ -72,9 +72,9 @@ public class SortingSMTTask extends AbstractTask {
// 获取任务 // 获取任务
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
// 配置信息 // 配置信息
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>() /*SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); .eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));*/
tasks = tasks.stream().sorted(Comparator.comparing(SchBaseTask::getAcs_trace_id)).collect(Collectors.toList()); tasks = tasks.stream().sorted(Comparator.comparing(SchBaseTask::getAcs_trace_id, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList());
for (SchBaseTask task : tasks) { for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task); TaskUtils.setUpdateByAcs(task);
// 找起点 // 找起点

2
lms/nladmin-ui/src/views/wms/produceScreen/index.vue

@ -224,7 +224,7 @@ export default {
popSecList: [], popSecList: [],
currentRow: null, currentRow: null,
value: '', value: '',
options: [{ value: 'G01', label: '钢托盘' }, { value: 'R01', label: '990mm笼框' }, { value: 'R02', label: '450mm 笼框' }, { value: 'S04', label: '1670mm料架' }, { value: 'S06', label: '1700mm料架' }], options: [{ value: 'G01', label: 'G01' }, { value: 'R01', label: 'R01' }, { value: 'R02', label: 'R02' }, { value: 'S04', label: 'S04' }, { value: 'S06', label: 'S06' }],
value1: '', value1: '',
options1: [{ value: '1', label: '货架' }, { value: '2', label: '内部' }, { value: '3', label: '外协' }], options1: [{ value: '1', label: '货架' }, { value: '2', label: '内部' }, { value: '3', label: '外协' }],
value2: '', value2: '',

33
lms/nladmin-ui/src/views/wms/sch/group/index.vue

@ -26,7 +26,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属区域" prop="region_code"> <el-form-item label="下道工序" prop="region_code">
<el-select <el-select
v-model="query.region_code" v-model="query.region_code"
placeholder="请选择" placeholder="请选择"
@ -228,12 +228,27 @@
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> <el-table
ref="table"
v-loading="crud.loading"
:load="load"
lazy
:data="crud.data"
row-key="group_id"
border
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
size="small"
style="width: 100%;"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="group_id" label="组盘编码" :min-width="flexWidth('group_id',crud.data,'组盘编码')" />
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" /> <el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
<!-- <el-table-column prop="child_vehicle_code" label="子载具编码" :min-width="flexWidth('child_vehicle_code',crud.data,'子载具编码')"/>--> <!-- <el-table-column prop="child_vehicle_code" label="子载具编码" :min-width="flexWidth('child_vehicle_code',crud.data,'子载具编码')"/>-->
<!-- <el-table-column prop="source_vehicle_code" label="来源载具" :min-width="flexWidth('source_vehicle_code',crud.data,'来源载具')" /> --> <!-- <el-table-column prop="source_vehicle_code" label="来源载具" :min-width="flexWidth('source_vehicle_code',crud.data,'来源载具')" /> -->
<el-table-column prop="region_name" label="所属区域" :min-width="flexWidth('region_name',crud.data,'所属区域')" /> <el-table-column prop="region_name" label="下道工序" :min-width="flexWidth('region_name',crud.data,'下道工序')" />
<!-- <el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" /> --> <!-- <el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" /> -->
<!-- <el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" /> --> <!-- <el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" /> -->
<!-- <el-table-column prop="is_full" label="是否满托" :min-width="flexWidth('is_full',crud.data,'是否满托')"> <!-- <el-table-column prop="is_full" label="是否满托" :min-width="flexWidth('is_full',crud.data,'是否满托')">
@ -251,10 +266,12 @@
</el-table-column> </el-table-column>
<el-table-column prop="standing_time" label="静置时间(分钟)" :min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')" /> --> <el-table-column prop="standing_time" label="静置时间(分钟)" :min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')" /> -->
<el-table-column v-if="false" prop="material_name" label="物料名称" show-overflow-tooltip :min-width="flexWidth('material_name',crud.data,'物料数量')" /> <el-table-column v-if="false" prop="material_name" label="物料名称" show-overflow-tooltip :min-width="flexWidth('material_name',crud.data,'物料数量')" />
<el-table-column prop="material_id" label="物料编码" show-overflow-tooltip :min-width="flexWidth('material_id',crud.data,'物料数量')" /> <el-table-column prop="material_id" label="物料编码" show-overflow-tooltip :min-width="flexWidth('material_id',crud.data,'物料编码')" />
<el-table-column prop="material_qty" label="物料数量" show-overflow-tooltip :min-width="flexWidth('material_qty',crud.data,'物料数量')" />
<el-table-column prop="job_name" label="jobName" show-overflow-tooltip :min-width="flexWidth('job_name',crud.data,'jobName')" /> <el-table-column prop="job_name" label="jobName" show-overflow-tooltip :min-width="flexWidth('job_name',crud.data,'jobName')" />
<el-table-column prop="due_date" label="交期时间" show-overflow-tooltip :min-width="flexWidth('due_date',crud.data,'交期时间')" /> <el-table-column prop="due_date" label="交期时间" show-overflow-tooltip :min-width="flexWidth('due_date',crud.data,'交期时间')" />
<el-table-column v-if="false" prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" /> <el-table-column v-if="false" prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" />
<el-table-column prop="theLocation" label="存放点位" :min-width="flexWidth('theLocation',crud.data,'存放点位')" />
<!-- <el-table-column prop="material_qty" label="物料数量" :min-width="flexWidth('material_qty',crud.data,'物料数量')" /> <!-- <el-table-column prop="material_qty" label="物料数量" :min-width="flexWidth('material_qty',crud.data,'物料数量')" />
<el-table-column prop="material_weight" label="物料重量" :min-width="flexWidth('material_weight',crud.data,'物料重量')" /> <el-table-column prop="material_weight" label="物料重量" :min-width="flexWidth('material_weight',crud.data,'物料重量')" />
<el-table-column prop="group_number" label="组盘次数" :min-width="flexWidth('group_number',crud.data,'组盘次数')" /> <el-table-column prop="group_number" label="组盘次数" :min-width="flexWidth('group_number',crud.data,'组盘次数')" />
@ -427,6 +444,14 @@ export default {
}, },
hand(value) { hand(value) {
this.crud.toQuery() this.crud.toQuery()
},
load(tree, treeNode, resolve) {
setTimeout(() => {
crudSchBaseVehiclematerialgroup.selectByVehicle(tree).then(res => {
console.log(res)
resolve(res)
})
}, 100)
} }
} }
} }

Loading…
Cancel
Save