Browse Source

opt:优化修改载具管理查询问题

master
zds 1 month ago
parent
commit
f6cbe0df32
  1. 2
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/classstandard/service/dao/mapper/ClassStandardMapper.xml
  2. 12
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/storagevehicleinfo/service/dao/mapper/StoragevehicleinfoMapper.xml
  3. 8
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/storagevehicleinfo/service/dto/StoragevehicleinfoDto.java
  4. 24
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/storagevehicleinfo/service/impl/StoragevehicleinfoServiceImpl.java
  5. 37
      lms/nladmin-ui/src/views/wms/basedata/master/storagevehicleinfo/index.vue

2
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/classstandard/service/dao/mapper/ClassStandardMapper.xml

@ -10,7 +10,7 @@
t1.class_id,
IF(find_in_set(parent_class_id, @pids) > 0, @pids := concat(@pids, ',', class_id), 0) AS ischild
FROM (
SELECT class_id, parent_class_id FROM md_pd_classstandard t WHERE t.is_delete = '0' ORDER BY class_code
SELECT class_id, parent_class_id FROM md_pb_classstandard t WHERE t.is_delete = '0' ORDER BY class_code
) t1,
(SELECT @pids := #{classId}) t2
) t3

12
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/storagevehicleinfo/service/dao/mapper/StoragevehicleinfoMapper.xml

