rev:修改确认子卷木箱规格页面能;
add:增加数据库字段执行sql;
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -311,6 +311,7 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
|
||||
private String box_group;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
|
||||
@@ -161,7 +161,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
;
|
||||
if (entityList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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("装箱区暂无空余库位!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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:{
|
||||
|
||||
@@ -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数据!");
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.Map;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@RequestMapping("/api/Materialbase")
|
||||
@Slf4j
|
||||
public class MaterialbaseController {
|
||||
|
||||
@@ -59,22 +59,8 @@
|
||||
placeholder="请输入子卷号"
|
||||
class="search-input"
|
||||
clearable
|
||||
@clear="handleInput"
|
||||
@input="handleSearch"
|
||||
@clear="clearSearch"
|
||||
/>
|
||||
|
||||
<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;">
|
||||
<el-button
|
||||
slot="left"
|
||||
@@ -228,11 +214,12 @@ export default {
|
||||
})
|
||||
console.log('multipleSelection2:', this.multipleSelection)
|
||||
const table2 = this.$refs.dis_table
|
||||
table2.clearSelection()
|
||||
const selectedRows = this.multipleSelection
|
||||
selectedRows.forEach(row => {
|
||||
debugger
|
||||
table2.toggleRowSelection(row)
|
||||
this.$nextTick(() => {
|
||||
table2.clearSelection()
|
||||
const selectedRows = this.multipleSelection
|
||||
selectedRows.forEach(row => {
|
||||
table2.toggleRowSelection(row)
|
||||
})
|
||||
})
|
||||
// this.$refs.dis_table.clearSelection()
|
||||
// this.multipleSelection.forEach(row => {
|
||||
@@ -270,7 +257,6 @@ export default {
|
||||
},
|
||||
getMultipleSelection(multipleSelection) {
|
||||
return multipleSelection.reduce((acc, item) => {
|
||||
debugger
|
||||
const existingItem = acc.find(existing => existing.container_name === item.container_name)
|
||||
if (!existingItem) {
|
||||
acc.push(item)
|
||||
@@ -296,7 +282,7 @@ export default {
|
||||
},
|
||||
// 表格1的行点击事件
|
||||
handleRowClick(scope) {
|
||||
debugger
|
||||
this.clearSelection()
|
||||
const table2 = this.$refs.dis_table
|
||||
const table2Data = Array.from(this.openParam)
|
||||
const groupValue = scope.box_group === 0 ? scope.container_name : scope.box_group
|
||||
@@ -327,24 +313,24 @@ export default {
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
tableChanged(row) {
|
||||
async tableChanged(row) {
|
||||
this.form.tableMater = this.currentSelection
|
||||
this.form.checked = row.material_code
|
||||
// 父组件传过来的订单号
|
||||
this.form.sale_order_name = this.sale_order_name
|
||||
crudPackagerelation.updateEntityList(this.form).then(res => {
|
||||
crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name }).then(res => {
|
||||
this.openParam = res.content
|
||||
this.$emit('childEvent')
|
||||
this.clearSelection()
|
||||
})
|
||||
this.form.tableMater = []
|
||||
try {
|
||||
await crudPackagerelation.updateEntityList(this.form)
|
||||
const res = await crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name })
|
||||
this.openParam = res.content
|
||||
this.clearSelection()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('更新数据出错:', error)
|
||||
this.crud.notify('更新数据出错', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
},
|
||||
divStruct() {
|
||||
debugger
|
||||
if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) {
|
||||
debugger
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(false)
|
||||
} else {
|
||||
@@ -378,7 +364,7 @@ export default {
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 200px;
|
||||
width: 251px;
|
||||
}
|
||||
|
||||
.clear-icon {
|
||||
|
||||
@@ -63,9 +63,9 @@ export default {
|
||||
return CRUD({
|
||||
title: '木箱规格',
|
||||
optShow: {},
|
||||
url: 'api/Materialbase',
|
||||
idField: 'material_id',
|
||||
sort: 'material_id,desc',
|
||||
url: 'api/boxinfo',
|
||||
idField: 'material_code',
|
||||
sort: 'material_code,desc',
|
||||
query: { search: '', material_id: '' },
|
||||
crudMethod: { ...crudMaterattr }
|
||||
})
|
||||
@@ -168,7 +168,6 @@ export default {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
debugger
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先选择木箱信息')
|
||||
|
||||
@@ -158,8 +158,7 @@ const defaultForm = {
|
||||
mass_per_unit_area: null,
|
||||
net_weight: null,
|
||||
length: null,
|
||||
date_of_production: null,
|
||||
is_un_plan_production: null,
|
||||
date_of_production: null, is_un_plan_production: null,
|
||||
un_plan_product_property1: null,
|
||||
un_plan_product_property2: null,
|
||||
un_plan_product_property3: null,
|
||||
@@ -279,7 +278,6 @@ export default {
|
||||
if (this.currentRow !== null) {
|
||||
crud.downloadLoading = true
|
||||
download('/api/packagerelation/download', this.crud.query).then(result => {
|
||||
debugger
|
||||
downloadFile(result, '子卷包装', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
|
||||
Reference in New Issue
Block a user