|
|
@ -36,10 +36,10 @@ import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description 服务实现 |
|
|
|
* @author lyd |
|
|
|
* @date 2023-05-16 |
|
|
|
**/ |
|
|
|
* @author lyd |
|
|
|
* @description 服务实现 |
|
|
|
* @date 2023-05-16 |
|
|
|
**/ |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseVehiclematerialgroupMapper, SchBaseVehiclematerialgroup> implements ISchBaseVehiclematerialgroupService { |
|
|
@ -55,8 +55,9 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISchBasePointService pointService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page){ |
|
|
|
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) { |
|
|
|
IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize()); |
|
|
|
IPage<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroupIPage = vehiclematerialgroupMapper.selectPage(pages, Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) |
|
|
|
.eq(StrUtil.isNotBlank(whereJson.getVehicle_code()), SchBaseVehiclematerialgroup::getVehicle_code, whereJson.getVehicle_code()) |
|
|
@ -64,18 +65,16 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
|
.eq(StrUtil.isNotBlank(whereJson.getGroup_bind_material_status()), SchBaseVehiclematerialgroup::getGroup_bind_material_status, whereJson.getGroup_bind_material_status()) |
|
|
|
.eq(StrUtil.isNotBlank(whereJson.getRegion_code()), SchBaseVehiclematerialgroup::getRegion_code, whereJson.getRegion_code())); |
|
|
|
schBaseVehiclematerialgroupIPage.getRecords().forEach(item -> { |
|
|
|
if(StrUtil.isNotBlank(item.getMaterial_id())) |
|
|
|
{ |
|
|
|
if (StrUtil.isNotBlank(item.getMaterial_id())) { |
|
|
|
MdBaseMaterial mdBaseMaterial = iMdBaseMaterialService.getOne(Wrappers.lambdaQuery(MdBaseMaterial.class) |
|
|
|
.eq(MdBaseMaterial::getMaterial_code, item.getMaterial_id())); |
|
|
|
if(ObjectUtil.isNotEmpty(mdBaseMaterial)){ |
|
|
|
if (ObjectUtil.isNotEmpty(mdBaseMaterial)) { |
|
|
|
item.setMaterial_name(mdBaseMaterial.getMaterial_name()); |
|
|
|
item.setMaterial_spec(mdBaseMaterial.getMaterial_spec()); |
|
|
|
item.setMaterial_code(mdBaseMaterial.getMaterial_code()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(StrUtil.isNotBlank(item.getRegion_code())) |
|
|
|
{ |
|
|
|
if (StrUtil.isNotBlank(item.getRegion_code())) { |
|
|
|
item.setRegion_name(pointService.list(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, item.getRegion_code())).get(0).getRegion_name()); |
|
|
|
} |
|
|
|
}); |
|
|
@ -88,11 +87,10 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
|
String currentUserId = SecurityUtils.getCurrentUserId(); |
|
|
|
String nickName = SecurityUtils.getCurrentNickName(); |
|
|
|
String now = DateUtil.now(); |
|
|
|
if(StringUtils.isNotBlank(entity.getPoint_code())) |
|
|
|
{ |
|
|
|
if (StringUtils.isNotBlank(entity.getPoint_code())) { |
|
|
|
entity.setRegion_code(pointService.getById(entity.getPoint_code()).getRegion_code()); |
|
|
|
} |
|
|
|
entity.setGroup_id(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
entity.setGroup_id(StrUtil.isNotEmpty(entity.getGroup_id()) ? entity.getGroup_id() : IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
entity.setCreate_id(currentUserId); |
|
|
|
entity.setCreate_name(nickName); |
|
|
|
entity.setCreate_time(now); |
|
|
@ -158,9 +156,9 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
|
List<SchBaseVehiclematerialgroup> order_code = vehiclematerialgroupMapper.selectList(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) |
|
|
|
.eq(SchBaseVehiclematerialgroup::getOrder_code, orderList.get("order_code")) |
|
|
|
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code)); |
|
|
|
if(CollUtil.isNotEmpty(order_code)){ |
|
|
|
orderList.put("region_code",order_code.get(0).getRegion_code()); |
|
|
|
orderList.put("due_date",order_code.get(0).getDue_date()); |
|
|
|
if (CollUtil.isNotEmpty(order_code)) { |
|
|
|
orderList.put("region_code", order_code.get(0).getRegion_code()); |
|
|
|
orderList.put("due_date", order_code.get(0).getDue_date()); |
|
|
|
} |
|
|
|
}); |
|
|
|
return maps; |
|
|
|