rev:修改确认子卷木箱规格页面能;

add:增加数据库字段执行sql;
This commit is contained in:
2024-03-20 13:40:26 +08:00
parent eba9ebf754
commit 773a951f1f
13 changed files with 132 additions and 61 deletions

View File

@@ -68,7 +68,7 @@ public class PdmBiSubpackagerelationController {
* @param whereJson 查询条件
*/
@GetMapping("/queryContainerNameBySaleOrder")
@Log("查询订单装箱信息")
@Log("根据订单号查询子卷信息")
public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestParam Map whereJson) {
return new ResponseEntity<>(TableDataInfo.build(pdmBiSubpackagerelationService.queryContainerNameBySaleOrder(whereJson)), HttpStatus.OK);
}

View File

@@ -311,6 +311,7 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
private String box_group;
/**
* 获取主键值
*

View File

@@ -161,7 +161,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.map(PdmBiSubpackagerelation::getWorkorder_id)
.map(String::valueOf)
.collect(Collectors.toList());
;
if (entityList.isEmpty()) {
return;
}

View File

@@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.b_lms.sch.task.dao.SchBaseTask;
@@ -27,6 +30,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@@ -46,7 +50,8 @@ public class DjqTask extends AbstractAcsTask {
private IbstIvtPackageinfoivtService packageinfoivtService;
@Resource
private OutBoxManageService outBoxManageService;
@Resource
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
@Resource
private MzhcwTask mzhcwTask;
@Resource
@@ -87,10 +92,13 @@ public class DjqTask extends AbstractAcsTask {
@Override
@Transactional(rollbackFor = Exception.class)
public void updateTaskStatus(JSONObject taskObj, String status) {
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>().eq( SchBaseTask::getTask_id, taskObj.getString("task_id")), false);
SchBaseTask schBaseTask = taskService.getOne(new LambdaUpdateWrapper<SchBaseTask>().eq(SchBaseTask::getTask_id, taskObj.getString("task_id")), false);
if (schBaseTask == null) {
throw new BadRequestException("满轴缓存位 -> 待检区更新接口任务号为空!");
}
if (StringUtils.isBlank(schBaseTask.getVehicle_code())) {
throw new BadRequestException("满轴缓存位 -> 待检区,子卷号不能为空!");
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中
schBaseTask.setTask_status(TaskStatusEnum.EXECUTING.getCode());
@@ -102,12 +110,25 @@ public class DjqTask extends AbstractAcsTask {
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
//更新库存记录
packageinfoivtService.update(new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("有子卷")).set("container_name", schBaseTask.getVehicle_code()).eq("point_code", schBaseTask.getPoint_code2()));
//todo 3.手持确认包装关系,生产包装关系表数据
//todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
//device_code终点,box_length 长,box_width 宽,box_high 高,num: 子卷数
// JSONObject boxInfo = new JSONObject();
// boxInfo.put("device_code", schBaseTask.getPoint_code2());
// outBoxManageService.outBox(boxInfo);
//PC子卷装箱界面确认包装关系根据子卷号查询包装关系获取木箱规格
String vehicleCode = schBaseTask.getVehicle_code();
PdmBiSubpackagerelation pdmBiSubpackagerelation = pdmBiSubpackagerelationService
.getOne(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, vehicleCode), false);
if (pdmBiSubpackagerelation != null) {
//如果子卷数大于0与木箱规格不为空,代表已确定子卷包装关系,则查询木箱号并木箱出库
if (pdmBiSubpackagerelation.getQuanlity_in_box().compareTo(BigDecimal.ZERO) > 0 && StringUtils.isNotBlank(pdmBiSubpackagerelation.getBox_type())) {
//device_code终点,material_code木箱规格,num: 子卷数
JSONObject boxInfo = new JSONObject();
boxInfo.put("device_code", schBaseTask.getPoint_code2());
boxInfo.put("material_code", pdmBiSubpackagerelation.getBox_type());
boxInfo.put("num", pdmBiSubpackagerelation.getQuanlity_in_box());
outBoxManageService.outBox(boxInfo);
//todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
String boxSn = "MX240115000152";
//更新子卷包装关系更新木箱号
pdmBiSubpackagerelationService.update(pdmBiSubpackagerelation, new UpdateWrapper<PdmBiSubpackagerelation>().set("package_box_sn", boxSn));
}
}
//5.查询是否有未下发的输送线->满轴位任务,有就下发
List<SchBaseTask> notIssueTaskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>()
//确定起点
@@ -133,10 +154,9 @@ public class DjqTask extends AbstractAcsTask {
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
jo.put("point_code1", schBaseTask.getPoint_code2());
jo.put("point_code2", zxqPointList.get(0).getPoint_code());
jo.put("vehicle_code", schBaseTask.getVehicle_code());
jo.put("vehicle_code", vehicleCode);
zxqTask.createTask(jo);
}
else{
} else {
throw new BadRequestException("装箱区暂无空余库位!");
}
}

View File

@@ -47,8 +47,6 @@ public class ZxqTask extends AbstractAcsTask {
@Resource
private ZxDjwTask zxDjwTask;
@Resource
private DjqTask djqTask;
@Resource
private IschBaseTaskService taskService;
@Resource
private IbstIvtPackageinfoivtService packageinfoivtService;

View File

@@ -1,9 +1,20 @@
package org.nl.b_lms.storage_manage.database.controller;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
import org.nl.modules.logging.annotation.Log;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* <p>
* 前端控制器
@@ -16,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/boxinfo")
public class BstIvtBoxinfoController {
@Resource
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
@GetMapping
@Log("查询木箱信息")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(iBstIvtBoxinfoService.queryAll(whereJson, page), HttpStatus.OK);
}
}

View File

@@ -3,6 +3,9 @@ package org.nl.b_lms.storage_manage.database.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
import org.springframework.data.domain.Pageable;
import java.util.Map;
/**
* <p>
@@ -14,6 +17,22 @@ import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
*/
public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> queryAll(Map whereJson, Pageable page);
/**
* 根据mes信息插入木箱信息
* @param whereJson{

View File

@@ -1,17 +1,23 @@
package org.nl.b_lms.storage_manage.database.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
import org.nl.common.utils.IdUtil;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 服务实现类
* 服务实现类
* </p>
*
* @author author
@@ -19,6 +25,23 @@ import org.springframework.stereotype.Service;
*/
@Service
public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, BstIvtBoxinfo> implements IBstIvtBoxinfoService {
@Resource
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
Map<String, Object> mapReslt = new HashMap<>();
LambdaQueryWrapper<BstIvtBoxinfo> queryWrapper = new LambdaQueryWrapper<>();
if (whereJson.containsKey("search")) {
queryWrapper.like(BstIvtBoxinfo::getBox_no, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_code, whereJson.get("search")).or().like(BstIvtBoxinfo::getMaterial_name, whereJson.get("search"));
}
IPage<BstIvtBoxinfo> result = bstIvtBoxinfoMapper.selectPage(new Page<>(page.getPageNumber() + 1, page.getPageSize()),queryWrapper);
mapReslt.put("content", result.getRecords());
mapReslt.put("totalElements", result.getTotal());
return mapReslt;
}
@Override
public BstIvtBoxinfo mesInsert(JSONObject whereJson) {
@@ -42,9 +65,9 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
try {
String one = description.substring(description.indexOf("|") + 1);
String two = one.substring(one.indexOf("|") + 1);
String num = two.substring(two.indexOf("|") + 1,two.indexOf("|") + 2);
String num = two.substring(two.indexOf("|") + 1, two.indexOf("|") + 2);
boxDao.setNum(num);
}catch (Exception e) {
} catch (Exception e) {
boxDao.setNum("截取失败请检查mes数据!");
}

View File

@@ -0,0 +1,7 @@
ALTER TABLE pdm_bi_subpackagerelation
ADD COLUMN `box_group` varchar(20) NULL DEFAULT '0' COMMENT '木箱组';
ALTER TABLE pdm_bi_slittingproductionplan
ADD COLUMN `level` char(1) NULL DEFAULT NULL COMMENT '子卷等级';
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `component_name`, `component`, `menu_sort`, `icon`, `path`, `iframe`, `cache`, `hidden`, `permission`, `create_name`, `update_name`, `create_time`, `update_time`, `is_pc`, `system_type`, `create_id`, `category`, `update_id`) VALUES ('1765714619160203264', '329', 0, 4, '子卷装箱', NULL, 'wms/pdm/sub/index', 998, 'zujian', 'wms/pdm/sub/index', 0, b'0', b'0', NULL, NULL, NULL, NULL, NULL, 1, '1', 1, NULL, NULL);
INSERT INTO `sys_dict` (`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1765997086853173248', 'sub_package_relation', '子卷包装关系状态', '未分配', '99', 0, NULL, NULL, NULL, NULL, '1', '管理员', '2024-03-08 15:04:50', '1', '管理员', '2024-03-08 15:04:50');

View File

@@ -22,7 +22,6 @@ import java.util.Map;
**/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/Materialbase")
@Slf4j
public class MaterialbaseController {