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;
|
||||
//
|
||||
// * 货位使用
|
||||
// *
|
||||
// * @return JSONObject {
|
||||
// * total_qty: 总货位数
|
||||
// * use_qty: 已用货位
|
||||
// * emp_qty: 空余货位
|
||||
// * use_percentage: 百分比(使用货位百分比)
|
||||
// * }
|
||||
//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>
|
||||
// *
|
||||
// * @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);
|
||||
|
||||
Reference in New Issue
Block a user