init:版本说明
This commit is contained in:
@@ -43,5 +43,11 @@ public class CodeUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static String codeView(String ruleCode) {
|
||||
final String[] code = {""};
|
||||
ISysCodeRuleService service = SpringContextHolder.getBean(ISysCodeRuleService.class);
|
||||
RedissonUtils.lock(() -> code[0] = service.codeDemo(MapOf.of("flag","0","code",ruleCode)), ruleCode, 1);
|
||||
return code[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.nl.common.utils;
|
||||
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: liaojinlong
|
||||
* @date: 2020/6/11 16:28
|
||||
* @apiNote: JDK 8 新日期类 格式化与字符串转换 工具类
|
||||
*/
|
||||
public class DateUtil {
|
||||
|
||||
public static final DateTimeFormatter DFY_MD_HMS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
public static final DateTimeFormatter DFY_MD = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
||||
/**
|
||||
* LocalDateTime 转时间戳
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static Long getDate(LocalDateTime localDateTime) {
|
||||
return localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond();
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳转LocalDateTime
|
||||
*
|
||||
* @param Date /
|
||||
* @return /
|
||||
*/
|
||||
public static LocalDateTime fromDate(Long Date) {
|
||||
return LocalDateTime.ofEpochSecond(Date, 0, OffsetDateTime.now().getOffset());
|
||||
}
|
||||
|
||||
/**
|
||||
* LocalDateTime 转 Date
|
||||
* Jdk8 后 不推荐使用 {@link Date} Date
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static Date toDate(LocalDateTime localDateTime) {
|
||||
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* LocalDate 转 Date
|
||||
* Jdk8 后 不推荐使用 {@link Date} Date
|
||||
*
|
||||
* @param localDate /
|
||||
* @return /
|
||||
*/
|
||||
public static Date toDate(LocalDate localDate) {
|
||||
return toDate(localDate.atTime(LocalTime.now(ZoneId.systemDefault())));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Date转 LocalDateTime
|
||||
* Jdk8 后 不推荐使用 {@link Date} Date
|
||||
*
|
||||
* @param date /
|
||||
* @return /
|
||||
*/
|
||||
public static LocalDateTime toLocalDateTime(Date date) {
|
||||
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期 格式化
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @param patten /
|
||||
* @return /
|
||||
*/
|
||||
public static String localDateTimeFormat(LocalDateTime localDateTime, String patten) {
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern(patten);
|
||||
return df.format(localDateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期 格式化
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @param df /
|
||||
* @return /
|
||||
*/
|
||||
public static String localDateTimeFormat(LocalDateTime localDateTime, DateTimeFormatter df) {
|
||||
return df.format(localDateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期格式化 yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static String localDateTimeFormatyMdHms(LocalDateTime localDateTime) {
|
||||
return DFY_MD_HMS.format(localDateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期格式化 yyyy-MM-dd
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public String localDateTimeFormatyMd(LocalDateTime localDateTime) {
|
||||
return DFY_MD.format(localDateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转 LocalDateTime ,字符串格式 yyyy-MM-dd
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static LocalDateTime parseLocalDateTimeFormat(String localDateTime, String pattern) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(pattern);
|
||||
return LocalDateTime.from(dateTimeFormatter.parse(localDateTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转 LocalDateTime ,字符串格式 yyyy-MM-dd
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static LocalDateTime parseLocalDateTimeFormat(String localDateTime, DateTimeFormatter dateTimeFormatter) {
|
||||
return LocalDateTime.from(dateTimeFormatter.parse(localDateTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转 LocalDateTime ,字符串格式 yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static LocalDateTime parseLocalDateTimeFormatyMdHms(String localDateTime) {
|
||||
return LocalDateTime.from(DFY_MD_HMS.parse(localDateTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转 yyyy-MM-dd
|
||||
*
|
||||
* @param localDateTime /
|
||||
* @return /
|
||||
*/
|
||||
public static String parseLocalDateTimeFormatYmd(String localDateTime) {
|
||||
if (localDateTime == null || localDateTime.length() < 10) {
|
||||
return localDateTime;
|
||||
}
|
||||
return localDateTime.substring(0, 10);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,26 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -30,8 +42,10 @@ import java.util.Set;
|
||||
@Slf4j
|
||||
public class GroupController {
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private final IMdPbGroupplateService iMdPbGroupplateService;
|
||||
@Autowired
|
||||
private final IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("分页查询")
|
||||
@@ -39,6 +53,31 @@ public class GroupController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbGroupplateService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@Log("新增组盘组盘")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
||||
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
||||
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
||||
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
||||
{
|
||||
iMdPbStoragevehicleinfoService.getByCode(storagevehicleCode);
|
||||
int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
if (has>0){
|
||||
throw new BadRequestException("当前载具组盘信息已存在");
|
||||
}
|
||||
}
|
||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||
groupPlate.setCreate_time(DateUtil.now());
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
iMdPbGroupplateService.save(groupPlate);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除组盘")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
@@ -43,8 +47,8 @@ public class StorageVehicleInfoController {
|
||||
|
||||
@PostMapping
|
||||
@Log("新增载具")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdPbStoragevehicleinfo dto) {
|
||||
iMdPbStoragevehicleinfoService.create(dto);
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject dto) {
|
||||
JSONArray array = iMdPbStoragevehicleinfoService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -62,4 +66,10 @@ public class StorageVehicleInfoController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getVehicle/{code}")
|
||||
@Log("获取起始载具号")
|
||||
public ResponseEntity<Object> getVehicle(@PathVariable String code) {
|
||||
return new ResponseEntity<>(MapOf.of("value", CodeUtil.codeView(code)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -30,7 +32,7 @@ public interface IMdPbStoragevehicleinfoService extends IService<MdPbStoragevehi
|
||||
* 新增载具信息
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void create(MdPbStoragevehicleinfo dto);
|
||||
JSONArray create(JSONObject dto);
|
||||
|
||||
/**
|
||||
* 修改载具
|
||||
|
||||
@@ -8,7 +8,9 @@ import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -108,4 +110,6 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
* 入库规则
|
||||
*/
|
||||
List<Structattr> inBoundSectDiv(StrategyStructParam param);
|
||||
|
||||
void changeStruct(StructattrChangeDto changeDto);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.nl.wms.basedata_manage.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StructattrChangeDto {
|
||||
String inv;
|
||||
String structCode;
|
||||
String storagevehicleCode;
|
||||
Boolean inBound;
|
||||
String taskType;
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package org.nl.wms.basedata_manage.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -10,12 +12,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.system_manage.service.dict.ISysDictService;
|
||||
import org.nl.wms.system_manage.service.dict.dao.Dict;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -32,6 +38,8 @@ import java.util.Set;
|
||||
*/
|
||||
@Service
|
||||
public class MdPbStoragevehicleinfoServiceImpl extends ServiceImpl<MdPbStoragevehicleinfoMapper, MdPbStoragevehicleinfo> implements IMdPbStoragevehicleinfoService {
|
||||
@Autowired
|
||||
private ISysDictService dictService;
|
||||
|
||||
@Override
|
||||
public IPage<MdPbStoragevehicleinfo> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -55,27 +63,44 @@ public class MdPbStoragevehicleinfoServiceImpl extends ServiceImpl<MdPbStorageve
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Transactional
|
||||
public void create(MdPbStoragevehicleinfo dto) {
|
||||
public JSONArray create(JSONObject dto) {
|
||||
// 根据载具编码查询是否有相同载具编码的载具
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, dto.getStoragevehicle_code())
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, dto.getString("storagevehicle_code"))
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(mdPbStoragevehicleinfo)) {
|
||||
throw new BadRequestException("当前载具编码已存在【"+dto.getStoragevehicle_code()+"】");
|
||||
throw new BadRequestException("当前载具编码已存在【"+dto.getString("storagevehicle_code")+"】");
|
||||
}
|
||||
|
||||
// 新增
|
||||
dto.setStoragevehicle_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
//转编码类型:
|
||||
Dict dict = dictService.getOne(new QueryWrapper<Dict>().eq("para1", dto.getString("vehicle_type")));
|
||||
if (dict==null){
|
||||
throw new BadRequestException("此载具类型"+dto.getString("vehicle_type")+"没有配置字典值");
|
||||
}
|
||||
JSONArray resultCodeArr = new JSONArray();
|
||||
MdPbStoragevehicleinfo vehicleInfo = dto.toJavaObject(MdPbStoragevehicleinfo.class);
|
||||
int num = MapUtil.getInt(dto, "num");
|
||||
for (int i = 0; i < num; i++) {
|
||||
MdPbStoragevehicleinfo entity = new MdPbStoragevehicleinfo();
|
||||
entity.setStoragevehicle_id(IdUtil.getStringId());
|
||||
entity.setStoragevehicle_code(CodeUtil.getNewCode(dto.getString("vehicle_type")));
|
||||
entity.setStoragevehicle_name(dict.getLabel());
|
||||
entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
entity.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setIs_used(vehicleInfo.getIs_used());
|
||||
entity.setStoragevehicle_type(dict.getValue());
|
||||
entity.setVehicle_height(vehicleInfo.getVehicle_height());
|
||||
entity.setVehicle_width(vehicleInfo.getVehicle_width());
|
||||
entity.setVehicle_long(vehicleInfo.getVehicle_long());
|
||||
entity.setOverstruct_type(vehicleInfo.getOverstruct_type());
|
||||
entity.setOccupystruct_qty(vehicleInfo.getOccupystruct_qty());
|
||||
this.save(entity);
|
||||
resultCodeArr.add(entity.getStoragevehicle_code());
|
||||
}
|
||||
return resultCodeArr;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -28,11 +29,17 @@ import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.StructattrMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.decision_manage.service.sectStrategy.IStSectStrategyService;
|
||||
import org.nl.wms.decision_manage.service.sectStrategy.dao.StSectStrategy;
|
||||
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.warehouse_manage.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_manage.service.dao.IOStorInv;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -40,6 +47,8 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -63,6 +72,12 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
@Autowired
|
||||
private ISectattrService iSectattrService;
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService stIvtStructivtflowService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Autowired
|
||||
private IStSectStrategyService iStSectStrategyService;
|
||||
|
||||
@@ -340,7 +355,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
@Override
|
||||
public List<Structattr> inBoundSectDiv(StrategyStructParam param) {
|
||||
//批号,单据暂时不校验,具体业务具体校验
|
||||
Assert.noNullElements(new Object[]{param.getQty(),param.getMaterial_code(),param.getStor_code(),param.getSect_code()},"请求参数不能为空");
|
||||
Assert.noNullElements(new Object[]{param.getQty(),param.getMaterial_code(),param.getSect_code()},"请求参数不能为空");
|
||||
StSectStrategy one = iStSectStrategyService.getOne(new LambdaQueryWrapper<StSectStrategy>()
|
||||
.eq(StSectStrategy::getSect_code, param.getSect_code())
|
||||
.eq(StSectStrategy::getStrategy_type, StatusEnum.STRATEGY_TYPE.code("入库")));
|
||||
@@ -352,7 +367,6 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
QueryWrapper<Structattr> query = new QueryWrapper<Structattr>()
|
||||
.eq("is_used", true)
|
||||
.eq("lock_type",IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.eq("stor_code", param.getStor_code())
|
||||
.eq("sect_code", param.getSect_code())
|
||||
.isNull("storagevehicle_code");
|
||||
List<Structattr> list = this.list(query);
|
||||
@@ -367,4 +381,57 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeStruct(StructattrChangeDto changeDto) {
|
||||
String now = DateUtil.now();
|
||||
UpdateWrapper<Structattr> wrapper = new UpdateWrapper<Structattr>()
|
||||
.set("update_time", now)
|
||||
.set("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||
.eq("struct_code", changeDto.getStructCode());
|
||||
//如果是整出
|
||||
if (!changeDto.getInBound()) {
|
||||
wrapper.set("storagevehicle_code", null);
|
||||
}
|
||||
this.update(wrapper);
|
||||
List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>()
|
||||
.eq("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||
.lt("status", IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
List<StIvtStructivtflow> records = new ArrayList<>();
|
||||
//更新冻结数量
|
||||
Structattr structattr = this.getByCode(changeDto.getStructCode());
|
||||
for (GroupPlate vehicleMater : groupPlates) {
|
||||
String vehicleCode = vehicleMater.getStoragevehicle_code();
|
||||
BigDecimal subtract = vehicleMater.getQty().subtract(vehicleMater.getFrozen_qty());
|
||||
//100-出50 = 50
|
||||
UpdateWrapper<GroupPlate> update = new UpdateWrapper<GroupPlate>()
|
||||
.set("frozen_qty", 0)
|
||||
.set("qty", subtract)
|
||||
.set("update_time", now)
|
||||
.eq("group_id", vehicleMater.getGroup_id());
|
||||
iMdPbGroupplateService.update(update);
|
||||
StIvtStructivtflow record = new StIvtStructivtflow();
|
||||
record.setId(IdUtil.getStringId());
|
||||
record.setUpdate_time(now);
|
||||
record.setVehicle_code(vehicleCode);
|
||||
record.setMaterial_id(vehicleMater.getMaterial_id());
|
||||
record.setPcsn(vehicleMater.getPcsn());
|
||||
record.setQty(vehicleMater.getQty());
|
||||
record.setChange_qty(subtract);
|
||||
record.setTask_type(changeDto.getTaskType());
|
||||
record.setFrozen_qty(vehicleMater.getFrozen_qty());
|
||||
record.setSource_form_id(changeDto.getInv());
|
||||
record.setUnit_id(vehicleMater.getQty_unit_id());
|
||||
record.setStruct_code(changeDto.getStructCode());
|
||||
record.setStor_code(structattr.getStor_code());
|
||||
record.setSect_code(structattr.getSect_code());
|
||||
record.setGrowth(changeDto.getInBound());
|
||||
records.add(record);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(records)){
|
||||
stIvtStructivtflowService.saveBatch(records);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,9 +10,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大屏显示 控制层
|
||||
@@ -27,14 +30,14 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Slf4j
|
||||
public class BigScreenController {
|
||||
|
||||
@Autowired
|
||||
// @Autowired
|
||||
private BigScreenService bigScreenService;
|
||||
|
||||
@PostMapping("/getData")
|
||||
@Log("大屏数据")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getData() {
|
||||
return new ResponseEntity<>(bigScreenService.getData(null), HttpStatus.OK);
|
||||
public ResponseEntity<Object> getData(@RequestBody List<String> stors) {
|
||||
return new ResponseEntity<>(bigScreenService.getData(stors), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.nl.wms.bigscreen_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大屏显示 服务类
|
||||
@@ -18,5 +20,5 @@ public interface BigScreenService {
|
||||
*根据配置的仓库
|
||||
* @return PdaResponse
|
||||
*/
|
||||
JSONObject getData(String[] stors);
|
||||
List<JSONObject> getData(List<String> stors);
|
||||
}
|
||||
|
||||
@@ -1,88 +1,95 @@
|
||||
package org.nl.wms.bigscreen_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.bigscreen_manage.service.BigScreenService;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.system_manage.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 大屏显示 实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-06-24
|
||||
*/
|
||||
@Service
|
||||
public class BigScreenServiceImpl implements BigScreenService {
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 载具扩展属性mapper服务
|
||||
*/
|
||||
@Autowired
|
||||
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||
|
||||
/**
|
||||
* 任务服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
@Override
|
||||
public JSONObject getData(String[] stors) {
|
||||
// String storCode = "GW";
|
||||
JSONObject result = new JSONObject();
|
||||
// //1.【货位使用】数据
|
||||
// result.put("pointUse", pointUse(storCode));
|
||||
// //2.【实时库存分析】数据
|
||||
// result.put("ivtAnalyse", ivtAnalyse(storCode));
|
||||
// //3.【出入库趋势】数据
|
||||
// result.put("inAndOutTrend", inAndOutTrend(storCode));
|
||||
// //4.【今日出入库】数据
|
||||
// result.put("toDayInAndOut", toDayInAndOut(storCode));
|
||||
// //5.【今日出入库】数据
|
||||
// result.put("realTask", realTask(storCode));
|
||||
// //6.【未完成单据】数据
|
||||
// result.put("unIos", unIos(storCode));
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
//package org.nl.wms.bigscreen_manage.service.impl;
|
||||
//
|
||||
// * 货位使用
|
||||
//import cn.hutool.core.date.DateField;
|
||||
//import cn.hutool.core.date.DateTime;
|
||||
//import cn.hutool.core.date.DateUtil;
|
||||
//import cn.hutool.core.util.NumberUtil;
|
||||
//import cn.hutool.core.util.ObjectUtil;
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import org.nl.common.utils.MapOf;
|
||||
//import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
//import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
//import org.nl.wms.basedata_manage.service.dao.StructattrVechielDto;
|
||||
//import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
//import org.nl.wms.bigscreen_manage.service.BigScreenService;
|
||||
//import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
//import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
//import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
//import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
//import org.nl.wms.system_manage.service.dict.dao.mapper.SysDictMapper;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.util.CollectionUtils;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * <p>
|
||||
// * 大屏显示 实现类
|
||||
// * </p>
|
||||
// *
|
||||
// * @return JSONObject {
|
||||
// * total_qty: 总货位数
|
||||
// * use_qty: 已用货位
|
||||
// * emp_qty: 空余货位
|
||||
// * use_percentage: 百分比(使用货位百分比)
|
||||
// * }
|
||||
// * @author Liuxy
|
||||
// * @since 2025-06-24
|
||||
// */
|
||||
//@Service
|
||||
//public class BigScreenServiceImpl implements BigScreenService {
|
||||
//
|
||||
// /**
|
||||
// * 仓位服务
|
||||
// */
|
||||
// @Autowired
|
||||
// private IStructattrService iStructattrService;
|
||||
//
|
||||
// /**
|
||||
// * 载具扩展属性mapper服务
|
||||
// */
|
||||
// @Autowired
|
||||
// private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||
//
|
||||
// /**
|
||||
// * 任务服务
|
||||
// */
|
||||
// @Autowired
|
||||
// private ISchBaseTaskService iSchBaseTaskService;
|
||||
//
|
||||
// @Override
|
||||
// public List<JSONObject> getData(List<String> stors) {
|
||||
//// String storCode = "GW";
|
||||
// List result = new ArrayList<>();
|
||||
// if (CollectionUtils.isEmpty(stors)){
|
||||
// return result;
|
||||
// }
|
||||
// for (String storCode : stors) {
|
||||
// JSONObject item = new JSONObject();
|
||||
// //1.【货位使用】数据
|
||||
// item.put("pointUse", pointUse(storCode));
|
||||
//// //2.【实时库存分析】数据
|
||||
// item.put("ivtAnalyse", ivtAnalyse(storCode));
|
||||
// //3.【出入库趋势】数据
|
||||
// item.put("inAndOutTrend", inAndOutTrend(storCode));
|
||||
//// //4.【今日出入库】数据
|
||||
// item.put("toDayInAndOut", toDayInAndOut(storCode));
|
||||
//// //5.【今日出入库】数据
|
||||
// item.put("realTask", realTask(storCode));
|
||||
// //6.【未完成单据】数据
|
||||
// item.put("unIos", unIos(storCode));
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
// /**
|
||||
////
|
||||
//// * 货位使用
|
||||
//// *
|
||||
//// * @return JSONObject {
|
||||
//// * total_qty: 总货位数
|
||||
//// * use_qty: 已用货位
|
||||
//// * emp_qty: 空余货位
|
||||
//// * use_percentage: 百分比(使用货位百分比)
|
||||
//// * }
|
||||
//// */
|
||||
// private JSONObject pointUse(String storCode) {
|
||||
// // 返回数据
|
||||
// JSONObject result = new JSONObject();
|
||||
@@ -373,4 +380,4 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
// });
|
||||
// return list;
|
||||
// }
|
||||
}
|
||||
//}
|
||||
|
||||
@@ -450,8 +450,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
//强制确认
|
||||
updateWrapper.set(GroupPlate::getQty, 0).set(GroupPlate::getFrozen_qty, 0);
|
||||
}
|
||||
updateWrapper.set(GroupPlate::getUpdate_optid, currentUserId + "")
|
||||
.set(GroupPlate::getUpdate_optname, nickName)
|
||||
updateWrapper.set(GroupPlate::getUpdate_id, currentUserId + "")
|
||||
.set(GroupPlate::getUpdate_name, nickName)
|
||||
.set(GroupPlate::getUpdate_time, now)
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
.eq(GroupPlate::getGroup_id, whereJson.getString("group_id"));
|
||||
|
||||
@@ -86,7 +86,7 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
@Override
|
||||
public void create(PmFormDataParam params) {
|
||||
params.setCode(CodeUtil.getNewCode("EXT_BILL"));
|
||||
params.setSource_form_date(org.nl.common.utils.DateUtil.parseLocalDateTimeFormatYmd(params.getSource_form_date()));
|
||||
params.setSource_form_date(params.getSource_form_date());
|
||||
MdPbMeasureunit mdPbMeasureunit = iMdPbMeasureunitService.getOne(new LambdaQueryWrapper<MdPbMeasureunit>().eq(MdPbMeasureunit::getMeasure_unit_id, params.getUnit_id()));
|
||||
if (ObjectUtil.isEmpty(mdPbMeasureunit)) {
|
||||
throw new BadRequestException("没有该计量单位信息");
|
||||
@@ -108,7 +108,6 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
*/
|
||||
@Override
|
||||
public void update(PmFormDataParam params) {
|
||||
params.setSource_form_date(org.nl.common.utils.DateUtil.parseLocalDateTimeFormatYmd(params.getSource_form_date()));
|
||||
MdPbMeasureunit mdPbMeasureunit = iMdPbMeasureunitService.getOne(new LambdaQueryWrapper<MdPbMeasureunit>().eq(MdPbMeasureunit::getMeasure_unit_id, params.getUnit_id()));
|
||||
if (ObjectUtil.isEmpty(mdPbMeasureunit)) {
|
||||
throw new BadRequestException("没有该计量单位信息");
|
||||
|
||||
@@ -172,8 +172,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
return this.list();
|
||||
}
|
||||
return pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, region.getRegion_code())
|
||||
.eq(SchBasePoint::getIs_has_workder, true));
|
||||
.eq(SchBasePoint::getRegion_code, region.getRegion_code()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,11 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String codeDemo(Map form) {
|
||||
String code = (String) form.get("code");
|
||||
String id = codeRuleMapper.selectOne(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, code)).getId();
|
||||
SysCodeRule sysCodeRule = codeRuleMapper.selectOne(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, code));
|
||||
if (sysCodeRule==null){
|
||||
throw new BadRequestException("缺少"+code+"相关配置");
|
||||
}
|
||||
String id = sysCodeRule.getId();
|
||||
// 如果flag = 1就执行更新数据库的操作
|
||||
String flag = (String) form.get("flag");
|
||||
List<SysCodeRuleDetail> ruleDetails = codeRuleDetailMapper.selectList(new LambdaQueryWrapper<SysCodeRuleDetail>()
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.warehouse_manage.record.controller;
|
||||
|
||||
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_manage.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.warehouse_manage.record.service.dto.StructIvtFlowQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/stIvtStructivtflow")
|
||||
public class StIvtStructivtflowController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService stIvtStructivtflowService;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(StructIvtFlowQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(stIvtStructivtflowService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.warehouse_manage.record.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_manage.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_manage.record.service.dto.StructIvtFlowQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
public interface IStIvtStructivtflowService extends IService<StIvtStructivtflow> {
|
||||
|
||||
Object pageQuery(StructIvtFlowQuery query, PageQuery page);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.nl.wms.warehouse_manage.record.service.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.common.domain.handler.FastjsonSortTypeHandler;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "st_ivt_structivtflow", autoResultMap = true)
|
||||
public class StIvtStructivtflow implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录标识
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 总库存
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 变动库存
|
||||
*/
|
||||
private BigDecimal change_qty;
|
||||
|
||||
/**
|
||||
* 冻结库存
|
||||
*/
|
||||
private BigDecimal frozen_qty;
|
||||
|
||||
/**
|
||||
* 载具物料参数
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonSortTypeHandler.class)
|
||||
private JSONObject vehicle_form_data;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String source_form_type;
|
||||
|
||||
/**
|
||||
* 单据表名
|
||||
*/
|
||||
private String source_form_id;
|
||||
|
||||
/**
|
||||
* 变动类型1入库0出库
|
||||
*/
|
||||
private String task_type;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 库存增加
|
||||
*/
|
||||
private Boolean growth;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.warehouse_manage.record.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_manage.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_manage.record.service.dto.StructIvtFlowQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
public interface StIvtStructivtflowMapper extends BaseMapper<StIvtStructivtflow> {
|
||||
|
||||
List<Map> getPageQuery(@Param("query") StructIvtFlowQuery query, PageQuery pageQuery);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.warehouse_manage.record.service.dao.mapper.StIvtStructivtflowMapper">
|
||||
<select id="getPageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
struct_flow.*,
|
||||
struct.struct_name,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
unit.unit_name
|
||||
FROM
|
||||
st_ivt_structivtflow struct_flow
|
||||
left join st_ivt_structattr struct on struct.struct_code = struct_flow.struct_code
|
||||
left join md_me_materialbase material on struct_flow.material_id = material.material_id
|
||||
left join md_pb_measureunit unit on struct_flow.unit_id = unit.measure_unit_id
|
||||
<where>
|
||||
<if test="query.search != null and query.search != ''">
|
||||
and (struct.struct_code LIKE '%${query.search}%'
|
||||
or struct.struct_name LIKE '%${query.search}%')
|
||||
</if>
|
||||
<if test="query.material_code != null and query.material_code != ''">
|
||||
and material.material_code LIKE '%${query.material_code}%'
|
||||
</if>
|
||||
<if test="query.vehicle_code != null and query.vehicle_code != ''">
|
||||
and struct_flow.vehicle_code LIKE '%${query.vehicle_code}%'
|
||||
</if>
|
||||
<if test="query.pcsn != null and query.pcsn != ''">
|
||||
and struct_flow.pcsn = '${query.pcsn}'
|
||||
</if>
|
||||
<if test="query.start_time != null and query.start_time != ''">
|
||||
and struct_flow.update_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null and query.end_time != ''">
|
||||
and #{query.end_time} >= struct_flow.update_time
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.nl.wms.warehouse_manage.record.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.warehouse_manage.record.service.dao.StIvtStructivtflow;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class StructIvtFlowQuery extends BaseQuery<StIvtStructivtflow> {
|
||||
|
||||
private String search;
|
||||
private String material_code;
|
||||
private String vehicle_code;
|
||||
private String pcsn;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.warehouse_manage.record.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_manage.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.warehouse_manage.record.service.dao.StIvtStructivtflow;
|
||||
import org.nl.wms.warehouse_manage.record.service.dao.mapper.StIvtStructivtflowMapper;
|
||||
import org.nl.wms.warehouse_manage.record.service.dto.StructIvtFlowQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-05-23
|
||||
*/
|
||||
@Service
|
||||
public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflowMapper, StIvtStructivtflow> implements IStIvtStructivtflowService {
|
||||
|
||||
@Override
|
||||
public Object pageQuery(StructIvtFlowQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("update_time DESC");
|
||||
List<Map> mst_detail = this.baseMapper.getPageQuery(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
}
|
||||
@@ -92,12 +92,12 @@ public class GroupPlate implements Serializable {
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
@@ -639,7 +640,16 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)){
|
||||
throw new BadRequestException("未找到任务对应的分配明细");
|
||||
}
|
||||
|
||||
// 明细
|
||||
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInvDtl)){
|
||||
throw new BadRequestException("未找到明细");
|
||||
}
|
||||
// 明细
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(ioStorInvDis.getIostorinv_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInv)){
|
||||
throw new BadRequestException("未找到明细");
|
||||
}
|
||||
// 完成当前分配明细
|
||||
ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
@@ -655,43 +665,29 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
finish_map.put("inv_id", null);
|
||||
finish_map.put("inv_code", null);
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
//库存变动
|
||||
StructattrChangeDto changeDto = StructattrChangeDto.builder()
|
||||
.inv(ioStorInv.getIostorinv_id())
|
||||
.storagevehicleCode(ioStorInvDis.getStoragevehicle_code())
|
||||
.structCode(ioStorInvDis.getStruct_code()).taskType(task.getConfig_code()).inBound(true).build();
|
||||
iStructattrService.changeStruct(changeDto);
|
||||
|
||||
//修改库存
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
JSONObject jsonIvt = new JSONObject();
|
||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
||||
jsonIvt.put("storagevehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
jsonIvt.put("material_id", ioStorInvDis.getMaterial_id());
|
||||
jsonIvt.put("pcsn", ioStorInvDis.getPcsn());
|
||||
jsonIvt.put("qty_unit_id", ioStorInvDis.getQty_unit_id());
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
||||
.ne(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
);
|
||||
|
||||
// 明细
|
||||
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
if (ObjectUtil.isEmpty(ioStorInvDtl)){
|
||||
throw new BadRequestException("未找到明细");
|
||||
}
|
||||
// 如果分配明细全部完成则更新明细表状态
|
||||
if (countDis == 0){
|
||||
// 更新明细表状态
|
||||
ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty());
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||
);
|
||||
|
||||
// 如果明细全部完成则更新主表状态
|
||||
if (countDtl == 0){
|
||||
//更新主表状态
|
||||
|
||||
@@ -166,8 +166,8 @@ public class UpdateIvtUtils {
|
||||
double frozen_qty = NumberUtil.add(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
@@ -200,8 +200,8 @@ public class UpdateIvtUtils {
|
||||
iMdPbStoragevehicleextService.removeById(extDao);
|
||||
} else {
|
||||
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
@@ -233,8 +233,8 @@ public class UpdateIvtUtils {
|
||||
// double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setFrozen_qty(BigDecimal.ZERO);
|
||||
extDao.setQty(BigDecimal.valueOf(qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
@@ -256,8 +256,8 @@ public class UpdateIvtUtils {
|
||||
}
|
||||
double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
@@ -283,8 +283,8 @@ public class UpdateIvtUtils {
|
||||
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【" + extDao.getQty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "】");
|
||||
}
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
|
||||
@@ -72,45 +72,65 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code" >
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
<el-input v-model="form.material_code" @focus="getMaterial" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" style="width: 200px;" />
|
||||
<el-input disabled v-model="form.material_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="规格" prop="material_spec">
|
||||
<label slot="label">规 格</label>
|
||||
<el-input v-model="form.material_spec" style="width: 200px;" />
|
||||
<el-input disabled v-model="form.material_spec" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="型号" prop="material_model">
|
||||
<label slot="label">型 号</label>
|
||||
<el-input v-model="form.material_model" style="width: 200px;" />
|
||||
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||
<label slot="label">载具编码</label>
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外部标识" prop="ext_id">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
<el-form-item label="物料批号" prop="pcsn">
|
||||
<el-input v-model="form.pcsn" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料数量" prop="qty">
|
||||
<el-input-number v-model="form.qty" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="静置时间" prop="standing_time">
|
||||
<el-input-number v-model="form.standing_time" :controls="false" :min="0" label="分钟" style="width: 200px;" />
|
||||
<el-form-item label="单位" prop="qty_unit_name">
|
||||
<el-select
|
||||
v-model="form.qty_unit_name"
|
||||
style="width: 100px"
|
||||
placeholder=""
|
||||
@change="unitChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableEnum.md_pb_measureunit"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value+'@'+item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
||||
<el-form-item label="源单号" prop="ext_code">
|
||||
<el-input v-model="form.ext_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="源单类型" prop="ext_type">
|
||||
<el-input v-model="form.ext_type" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -157,6 +177,8 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<!--放引用的组件-->
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -167,11 +189,14 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
|
||||
|
||||
const defaultForm = {
|
||||
group_id: null,
|
||||
storagevehicle_code: null,
|
||||
material_id: null,
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
pcsn: null,
|
||||
qty_unit_id: null,
|
||||
qty_unit_name: null,
|
||||
@@ -186,8 +211,9 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Group',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
|
||||
// 数据字典
|
||||
dicts: ['is_used', 'GROUP_STATUS'],
|
||||
cruds() {
|
||||
@@ -206,6 +232,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
materialDialog: false,
|
||||
classes: [],
|
||||
rules: {
|
||||
}
|
||||
@@ -218,6 +245,20 @@ export default {
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.GROUP_STATUS[row.status]
|
||||
},
|
||||
getMaterial() {
|
||||
this.materialDialog = true
|
||||
},
|
||||
unitChange(row) {
|
||||
const split = row.split('@')
|
||||
this.form.qty_unit_id = split[0]
|
||||
this.form.qty_unit_name = split[1]
|
||||
},
|
||||
materialChoose(row) {
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_spec = row.material_spec
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
153
nladmin-ui/src/views/wms/basedata/material/MaterialDialog.vue
Normal file
153
nladmin-ui/src/views/wms/basedata/material/MaterialDialog.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="物料选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" width="140" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip/>
|
||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||
<el-table-column prop="unit_name" label="计量单位" />
|
||||
<el-table-column prop="product_series_name" label="系列" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'MaterialDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({ title: '物料选择', url: 'api/Materia', optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('materialChoose', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选物料')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('materialChoose', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
>
|
||||
<el-form-item label="载具类型">
|
||||
<el-select
|
||||
v-model="query.storagevehicle_type"
|
||||
v-model="query.vehicle_type"
|
||||
clearable
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
class="filter-item"
|
||||
style="width: 180px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
@@ -26,13 +28,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模糊搜索">
|
||||
|
||||
<el-form-item label="载具号">
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="载具号、载具名称"
|
||||
style="width: 200px;"
|
||||
placeholder="载具号"
|
||||
style="width: 110px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
@@ -42,8 +45,114 @@
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
@click="printView"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="载具物料信息"
|
||||
width="540px"
|
||||
@close="materiValueCancel()"
|
||||
>
|
||||
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="materialForm.vehicle_code" disabled style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="materialForm.material_code" clearable style="width: 370px"
|
||||
@clear="materialForm.material_id='',materialForm.material_code='',materialForm.material_name='',materialForm.material_spec=''">
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryMater"/>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批 次" prop="pcsn">
|
||||
<el-input v-model="materialForm.pcsn" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料数量" prop="qty">
|
||||
<el-input v-model="materialForm.qty" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="冻结数量" prop="frozen_qty">
|
||||
<el-input v-model="materialForm.frozen_qty" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程实例" prop="proc_inst_id">
|
||||
<el-input v-model="materialForm.proc_inst_id" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="materiValueCancel()">取消</el-button>
|
||||
<el-button type="primary" @click="materiValueSubmit()">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="pointMVisible"
|
||||
title="载具信息"
|
||||
width="540px"
|
||||
@close="materiValueCancel()"
|
||||
>
|
||||
<el-form ref="form" :model="updateForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="载具编号" prop="vehicle_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="updateForm.vehicle_code" clearable/>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量(g)" prop="vehicle_weight">
|
||||
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="materiValueCancel()">取消</el-button>
|
||||
<el-button type="primary" @click="pointMateriSubmit()">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:before-close="crud.cancelCU"
|
||||
:close-on-click-modal="false"
|
||||
title="打印配置"
|
||||
:visible.sync="printVisible"
|
||||
width="450px"
|
||||
>
|
||||
<el-form ref="form" :model="printForm" size="mini" label-width="150px">
|
||||
<el-form-item label="纸张高度(mm)" prop="pageh">
|
||||
<el-input v-model="printForm.pageh" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="纸张宽度(mm)" prop="pagew">
|
||||
<el-input v-model="printForm.pagew" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距top(mm)" prop="pagetop">
|
||||
<el-input v-model="printForm.pagetop" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距right(mm)" prop="pageright">
|
||||
<el-input v-model="printForm.pageright" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距down(mm)" prop="pagedown">
|
||||
<el-input v-model="printForm.pagedown" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距left(mm)" prop="pageleft">
|
||||
<el-input v-model="printForm.pageleft" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<br>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="printClose">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="print">打印</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:before-close="crud.cancelCU"
|
||||
:close-on-click-modal="false"
|
||||
@@ -52,29 +161,41 @@
|
||||
width="450px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="载具类型" prop="storagevehicle_type">
|
||||
<el-form-item label="载具类型" prop="vehicle_type">
|
||||
<el-select
|
||||
v-model="form.storagevehicle_type"
|
||||
class="filter-item"
|
||||
v-model="form.vehicle_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
:disabled="crud.status.edit > 0"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
style="width: 250px;"
|
||||
@change="getVehicle"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:value="item.para1"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
<br>
|
||||
<el-form-item label="起始载具号" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 250px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具名称" prop="storagevehicle_name">
|
||||
<el-input v-model="form.storagevehicle_name" style="width: 200px;" />
|
||||
<el-form-item label="载具数量" prop="num">
|
||||
<el-input-number v-model="form.num" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量" prop="weigth">
|
||||
<el-input-number v-model="form.weigth" :precision="1" style="width: 200px;" />
|
||||
<el-form-item label="高度(mm)" prop="h">
|
||||
<el-input-number v-model="form.h" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度(mm)" prop="w">
|
||||
<el-input-number v-model="form.w" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="深度(mm)" prop="l">
|
||||
<el-input-number v-model="form.l" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="重量(g)" prop="weight">
|
||||
<el-input-number v-model="form.weight" :precision="0" style="width: 150px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
@@ -83,7 +204,8 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">生成</el-button>
|
||||
<el-button type="primary" @click="addAndprint">生成并打印</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -131,50 +253,53 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<!-- 分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materialShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="materType"
|
||||
@setMaterValue="setMaterValue"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStoragevehicleinfo from '@/views/wms/basedata/storagevehicleinfo/storagevehicleinfo'
|
||||
import crudStoragevehicleinfo from './storagevehicleinfo'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
import MaterDtl from '@/views/wms/basedata/material/MaterialDialog'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
storagevehicle_id: null,
|
||||
storagevehicle_code: null,
|
||||
storagevehicle_name: null,
|
||||
vehicle_code: null,
|
||||
vehicle_name: null,
|
||||
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_name: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
is_used: '1',
|
||||
storagevehicle_type: null,
|
||||
weigth: null,
|
||||
vehicle_width: null,
|
||||
vehicle_long: null,
|
||||
vehicle_height: null,
|
||||
overstruct_type: null,
|
||||
occupystruct_qty: null,
|
||||
ext_id: null,
|
||||
qty: null,
|
||||
pcsn: null
|
||||
w: null,
|
||||
l: null,
|
||||
h: null,
|
||||
weight: null,
|
||||
overstruct_type: '0',
|
||||
occupystruct_qty: '1',
|
||||
ext_json: null,
|
||||
num: '1'
|
||||
}
|
||||
export default {
|
||||
name: 'Storagevehicleinfo',
|
||||
dicts: ['storagevehicle_type', 'is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['storagevehicle_type', "VEHICLE_OVER_TYPE"],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -203,31 +328,42 @@ export default {
|
||||
}
|
||||
}
|
||||
return {
|
||||
printVisible: false,
|
||||
updateForm: {},
|
||||
printForm: {
|
||||
pageh: '40mm',
|
||||
pagew: '60mm',
|
||||
pagetop: '4.3mm',
|
||||
pagedown: '50mm',
|
||||
pageright: '30mm',
|
||||
pageleft: '8mm'
|
||||
},
|
||||
pointMVisible: false,
|
||||
materType: '01',
|
||||
materialShow: false,
|
||||
dialogVisible: false,
|
||||
materialForm: {},
|
||||
resultCodeArr: [],
|
||||
permission: {},
|
||||
classes1: [],
|
||||
rules: {
|
||||
vehicle_code: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
storagevehicle_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
vehicle_type: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
overstruct_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
{required: true, message: '不能为空', trigger: 'blur'},
|
||||
{validator: numberOne}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -237,39 +373,155 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
onCloseDialog() {
|
||||
this.form = defaultForm
|
||||
},
|
||||
queryMater() {
|
||||
this.materialShow = true
|
||||
},
|
||||
setMaterValue(row) {
|
||||
this.$set(this.materialForm, 'material_code', row.material_code)
|
||||
this.$set(this.materialForm, 'material_id', row.material_id)
|
||||
this.$set(this.materialForm, 'material_code', row.material_code)
|
||||
},
|
||||
materiValueCancel() {
|
||||
this.updateForm = {}
|
||||
this.pointMVisible = false
|
||||
this.dialogVisible = false
|
||||
},
|
||||
materiValueSubmit() {
|
||||
crudStoragevehicleinfo.updateVehicleMaterial(this.materialForm).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.materiValueCancel()
|
||||
})
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.storagevehicle_code + ', 是否继续?', '提示', {
|
||||
let msg = '此操作将停用载具,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用载具,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudStoragevehicleinfo.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
crudStoragevehicleinfo.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
formattType(row) {
|
||||
return this.dict.label.storagevehicle_type[row.storagevehicle_type]
|
||||
},
|
||||
printView() {
|
||||
this.printForm = {
|
||||
pageh: '40mm',
|
||||
pagew: '60mm',
|
||||
pagetop: '4.3mm',
|
||||
pagedown: '50mm',
|
||||
pageright: '30mm',
|
||||
pageleft: '8mm'
|
||||
}
|
||||
this.printVisible = true
|
||||
},
|
||||
printClose() {
|
||||
this.printVisible = false
|
||||
this.printForm = {
|
||||
pageh: '40mm',
|
||||
pagew: '60mm',
|
||||
pagetop: '4.3mm',
|
||||
pagedown: '50mm',
|
||||
pageright: '30mm',
|
||||
pageleft: '8mm'
|
||||
}
|
||||
},
|
||||
print() {
|
||||
this.printVisible = false
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (!_selectData || _selectData.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
console.log(_selectData.length)
|
||||
console.log(this.printForm)
|
||||
for (let i = 0; i < _selectData.length; i++) {
|
||||
const code = _selectData[i].vehicle_code
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, this.printForm.pagew, this.printForm.pageh, '1')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '50mm', '30mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE(this.printForm.pagetop, this.printForm.pageleft, this.printForm.pagedown, this.printForm.pageright, '128Auto', code)
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
},
|
||||
toView(row) {
|
||||
this.dialogVisible = true
|
||||
crudStoragevehicleinfo.getMaterialByVehicle(row).then(res => {
|
||||
this.materialForm = res
|
||||
})
|
||||
},
|
||||
updateweight(row) {
|
||||
this.pointMVisible = true
|
||||
this.updateForm = row
|
||||
},
|
||||
pointMateriSubmit() {
|
||||
console.log(this.updateForm)
|
||||
crudStoragevehicleinfo.edit(this.updateForm).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
this.updateForm = {}
|
||||
this.pointMVisible = false
|
||||
this.crud.refresh()
|
||||
},
|
||||
addAndprint() {
|
||||
const data = this.form
|
||||
if (!this.form.storagevehicle_type) {
|
||||
this.crud.notify('载具类型不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!this.form.num) {
|
||||
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
crudStoragevehicleinfo.add(data).then(res => {
|
||||
res.forEach((item) => {
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '60mm', '40mm', '1')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '50mm', '30mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE('4.3mm', '8mm', '50mm', '30mm', '128Auto', item)
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
})
|
||||
this.crud.status.add = CRUD.STATUS.NORMAL
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
getVehicle(code) {
|
||||
if (!code) {
|
||||
this.crud.notify('请选择载具类型', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.form.vehicle_code = ''
|
||||
return false
|
||||
}
|
||||
crudStoragevehicleinfo.getVehicle(code).then(res => {
|
||||
this.form.vehicle_code = res.value
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ export default {
|
||||
this.sects = res.content
|
||||
})
|
||||
|
||||
const area_type = 'NBJ01'
|
||||
const area_type = 'RKQ'
|
||||
|
||||
crudPoint.getPointList({ 'region_code': area_type }).then(res => {
|
||||
this.pointlist = res
|
||||
|
||||
178
nladmin-ui/src/views/wms/statement/record/index.vue
Normal file
178
nladmin-ui/src/views/wms/statement/record/index.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="仓位信息">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入仓位信息"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入物料编码"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码">
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入载具编码"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="请输入批次信息"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变动日期" prop="analyseData">
|
||||
<el-date-picker
|
||||
v-model="query.datepick"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column prop="stor_code" label="仓库" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="struct_code" label="仓位编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_code" label="物料编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_name" label="物料名称" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="growth" label="是否增加库存" width="150" show-tooltip-when-overflow>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.growth }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pcsn" label="批次" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="qty" label="总库存" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="frozen_qty" label="冻结库存" show-tooltip-when-overflow />
|
||||
<el-table-column prop="change_qty" label="变动库存" show-tooltip-when-overflow />
|
||||
<el-table-column prop="unit_name" label="单位" show-tooltip-when-overflow />
|
||||
<el-table-column prop="vehicle_form_data" label="物料扩展信息" width="300" show-tooltip-when-overflow />
|
||||
<el-table-column prop="source_form_type" label="单据编号" show-tooltip-when-overflow />
|
||||
<el-table-column prop="source_form_id" label="单据表名" min-width="120" show-tooltip-when-overflow />
|
||||
<el-table-column prop="task_type" show-overflow-tooltip show-tooltip-when-overflow label="变动类型" />
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{ statusEnum.label.TASK_TYPE[scope.row.task_type] }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="update_time" label="修改时间" width="120" show-tooltip-when-overflow />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import curdStructIvtFlow from './curdStructIvtFlow'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
struct_code: null,
|
||||
material_id: null,
|
||||
pcsn: null,
|
||||
qty: true,
|
||||
frozen_qty: null,
|
||||
vehicle_form_data: null,
|
||||
source_form_type: null,
|
||||
source_form_id: null,
|
||||
task_type: null,
|
||||
unit_id: null,
|
||||
update_time: null,
|
||||
growth: null,
|
||||
vehicle_code: null
|
||||
}
|
||||
export default {
|
||||
dicts: [],
|
||||
name: 'StructIvtFlow',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
statusEnums: ['TASK_TYPE'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库存变动记录',
|
||||
url: 'api/stIvtStructivtflow',
|
||||
optShow: {
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...curdStructIvtFlow }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query.datepick) {
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length > 1) {
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
} else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user