@ -20,30 +20,26 @@
(#{item.storagevehicle_code},#{item.storagevehicle_id},#{item.storagevehicle_name},#{item.storagevehicle_type},#{item.create_name},#{item.create_id},#{item.create_time},#{item.update_optid},#{item.update_time})
</foreach>
</insert>
<select id="selectByParam"
resultType="org.nl.wms.basedata.master.storagevehicleinfo.service.dto.StoragevehicleinfoDto">
<select id="selectByParam" resultType="org.nl.wms.basedata.master.storagevehicleinfo.service.dto.StoragevehicleinfoDto">
SELECT
s.*,
ext.pcsn,
ext.qty,
ext.update_time AS change_time,
point.point_code,
point.point_name,
class.class_name AS storagevehicle_type_name
FROM
md_pb_storagevehicleinfo s
LEFT JOIN sch_base_point point ON point.vehicle_code = s.storagevehicle_code
LEFT JOIN md_pb_classstandard class ON class.class_code = s.storagevehicle_type
LEFT JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = s.storagevehicle_code
LEFT JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_id = s.storagevehicle_id
WHERE
1=1
and s.is_delete = '0'
<if test="whereJson.storagevehicle_types != null">
s.storagevehicle_type in
and class.class_id in
<foreach collection="whereJson.storagevehicle_types" item="type" open="(" separator="," close=")">
#{type}
</foreach>
</if>
and s.is_delete = '0'
<if test="whereJson.storagevehicle_code_begin != null">
AND s.storagevehicle_code >= #{whereJson.storagevehicle_code_begin}
</if>

8
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/storagevehicleinfo/service/dto/StoragevehicleinfoDto.java

@ -50,14 +50,6 @@ public class StoragevehicleinfoDto implements Serializable {
private String storagevehicle_type;
private String storagevehicle_type_name;
private BigDecimal vehicle_width;
private BigDecimal vehicle_long;
private BigDecimal vehicle_height;
private String overstruct_type;
private BigDecimal occupystruct_qty;

24
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/storagevehicleinfo/service/impl/StoragevehicleinfoServiceImpl.java

@ -2,30 +2,23 @@ package org.nl.wms.basedata.master.storagevehicleinfo.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
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 lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.system.service.coderule.impl.SysCodeRuleServiceImpl;
import org.nl.wms.basedata.master.sectattr.service.dao.Sectattr;
import org.nl.wms.basedata.master.standard.service.IClassStandardService;
import org.nl.wms.basedata.master.standard.service.dao.ClassStandard;
import org.nl.wms.basedata.master.standard.service.dao.mapper.ClassStandardMapper;
import org.nl.wms.basedata.master.classstandard.service.IClassStandardService;
import org.nl.wms.basedata.master.classstandard.service.dao.ClassStandard;
import org.nl.wms.basedata.master.classstandard.service.dao.mapper.ClassStandardMapper;
import org.nl.wms.basedata.master.storagevehicleinfo.service.StoragevehicleinfoService;
import org.nl.wms.basedata.master.storagevehicleinfo.service.dao.Storagevehicleex;
import org.nl.wms.basedata.master.storagevehicleinfo.service.dao.Storagevehicleinfo;
@ -33,10 +26,8 @@ import org.nl.wms.basedata.master.storagevehicleinfo.service.dao.mapper.Storagev
import org.nl.wms.basedata.master.storagevehicleinfo.service.dao.mapper.StoragevehicleinfoMapper;
import org.nl.wms.basedata.master.storagevehicleinfo.service.dto.StoragevehicleinfoDto;
import org.nl.wms.basedata.master.storagevehicleinfo.service.dto.StoragevehicleinfoQuery;
import org.nl.wms.basedata.master.unit.service.dao.Unit;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -64,11 +55,10 @@ public class StoragevehicleinfoServiceImpl implements StoragevehicleinfoService
@Override
public JSONObject queryAll(StoragevehicleinfoQuery whereJson, PageQuery page) {
if (StrUtil.isNotEmpty((String) whereJson.getStoragevehicle_type())) {
ClassStandard dto = classStandardMapper.selectById(whereJson.getStoragevehicle_type());
List<String> storagevehicle_types = classstandardService.getAllChildrenIds(dto.getClass_id().toString());
whereJson.setStoragevehicle_types(storagevehicle_types);
if (StrUtil.isNotEmpty(whereJson.getStoragevehicle_type())) {
Set<String> storagevehicle_types = classStandardMapper.selectClassIds(whereJson.getStoragevehicle_type());
storagevehicle_types.add(whereJson.getStoragevehicle_type());
whereJson.setStoragevehicle_types(new ArrayList<>(storagevehicle_types));
}
IPage<Storagevehicleinfo> pages = new Page<>(page.getPage() + 1, page.getSize());
IPage<StoragevehicleinfoDto> storagevehicleinfoIPage = storagevehicleinfoMapper.selectByParam(whereJson,pages);

37
lms/nladmin-ui/src/views/wms/basedata/master/storagevehicleinfo/index.vue

@ -112,10 +112,6 @@
<el-table-column prop="storagevehicle_type_name" label="载具类型" />
<el-table-column prop="storagevehicle_code" label="载具编码" />
<el-table-column prop="storagevehicle_name" label="载具名称" />
<!-- <el-table-column prop="is_task" label="是否搬运中" :formatter="formatIsTask"/>-->
<!--<el-table-column prop="point_code" label="当前点位" width="120px"/>
<el-table-column prop="start_point_code" label="起点" width="120px"/>
<el-table-column prop="next_point_code" label="终点" width="120px"/>-->
<el-table-column prop="pcsn" label="绑定物料" />
<el-table-column prop="qty" label="托盘重量" />
<el-table-column label="是否启用" align="center" prop="is_used">
@ -130,6 +126,8 @@
</el-table-column>
<el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" width="150px" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150px" />
<el-table-column
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
label="操作"
@ -170,18 +168,9 @@ const defaultForm = {
one_code: null,
two_code: null,
rfid_code: null,
create_id: null,
create_name: null,
create_time: null,
update_optid: null,
update_optname: null,
update_time: null,
is_delete: null,
is_used: '1',
storagevehicle_type: null,
vehicle_width: null,
vehicle_long: null,
vehicle_height: null,
overstruct_type: null,
occupystruct_qty: null,
ext_id: null,
@ -222,24 +211,14 @@ export default {
}
return {
resultCodeArr: [],
permission: {},
permission: {
add: ['admin', 'storagevehicleinfo:add'],
edit: ['admin', 'storagevehicleinfo:edit'],
del: ['admin', 'storagevehicleinfo:del']
},
classes1: [],
classlist: [],
rules: {
create_id: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
create_name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
create_time: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
is_delete: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
is_used: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
storagevehicle_type: [
{ required: true, message: '不能为空', trigger: 'blur' }
],

Loading…
Cancel
Save