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 查询条件 * @param whereJson 查询条件
*/ */
@GetMapping("/queryContainerNameBySaleOrder") @GetMapping("/queryContainerNameBySaleOrder")
@Log("查询订单装箱信息") @Log("根据订单号查询子卷信息")
public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestParam Map whereJson) { public ResponseEntity<Object> queryContainerNameBySaleOrder(@RequestParam Map whereJson) {
return new ResponseEntity<>(TableDataInfo.build(pdmBiSubpackagerelationService.queryContainerNameBySaleOrder(whereJson)), HttpStatus.OK); 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; private String box_group;
/** /**
* 获取主键值 * 获取主键值
* *

View File

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

View File

@@ -10,6 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; 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.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService; import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.b_lms.sch.task.dao.SchBaseTask; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -46,7 +50,8 @@ public class DjqTask extends AbstractAcsTask {
private IbstIvtPackageinfoivtService packageinfoivtService; private IbstIvtPackageinfoivtService packageinfoivtService;
@Resource @Resource
private OutBoxManageService outBoxManageService; private OutBoxManageService outBoxManageService;
@Resource
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
@Resource @Resource
private MzhcwTask mzhcwTask; private MzhcwTask mzhcwTask;
@Resource @Resource
@@ -91,6 +96,9 @@ public class DjqTask extends AbstractAcsTask {
if (schBaseTask == null) { if (schBaseTask == null) {
throw new BadRequestException("满轴缓存位 -> 待检区更新接口任务号为空!"); throw new BadRequestException("满轴缓存位 -> 待检区更新接口任务号为空!");
} }
if (StringUtils.isBlank(schBaseTask.getVehicle_code())) {
throw new BadRequestException("满轴缓存位 -> 待检区,子卷号不能为空!");
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) { if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中 // 更新任务状态为执行中
schBaseTask.setTask_status(TaskStatusEnum.EXECUTING.getCode()); 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", 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())); 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.手持确认包装关系,生产包装关系表数据 //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.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务 //todo 4.根据子卷包装关系查询木箱号,调刘先源的空木箱出库服务创建出库任务
//device_code终点,box_length 长,box_width 宽,box_high 高,num: 子卷数 String boxSn = "MX240115000152";
// JSONObject boxInfo = new JSONObject(); //更新子卷包装关系更新木箱号
// boxInfo.put("device_code", schBaseTask.getPoint_code2()); pdmBiSubpackagerelationService.update(pdmBiSubpackagerelation, new UpdateWrapper<PdmBiSubpackagerelation>().set("package_box_sn", boxSn));
// outBoxManageService.outBox(boxInfo); }
}
//5.查询是否有未下发的输送线->满轴位任务,有就下发 //5.查询是否有未下发的输送线->满轴位任务,有就下发
List<SchBaseTask> notIssueTaskList = taskService.list(new LambdaUpdateWrapper<SchBaseTask>() 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("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
jo.put("point_code1", schBaseTask.getPoint_code2()); jo.put("point_code1", schBaseTask.getPoint_code2());
jo.put("point_code2", zxqPointList.get(0).getPoint_code()); jo.put("point_code2", zxqPointList.get(0).getPoint_code());
jo.put("vehicle_code", schBaseTask.getVehicle_code()); jo.put("vehicle_code", vehicleCode);
zxqTask.createTask(jo); zxqTask.createTask(jo);
} } else {
else{
throw new BadRequestException("装箱区暂无空余库位!"); throw new BadRequestException("装箱区暂无空余库位!");
} }
} }

View File

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

View File

@@ -1,9 +1,20 @@
package org.nl.b_lms.storage_manage.database.controller; 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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/** /**
* <p> * <p>
* 前端控制器 * 前端控制器
@@ -16,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/boxinfo") @RequestMapping("/api/boxinfo")
public class BstIvtBoxinfoController { 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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo; import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
import org.springframework.data.domain.Pageable;
import java.util.Map;
/** /**
* <p> * <p>
@@ -14,6 +17,22 @@ import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
*/ */
public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> { public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> queryAll(Map whereJson, Pageable page);
/** /**
* 根据mes信息插入木箱信息 * 根据mes信息插入木箱信息
* @param whereJson{ * @param whereJson{

View File

@@ -1,13 +1,19 @@
package org.nl.b_lms.storage_manage.database.service.impl; package org.nl.b_lms.storage_manage.database.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; 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 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.IBstIvtBoxinfoService;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo; 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.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/** /**
* <p> * <p>
@@ -19,6 +25,23 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, BstIvtBoxinfo> implements IBstIvtBoxinfoService { 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 @Override
public BstIvtBoxinfo mesInsert(JSONObject whereJson) { public BstIvtBoxinfo mesInsert(JSONObject whereJson) {

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 @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/Materialbase") @RequestMapping("/api/Materialbase")
@Slf4j @Slf4j
public class MaterialbaseController { public class MaterialbaseController {

View File

@@ -59,22 +59,8 @@
placeholder="请输入子卷号" placeholder="请输入子卷号"
class="search-input" class="search-input"
clearable clearable
@clear="handleInput" @clear="clearSearch"
@input="handleSearch"
/> />
<span class="crud-opts-right2">
<el-button
slot="left"
class="filter-item"
type="success"
icon="el-icon-circle-close"
size="mini"
@click="clearSearch()"
>
清空
</el-button>
</span>
<span class="crud-opts-right2" style="margin-left: 15px;"> <span class="crud-opts-right2" style="margin-left: 15px;">
<el-button <el-button
slot="left" slot="left"
@@ -228,12 +214,13 @@ export default {
}) })
console.log('multipleSelection2:', this.multipleSelection) console.log('multipleSelection2:', this.multipleSelection)
const table2 = this.$refs.dis_table const table2 = this.$refs.dis_table
this.$nextTick(() => {
table2.clearSelection() table2.clearSelection()
const selectedRows = this.multipleSelection const selectedRows = this.multipleSelection
selectedRows.forEach(row => { selectedRows.forEach(row => {
debugger
table2.toggleRowSelection(row) table2.toggleRowSelection(row)
}) })
})
// this.$refs.dis_table.clearSelection() // this.$refs.dis_table.clearSelection()
// this.multipleSelection.forEach(row => { // this.multipleSelection.forEach(row => {
// this.$refs.dis_table.toggleRowSelection(row,true); // this.$refs.dis_table.toggleRowSelection(row,true);
@@ -270,7 +257,6 @@ export default {
}, },
getMultipleSelection(multipleSelection) { getMultipleSelection(multipleSelection) {
return multipleSelection.reduce((acc, item) => { return multipleSelection.reduce((acc, item) => {
debugger
const existingItem = acc.find(existing => existing.container_name === item.container_name) const existingItem = acc.find(existing => existing.container_name === item.container_name)
if (!existingItem) { if (!existingItem) {
acc.push(item) acc.push(item)
@@ -296,7 +282,7 @@ export default {
}, },
// 表格1的行点击事件 // 表格1的行点击事件
handleRowClick(scope) { handleRowClick(scope) {
debugger this.clearSelection()
const table2 = this.$refs.dis_table const table2 = this.$refs.dis_table
const table2Data = Array.from(this.openParam) const table2Data = Array.from(this.openParam)
const groupValue = scope.box_group === 0 ? scope.container_name : scope.box_group const groupValue = scope.box_group === 0 ? scope.container_name : scope.box_group
@@ -327,24 +313,24 @@ export default {
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
row.index = rowIndex row.index = rowIndex
}, },
tableChanged(row) { async tableChanged(row) {
this.form.tableMater = this.currentSelection this.form.tableMater = this.currentSelection
this.form.checked = row.material_code this.form.checked = row.material_code
// 父组件传过来的订单号
this.form.sale_order_name = this.sale_order_name this.form.sale_order_name = this.sale_order_name
crudPackagerelation.updateEntityList(this.form).then(res => { try {
crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name }).then(res => { await crudPackagerelation.updateEntityList(this.form)
const res = await crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name })
this.openParam = res.content this.openParam = res.content
this.$emit('childEvent')
this.clearSelection() this.clearSelection()
})
this.form.tableMater = []
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}) } catch (error) {
console.error('更新数据出错:', error)
this.crud.notify('更新数据出错', CRUD.NOTIFICATION_TYPE.ERROR)
}
}, },
divStruct() { divStruct() {
debugger
if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) { if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) {
debugger
this.structShow = true this.structShow = true
this.$refs.child.getMsg(false) this.$refs.child.getMsg(false)
} else { } else {
@@ -378,7 +364,7 @@ export default {
} }
.search-input { .search-input {
width: 200px; width: 251px;
} }
.clear-icon { .clear-icon {

View File

@@ -63,9 +63,9 @@ export default {
return CRUD({ return CRUD({
title: '木箱规格', title: '木箱规格',
optShow: {}, optShow: {},
url: 'api/Materialbase', url: 'api/boxinfo',
idField: 'material_id', idField: 'material_code',
sort: 'material_id,desc', sort: 'material_code,desc',
query: { search: '', material_id: '' }, query: { search: '', material_id: '' },
crudMethod: { ...crudMaterattr } crudMethod: { ...crudMaterattr }
}) })
@@ -168,7 +168,6 @@ export default {
this.$emit('update:dialogShow', false) this.$emit('update:dialogShow', false)
}, },
submit() { submit() {
debugger
this.rows = this.$refs.table.selection this.rows = this.$refs.table.selection
if (this.rows.length <= 0) { if (this.rows.length <= 0) {
this.$message('请先选择木箱信息') this.$message('请先选择木箱信息')

View File

@@ -158,8 +158,7 @@ const defaultForm = {
mass_per_unit_area: null, mass_per_unit_area: null,
net_weight: null, net_weight: null,
length: null, length: null,
date_of_production: null, date_of_production: null, is_un_plan_production: null,
is_un_plan_production: null,
un_plan_product_property1: null, un_plan_product_property1: null,
un_plan_product_property2: null, un_plan_product_property2: null,
un_plan_product_property3: null, un_plan_product_property3: null,
@@ -279,7 +278,6 @@ export default {
if (this.currentRow !== null) { if (this.currentRow !== null) {
crud.downloadLoading = true crud.downloadLoading = true
download('/api/packagerelation/download', this.crud.query).then(result => { download('/api/packagerelation/download', this.crud.query).then(result => {
debugger
downloadFile(result, '子卷包装', 'xlsx') downloadFile(result, '子卷包装', 'xlsx')
crud.downloadLoading = false crud.downloadLoading = false
}).catch(() => { }).catch(() => {