rev 更新根据物料信息查询未删除启用的
This commit is contained in:
@@ -82,10 +82,10 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
|||||||
@Override
|
@Override
|
||||||
public MaterialbaseDto findById(Long material_id) {
|
public MaterialbaseDto findById(Long material_id) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("md_me_materialbase");
|
WQLObject wo = WQLObject.getWQLObject("md_me_materialbase");
|
||||||
JSONObject json = wo.query("material_id =" + material_id + "").uniqueResult(0);
|
JSONObject json = wo.query("is_delete = '0' AND is_used = '1' AND material_id =" + material_id + "").uniqueResult(0);
|
||||||
// String unit_name = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id= '" + json.getString("base_unit_id") + "'").uniqueResult(0).getString("unit_name");
|
// String unit_name = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id= '" + json.getString("base_unit_id") + "'").uniqueResult(0).getString("unit_name");
|
||||||
// json.put("base_unit_name", unit_name);
|
// json.put("base_unit_name", unit_name);
|
||||||
if (ObjectUtil.isNotEmpty(json)){
|
if (ObjectUtil.isNotEmpty(json)) {
|
||||||
return json.toJavaObject(MaterialbaseDto.class);
|
return json.toJavaObject(MaterialbaseDto.class);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -97,7 +97,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
|||||||
if (StrUtil.isNotEmpty(code) && code.contains("\\")) {
|
if (StrUtil.isNotEmpty(code) && code.contains("\\")) {
|
||||||
code = code.replace("\\", "\\\\");
|
code = code.replace("\\", "\\\\");
|
||||||
}
|
}
|
||||||
JSONObject json = wo.query("material_code ='" + code + "'").uniqueResult(0);
|
JSONObject json = wo.query("is_delete = '0' AND is_used = '1' AND material_code ='" + code + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(json)) return null;
|
if (ObjectUtil.isEmpty(json)) return null;
|
||||||
// String unit_name = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id= '" + json.getString("base_unit_id") + "'").uniqueResult(0).getString("unit_name");
|
// String unit_name = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id= '" + json.getString("base_unit_id") + "'").uniqueResult(0).getString("unit_name");
|
||||||
// json.put("base_unit_name", unit_name);
|
// json.put("base_unit_name", unit_name);
|
||||||
@@ -108,6 +108,8 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(MaterialbaseDto dto) {
|
public void create(MaterialbaseDto dto) {
|
||||||
|
MaterialbaseDto materialbaseDto = this.findByCode(dto.getMaterial_code());
|
||||||
|
if (materialbaseDto != null) throw new BadRequestException("物料编码重复!");
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -131,7 +133,10 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
|||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
}
|
}
|
||||||
|
MaterialbaseDto materialbaseDto = this.findByCode(dto.getMaterial_code());
|
||||||
|
if (ObjectUtil.isNotEmpty(materialbaseDto) && materialbaseDto.getMaterial_id() != entity.getMaterial_id()) {
|
||||||
|
throw new BadRequestException("物料编码重复!");
|
||||||
|
}
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
|
||||||
|
|||||||
@@ -147,11 +147,16 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
&& ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
&& ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
||||||
throw new BadRequestException("选择物料编码必须选择托盘编号");
|
throw new BadRequestException("选择物料编码必须选择托盘编号");
|
||||||
}
|
}
|
||||||
|
StructivtDto structivtDto = this.findById(dto.getStockrecord_id());
|
||||||
|
if (structivtDto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
if (StrUtil.isNotBlank(dto.getVehicle_code())) {
|
if (StrUtil.isNotBlank(dto.getVehicle_code())) {
|
||||||
// if (ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
|
||||||
redisUtils.set(dto.getVehicle_code(), ObjectUtil.isEmpty(dto.getMaterial_id()) ? "" : dto.getMaterial_id().toString());
|
redisUtils.set(dto.getVehicle_code(), ObjectUtil.isEmpty(dto.getMaterial_id()) ? "" : dto.getMaterial_id().toString());
|
||||||
redisUtils.set(dto.getVehicle_code() + "-ivt_qty", "1");
|
redisUtils.set(dto.getVehicle_code() + "-ivt_qty", "1");
|
||||||
log.info("手动修改库存信息,往redis存储载具信息,载具号:{},物料信息:{},物料个数:{}", dto.getVehicle_code(), dto.getMaterial_id(), "1");
|
log.info("手动修改库存信息,往redis存储载具信息:设备号:{},载具号:{},物料信息:{},物料个数:{}", dto.getPoint_code(), dto.getVehicle_code(), dto.getMaterial_id(), "1");
|
||||||
|
log.info("手动修改库存信息,原库存信息为" +
|
||||||
|
":设备号:{},载具号:{},物料信息:{},物料个数:{}------redis中存储的原载具号对应的物料信息为:{}",
|
||||||
|
structivtDto.getPoint_code(), structivtDto.getVehicle_code(), structivtDto.getMaterial_id(), structivtDto.getVehicle_qty(), redisUtils.get(structivtDto.getVehicle_code()));
|
||||||
|
// if (ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// redisUtils.del(dto.getVehicle_code());
|
// redisUtils.del(dto.getVehicle_code());
|
||||||
@@ -160,17 +165,16 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
}
|
}
|
||||||
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
WQLObject wo_point = WQLObject.getWQLObject("sch_base_point");
|
||||||
// 找主表获取之前的数据
|
// 找主表获取之前的数据
|
||||||
StructivtDto structivtDto = this.findById(dto.getStockrecord_id());
|
|
||||||
if (structivtDto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
|
||||||
log.info("手动修改库存信息,原库存信息为" +
|
|
||||||
",载具号:{},物料信息:{},物料个数:{}------redis中存储的原载具号对应的物料信息为:{}",
|
|
||||||
structivtDto.getVehicle_code(), structivtDto.getMaterial_id(), structivtDto.getVehicle_qty(), redisUtils.get(structivtDto.getVehicle_code()));
|
|
||||||
String region_code = structivtDto.getRegion_code();
|
String region_code = structivtDto.getRegion_code();
|
||||||
if (StrUtil.isBlank(dto.getVehicle_code())
|
// if ((StrUtil.isBlank(dto.getVehicle_code())
|
||||||
|| !dto.getVehicle_code().equals(structivtDto.getVehicle_code())) {
|
// || !dto.getVehicle_code().equals(structivtDto.getVehicle_code())) && !structivtDto.getRegion_code().equals(RegionTypeEnum.KLZHCQ.getCode())
|
||||||
redisUtils.set(structivtDto.getVehicle_code(), "");
|
// && !structivtDto.getRegion_code().equals(RegionTypeEnum.HNJQ.getCode())
|
||||||
redisUtils.set(structivtDto.getVehicle_code() + "-ivt_qty", "1");
|
// ) {
|
||||||
}
|
// redisUtils.set(structivtDto.getVehicle_code(), "");
|
||||||
|
// redisUtils.set(structivtDto.getVehicle_code() + "-ivt_qty", "1");
|
||||||
|
// log.info("手动修改库存信息,非空盅暂存区和混碾机区修改redis库存信息,载具号:{}", structivtDto.getVehicle_code());
|
||||||
|
// }
|
||||||
|
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ file:
|
|||||||
avatarMaxSize: 5
|
avatarMaxSize: 5
|
||||||
logging:
|
logging:
|
||||||
file:
|
file:
|
||||||
path: C:\log\lms
|
path: D:\log\lms
|
||||||
config: classpath:logback-spring.xml
|
config: classpath:logback-spring.xml
|
||||||
|
|
||||||
# Sa-Token配置
|
# Sa-Token配置
|
||||||
|
|||||||
Reference in New Issue
Block a user