rev 更新根据物料信息查询未删除启用的
This commit is contained in:
@@ -82,10 +82,10 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
@Override
|
||||
public MaterialbaseDto findById(Long material_id) {
|
||||
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");
|
||||
// json.put("base_unit_name", unit_name);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(MaterialbaseDto.class);
|
||||
}
|
||||
return null;
|
||||
@@ -97,7 +97,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
if (StrUtil.isNotEmpty(code) && code.contains("\\")) {
|
||||
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;
|
||||
// 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);
|
||||
@@ -108,6 +108,8 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MaterialbaseDto dto) {
|
||||
MaterialbaseDto materialbaseDto = this.findByCode(dto.getMaterial_code());
|
||||
if (materialbaseDto != null) throw new BadRequestException("物料编码重复!");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
@@ -131,7 +133,10 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
if (entity == null) {
|
||||
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();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -231,7 +236,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
// .query("unit_code = '" + unit_code + "'")
|
||||
// .uniqueResult(0);
|
||||
// if (ObjectUtil.isEmpty(unit)) {
|
||||
// 如果不存在则添加
|
||||
// 如果不存在则添加
|
||||
// material.put("measure_unit_id", IdUtil.getSnowflake(1L, 1L));
|
||||
// material.put("is_used", "1");
|
||||
// material.put("create_id", user_id);
|
||||
@@ -239,7 +244,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
// material.put("create_time", now);
|
||||
// unit_table.insert(material);
|
||||
// } else {
|
||||
// 如果存在则修改
|
||||
// 如果存在则修改
|
||||
// unit.put("unit_name", material.getString("unit_name"));
|
||||
// unit.put("update_optid", user_id);
|
||||
// unit.put("update_optname", nick_name);
|
||||
|
||||
@@ -147,11 +147,16 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
&& ObjectUtil.isNotEmpty(dto.getMaterial_id())) {
|
||||
throw new BadRequestException("选择物料编码必须选择托盘编号");
|
||||
}
|
||||
StructivtDto structivtDto = this.findById(dto.getStockrecord_id());
|
||||
if (structivtDto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
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() + "-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 {
|
||||
// redisUtils.del(dto.getVehicle_code());
|
||||
@@ -160,17 +165,16 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
}
|
||||
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();
|
||||
if (StrUtil.isBlank(dto.getVehicle_code())
|
||||
|| !dto.getVehicle_code().equals(structivtDto.getVehicle_code())) {
|
||||
redisUtils.set(structivtDto.getVehicle_code(), "");
|
||||
redisUtils.set(structivtDto.getVehicle_code() + "-ivt_qty", "1");
|
||||
}
|
||||
// if ((StrUtil.isBlank(dto.getVehicle_code())
|
||||
// || !dto.getVehicle_code().equals(structivtDto.getVehicle_code())) && !structivtDto.getRegion_code().equals(RegionTypeEnum.KLZHCQ.getCode())
|
||||
// && !structivtDto.getRegion_code().equals(RegionTypeEnum.HNJQ.getCode())
|
||||
// ) {
|
||||
// redisUtils.set(structivtDto.getVehicle_code(), "");
|
||||
// redisUtils.set(structivtDto.getVehicle_code() + "-ivt_qty", "1");
|
||||
// log.info("手动修改库存信息,非空盅暂存区和混碾机区修改redis库存信息,载具号:{}", structivtDto.getVehicle_code());
|
||||
// }
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -128,7 +128,7 @@ file:
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: C:\log\lms
|
||||
path: D:\log\lms
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# Sa-Token配置
|
||||
|
||||
Reference in New Issue
Block a user