|
@ -2,6 +2,7 @@ package org.nl.wms.pda_manage.ios_manage.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
|
import cn.hutool.http.HttpStatus; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
@ -17,6 +18,7 @@ import org.nl.common.domain.vo.SelectItemVo; |
|
|
import org.nl.common.exception.BadRequestException; |
|
|
import org.nl.common.exception.BadRequestException; |
|
|
import org.nl.common.utils.IdUtil; |
|
|
import org.nl.common.utils.IdUtil; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
|
|
|
import org.nl.wms.basedata_manage.enums.BaseDataEnum; |
|
|
import org.nl.wms.basedata_manage.service.*; |
|
|
import org.nl.wms.basedata_manage.service.*; |
|
|
import org.nl.wms.basedata_manage.service.dao.*; |
|
|
import org.nl.wms.basedata_manage.service.dao.*; |
|
|
import org.nl.wms.basedata_manage.service.dto.MaterialQuery; |
|
|
import org.nl.wms.basedata_manage.service.dto.MaterialQuery; |
|
@ -132,7 +134,7 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PdaResponse groupPlate(JSONObject whereJson) { |
|
|
public JSONObject groupPlate(JSONObject whereJson) { |
|
|
// 物料编码
|
|
|
// 物料编码
|
|
|
String materialId = whereJson.getString("material_id"); |
|
|
String materialId = whereJson.getString("material_id"); |
|
|
//载具号
|
|
|
//载具号
|
|
@ -157,16 +159,16 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
throw new BadRequestException("载具编码:" + vehicle_code + "已存在组盘信息,请对数据进行核实!"); |
|
|
throw new BadRequestException("载具编码:" + vehicle_code + "已存在组盘信息,请对数据进行核实!"); |
|
|
} |
|
|
} |
|
|
//判断该载具编号是否已经存在库内
|
|
|
//判断该载具编号是否已经存在库内
|
|
|
long count = iStructattrService.count( |
|
|
List<Structattr> count = iStructattrService.list( |
|
|
new LambdaQueryWrapper<Structattr>() |
|
|
new LambdaQueryWrapper<Structattr>() |
|
|
.eq(Structattr::getStoragevehicle_code, vehicle_code) |
|
|
.eq(Structattr::getStoragevehicle_code, vehicle_code) |
|
|
); |
|
|
); |
|
|
if (count > 0) { |
|
|
if (count.size() > 0) { |
|
|
throw new BadRequestException("载具编码:" + vehicle_code + "已存在库内,请对数据进行核实!"); |
|
|
throw new BadRequestException("载具编码:" + vehicle_code + "已存在库内:"+count.get(0).getStruct_code()+",请对数据进行核实!"); |
|
|
} |
|
|
} |
|
|
GroupPlate groupDao = GroupPlate.builder() |
|
|
GroupPlate groupDao = GroupPlate.builder() |
|
|
.group_id(IdUtil.getStringId()) |
|
|
.group_id(IdUtil.getStringId()) |
|
|
.material_id(materDao.getMaterial_code()) |
|
|
.material_id(materDao.getMaterial_id()) |
|
|
.storagevehicle_code(vehicle_code) |
|
|
.storagevehicle_code(vehicle_code) |
|
|
.qty_unit_id(unitDao.getMeasure_unit_id()) |
|
|
.qty_unit_id(unitDao.getMeasure_unit_id()) |
|
|
.qty_unit_name(unitDao.getUnit_name()) |
|
|
.qty_unit_name(unitDao.getUnit_name()) |
|
@ -178,7 +180,10 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
.create_time(DateUtil.now()) |
|
|
.create_time(DateUtil.now()) |
|
|
.build(); |
|
|
.build(); |
|
|
iMdPbGroupplateService.save(groupDao); |
|
|
iMdPbGroupplateService.save(groupDao); |
|
|
return PdaResponse.requestOk(); |
|
|
JSONObject ret = new JSONObject(); |
|
|
|
|
|
ret.put("status", String.valueOf(HttpStatus.HTTP_OK)); |
|
|
|
|
|
ret.put("message","操作成功"); |
|
|
|
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -219,7 +224,9 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<SelectItemVo> getSect(JSONObject whereJson) { |
|
|
public List<SelectItemVo> getSect(JSONObject whereJson) { |
|
|
List<Sectattr> sectList = iSectattrService.list(); |
|
|
LambdaQueryWrapper<Sectattr> queryWrapper = new LambdaQueryWrapper<>(Sectattr.class) |
|
|
|
|
|
.ne(Sectattr::getSect_type_attr,"09"); |
|
|
|
|
|
List<Sectattr> sectList = iSectattrService.list(queryWrapper); |
|
|
List<SelectItemVo> selectList = new ArrayList<>(); |
|
|
List<SelectItemVo> selectList = new ArrayList<>(); |
|
|
sectList.forEach(r -> |
|
|
sectList.forEach(r -> |
|
|
selectList.add(SelectItemVo.builder().text(r.getSect_name()).value(r.getSect_id()).build()) |
|
|
selectList.add(SelectItemVo.builder().text(r.getSect_name()).value(r.getSect_id()).build()) |
|
@ -261,7 +268,7 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional |
|
|
@Transactional |
|
|
public PdaResponse confirmIn(JSONObject whereJson) { |
|
|
public JSONObject confirmIn(JSONObject whereJson) { |
|
|
//物料组盘入库
|
|
|
//物料组盘入库
|
|
|
if (StringUtils.isBlank(whereJson.getString("is_empty_vehicle"))) { |
|
|
if (StringUtils.isBlank(whereJson.getString("is_empty_vehicle"))) { |
|
|
//获取起点
|
|
|
//获取起点
|
|
@ -270,7 +277,6 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
throw new BadRequestException("点位不存在:"+whereJson.getString("site_code")); |
|
|
throw new BadRequestException("点位不存在:"+whereJson.getString("site_code")); |
|
|
} |
|
|
} |
|
|
//todo 需组织入库单数据
|
|
|
|
|
|
whereJson.put("point_code",whereJson.getString("site_code")); |
|
|
whereJson.put("point_code",whereJson.getString("site_code")); |
|
|
// 预组织出入库单据实体
|
|
|
// 预组织出入库单据实体
|
|
|
Map<String, Object> jsonMst = organizeInsertData(whereJson); |
|
|
Map<String, Object> jsonMst = organizeInsertData(whereJson); |
|
@ -289,7 +295,10 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code")) |
|
|
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code")) |
|
|
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))); |
|
|
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))); |
|
|
} |
|
|
} |
|
|
return PdaResponse.requestOk(); |
|
|
JSONObject ret = new JSONObject(); |
|
|
|
|
|
ret.put("status", String.valueOf(HttpStatus.HTTP_OK)); |
|
|
|
|
|
ret.put("message","操作成功"); |
|
|
|
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -364,8 +373,8 @@ public class PdaIosInServiceImpl implements PdaIosInService { |
|
|
jsonMst.put("checked", true); |
|
|
jsonMst.put("checked", true); |
|
|
jsonMst.put("sect_id", sectDao.getSect_id()); |
|
|
jsonMst.put("sect_id", sectDao.getSect_id()); |
|
|
jsonMst.put("stor_id", sectDao.getStor_id()); |
|
|
jsonMst.put("stor_id", sectDao.getStor_id()); |
|
|
jsonMst.put("sect_code", sectDao.getSect_code()); |
|
|
jsonMst.put("sect_code", sectDao.getSect_id()); |
|
|
jsonMst.put("stor_code", storeDao.getStor_code()); |
|
|
jsonMst.put("stor_code", storeDao.getStor_id()); |
|
|
// 组织明细数据
|
|
|
// 组织明细数据
|
|
|
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne( |
|
|
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne( |
|
|
new QueryWrapper<IOStorInvDtl>().lambda() |
|
|
new QueryWrapper<IOStorInvDtl>().lambda() |
|
|